From nmcalder at verizon.net  Sun Dec 23 18:44:15 2007
From: nmcalder at verizon.net (Matt Calder)
Date: Sun, 23 Dec 2007 12:44:15 -0500
Subject: [Rd] Problem with dyn.load'ed code
Message-ID: <1198431855.9564.10.camel@calder-linux>

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



[Rd] Problem with dyn.load'ed code
Matt Calder