Re: R-alpha: dyn.load on Linux machines

Heiner Schwarte (schwarte@feat.mathematik.uni-essen.de)
Fri, 7 Jun 1996 13:45:48 +0200 (DFT)


Date: Fri, 7 Jun 1996 13:45:48 +0200 (DFT)
From: Heiner Schwarte <schwarte@feat.mathematik.uni-essen.de>
Subject: Re: R-alpha: dyn.load on Linux machines 
To: dunne@matilda.vut.edu.au
In-Reply-To: <9606070938.AA17765@yarra.vut.edu.au>
Message-Id: <Pine.3.89.9606071213.A12932-0100000@feat.mathematik.uni-essen.de>

Hi Rob:

Yes, dyn.load was designed on Linux and one is lead to conclude 
that dyn.load should work. But unfortunately this conclusion is 
incorrect. In February I did send patches to Ross who integrated
them into the R distribution. Unfortunately the code was broken in
an effort to support other platforms. Even worse, I did not regularly
keep track of new releases of R and thus didn't find out about this 
problem. 

Here is the required patch (this applies to R.alpha0.8, 0.9 hasn't yet
arrived at the Heidelberg mirror)

In dotcode.c, definition of findDynProc(), replace the line

  sprintf(buf, "_%s", name);     

by

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

This should solve your problem, but will break the code for other 
platforms. Thus another #ifdef appears necessary. The procedure 
you describe to build the shared library looks correct. Sorry for any 
inconveniences.

There is another conceivable problem with dyn.load on Linux. If one 
loads Fortran code, undefined symbols are possible if R has been 
linked with the static libf2c.a. Unfortunately I am unable to find
out the conditions when this happens. (The configuration of my Linux 
box at home is highly non-standard, i.e. in a state of disaster, after
a major upgrading effort.) Just ldd R.binary to find out. 

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
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-