[R] Dynamic loading problem.

Rolf Turner rolf at math.unb.ca
Fri Sep 14 17:13:20 CEST 2001

I'm having a dynamic loading problem that seems to be
caused by exponentiation (the ** operator in Fortran/ratfor).

This can be illustrated by the following toy example:

% cat foo.r
subroutine foo(x,n)
x = x**n

% f77 -c foo.r
% R CMD SHLIB -o foo.so foo.o
gcc -G  -o foo.so foo.o  -L/usr/local/lib  
% R -q

> dyn.load("foo.so")
Error in dyn.load(x, as.logical(local), as.logical(now)) : 
        unable to load shared library "/home1/faculty/rolf/Traal/Temp/foo.so":
  ld.so.1: /usr/local/lib/R/bin/R.bin: fatal: relocation error: file /home1/faculty/rolf/Traal/Temp/foo.so: symbol __pow_ri: referenced symbol not found
> q()

I presume/hope that by handing SHLIB some other flags or by
specifying some environment variable or other, or by ..., I should
be able to get dyn.load() to find ``__pow_ri''.

The same problem does NOT arise when I use Splus3.4 SHLIB and
dyn.load.shared() in Splus3.4, so ``__pow_ri'' must be around

Can anyone tell me (in simple, prescriptive, explicit terms) what
I need to do to alleviate this problem?

I'm running R-1.3.1 on a Sun Sparc Ultra-5, under SunOS 5.7/Solaris 2.7.


						Rolf Turner
						rolf at math.unb.ca
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