Undefined References From Boost When Installing Bam-Readcount
0
1
Entering edit mode
10.8 years ago
sally.boyd ▴ 10

I am trying to install bam-readcount in a centralized location for our cluster, which means downloading "source" and building in a non-standard location. I built cmake 2.18.12.2 and boost 1.55.0. Then following the instructions did: cmake <path/to/source>, make deps and make.

I had to dig down and find the actual c++ statement (actually gcc), and add in the paths to the boost libraries, include, etc. and the build is down to what appears to be 4 errors (one very long). I'm not sure if my version of boost has changed some things since 1.40, or if I'm just missing some libraries. I'm getting:

  /scratch/rists/hpcapps/x86_64/boost/1.55.0/lib/libboost_program_options.a(options_description.o):
  In function
  boost::program_options::options_description::print(std::basic_ostream<char,
std::char_traits<char> >&) const':
options_description.cpp:(.text+0x2a8b): undefined reference to
std::basic_ostream<char, std::char_traits<char> >&
  std::__ostream_insert<char, std::char_traits<char>

      (std::basic_ostream<char, std::char_traits<char> >&, char const*, long)' ...

  /scratch/rists/hpcapps/x86_64/boost/1.55.0/lib/libboost_program_options.a(options_description.o):options_description.cpp:(.text+0x2fc4):
  more undefined references to std::basic_ostream<char,
  std::char_traits<char> >& std::__ostream_insert<char,
  std::char_traits<char> >(std::basic_ostream<char,
  std::char_traits<char> >&, char const*, long)' follow

  /scratch/rists/hpcapps/x86_64/boost/1.55.0/lib/libboost_program_options.so:
  undefined reference to std::basic_ostream<char,
  std::char_traits<char> >& std::__ostream_insert<char,
  std::char_traits<char> >(std::basic_ostream<char,
  std::char_traits<char> >&, char const*, long)@GLIBCXX_3.4.9'

  /scratch/rists/hpcapps/x86_64/boost/1.55.0/lib/libboost_program_options.so:
  undefined reference to std::ctype<char>::_M_widen_init()
  const@GLIBCXX_3.4.11'

I am open to suggestions here -- I'm hoping I can just add some additional libraries to the c++ statement.

Regards,
Sally Boyd

bam-readcount • 6.1k views
ADD COMMENT
2
Entering edit mode

Are you compiling with gcc rather than g++? That's a frequent cause of things like undefined reference to std::basic_ostream. You might also just add -lstdc++, which ends up doing much of the same thing, but it's better to directly call g++.

ADD REPLY
0
Entering edit mode

It was using /usr/bin/c++. Changed it to g++ (no path) and that worked! Thanks so much!

ADD REPLY
0
Entering edit mode

I am having the exact problem! Could you please explain in detail what you did? How did you change it to g++?

ADD REPLY
0
Entering edit mode

@dpryan79 I am having the same problem. I have pasted the error messages I am getting here. Please look at them and let me know how I should install bam-readcount successfully on my system. Thanks!

ADD REPLY
0
Entering edit mode

Try just setting the CXX environment variable to g++. That might solve the problem. Make sure to wipe the build tree first (i.e. start with nothing compiled).

ADD REPLY
0
Entering edit mode

That didn't work for me. What finally worked was disabling auto-linking by adding to CMakeLists.txt

add_definitions(-DBOOST_ALL_NO_LIB)

and linking to the boost program options library by adding the line

link_libraries(${Boost_PROGRAM_OPTIONS_LIBRARY})
ADD REPLY

Login before adding your answer.

Traffic: 1292 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