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

Heiner Schwarte (
Fri, 7 Jun 1996 13:45:48 +0200 (DFT)

Date: Fri, 7 Jun 1996 13:45:48 +0200 (DFT)
From: Heiner Schwarte <>
Subject: Re: R-alpha: dyn.load on Linux machines 
In-Reply-To: <>
Message-Id: <>

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 

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);     


  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 

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. 

r-testers mailing list -- To (un)subscribe, send
subscribe	or	unsubscribe
(in the "body", not the subject !)  To: