Problems compiling R65.0 (PR#262)

Peter Dalgaard BSA p.dalgaard@biostat.ku.dk
01 Sep 1999 12:18:15 +0200


plindsey@alpha.luc.ac.be writes:

> Hi,
> I appear to have a slight problem compiling R0.65.0 under Linux
> (slackware) using g77. By simply typing configure then make, I obtain
> a binary which when "ldd" does not contain the f2c library. I
> therefore cannot load any libraries containing fortran code (I obtain
> unresolved symbol messages from R.X11 and an unable to load shared
> library from dyn.load(file)).

Yes, this is a bit of a pain. The issue is that libf2c is not a
dynamic library on all systems, and hence does not show on ldd, and
only the routines that are actually used by R get loaded into the
binary. 

What should happen in that case is that R SHLIB/INSTALL would generate
so files with the relevant Fortran linked in, e.g. if that doesn't
happen for you, there's a bug in the configure script. With egsc/g77 I
get the following:

# R INSTALL multiv
Installing package `multiv' ...
 libs
g77  -fPIC -g -O2 -c bea.f -o bea.o
g77  -fPIC -g -O2 -c ca.f -o ca.o
g77  -fPIC -g -O2 -c hc.f -o hc.o
g77  -fPIC -g -O2 -c hcmovie.f -o hcmovie.o
g77  -fPIC -g -O2 -c members.f -o members.o
g77  -fPIC -g -O2 -c partition.f -o partition.o
g77  -fPIC -g -O2 -c pca.f -o pca.o
g77  -fPIC -g -O2 -c sammon.f -o sammon.o
gcc -shared  -o /usr/local/lib/R/library/multiv/libs/multiv.so bea.o ca.o hc.o hcmovie.o members.o partition.o pca.o sammon.o -L/usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66 -L/usr/i386-redhat-linux/lib -lg2c -lm

# R SHLIB ca.f 
gcc -shared  -o ca.so ca.o -L/usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66 -L/usr/i386-redhat-linux/lib -lg2c -lm



> If I change the "-lf2c" flag on the FLIBS line of the Makeconf to
> "-L/usr/lib/libf2c", I then obtain the following error when R.X11 is
> being created:

That couldn't possibly work. '-L' specifies a directory to search, so
you get the same effect as if you had just removed -lf2c.

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._