Friday, 9 April 2010

Installing Bioperl 1.6.1 from CPAN in ubuntu 9.04: fixing DB_File failed dependency

I was unable to install BioPerl 1.6.1 from CPAN. DB_File dependence was not compiling.

DB_FILE was failing because I don't have db.h in my ubuntu 9.04

cpan[4]> install DB_File
[...] Going to build P/PM/PMQS/DB_File-1.820.tar.gz

Looks Good.
Checking if your kit is complete...
Looks good
Note (probably harmless): No library found for -ldb
Writing Makefile for DB_File
cp blib/lib/
AutoSplitting blib/lib/ (blib/lib/auto/DB_File)
cc -c -I/usr/local/BerkeleyDB/include -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -DVERSION=\"1.820\" -DXS_VERSION=\"1.82\" -fPIC "-I/home/pablo/localperl/lib/5.10.1/i686-linux/CORE" -D_NOT_CORE -DmDB_Prefix_t=size_t -DmDB_Hash_t=u_int32_t version.c
version.c:30:16: error: db.h: No such file or directory
make: *** [version.o] Error 1
/usr/bin/make -- NOT OK
Running make test
Can't test without successful make
Running make install
Make had returned bad status, install seems impossible
Failed during this command:
PMQS/DB_File-1.820.tar.gz : make NO

So it is missing the db.h file.

> sudo aptitude install libdb4.6-dev
$ perl Makefile.PL
Looks Good.
Writing Makefile for DB_File

Now it is ok:

> make
> make test
PERL_DL_NONLAZY=1 /home/pablo/localperl/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/db-btree.t .. ok
t/db-hash.t ... ok
t/db-recno.t .. ok
t/pod.t ....... ok
All tests successful.
Files=4, Tests=568, 4 wallclock secs ( 0.13 usr 0.09 sys + 0.94 cusr 1.48 csys = 2.64 CPU)
Result: PASS
> make install
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
Installing /home/pablo/localperl/locallib/lib/perl5/i686-linux/auto/DB_File/
Installing /home/pablo/localperl/locallib/lib/perl5/i686-linux/auto/DB_File/
Installing /home/pablo/localperl/locallib/lib/perl5/i686-linux/
Installing /home/pablo/localperl/locallib/lib/perl5/i686-linux/auto/DB_File/autosplit.ix
Installing /home/pablo/localperl/locallib/man/man3/DB_File.3
Appending installation info to /home/pablo/localperl/locallib/lib/perl5/i686-linux/perllocal.pod



cjfields said...

Odd, I didn't have problems with the install, but then I'm a bioperl dev, so maybe I'm too close to the distribution.

Pablo Marin-Garcia said...

Hello Chris,

Don't worry.

I would say that this is not a bioperl fault, but a very specific situation for people trying to install bioperl without the Berkeley db headers intalled.

The problem was not with bioperl itself, but with my Ubuntu installation that it had the libdb4.6 installed but didn't have the Berkeley db headers from libdb-dev.

I posted this entry here just in case someone find similar problems with the DB_File and wonders which package contains the db.h file, and google for it (googling for it show that other people had it in the past). I don't think that this is a common problem so I didn't send it to the bioperl mailing list, but put it here instead for future reference only.

I have installed several times BioPerl from CPAN in diferent machines and I haven't had problems. But this was because they were my working machines so I had all headers files and programs installed. But in this particular case, the machine is a virtual box in my mac that I was setting to create a DAS server therefore there were a lot of things not installed.

For example I needed to install also "libexpat-dev" in order to have the XML::Parser for the installation of the optional bioperl modules that needed it. And also I needed to install GraphViz before installing Bio::Graphics. etc.

Now that we are here I would say that other problem that I had is that I was not able to install bioperl if I selected the installation of Bio-ASN1-EntrezGene. But without it, bioperl install now OK

Running Build test
Can't test without successful make
Running Build install
Make had returned bad status, install seems impossible
Failed during this command:
CJFIELDS/BioPerl-1.6.1.tar.gz : make NO cannot resolve circular dependency
MINGYILIU/Bio-ASN1-EntrezGene-1.091.tgz : make NO cannot resolve circular dependency

alex said...

thanks a lot, I is exactly the problem I was facing. solved smoothly

new said...

Thx, I was setting up a bioinfo workstation with a fresh installation of Ubuntu 11.10 and i stuck during bioperl installing and this was exactly the error I was facing. Thank you for the solution. Just one more thing, I was setting up perl modules using cpanm under perlbrew and I was getting "write permissions" errors just during Bioperl installation, so I need to run cpanm --sudo to work even if the module was installed in home directory.