From ligges at statistik.uni-dortmund.de  Wed Jul  6 22:49:09 2005
From: ligges at statistik.uni-dortmund.de (Uwe Ligges)
Date: Wed, 06 Jul 2005 22:49:09 +0200
Subject: [Rd] dyn.load in linux: missing libraries?
In-Reply-To: <42CBD53F.8000209@mail.mcgill.ca>
References: <42CB5471.5040506@mail.mcgill.ca>	<x2pstw75ch.fsf@turmalin.kubism.ku.dk>
	<42CBD53F.8000209@mail.mcgill.ca>
Message-ID: <42CC43C5.7050901@statistik.uni-dortmund.de>

Tyler Smith wrote:

> ah, that's better. For an immediate fix I just changed .dll to .so, and 

No, change it to
   .Platform$dynlib.ext
or do as already recommended: use library.dynam()

Uwe Ligges



> it appears to work perfectly. I will read through Writing R Extensions 
> to make sure I understand what I'm doing!
> 
> Thanks!
> 
> Tyler
> 
> Peter Dalgaard wrote:
> 
> 
>>Tyler Smith <tyler.smith at mail.mcgill.ca> writes:
>>
>> 
>>
>>
>>>Hi,
>>>
>>>I've just about got myself transferred from windowsXP to Linux (Mepis 
>>>3.3.1-1). I've got R 2.1.1, emacs, and ess running from the debian 
>>>repositories. Of course, there is a hitch. I have a bit of C code in one 
>>>of my personal functions. I have, apparently without problem, been able 
>>>to compile it using R CMD SHLIB, but when I try to dyn.load it I get the 
>>>following error:
>>>
>>>
>>>>dyn.load("Cfiles/Neutral/Bell2000.dll")
>>>
>>>Error in dyn.load(x, as.logical(local), as.logical(now)) :
>>>   unable to load shared library 
>>>'/home/tyler/RWorkingDirectory/Cfiles/Neutral/Bell2000.dll':
>>> /home/tyler/RWorkingDirectory/Cfiles/Neutral/Bell2000.dll: invalid ELF 
>>>header
>>>
>>>I take this to mean one of the required libraries is either not loaded 
>>>or not updated. Or, I've overlooked something. Can anyone point me to a 
>>>solution? I tried updating my perl files, and I haven't found anything 
>>>using the R Site Search...
>>>   
>>>
>>
>>Nope, the missing library is the one that you're trying to load.
>>Dynamic libraries are not called .dll on Linux, but rather .so...
>>
>>You should probably read up on "Writing R Extensions", including the
>>hints on how to write portable code (use library.dynam).
>>
>> 
>>
> 
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



[Rd] dyn.load in linux: missing libraries?
Uwe Ligges