Thanks for taking the time to look at this Uwe. Turns out the
problem was caused by the fact that foo.so was built with
incorrect linker options (not pointing to bar.so), so there were
undefined symbols. Why it worked at all is a puzzle.

2010/5/22 Uwe Ligges <ligges@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@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>
>

	[[alternative HTML version deleted]]

