[R-SIG-Mac] Building from source problems.

Steven McKinney smckinney at bccrc.ca
Thu Oct 29 02:25:26 CET 2009


> -----Original Message-----
> From: r-sig-mac-bounces at stat.math.ethz.ch [mailto:r-sig-mac-
> bounces at stat.math.ethz.ch] On Behalf Of Rolf Turner
> Sent: Wednesday, October 28, 2009 5:21 PM
> To: R-Sig Mac
> Subject: [R-SIG-Mac] Building from source problems.
> 
> 
> QUESTION 1:
> ===========
> 
> Yesterday I sent out a cri de coeur in respect of not being
> able to build R 2.10.0 from source on my Mac (OS X 10.4.11).
> 
> Simon Urbanek informed me that I could get a working R 2.10.0
> from http://r.research.att.com/ which I duly did.  That went
> O.K.
> 
> Then today, because of another problem that I encountered (see
> below) I decided to go back to R 2.9.2.  I retrieved the
> tar file from the ``Source code of older versions of R'' and
> went through the ./configure and make routine.  Blow me down,
> but didn't I get the same error that I got when trying to make
> version 2.10.0:
> 
> > building package 'tcltk'
> > mkdir ../../../library/tcltk
> > mkdir ../../../library/tcltk/R
> > mkdir ../../../library/tcltk/exec
> > mkdir ../../../library/tcltk/po
> > mkdir ../../../library/tcltk/man
> > 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/sw/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/sw/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/sw/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 -
> > mmacosx-version-min=10.4 -undefined dynamic_lookup -single_module -
> > multiply_defined suppress -L/sw/lib -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 -dylib_file libRblas.dylib:../../../../lib/
> > libRblas.dylib -lintl -liconv -lc -Wl,-framework -Wl,CoreFoundation
> > /usr/libexec/gcc/i686-apple-darwin8/4.0.1/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
> 
> Simon told me that the error that arose when I tried to make 2.10.0 was
> due to trying to build a 64 bit version under a too-ancient version of
> Mac OS X.  Is the 2.9.2 release configured to produce a 64 bit version?
> I ***thought*** I had installed 2.9.2 from source, but maybe not ....
> 
> Is there any way I can tell it ***not*** to go for a 64-bit version?
> (Surely there must be, since the r.research.att web site provides a
> version which runs under Mac OS X 10.4.11.)

Right - there is a way, but you might not want to go there.
Learning about and properly configuring a build environment
on the Mac requires much time, patience and reading.

Simon wrote the book you'll be reading, so just download and
install Simon's pre-compiled R binary.  You can start reading the
book while it installs.  (The tcl/tk materials will help
you figure out what's wrong with your tcl/tk setup or lack
thereof on your Mac.)

> 
> QUESTION 2:
> ===========
> 
> The reason that I decided to go back to R 2.9.2 was that I tried to
> install the contributed package spatstat (version 1.17.0) from source
> and got an error:
> 
> gcc -arch i386 -std=gnu99 -I/Library/Frameworks/R.framework/Resources/
> include -I/Library/Frameworks/R.framework/Resources/include/i386  -I/
> usr/local/include    -fPIC  -mtune=core2 -g -O2 -c Kborder.c -o
> Kborder.o
> Kborder.c:1: error: bad value (core2) for -mtune= switch
> make: *** [Kborder.o] Error 1
> ERROR: compilation failed for package 'spatstat'
> 
> I thought this error must have resulted from the upgrade to 2.10.0.
> However
> when I finally succeeded in backing off to 2.9.2 (by getting a binary
> from
> the r.research.att site) I got exactly the same error under 2.9.2.
> 
> What is this error all about?  What can I do about it?  Is there any
> flag
> I can set for configure (???) that will get rid that -mtune=core2 in
> the call to gcc?  What is ``mtune'' all about?  What does ``core2''
> mean?

I don't yet know about the core2 value for the mtune switch, 
but I do know about the excellent package installer and
package manager that Simon has set up in the Mac R GUI.
Install the Mac OS X R GUI from the r.research.att site.
Start it up, select "Package Installer" from the
"Packages and Data" menu item, select the CRAN (binaries)
option in the upper left of the dialogue, type "spatstat"
in the search field slot and click "Get List".
I see spatstat repository version 1.17-0 show up.
Click on that line, click the check box "Install dependencies"
at the bottom of the dialogue, then click "Install Selected".

Whenever this works, it is the preferred route in my books, as
someone else who probably knows a lot more about it has done 
all the compile management stuff.  

Simon's package management works very well, and I appreciate
the time it saves me.

HTH

Steve McKinney

> 
> Sheesh! :-)
> 
> Thanks for any enlightenment.
> 
> 	cheers,
> 
> 		Rolf Turner
> 
> 
> 
> ######################################################################
> Attention:\ This e-mail message is privileged and
> confid...{{dropped:9}}
> 
> _______________________________________________
> 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