Problem Compiling Bam-Readcount
1
0
Entering edit mode
10.4 years ago

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?

• 3.5k views
ADD COMMENT
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

can you show us your command line?

ADD REPLY
0
Entering edit mode

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.

ADD REPLY
0
Entering edit mode

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})

ADD REPLY
1
Entering edit mode

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!

ADD REPLY
0
Entering edit mode

glad you got it figured out.

ADD REPLY
0
Entering edit mode

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.

ADD REPLY
2
Entering edit mode
10.4 years ago
ernfrid ▴ 400

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.

ADD COMMENT
0
Entering edit mode

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.

ADD REPLY
0
Entering edit mode

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.

ADD REPLY

Login before adding your answer.

Traffic: 2732 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6