DiltheyLab / MetaMaps

Long-read metagenomic analysis
Other
98 stars 23 forks source link

Installation failed #15

Closed xlinxlin closed 5 years ago

xlinxlin commented 5 years ago

I just tried to install MetaMaps on my Ubuntu 18.04 computer but it failed, the last installation message I can get from the console is:

g++ -O2 -ggdb -fopenmp -std=c++11 -Isrc -L /opt/boost_1_68/lib -I /opt/boost_1_68/include  -include src/common/memcpyLink.h -Wl,--wrap=memcpy -DUSE_BOOST src/map/mash_map.o   -o metamaps /opt/boost_1_68/lib/libboost_math_c99.a -lstdc++ -fopenmp -lz -lm -lpthread -lboost_system -lboost_filesystem -lboost_serialization -lboost_regex
src/map/mash_map.o: In function `boost::re_detail_106501::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::unwind_extra_block(bool)':
/usr/include/boost/regex/v4/perl_matcher_non_recursive.hpp:1352: undefined reference to `boost::re_detail_106501::put_mem_block(void*)'
src/map/mash_map.o: In function `boost::system::error_category::std_category::equivalent(std::error_code const&, int) const':
/usr/include/boost/system/error_code.hpp:686: undefined reference to `boost::system::generic_category()'
/usr/include/boost/system/error_code.hpp:689: undefined reference to `boost::system::generic_category()'
/usr/include/boost/system/error_code.hpp:701: undefined reference to `boost::system::generic_category()'
src/map/mash_map.o: In function `boost::system::error_category::std_category::equivalent(int, std::error_condition const&) const':
/usr/include/boost/system/error_code.hpp:656: undefined reference to `boost::system::generic_category()'
/usr/include/boost/system/error_code.hpp:659: undefined reference to `boost::system::generic_category()'
src/map/mash_map.o:/usr/include/boost/system/error_code.hpp:206: more undefined references to `boost::system::generic_category()' follow
src/map/mash_map.o: In function `_GLOBAL__sub_I__Z5errExRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE':
/usr/include/boost/system/error_code.hpp:210: undefined reference to `boost::system::system_category()'
src/map/mash_map.o: In function `void boost::re_detail_106501::raise_error<boost::regex_traits_wrapper<boost::regex_traits<char, boost::cpp_regex_traits<char> > > >(boost::regex_traits_wrapper<boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::error_type)':
/usr/include/boost/regex/v4/cpp_regex_traits.hpp:449: undefined reference to `boost::re_detail_106501::get_default_error_string(boost::regex_constants::error_type)'
src/map/mash_map.o: In function `void boost::re_detail_106501::raise_error<boost::regex_traits_wrapper<boost::regex_traits<char, boost::cpp_regex_traits<char> > > >(boost::regex_traits_wrapper<boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::error_type)':
/usr/include/boost/regex/pattern_except.hpp:75: undefined reference to `boost::re_detail_106501::raise_runtime_error(std::runtime_error const&)'
src/map/mash_map.o: In function `__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > boost::re_detail_106501::re_is_set_member<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, char, boost::regex_traits<char, boost::cpp_regex_traits<char> >, unsigned int>(__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, boost::re_detail_106501::re_set_long<unsigned int> const*, boost::re_detail_106501::regex_data<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, bool)':
/usr/include/boost/regex/v4/cpp_regex_traits.hpp:966: undefined reference to `boost::re_detail_106501::cpp_regex_traits_implementation<char>::transform_primary[abi:cxx11](char const*, char const*) const'
/usr/include/boost/regex/v4/cpp_regex_traits.hpp:962: undefined reference to `boost::re_detail_106501::cpp_regex_traits_implementation<char>::transform[abi:cxx11](char const*, char const*) const'
src/map/mash_map.o: In function `boost::re_detail_106501::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::extend_stack()':
/usr/include/boost/regex/v4/perl_matcher_non_recursive.hpp:222: undefined reference to `boost::re_detail_106501::get_mem_block()'
src/map/mash_map.o: In function `boost::re_detail_106501::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::find_imp()':
/usr/include/boost/regex/v4/perl_matcher_non_recursive.hpp:107: undefined reference to `boost::re_detail_106501::get_mem_block()'
src/map/mash_map.o: In function `boost::re_detail_106501::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::find_imp()':
/usr/include/boost/regex/v4/perl_matcher_common.hpp:300: undefined reference to `boost::re_detail_106501::verify_options(unsigned int, boost::regex_constants::_match_flags)'
src/map/mash_map.o: In function `boost::re_detail_106501::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::find_imp()':
/usr/include/boost/regex/v4/perl_matcher_non_recursive.hpp:115: undefined reference to `boost::re_detail_106501::put_mem_block(void*)'
/usr/include/boost/regex/v4/perl_matcher_non_recursive.hpp:115: undefined reference to `boost::re_detail_106501::put_mem_block(void*)'
src/map/mash_map.o: In function `bool boost::regex_search<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >(__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > >&, boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags, __gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >)':
/usr/include/boost/regex/v4/perl_matcher.hpp:383: undefined reference to `boost::re_detail_106501::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::construct_init(boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags)'
collect2: error: ld returned 1 exit status
Makefile:20: recipe for target 'metamaps' failed
make: *** [metamaps] Error 1

