[BioLib-dev] Test Errors on Ubuntu

Chris Fields cjfields at illinois.edu
Fri Feb 12 04:53:11 UTC 2010


On Feb 11, 2010, at 10:44 AM, Pjotr Prins wrote:

> On Wed, Feb 10, 2010 at 04:18:21PM -0600, Chris Fields wrote:
>> Pjotr,
>> 
>> Just noticed an odd error on Ubuntu using the latest github; basically,
>> everything builds on Ubuntu just fine, but there appear to be odd issues
>> with shared libs.  This doesn't affect the example or emboss, but affyio
>> and (strangely) io_lib are affected.  
>> 
>> The library in question is libR.so; this pops up with failing tests for
>> affyio and io_lib with 'make test'.  Here are the relevant errors from
>> the test scripts (bootstrapping problem):
>> 
>> cjfields at pyrimidine:~/src/biolib/src/mappings/swig/perl/test$ perl
>> test_staden_io_lib.pl
>> Can't load '/usr/local/lib/perl/5.10.0/staden_io_lib.so' for module
>> staden_io_lib: libR.so: cannot open shared object file: No such file or
>> directory at /usr/lib/perl/5.10/DynaLoader.pm line 196.
>> at /usr/local/lib/perl/5.10.0/biolib/staden_io_lib.pm line 10
>> Compilation failed in require at test_staden_io_lib.pl line 1.
>> BEGIN failed--compilation aborted at test_staden_io_lib.pl line 1.
>> 
>> cjfields at pyrimidine:~/src/biolib/src/mappings/swig/perl/test$ perl
>> test_affyio.pl
>> Can't load '/usr/local/lib/perl/5.10.0/affyio.so' for module affyio:
>> libR.so: cannot open shared object file: No such file or directory
>> at /usr/lib/perl/5.10/DynaLoader.pm line 196.
>> at /usr/local/lib/perl/5.10.0/biolib/affyio.pm line 10
>> Compilation failed in require at test_affyio.pl line 4.
>> BEGIN failed--compilation aborted at test_affyio.pl line 4.
> 
>> For some reason the absolute path is dropped.  I understand this
>> affecting affyio, but it's strange that io_lib is also affected.  OS X
>> doesn't seem to be affected, but 
> 
> There should be no dependency, per se. If I do 
> 
>  ./configure --with-staden &> test.out
> 
> there is no libR.so reference. It appears that because you also built
> affyio it finds libR.so and, from then on, add it in for all cases.
> This is not necessarily bad behaviour.
> 
> The odd thing is that it gives this error while you apparently have
> libR.so somewhere on your system. 
> 
> The location /usr/local/lib/perl/5.10.0/affyio.so is also a bit
> puzzling. But that is what the Perl interpreter is telling the build
> system. After above configure I can do:
> 
>  make install
>  [ 94%] Built target biolib_staden_io_lib-0.0.6
>  [100%] Built target staden_io_lib
>  Install the project...
>  -- Install configuration: "Release"
>  -- Installing: /usr/lib/libbiolib_staden_io_lib-0.0.6.so
>  -- Installing: /usr/local/lib/perl/5.10.1/biolib/staden_io_lib.pm
>  -- Installing: /usr/local/lib/perl/5.10.1/staden_io_lib.so
> 
> Running ldd shows no libR.so dependency:
> ...
> 
> Which is fine. When I do a full install there, indeed, appears a
> dependency on libR.so. But that is OK. It is simply a side-product of
> the full build with libR available.
> 
> Can you replicate above? Do you have libR.so on your system? If so,
> does it show correctly in the build logs? If not, there is a real
> problem, because it should not link to a non-existing library.
> 
> The R library is located in
> 
>  tools/cmake-support/modules/FindRLibs.cmake
> 
> if finds it by querying R itself. It should not find it if it is not
> there.

One of the issues is that it appears the perl test script preferentially uses any installed staden_io_lib.so over any locally built one, or is only finding the library after it is installed.  The missing libR.so triggered this; deleting the aforementioned library and running './configure --with-staden' works (no more libR.so needed).  We should probably set a 'use lib' directive in the script to preferentially catch local module builds.

Re: having libR.so being called from staden_io_lib is still an odd issue (particularly since it disappears when configuring staden alone).  It only occurs when compiling both staden_io_lib and affyio, the others passed w/o problems.

> I suspect you have to tell Perl what the load path is for the
> libR.so. Is R in a standard location? Can you try updating the load
> path? Maybe it is a Ubuntu thing:
> 
>  http://blog.andrewbeacock.com/2007/10/how-to-add-shared-libraries-to-linuxs.html

Setting LD_LIBRARY_PATH or adding to /etc/ld.so.conf.d fixes the problem. libR.so is in /usr/lib/R/lib, which apparently is not added to ld.so.conf.d via apt-get.

>> I'll pass on the config and build output to you off-list, or I could put
>> it up on Issues on github if you would like.
> 
> I prefer mail, normally. 
> 
> Pj.

I think this sorts out most pertinent issues.  I'm working on a simple BioPerl-specific set of modules for io_lib that will eventually replace the XS-based code from bioperl-ext.  This gets us along that path a bit.  Probably something to note for the install process, however.

chris





More information about the BioLib-dev mailing list