[R-SIG-Mac] Error when trying to compile R-devel

Simon Urbanek simon.urbanek at r-project.org
Sun Sep 27 16:55:09 CEST 2009


On Sep 27, 2009, at 10:42 AM, cstrato wrote:

> Dear Simon,
>
> Thank you for your reply, I have now installed "R-devel-48594.dmg"  
> and my package passed "R CMD check" w/o problems.
>
> Nevertheless, I would be interested to know why I could not compile  
> the source.
> The problem appears when trying to buid package "tcltk".  What does  
> "for architecture x86_64 object: /usr/local/lib/libtk8.5.dylib  
> malformed object (unknown load command 7) mean?
>

It means that the linker is confused about the 64-bit Intel binary of  
Tcl/Tk (the 64-bit version of Tcl/Tk is only for Leopard so it's not  
that surprising). However, I'm not sure why it's looking at 64-bit  
binaries, because Tiger doesn't have 64-bit X11 so you cannot build 64- 
bit R on Tiger out of the box. I would suggest that you use -arch i386  
when configuring R to make sure the linker is looking at 32-bit only.

This is mostly what the CRAN build uses:

CC="gcc -arch i386 -std=gnu99" CXX="g++ -arch i386" OBJC="gcc -arch  
i386 -std=gnu99" F77="gfortran -arch i386" FC="gfortran -arch i386"

Cheers,
Simon


>
>
> Simon Urbanek wrote:
>>
>> On Sep 27, 2009, at 7:03 AM, cstrato wrote:
>>
>>> Dear All,
>>>
>>> In order to test my package with the newest R-devel I wanted to  
>>> install R-devel on my Mac Tiger 10.4.11.
>>>
>>> First I downloaded "R-devel-48594.dmg", however the installer says  
>>> "This multi-package is missing tools that are necessary to build R  
>>> packages from sources". Although I have currently installed  
>>> "R-2.9.1.dmg" I am not sure if the installed tools will work with  
>>> R-devel, so I did not install it.
>>>
>>
>> Sure, they do. The "tools" it's talking about are simply the GNU  
>> Fortran with you can also download separately from CRAN if you  
>> care, but you have it already if you installed any recent R.
>>
>>
>>> Instead I downloaded the newest source "R-devel.tar.gz" (9/27/09)  
>>> and wanted to build it:
>>
>> Well, if you thought the tools don't work - how do you expect to  
>> build R? ;) Just pick the binary and you'll be fine.
>>
>> Cheers,
>> S
>>
>>> $ cd /Volumes/CoreData/CRAN
>>> $ tar -zxf R-devel.tar.gz
>>> $ cd /Volumes/CoreData/CRAN/R-devel
>>> $ ./configure --with-blas='-framework vecLib' F77=/usr/local/bin/ 
>>> gfortran
>>> $ make
>>>
>>> Configure did work, see the output below.
>>> However, when running make I get the following error:
>>>
>>> building package 'tcltk'
>>> mkdir ../../../library/tcltk
>>> mkdir ../../../library/tcltk/R
>>> mkdir ../../../library/tcltk/exec
>>> mkdir ../../../library/tcltk/po
>>> making init.d from init.c
>>> making tcltk.d from tcltk.c
>>> making tcltk_unix.d from tcltk_unix.c
>>> gcc -std=gnu99 -I../../../../include -I/usr/local/include -I/usr/ 
>>> local/include  -I/usr/X11R6/include -I/usr/local/include    -fPIC   
>>> -g -O2 -c init.c -o init.o
>>> gcc -std=gnu99 -I../../../../include -I/usr/local/include -I/usr/ 
>>> local/include  -I/usr/X11R6/include -I/usr/local/include    -fPIC   
>>> -g -O2 -c tcltk.c -o tcltk.o
>>> gcc -std=gnu99 -I../../../../include -I/usr/local/include -I/usr/ 
>>> local/include  -I/usr/X11R6/include -I/usr/local/include    -fPIC   
>>> -g -O2 -c tcltk_unix.c -o tcltk_unix.o
>>> In file included from tcltk_unix.c:23:
>>> ../../../../include/R_ext/eventloop.h:73: warning: 'struct  
>>> timeval' declared inside parameter list
>>> ../../../../include/R_ext/eventloop.h:73: warning: its scope is  
>>> only this definition or declaration, which is probably not what  
>>> you want
>>> gcc -std=gnu99 -dynamiclib -Wl,-headerpad_max_install_names - 
>>> undefined dynamic_lookup -single_module -multiply_defined suppress  
>>> -L/usr/local/lib -o tcltk.so init.o tcltk.o tcltk_unix.o -L/usr/ 
>>> local/lib -ltcl8.5 -L/usr/local/lib -ltk8.5 -L/usr/X11R6/lib -lX11  
>>> -Wl,-weak-lXss -lXext -L../../../../lib -lR -lintl -liconv -lc - 
>>> Wl,-framework -Wl,CoreFoundation
>>> /usr/bin/libtool: for architecture x86_64 object: /usr/local/lib/ 
>>> libtk8.5.dylib malformed object (unknown load command 7)
>>> make[4]: *** [tcltk.so] Error 1
>>> make[3]: *** [all] Error 1
>>> make[2]: *** [R] Error 1
>>> make[1]: *** [R] Error 1
>>> make: *** [R] Error 1
>>>
>>> Do you know the reason for this error?
>>>
>>> Best regards
>>> Christian
>>> _._._._._._._._._._._._._._._._._._
>>> C.h.r.i.s.t.i.a.n   S.t.r.a.t.o.w.a
>>> V.i.e.n.n.a           A.u.s.t.r.i.a
>>> e.m.a.i.l:        cstrato at aon.at
>>> _._._._._._._._._._._._._._._._._._
>>>
>>> Here is the output of configure:
>>>
>>
>>
>
>



More information about the R-SIG-Mac mailing list