Closed linsalrob closed 8 years ago
It seems the library path is not correct. Where are the boost libraries? Thanks!
I have the libraries in the 2.23/Src directory I downloaded from sourceforge
$ ls Src/
aa.h BlastStat.h BuildHash.cpp codon.h HashSearch.h libboost_chrono.a libboost_system.a lnfac.h Makefile mergeUnit.h paras.h Seg.h threadpool.hpp
BlastStat.cpp boost cindex.h HashSearch.cpp hitUnit.h libboost_serialization.a libboost_thread.a main.cpp mergeUnit.cpp n2a.h Seg.cpp threadpool weight.h
and I also have boost installed:
/usr/lib/x86_64-linux-gnu/libboost_date_time.so.1.58.0
/usr/lib/x86_64-linux-gnu/libboost_filesystem.a
/usr/lib/x86_64-linux-gnu/libboost_filesystem.so
/usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.58.0
/usr/lib/x86_64-linux-gnu/libboost_iostreams.a
/usr/lib/x86_64-linux-gnu/libboost_iostreams.so
/usr/lib/x86_64-linux-gnu/libboost_iostreams.so.1.58.0
/usr/lib/x86_64-linux-gnu/libboost_program_options.so.1.58.0
/usr/lib/x86_64-linux-gnu/libboost_regex.a
/usr/lib/x86_64-linux-gnu/libboost_regex.so
/usr/lib/x86_64-linux-gnu/libboost_regex.so.1.58.0
/usr/lib/x86_64-linux-gnu/libboost_system.a
/usr/lib/x86_64-linux-gnu/libboost_system.so
/usr/lib/x86_64-linux-gnu/libboost_system.so.1.58.0
/usr/lib/x86_64-linux-gnu/libboost_thread.so.1.58.0
that is in my LD_LINKER_PATH too
Rob
What's 'LIB' in Makefile? Thanks!
LIBS := -L ./
Please try -L /usr/lib/x86_64-linux-gnu/
The problem is that Ubuntu is using gcc-5 (my machine has version 5.4.0) and the boost libs do not compile with that version.
The solution is to edit the Makefile in Src and change the line
CXX := g++
to
CXX := g++-4.8
All my Ubuntu systems include a version of gcc-4.x, but you should confirm the version that you have, e.g. by typing g++ and pressing two tabs on the command line.
With this change the code compiles and installs.
Same thing happened to me. Thank you @linsalrob for the fix
Install of both version 2.22 and 2.23 (64 bit) does not install:
RAPSearch installer rm -f _.o rapsearch prerapsearch g++ -c -O3 -w HashSearch.cpp -o HashSearch.o -I ./ g++ -c -O3 -w BlastStat.cpp -o BlastStat.o -I ./ g++ -c -O3 -w Seg.cpp -o Seg.o -I ./ g++ -c -O3 -w mergeUnit.cpp -o mergeUnit.o -I ./ g++ -O3 -w -o rapsearch main.cpp HashSearch.o BlastStat.o Seg.o mergeUnit.o -I ./ -L ./ -lboost_serialization -lpthread -lboost_thread -lboost_system -lboost_chrono HashSearch.o: In function >::save(std::cxx11::basic_string<char, std::char_traits, std::allocator > const&)'
HashSearch.o: In function `boost::archive::detail::oserializer<boost::archive::binary_oarchive, std::vector<std::cxx11::basic_string<char, std::char_traits, std::allocator >, std::allocator<std:: cxx11::basic_string<char, std::char_traits, std::allocator > > > >::save_object_data(boost::archive::detail::basicoarchive&, void const) const':
HashSearch.cpp:(.text._ZNK5boost7archive6detail11oserializerINS0_15binary_oarchiveESt6vectorINSt7 cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaISA_EEE16save_object_dataERNS1_14basic_oarchiveEPKv[_ZNK5boost7archive6detail11oserializerINS0_15binary_oarchiveESt6vectorINSt7cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaISA_EEE16save_object_dataERNS1_14basic_oarchiveEPKv]+0xcb): undefined reference to , std::allocator >, std::allocator<std::cxx11::basic_string<char, std::char_traits, std::allocator > > > >::load_object_data(boost::archive::detail::basiciarchive&, void, unsigned int) const':
HashSearch.cpp:(.text._ZNK5boost7archive6detail11iserializerINS0_15binary_iarchiveESt6vectorINSt7cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaISA_EEE16load_object_dataERNS1_14basic_iarchiveEPvj[_ZNK5boost7archive6detail11iserializerINS0_15binary_iarchiveESt6vectorINSt7cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaISA_EEE16load_object_dataERNS1_14basic_iarchiveEPvj]+0x11c): undefined reference to `boost::archive::basic_binary_iprimitive<boost::archive::binary_iarchive, char, std::char_traits >::load(std:: cxx11::basic_string<char, std::char_traits, std::allocator >&)'
HashSearch.o: In function >::save(std::cxx11::basic_string<char, std::char_traits, std::allocator > const&)'
HashSearch.cpp:(.text._ZN8CHitUnit9serializeIN5boost7archive15binary_oarchiveEEEvRT_j[_ZN8CHitUnit9serializeIN5boost7archive15binary_oarchiveEEEvRT_j]+0x185): undefined reference to`boost::archive::basic_binary_oprimitive<boost::archive::binary_oarchive, char, std::char_traits >::save(std:: cxx11::basic_string<char, std::char_traits, std::allocator > const&)'
HashSearch.cpp:(.text._ZN8CHitUnit9serializeIN5boost7archive15binary_oarchiveEEEvRT_j[_ZN8CHitUnit9serializeIN5boost7archive15binary_oarchiveEEEvRT_j]+0x19c): undefined reference to >::save(std::cxx11::basic_string<char, std::char_traits, std::allocator > const&)'
HashSearch.cpp:(.text._ZN8CHitUnit9serializeIN5boost7archive15binary_oarchiveEEEvRT_j[_ZN8CHitUnit9serializeIN5boost7archive15binary_oarchiveEEEvRT_j]+0x1ce): undefined reference to `boost::archive::basic_binary_oprimitive<boost::archive::binary_oarchive, char, std::char_traits >::save(std:: cxx11::basic_string<char, std::char_traits, std::allocator > const&)'
mergeUnit.o: In function >::load(std::cxx11::basic_string<char, std::char_traits, std::allocator >&)'
mergeUnit.cpp:(.text._ZNK5boost7archive6detail11iserializerINS0_15binary_iarchiveE8CHitUnitE16load_object_dataERNS1_14basic_iarchiveEPvj[_ZNK5boost7archive6detail11iserializerINS0_15binary_iarchiveE8CHitUnitE16load_object_dataERNS1_14basic_iarchiveEPvj]+0x23b): undefined reference to`boost::archive::basic_binary_iprimitive<boost::archive::binary_iarchive, char, std::char_traits >::load(std:: cxx11::basic_string<char, std::char_traits, std::allocator >&)'
mergeUnit.cpp:(.text._ZNK5boost7archive6detail11iserializerINS0_15binary_iarchiveE8CHitUnitE16load_object_dataERNS1_14basic_iarchiveEPvj[_ZNK5boost7archive6detail11iserializerINS0_15binary_iarchiveE8CHitUnitE16load_object_dataERNS1_14basic_iarchiveEPvj]+0x24a): undefined reference to >::load(std::cxx11::basic_string<char, std::char_traits, std::allocator >&)'
mergeUnit.cpp:(.text._ZNK5boost7archive6detail11iserializerINS0_15binary_iarchiveE8CHitUnitE16load_object_dataERNS1_14basic_iarchiveEPvj[_ZNK5boost7archive6detail11iserializerINS0_15binary_iarchiveE8CHitUnitE16load_object_dataERNS1_14basic_iarchiveEPvj]+0x268): undefined reference to `boost::archive::basic_binary_iprimitive<boost::archive::binary_iarchive, char, std::char_traits >::load(std:: cxx11::basic_string<char, std::char_traits, std::allocator >&)'
collect2: error: ld returned 1 exit status
Makefile:33: recipe for target 'rapsearch' failed
make: *\ [rapsearch] Error 1
mv: cannot stat 'Src/rapsearch': No such file or directory
mv: cannot stat 'Src/prerapsearch': No such file or directory
boost::archive::detail::common_oarchive<boost::archive::binary_oarchive>::vsave(boost::archive::class_name_type const&)': HashSearch.cpp:(.text._ZN5boost7archive6detail15common_oarchiveINS0_15binary_oarchiveEE5vsaveERKNS0_15class_name_typeE[_ZN5boost7archive6detail15common_oarchiveINS0_15binary_oarchiveEE5vsaveERKNS0_15class_name_typeE]+0x59): undefined reference to
boost::archive::basic_binary_oprimitive<boost::archive::binary_oarchive, char, std::char_traitsboost::archive::basic_binary_oprimitive<boost::archive::binary_oarchive, char, std::char_traits<char> >::save(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' HashSearch.o: In function
boost::archive::detail::iserializer<boost::archive::binary_iarchive, std::vector<std::cxx11::basic_string<char, std::char_traitsvoid CHitUnit::serializeboost::archive::binary_oarchive(boost::archive::binary_oarchive&, unsigned int)': HashSearch.cpp:(.text._ZN8CHitUnit9serializeIN5boost7archive15binary_oarchiveEEEvRT_j[_ZN8CHitUnit9serializeIN5boost7archive15binary_oarchiveEEEvRT_j]+0x171): undefined reference to
boost::archive::basic_binary_oprimitive<boost::archive::binary_oarchive, char, std::char_traitsboost::archive::basic_binary_oprimitive<boost::archive::binary_oarchive, char, std::char_traits<char> >::save(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' HashSearch.cpp:(.text._ZN8CHitUnit9serializeIN5boost7archive15binary_oarchiveEEEvRT_j[_ZN8CHitUnit9serializeIN5boost7archive15binary_oarchiveEEEvRT_j]+0x1b3): undefined reference to
boost::archive::basic_binary_oprimitive<boost::archive::binary_oarchive, char, std::char_traitsboost::archive::detail::iserializer<boost::archive::binary_iarchive, CHitUnit>::load_object_data(boost::archive::detail::basic_iarchive&, void_, unsigned int) const': mergeUnit.cpp:(.text._ZNK5boost7archive6detail11iserializerINS0_15binary_iarchiveE8CHitUnitE16load_object_dataERNS1_14basic_iarchiveEPvj[_ZNK5boost7archive6detail11iserializerINS0_15binary_iarchiveE8CHitUnitE16load_object_dataERNS1_14basic_iarchiveEPvj]+0x22f): undefined reference to
boost::archive::basic_binary_iprimitive<boost::archive::binary_iarchive, char, std::char_traitsboost::archive::basic_binary_iprimitive<boost::archive::binary_iarchive, char, std::char_traits<char> >::load(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&)' mergeUnit.cpp:(.text._ZNK5boost7archive6detail11iserializerINS0_15binary_iarchiveE8CHitUnitE16load_object_dataERNS1_14basic_iarchiveEPvj[_ZNK5boost7archive6detail11iserializerINS0_15binary_iarchiveE8CHitUnitE16load_object_dataERNS1_14basic_iarchiveEPvj]+0x259): undefined reference to
boost::archive::basic_binary_iprimitive<boost::archive::binary_iarchive, char, std::char_traitsExecutables are now installed under bin/