0

EDIT: solved, incorrect boost setup /facepalm

I have been trying to install boost-mpi on an old system/cluster.

After installing boost and using bjam --with-mpi, i tried to compile a hello_world example that came with the boost-mpi setup tutorial. I supplied the mpi-autoconfig for bjam with mpic++ and when I compile using the following:

/../gnu/bin/mpic++ -I/home/user/boost_1_51_0 communicator.cpp -lstdc++ -L/home/user/boost_1_51_0/stage/lib -lboost_mpi -lboost_serialization

I receive the following errors:

libboost_serialization.so: undefined reference to `std::basic_istream<char, std::char_traits<char> >& std::basic_istream<char, std::char_traits<char> >::_M_extract<unsigned short>(unsigned short&)@GLIBCXX_3.4.9'

So I guessed that GLIBCXX3.4.9 must have been found when building with bjam, but after

locate libstdc++.so

I used

"strings /path/to/libstdc++.so | grep LIBCXX" 

and each one only had 3.4.8 as the latest version of GLIBCXX.

I am rather confused about this problem. Any help is appreciated!

Jeff
  • 73
  • 1
  • 4

1 Answers1

0

This does indeed mean libboost_serialization.so was compiled with a newer version of GCC.

Are you sure you don't have another version installed? Is your locate database up to date? What does which g++ show?

Does it help if you put -lstdc++ last in the compilation command? Since liboost_serialization.so depends on libstdc++.so you should order them correctly.

Jonathan Wakely
  • 166,810
  • 27
  • 341
  • 521
  • locate is probably not up to date since the version of gcc on this cluster was released 5 years ago lol. which g++ simply returns /usr/bin/g++, but it returns gcc version 4.1.2 placing -lstdc++ last also did not change the errors unfortunately – Jeff Aug 28 '12 at 13:35