Re: R-alpha: dyn.load

Heiner Schwarte (schwarte@feat.mathematik.uni-essen.de)
Sun, 31 Mar 1996 20:55:50 +0100 (NFT)


Date: Sun, 31 Mar 1996 20:55:50 +0100 (NFT)
From: Heiner Schwarte <schwarte@feat.mathematik.uni-essen.de>
Subject: Re: R-alpha: dyn.load
To: "Alan K.F. Siu" <hrnekfs@econ1.hku.hk>
In-Reply-To: <199603281726.BAA28513@econ1.hku.hk>
Message-Id: <Pine.3.89.9603312014.A14350-0100000@feat.mathematik.uni-essen.de>


R.alpha0.3's dyn.load() does not work properly under Linux. There is 
an immediate fix to this problem: in dotcode.c replace

	sprintf(buf, "_%s", name)           (*)
by

	sprintf(buf, "%s", name)            (**)

Then dyn.load() should work. Of course the linker requires the -ldl
flag which has to be added to the Makefile. Note that under Linux 
the definitions of .C() and .Fortran() are slightly different. Thus 
functions compiled from C should be called by .C() and functions compiled 
from Fortran by .Fortran().

If the form (*) is necessary for other platforms, (*) should be ifdefed 
appropriately. Both ELF-Linux and AIX with the libdl emulation library 
require the form (**). 

Heiner
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
r-testers mailing list -- To (un)subscribe, send
subscribe	or	unsubscribe
(in the "body", not the subject !)  To: r-testers-request@stat.math.ethz.ch
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-