R-beta: dyn.load: incompatability between R and S
Ross Ihaka
ihaka at stat.auckland.ac.nz
Fri Jul 25 03:41:38 CEST 1997
Jonathan Myles writes:
> However, in R although the first two statements execute OK, the third
> produces
>
> > dyn.load("/homef/jonm/postdocs/GLMM_project/Cprogs/nn/ars.o")
> Error in dyn.load(x) : ld.so.1: /scratch0/jonm/R-0.50-a1/bin/R.binary: fatal: re
> location error: symbol not found: unitexp: referenced in /homef/jonm/postdocs/GL
The problem is that our "dyn.load" expects to get a shared library
rather than just a compiled binary file. You could take a look at
the code in demos/dynload to see how this works. Under SunOS you
would do
gcc -g -fpic misc.c random.c ars.c
ld -assert pure-text misc.o random.o ars.o -o mylib.so
and then in R
dyn.load("mylib.so")
The Makefile in demos/dynload may contain flags that will work
(no promises though).
We do it this way because linking with shared libraries is a much more
portable solution. I suppose we should change the name to
dyn.load.lib or something.
Ross
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
r-help 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-help-request at stat.math.ethz.ch
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
More information about the R-help
mailing list