[R-SIG-Mac] Building R-devel from Source on Snow Leopard

Adam D. I. Kramer adik at ilovebacon.org
Fri Sep 4 23:52:32 CEST 2009

Hi Tony and Simon,

 	I was having this trouble today/yesterday and have been following
along on this thread. The solution I found was to add this to my

LDFLAGS="-m64 -L/usr/lib/gcc/i686-apple-darwin9/4.2.1/x86_64 -lgfortran"
F77="gfortran -arch x86_64"

...this gets me through the "can't make mixed C/Fortran code" errors. However, 
through one hoop of fire and I'm confronted by another:

checking for iconv.h... yes
checking for iconv... no
checking for iconvlist... no
configure: error: --with-iconv=yes (default) and a suitable iconv is not

...this strikes me as odd. The relevant lines from the config.log file are:

configure:39212: gcc -std=gnu99 -o conftest -O3 -fopenmp -mtune=native -m64  -m64 -L/usr/lib/gcc/i686-apple-darwin9/4.2.1/x86_64 -lgfortran conftest.c -lm >&5
conftest.c: In function 'main':
conftest.c:189: warning: passing argument 1 of 'libiconvlist' from
incompatible pointer type
Undefined symbols:
   "_libiconvlist", referenced from:
       _main in cc2XgkAg.o
ld: symbol(s) not found
collect2: ld returned 1 exit status


swiss:R-2.9.2$ nm /usr/lib/libiconv.dylib | grep _libiconvlist
00008807 T _libiconvlist

...I'm not sure where else configure could be trying to find libiconv, but
running "locate libiconv" shows versions in
/Developer/SDKs/MacOSX10.6.sdk/usr/lib/ also, which also show _libiconvlist
when I nm them.

Any suggestions? I'm not sure how to further debug this...the symbols are


>Hi Simon,
>I think that you might have resolved my issue. I did not specify the arch,
>so I will try that and let everyone know if that works.
>On Thu, Sep 3, 2009 at 4:11 PM, Simon Urbanek
><simon.urbanek at r-project.org>wrote:
>> Tony,
>> On Sep 3, 2009, at 6:14 PM, Tony Chiang wrote:
>>  So I am trying to configure and build the latest of R-devel on one of the
>>> new Macbook Pro's running Snow leopard. I have installed the latest
>>> X-Code
>>> tools (downloaded from the Apple Site) and have gcc installed:
>>> gcc --versioni686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build
>>> 5646)
>>> So as I am trying to configure, I get this error message:
>> What is the exact configure command you're running? I suspect that your
>> problem is a 32-bit vs 64-bit mismatch, because SL changed the gcc default
>> to 64-bit whereas the gfortran default is 32-bit, so you have to make sure
>> your archs match (depending on which you actually want to build) - ideally
>> you should specify -arch for all compilers (as the CRAN binary does - also
>> see the FAQ).
>> Cheers,
>> Simon
>>  ...cut...
>>>  checking for Fortran 77 libraries of gfortran...  -L/usr/local/lib
>>>> -L/usr/local/lib/gcc/i686-apple-darwin8/4.2.3
>>>> -L/usr/local/lib/gcc/i686-apple-darwin8/4.2.3/../../.. -lgfortranbegin
>>>> -lgfortran
>>>> checking how to get verbose linking output from gcc -std=gnu99... -v
>>>> checking for C libraries of gcc -std=gnu99...  -lcrt1.10.6.o
>>>> -L/usr/local/lib -L/usr/lib/gcc/i686-apple-darwin10/4.2.1/x86_64
>>>> -L/usr/lib/i686-apple-darwin10/4.2.1
>>>> -L/usr/lib/gcc/i686-apple-darwin10/4.2.1
>>>> -L/usr/lib/gcc/i686-apple-darwin10/4.2.1/../../../i686-apple-darwin10/4.2.1
>>>> -L/usr/lib/gcc/i686-apple-darwin10/4.2.1/../../.. -lSystem
>>>> checking for dummy main to link with Fortran 77 libraries... rm:
>>>> conftest.dSYM: is a directory
>>>> none
>>>> checking for Fortran 77 name-mangling scheme... rm: conftest.dSYM: is a
>>>> directory
>>>> unknown
>>>> configure: WARNING: unknown Fortran name-mangling scheme
>>>> checking whether gfortran appends underscores to external names...
>>>> unknown
>>>> configure: error: cannot use Fortran
>>> I have not seen any messages quite like this on the mailing list. What is
>>> pretty strange is the conftest.dSYM needs to be removed (?) for some
>>> reason
>>> but is a directory. Any ideas or suggestions on how to resolve this?
>>> Best,
>>> --Tony
>>>        [[alternative HTML version deleted]]
>>> _______________________________________________
>>> R-SIG-Mac mailing list
>>> R-SIG-Mac at stat.math.ethz.ch
>>> https://stat.ethz.ch/mailman/listinfo/r-sig-mac

More information about the R-SIG-Mac mailing list