Can someone help me? Thanks!

AlexanderDilthey commented 5 years ago

@xlinxlin Apologies for late response, I had been away for a few days. This is a Boost issue - difficult to diagnose remotely. Is it possible that the version of gcc used to build the library is different from the one you have in your PATH? I'd recommend trying to build against a local version of Boost.

xlinxlin commented 5 years ago

@AlexanderDilthey Thank you for your response, I also think it is a Boost issue but I have no idea how to fix it... Here is my commands how I installed Boost and MetaMaps (I just tried it again with boost 1.70 and got the same error messages).

cd boost_1_70_0
sudo mkdir /opt/boost_1_70_0
sudo ./bootstrap.sh --prefix=/opt/boost_1_70_0
sudo ./b2 install
cd ~/git/MetaMaps
sudo ./bootstrap.sh 
sudo./configure --with-boost=/opt/boost_1_70_0
sudo make metamaps

What I noticed is that I set the path to Boost is /opt/boost_1_70_0, but in the error message it seems that it used the Boost in /usr/include, is that could be the problem? Should I set some extra settings for this installation? Thank you!

xlinxlin commented 5 years ago

@AlexanderDilthey and my gcc version is 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1), is that also could be an issue?

AlexanderDilthey commented 5 years ago

gcc 7.4.0 should be fine.

Yes, there seems to be a version mismatch, the output you listed all points to /opt/boost_1_68/lib. Did you check that there is a valid installation of boost in /opt/boost_1_70_0? Also, it might be that a space character is misisng between sudo and ./configure in the command you quoted: sudo./configure --with-boost=/opt/boost_1_70_0.

I am not sure why configure does not include the correct paths - you could always manually edit the generated makefile. Let me know if you need help with this.

xlinxlin commented 5 years ago

@AlexanderDilthey It would be greatly appreciated if you could help me to edit the generated makefile. Please find the attached file, thank you. Makefile.gz

AlexanderDilthey commented 5 years ago

Thank you! The Makefile looks good to me!

  1. Can you do a make clean in the MetaMaps directory, followed by a make metamaps, and confirm that you still get error messages that refer to your global Boost installation (/usr/include/boost/...)?

  2. Can you do an ls on /opt/boost_1_70_0/include and post the output?

xlinxlin commented 5 years ago

@AlexanderDilthey

  1. Now I got a new error message:
    g++ -c -O2 -ggdb -fopenmp -std=c++11 -Isrc -L /opt/boost_1_70_0/lib -I /opt/boost_1_70_0/include  -include src/common/memcpyLink.h -Wl,--wrap=memcpy -DUSE_BOOST -o src/map/mash_map.o src/map/mash_map.cpp
    g++ -O2 -ggdb -fopenmp -std=c++11 -Isrc -L /opt/boost_1_70_0/lib -I /opt/boost_1_70_0/include  -include src/common/memcpyLink.h -Wl,--wrap=memcpy -DUSE_BOOST src/map/mash_map.o   -o metamaps /opt/boost_1_70_0/lib/libboost_math_c99.a -lstdc++ -fopenmp -lz -lm -lpthread -lboost_system -lboost_filesystem -lboost_serialization -lboost_regex
  2. Under/opt/boost_1_70_0/include there is only a folder boost

Please see the screenshots in the attachment, thank you. 2 1

xlinxlin commented 5 years ago

@AlexanderDilthey I think I have maybe the same issue mentioned in this post, but I have no idea how to fix it... 3

xlinxlin commented 5 years ago

@AlexanderDilthey Finally...It works! 4

AlexanderDilthey commented 5 years ago

Excellent! I'll close this issue now, but let me know if you encounter further problems.