[R] unable to load shared library "/home/hpc1367/runs/taper/taper.so"

Martin Maechler maechler at stat.math.ethz.ch
Tue Sep 21 10:00:35 CEST 2004


>>>>> "hpc1367" == hpc1367  <sje at mast.queensu.ca>
>>>>>     on Mon, 20 Sep 2004 18:18:58 -0400 writes:

Why do you put the full filename in the e-mail subject?????
(We'd rather want to know your operating system, some
 kind of unix, probably Linux, seen from below)

    hpc1367> I am trying to load a .so file and get the
    hpc1367> following error message:
    >> dyn.load("taper.so",local=F)
    hpc1367> Error in dyn.load(x, as.logical(local),
    hpc1367> as.logical(now)) : unable to load shared library
    hpc1367> "/home/hpc1367/runs/taper/taper.so": ld.so.1:
    hpc1367> /usr/local/lib/R/bin/R.bin: fatal: relocation
    hpc1367> error: file /home/hpc1367/runs/taper/taper.so:
    hpc1367> symbol f90_init: referenced symbol not found
	     ^^^^^^^^^^^^^^^^
this is the crucial part !

    hpc1367> also tried with default local=T and got same error.

of course, since your fortran90 code needs    f90_init()
and that is evidently not linked into your taper.so
but is provided by your Fortran90 
    hpc1367> my makefile (used to produce the .so) is included below


    hpc1367> F90S = taper.f90
    hpc1367> OBJS = taper.o
    hpc1367> LIBS = -lsocket -lnsl -lintl
    hpc1367> OPT = -fast
    hpc1367> MODS = -M/opt/NAG/fnsol04dbl/nag_mod_dir
    hpc1367> NAG = /opt/NAG/fnsol04dbl/libnagfl90.a

    hpc1367> STATNAG = /opt/NAG/flsol20dal/libnag.a

    hpc1367> taper.o : taper.f90
    hpc1367> f95 -c -dalign  $(OPT) $(MODS) taper.f90

    hpc1367> taper.so: taper.f90
    hpc1367> f95 -o taper.so -G -dalign $(OPT) $(MODS) taper.f90

    hpc1367> taper.x : taper.o
    hpc1367> f95 -o taper.x -dalign $(OPT) $(MODS) $(LIBS) taper.o $(OBJS)
    hpc1367> $(NAG)

You must make sure that the "system" library which defines the
f90_init() symbol is specified at link time, i.e., when taper.so
is built. 
So I guess you need at least the $(LIBS) also in that line,
probably also $(NAG).

But we don't have your non-free NAG compilers and libraries and
it's hard to find out "from here".  Use 'nm' and 'ldd' but
probably rather ask someone at your institution who knows more
about compilation and linking.

    hpc1367> please, help
    hpc1367> thank you very much




More information about the R-help mailing list