Skip to content

Compilation error on mgcv_1.1-7 on OS X (10.3)

5 messages · Jon Egil Strand, Brian Ripley, Paul Roebuck +1 more

#
Greetings

I run into a compilation error when updating to mgcv_1.1-7 in R 2.0.0 on 
OS X 10.3. Note that other pacakges have compiled nicely. 

Some details are given below, but in short it looks like it's seeking for 
	
	/usr/local/lib/powerpc-apple-darwin6.8/3.4.2/

which I don't have. But I do have 

	/usr/lib/gcc/darwin/3.3

i.e a lower version of GCC in a different directory. More details at end.

I am sorry if this is very easy to configure, but as long as I am unable 
to do it I will be very grateful for any help.

All the best

Jon Egil Strand
M.Sc

-----------------------------------
	Compilation details       
-----------------------------------

gcc -no-cpp-precomp -I/Library/Frameworks/R.framework/Resources/include  -I/usr/local/include   -fno-common  -g -O2 -c qp.c -o qp.o
gcc -no-cpp-precomp -I/Library/Frameworks/R.framework/Resources/include  -I/usr/local/include   -fno-common  -g -O2 -c tprs.c -o tprs.o
gcc -bundle -flat_namespace -undefined suppress -L/usr/local/lib -o 
  mgcv.so gcv.o magic.o mat.o matrix.o mgcv.o qp.o tprs.o  -framework 
  vecLib -L/usr/local/lib -L/usr/local/lib/gcc/powerpc-apple-darwin6.8/3.4.2 
  -L/usr/local/lib/gcc/powerpc-apple-darwin6.8/3.4.2/../../.. -lfrtbegin 
  -lg2c -lSystem -lcc_dynamic -framework R

ld: warning -L: directory name (/usr/local/lib/gcc/powerpc-apple-darwin6.8/3.4.2) does not exist
ld: warning -L: directory name (/usr/local/lib/gcc/powerpc-apple-darwin6.8/3.4.2/../../..) does not exist
ld: can't locate file for: -lfrtbegin

make: *** [mgcv.so] Error 1
ERROR: compilation failed for package 'mgcv'
#
I expect your version of R was not compiled on your own system, although 
you don't say (please see the posting guide).  (I also presume this is a 
Macintosh but you could have said.)

The solutions are simple:

1) Compile R yourself -- the best choice.
2) Download a pre-compiled binary of that package for your platform.
3) Install the same tools as used to build R in the same places.
4) (Perhaps) edit R_HOME/etc/Makeconf and replace the paths in FLIBS.
On Mon, 1 Nov 2004, Jon Egil Strand wrote:

            
Packages containing Fortran source code?

  
    
#
On Mon, 1 Nov 2004, Jon Egil Strand wrote:

            
My guess would be that this package requires G77 in order
to link correctly as that library is for Fortran.

Install this and try it again.

<http://hpc.sf.net/g77v3.4-bin.tar.gz>

----------------------------------------------------------
SIGSIG -- signature too long (core dumped)
#
- The source is C, but linpack and lapack routines are called 
directly (see mgcv/src/mat.c) and they're written in F77...
2 days later
#
Prof Ripley, thank you for your answer. 

Indeed you are correct in that I was using precompiled R-2.0 on a 
Macintosh.
Following your suggestion of building R from source I ran into problems 
due to a lack of a fortran compiler (or f2c). It turns out half a gigabyte 
of compiler tools from the Xcode package wasn't enough, Apple left out any 
fortran tools. Hmpf. I transformed the iBook to a pure gentoo linux 
machine, and everything compiles like a charm. 

All the best

Jon Egil Strand