From p.dalgaard at biostat.ku.dk  Tue Oct 25 22:48:00 2005
From: p.dalgaard at biostat.ku.dk (Peter Dalgaard)
Date: 25 Oct 2005 22:48:00 +0200
Subject: [Rd] error from make: gcc -shared -L/usr/local/lib64 ...
	relocation R_X86_64_32...
In-Reply-To: <Pine.LNX.4.43.0510251322130.6843@hymn06.u.washington.edu>
References: <Pine.LNX.4.43.0510251322130.6843@hymn06.u.washington.edu>
Message-ID: <x2ll0h8gsf.fsf@turmalin.kubism.ku.dk>

Dick Beyer <dbeyer at u.washington.edu> writes:

> I hope someone can point me, a newcomer to building R as well as 64-bit R, in 
> a useful direction.  I have a dual Opteron 275 box running RedHat EL4.  I ran 
> configure successfully, and, then, get the following error while running make:
> 
> make[4]: Entering directory `/tmp/R-2.2.0/src/modules/lapack'  
> g77 -fPIC  -g -O2 -ffloat-store -c dlamc.f -o dlamc.lo  
> g77  -fPIC  -g -O2 -c dlapack0.f -o dlapack0.lo  
> g77  -fPIC  -g -O2 -c dlapack1.f -o dlapack1.lo  
> g77  -fPIC  -g -O2 -c dlapack2.f -o dlapack2.lo  
> g77  -fPIC  -g -O2 -c dlapack3.f -o dlapack3.lo  
> g77  -fPIC  -g -O2 -c cmplx.f -o cmplx.lo  
> g77  -fPIC  -g -O2 -c cmplxblas.f -o cmplxblas.lo  
> gcc -shared -L/usr/local/lib64  -o libRlapack.so dlamc.lo dlapack0.lo  
> dlapack1.lo dlapack2.lo dlapack3.lo cmplx.lo  cmplxblas.lo  -lg2c -lm -lgcc_s  
> /usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/3.4.4/libg2c.a(s_cat.o):  
> relocation R_X86_64_32 against `a local symbol' can not be used when making a  
> shared object; recompile with -fPIC  
> /usr/lib/gcc/x86_64-redhat-linux/3.4.4/libg2c.a: could not read symbols: Bad  
> value  
> collect2: ld returned 1 exit status  
> make[4]: *** [libRlapack.so] Error 1
> 
> 
> I am confused by the error message "recompile with -fPIC" since it looks like  
> all the lapack routines are already being compiled with -fPIC. I did struggle 
> with getting all the right development packages installed, so maybe I am 
> missing some critical package?
> 
> Any help, suggestions, or pointers to 64-bit RedHat EL4 would be greatly  
> appreciated.

I have a faint bell ringing in the distance... The proximate cause is
that the static libg2c.a is being picked up and it is likely not -fPIC
compiled (which is important on 64bit but AFAIR you get away with it
on 32bit). Now why is it that this happens... 

Is there a libg2c.so around?

- 
   O__  ---- Peter Dalgaard             ?ster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)                  FAX: (+45) 35327907



[Rd] error from make: gcc -shared -L/usr/local/lib64 ... relocation R_X86_64_32...
Peter Dalgaard