From ligges at statistik.tu-dortmund.de  Sat May 22 16:12:51 2010
From: ligges at statistik.tu-dortmund.de (Uwe Ligges)
Date: Sat, 22 May 2010 16:12:51 +0200
Subject: [Rd] dyn.load() strange behavior
In-Reply-To: <AANLkTilbED_tlJJV9wZd8iZDKd-7P0vPYhbKT3CzehHK@mail.gmail.com>
References: <AANLkTilbED_tlJJV9wZd8iZDKd-7P0vPYhbKT3CzehHK@mail.gmail.com>
Message-ID: <4BF7E663.2040700@statistik.tu-dortmund.de>

- Does bar really dyn.load its shared library on load?
- Have you told package foo (in the DESCRIPTION) it is LinkingTo: bar ?

Uwe Ligges



On 21.05.2010 22:35, Dominick Samperi wrote:
> Hello,
>
> I am observing the following strange behavior when I try to
> load a shared library using dyn.load() under Linux...
>
> The library foo.so refers to a symbol in another package bar
> (with shared library bar.so), I get:
>
> dyn.load('foo.so') # error message because I forgot to load bar
> library(bar) # so I fix it
> dyn.load('foo.so') # works this time and everything is fine
>
> But, if restart my R session and do it "right" the second
> time there is a surprise:
>
> library(bar)
> dyn.load('foo.so') # fails
> library(bar) # just to be sure?
> dyn.load('foo.so) # fails again
> dyn.load('/usr/local/lib64/library/bar/lib/libbar.so') # just to be really
> sure?
> dyn.load('foo.so')
>
> In other words, it is possible to load foo.so, but only
> after a failed attempt. If I remember to load the required
> package bar I cannot load the depenent library foo.so.
>
> Any ideas?
>
> Thanks,
> Dominick
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



[Rd] dyn.load() strange behavior
Uwe Ligges