Thursday, April 25, 2013

Unable to detect bamlib libraries (version or higher) when installing cufflinks

If you are installing Cufflinks according to the instructions as given by http://cufflinks.cbcb.umd.edu/tutorial.html. 

The compiling of the components below are quite expected.
boost,
eigen,
samtools

But when finally compiling cufflinks, you might encounter errors
.....
..... 
checking for bamlib... configure: error: We could not detect the bam libraries 
(version    or higher). If you have a staged bam library (still not installed) 
please specify $BAM_ROOT in your environment and do not give a PATH to --with-bam option.  
If you are sure you have bam installed, then check your version number looking in......... 
See http://randspringer.de/bam for more documentation. 
The source of the error is somehow the cufflinks is not able to find the libraires and binaries found by samtools. This is especially true if you compiled the components into distinct directories and not into standard directories like /usr/local/bin and /usr/local/lib /usr/local/include

To ensure that the cufflinks detects the samtools libraries, you might want to do the following.
# mkdir -p /usr/local/include/bam
# cp ${SAMTOOLS}/libbam.a /usr/local/lib/
# cp ${SAMTOOLS}/*.h /usr/local/include/bam
# cp ${SAMTOOLS}/samtools /usr/local/bin/

Try compiling again. It should work

11 comments:

Ivarz said...

Thanks, worked like a charm

2250sdod said...

What if I have these somewhere else? I'm trying --with-bam with no luck :(

J said...

Did all that is listed here (latest cufflinks from GitHub), still getting the error about not being able to find bamlib... This problem seems to be at least 5 years old, from my searches on line (wrong URL still being listed by ./configure, for example), and people are still having problems with this. Pathetic.

By the way, I tried both of these (even if ./cofigure tells me not to):
--with-bam=/usr/local/include/bam/
export BAM_ROOT=/usr/local/include/bam/

Xingyu Yang said...

I think I solved the issue.
In additional to the mentioned 4 steps, we also need to rename XXX/include/bam/version.h to XXX/include/bam/version.hpp. This is of course a bug.

Samuel Hokin said...

Thanks! This solved it! Note that make install under samtools does NOT put things in the places expected by cuffdiff configure.

Lucas Castro said...

Thanks Xingyu Yang, it solved my issue too!

Lucas Castro said...

Thanks Xingyu Yang, it solved my issue too!

Ty said...

Thanks Xingyu Yang!

Halil İbrahim Oymacı said...

Xingyu Yang said that it is run for me, thanks a lot.

Halil İbrahim Oymacı said...

It is Xingyu Yang said that it is run for me, thanks a lot.

Wenlan Zang said...

That's iNDEED a HUGE BUG!! thank you Xingyu Yang!!! Really saved me from keep ./configure