[Rd] Problem with dyn.load'ed code

Matt Calder nmcalder at verizon.net
Sun Dec 23 18:44:15 CET 2007


Hi,
    I am having trouble with some code that I am dyn.loading. I am
writing an interface to ARPACK. I compile my interface (dssimp.cc), and
link it against the ARPACK library (libarpack_SUN4.a):

 g++ -shared -static -fPIC dssimp.cc -o dssimp.so -larpack_SUN4 -lg2c -lm 

I can dyn.load the code and it appears OK. However, when I call my
function, the call to the function in the ARPACK library returns an
error. 
	I can print the arguments to my function when I call it from R, so I
can see that I am dyn.load'd, and the arguments are passed correctly. 	
	Moreover, I can load and call the shared object (dssimp.so) using
dlopen and dlsym from a stand alone C++ program. So I can see that the
shared object is OK.
	In summary, I have a shared object that works correctly outside of R,
but when dyn.load'd into R, does not work. Short of calling errors
(which is not the case here) I wonder how that might happen, and how I
might fix it?

	Matt



More information about the R-devel mailing list