This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Problem Compiling Bam-Readcount

Hi!

I'm trying to compile bam-readcount on SUSE Linux (without root rights, this is our cluster). I seem to have a problem with Boost, I get a bunch of errors similar to this:

bamreadcount.cpp:(.text+0x32f4): undefined reference to `boost::program_options::options_description::m_default_line_length'

I assume the linking to Boost is not working. I have compiled Boost and setup environment variables for cmake for boost_root and the include dir. What am I missing?

What about the library directory? Presumably you need to add an -Lsome_directory option.

can you show us your command line?

The command line is "make" ;). I think -L does not apply here as it's cmake? I gave cmake the location of Boost with environment variables, as per the instructions. If I don't do that it doesn't even start to compile things, so that's somewhat working at least.

Perhaps you should have mentioned you were working with CMAKE.

try editing your CMAKE and add:

find_package(Boost REQUIRED)

include_directories(${Boost_INCLUDE_DIRS})

The fastest solution will most likely be to ask the admin to install the boost-devel libraries system wide using yum ... or something equivalent. Linking to local installs in CMAKE is going to cause you ALOT of pain. I speak from experience, I tried to do the exact same thing.

Thanks, I did mention cmake in the question. The problem seems to have been the version of bam-readcount, see below. Worked with local install of cmake and Boost even!

1 answer

bam-readcount has been under a fair amount of development over the last week. I have only recently added boost as a dependency and haven't yet updated bam-readcount to include it as part of the package. I would recommend either utilizing the last stable version (which did not require boost) by using git co v0.4.6 and then following the normal directions or attempting to set up cmake to point to your boost directories directly. The libraries should be found by cmake, but it doesn't always work when they are in a non-standard location. If I look at my local compilation I see the following cmake variables set:

Boost_INCLUDE_DIR /usr/include

Boost_LIBRARY_DIRS /usr/lib/boost

Boost_PROGRAM_OPTIONS_LIBRARY /usr/lib/libboost_program_options-mt.so

You may want to try setting those to point somewhere appropriate for your installation and see if things work.

And to be more clear, I think your would want to do something like this:

cmake -DBoost_INCLUDE_DIR=/usr/include -DBoost_LIBRARY_DIRS=/usr/lib/boost -DBoost_PROGRAM_OPTIONS_LIBRARY=/usr/lib/libboost_program_options-mt.so ..

I would try without the program options part first.

Thanks, version 0.4.6 compiled as described in the readme. The Boost library location was always set for cmake with env variables, so it seems the current version does something different.

Log in to answer this question.