DiltheyLab / MetaMaps

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

MetaMaps configure issue #20

Open dinhe878 opened 4 years ago

dinhe878 commented 4 years ago

Hi,

I am trying to compile MetaMaps on a linux server (CentOS Linux). I use miniconda to manage packages, therefore, installed boost library via conda (https://anaconda.org/anaconda/boost). I could locate the path to my boost library and provided when configure the program:

./configure --with-boost=/path/to/boost/ -- --prefix=/path/to/bin/

However, it still complains with error messages:

checking boost/math/distributions/binomial.hpp usability... no checking boost/math/distributions/binomial.hpp presence... no checking for boost/math/distributions/binomial.hpp... no configure: error: Boost Library headers not found.

Could you help me to resolve the issue?

Many thanks! Ding

froggleston commented 4 years ago

Hi Ding,

What path are you giving to --with-boost? You need the development headers (hpp) files, not the location where the linkers (.so) files are. I'm not sure that the anaconda package supplies the headers, but the biobuilds package does:

https://anaconda.org/biobuilds/boost

Cheers

Rob

dinhe878 commented 4 years ago

Hi Bob,

Thanks for getting back to me. I did manage to configure MetaMaps after changing the path pointed to the root directory of my conda environment. However, I ran into issues when do "make":

(metagenome_pipeline) [dinghe@fe1 MetaMaps]$ make metamaps g++ -c -O2 -ggdb -fopenmp -std=c++11 -Isrc -L /home/dinghe/miniconda3/envs/metagenome_pipeline/lib -I /home/dinghe/miniconda3/envs/metagenome_pipeline/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 /home/dinghe/miniconda3/envs/metagenome_pipeline/lib -I /home/dinghe/miniconda3/envs/metagenome_pipeline/include -include src/common/memcpyLink.h -Wl,--wrap=memcpy -DUSE_BOOST src/map/mash_map.o -o metamaps /home/dinghe/miniconda3/envs/metagenome_pipeline/lib/libboost_math_c99.a -lstdc++ -fopenmp -lz -lm -lpthread -lboost_system -lboost_filesystem -lboost_serialization -lboost_regex /usr/bin/ld: warning: libicudata.so.64, needed by /home/dinghe/miniconda3/envs/metagenome_pipeline/lib/libboost_regex.so, not found (try using -rpath or -rpath-link) /usr/bin/ld: warning: libicui18n.so.64, needed by /home/dinghe/miniconda3/envs/metagenome_pipeline/lib/libboost_regex.so, not found (try using -rpath or -rpath-link) /usr/bin/ld: warning: libicuuc.so.64, needed by /home/dinghe/miniconda3/envs/metagenome_pipeline/lib/libboost_regex.so, not found (try using -rpath or -rpath-link) src/map/mash_map.o: In function save_primitive<boost::archive::text_oarchive, std::basic_string<char> >': /home/dinghe/miniconda3/envs/metagenome_pipeline/include/boost/archive/detail/oserializer.hpp:93: undefined reference toboost::archive::text_oarchive_impl::save(std::string const&)' src/map/mash_map.o: In function save_primitive<boost::archive::binary_oarchive, std::basic_string<char> >': /home/dinghe/miniconda3/envs/metagenome_pipeline/include/boost/archive/detail/oserializer.hpp:93: undefined reference toboost::archive::basic_binary_oprimitive<boost::archive::binary_oarchive, char, std::char_traits >::save(std::string const&)' src/map/mash_map.o: In function perl_matcher': /home/dinghe/miniconda3/envs/metagenome_pipeline/include/boost/regex/v4/perl_matcher.hpp:391: undefined reference toboost::re_detail_107000::perl_matcher<gnu_cxx::normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<gnu_cxx::normal_iterator<char const, std::string> > >, boost::regex_traits<char, boost::cpp_regex_traits > >::construct_init(boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits > > const&, boost::regex_constants::_match_flags)' src/map/mash_map.o: In function `boost::cpp_regex_traits::transform_primary(char const, char const) const': /home/dinghe/miniconda3/envs/metagenome_pipeline/include/boost/regex/v4/cpp_regex_traits.hpp:966: undefined reference to `boost::re_detail_107000::cpp_regex_traits_implementation::transform_primary(char const, char const) const' src/map/mash_map.o: In function `boost::cpp_regex_traits::transform(char const, char const) const': /home/dinghe/miniconda3/envs/metagenome_pipeline/include/boost/regex/v4/cpp_regex_traits.hpp:962: undefined reference to `boost::re_detail_107000::cpp_regex_traits_implementation::transform(char const, char const) const' src/map/mash_map.o: In function `boost::re_detail_107000::perl_matcher<__gnu_cxx::__normal_iterator<char const, std::string>, std::allocator<boost::sub_match<gnu_cxx::__normal_iterator<char const*, std::string> > >, boost::regex_traits<char, boost::cpp_regex_traits > >::match_prefix()': /home/dinghe/miniconda3/envs/metagenome_pipeline/include/boost/regex/v4/perl_matcher_common.hpp:346: undefined reference to `boost::match_results<gnu_cxx::normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<gnu_cxx::normal_iterator<char const*, std::string> > > >::maybe_assign(boost::match_results<__gnu_cxx::normal_iterator<char const, std::string>, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const, std::string> > > > const&)' src/map/mash_map.o: In function boost::re_detail_107000::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::string> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match_match()': /home/dinghe/miniconda3/envs/metagenome_pipeline/include/boost/regex/v4/perl_matcher_non_recursive.hpp:1108: undefined reference toboost::match_results<gnu_cxx::normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<gnu_cxx::normal_iterator<char const, std::string> > > >::maybe_assign(boost::match_results<__gnu_cxx::__normal_iterator<char const, std::string>, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::string> > > > const&)' src/map/mash_map.o: In function save_primitive<boost::archive::text_oarchive, std::basic_string<char> >': /home/dinghe/miniconda3/envs/metagenome_pipeline/include/boost/archive/detail/oserializer.hpp:93: undefined reference toboost::archive::text_oarchive_impl::save(std::string const&)' src/map/mash_map.o: In function load_primitive<boost::archive::text_iarchive, std::basic_string<char> >': /home/dinghe/miniconda3/envs/metagenome_pipeline/include/boost/archive/detail/iserializer.hpp:108: undefined reference toboost::archive::text_iarchive_impl::load(std::string&)' src/map/mash_map.o: In function save_primitive<boost::archive::text_oarchive, std::basic_string<char> >': /home/dinghe/miniconda3/envs/metagenome_pipeline/include/boost/archive/detail/oserializer.hpp:93: undefined reference toboost::archive::text_oarchive_impl::save(std::string const&)' /home/dinghe/miniconda3/envs/metagenome_pipeline/include/boost/archive/detail/oserializer.hpp:93: undefined reference to boost::archive::text_oarchive_impl<boost::archive::text_oarchive>::save(std::string const&)' src/map/mash_map.o: In functionsave_primitive<boost::archive::binary_oarchive, std::basic_string >': /home/dinghe/miniconda3/envs/metagenome_pipeline/include/boost/archive/detail/oserializer.hpp:93: undefined reference to boost::archive::basic_binary_oprimitive<boost::archive::binary_oarchive, char, std::char_traits<char> >::save(std::string const&)' src/map/mash_map.o: In functionload_primitive<boost::archive::binary_iarchive, std::basic_string >': /home/dinghe/miniconda3/envs/metagenome_pipeline/include/boost/archive/detail/iserializer.hpp:108: undefined reference to boost::archive::basic_binary_iprimitive<boost::archive::binary_iarchive, char, std::char_traits<char> >::load(std::string&)' src/map/mash_map.o: In functionload_primitive<boost::archive::text_iarchive, std::basic_string >': /home/dinghe/miniconda3/envs/metagenome_pipeline/include/boost/archive/detail/iserializer.hpp:108: undefined reference to boost::archive::text_iarchive_impl<boost::archive::text_iarchive>::load(std::string&)' /home/dinghe/miniconda3/envs/metagenome_pipeline/include/boost/archive/detail/iserializer.hpp:108: undefined reference toboost::archive::text_iarchive_impl::load(std::string&)' /home/dinghe/miniconda3/envs/metagenome_pipeline/lib/libboost_regex.so: undefined reference to u_charType_64' /home/dinghe/miniconda3/envs/metagenome_pipeline/lib/libboost_regex.so: undefined reference toicu_64::Collator::createInstance(icu_64::Locale const&, UErrorCode&)' /home/dinghe/miniconda3/envs/metagenome_pipeline/lib/libboost_regex.so: undefined reference to u_isblank_64' /home/dinghe/miniconda3/envs/metagenome_pipeline/lib/libboost_regex.so: undefined reference toicu_64::Locale::~Locale()' /home/dinghe/miniconda3/envs/metagenome_pipeline/lib/libboost_regex.so: undefined reference to u_tolower_64' /home/dinghe/miniconda3/envs/metagenome_pipeline/lib/libboost_regex.so: undefined reference toicu_64::Locale::Locale()' /home/dinghe/miniconda3/envs/metagenome_pipeline/lib/libboost_regex.so: undefined reference to u_digit_64' /home/dinghe/miniconda3/envs/metagenome_pipeline/lib/libboost_regex.so: undefined reference tou_isspace_64' /home/dinghe/miniconda3/envs/metagenome_pipeline/lib/libboost_regex.so: undefined reference to icu_64::Locale::Locale(icu_64::Locale const&)' /home/dinghe/miniconda3/envs/metagenome_pipeline/lib/libboost_regex.so: undefined reference tou_charFromName_64' collect2: error: ld returned 1 exit status make: *** [metamaps] Error 1

Any idea? Cheers, Ding

froggleston commented 4 years ago

It looks like anaconda is missing ICU. You can install this package to provide it: https://anaconda.org/conda-forge/icu

dinhe878 commented 4 years ago

Installed (and showed it has been installed), so same error...

froggleston commented 4 years ago

Can you confirm where libicudata.so.64 is on your system?

dinhe878 commented 4 years ago

/home/dinghe/miniconda3/envs/metagenome_pipeline/lib/libicudata.so.64

zdk123 commented 4 years ago

I had this issue as well when trying to manage boost and icu from conda. The issue is that the compiler (g++) expects icu on the system. On ubuntum, I was able to specify the path directly via the recipe:

conda create -n metamaps -c conda-forge autoconf boost zlib icu==64.2
conda activate metamaps
git clone https://github.com/DiltheyLab/MetaMaps
cd MetaMaps
./bootstrap.sh
./configure --with-boost=$CONDA_PREFIX --prefix=$CONDA_PREFIX
export CXXFLAGS=-Wl,-rpath,$CONDA_PREFIX/lib
make metamaps
dinhe878 commented 4 years ago

Thanks @zdk123, followed your suggestion but still not resolved my issue:

g++ -c -Wl,-rpath,/home/dinghe/miniconda3/envs/metamaps/lib -O2 -ggdb -fopenmp -std=c++11 -Isrc -L /home/dinghe/miniconda3/envs/metamaps/lib -I /home/dinghe/miniconda3/envs/metamaps/include -include src/common/memcpyLink.h -Wl,--wrap=memcpy -DUSE_BOOST -o src/map/mash_map.o src/map/mash_map.cpp g++ -Wl,-rpath,/home/dinghe/miniconda3/envs/metamaps/lib -O2 -ggdb -fopenmp -std=c++11 -Isrc -L /home/dinghe/miniconda3/envs/metamaps/lib -I /home/dinghe/miniconda3/envs/metamaps/include -include src/common/memcpyLink.h -Wl,--wrap=memcpy -DUSE_BOOST src/map/mash_map.o -o metamaps /home/dinghe/miniconda3/envs/metamaps/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 save_primitive<boost::archive::text_oarchive, std::basic_string<char> >': /home/dinghe/miniconda3/envs/metamaps/include/boost/archive/detail/oserializer.hpp:93: undefined reference toboost::archive::text_oarchive_impl::save(std::string const&)' src/map/mash_map.o: In function save_primitive<boost::archive::binary_oarchive, std::basic_string<char> >': /home/dinghe/miniconda3/envs/metamaps/include/boost/archive/detail/oserializer.hpp:93: undefined reference toboost::archive::basic_binary_oprimitive<boost::archive::binary_oarchive, char, std::char_traits >::save(std::string const&)' src/map/mash_map.o: In function perl_matcher': /home/dinghe/miniconda3/envs/metamaps/include/boost/regex/v4/perl_matcher.hpp:391: undefined reference toboost::re_detail_107000::perl_matcher<gnu_cxx::normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<gnu_cxx::normal_iterator<char const, std::string> > >, boost::regex_traits<char, boost::cpp_regex_traits > >::construct_init(boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits > > const&, boost::regex_constants::_match_flags)' src/map/mash_map.o: In function `boost::cpp_regex_traits::transform_primary(char const, char const) const': /home/dinghe/miniconda3/envs/metamaps/include/boost/regex/v4/cpp_regex_traits.hpp:966: undefined reference to `boost::re_detail_107000::cpp_regex_traits_implementation::transform_primary(char const, char const) const' src/map/mash_map.o: In function `boost::cpp_regex_traits::transform(char const, char const) const': /home/dinghe/miniconda3/envs/metamaps/include/boost/regex/v4/cpp_regex_traits.hpp:962: undefined reference to `boost::re_detail_107000::cpp_regex_traits_implementation::transform(char const, char const) const' src/map/mash_map.o: In function `boost::re_detail_107000::perl_matcher<__gnu_cxx::__normal_iterator<char const, std::string>, std::allocator<boost::sub_match<gnu_cxx::normal_iterator<char const*, std::string> > >, boost::regex_traits<char, boost::cpp_regex_traits > >::match_prefix()': /home/dinghe/miniconda3/envs/metamaps/include/boost/regex/v4/perl_matcher_common.hpp:346: undefined reference to `boost::match_results<gnu_cxx::normal_iterator<char const, std::string>, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const, std::string> > > >::maybe_assign(boost::match_results<gnu_cxx::normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<gnu_cxx::normal_iterator<char const, std::string> > > > const&)' src/map/mash_map.o: In function `boost::re_detail_107000::perl_matcher<__gnu_cxx::__normal_iterator<char const, std::string>, std::allocator<boost::sub_match<gnu_cxx::__normal_iterator<char const*, std::string> > >, boost::regex_traits<char, boost::cpp_regex_traits > >::match_match()': /home/dinghe/miniconda3/envs/metamaps/include/boost/regex/v4/perl_matcher_non_recursive.hpp:1108: undefined reference to `boost::match_results<gnu_cxx::normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<gnu_cxx::normal_iterator<char const*, std::string> > > >::maybe_assign(boost::match_results<__gnu_cxx::normal_iterator<char const, std::string>, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const, std::string> > > > const&)' src/map/mash_map.o: In function save_primitive<boost::archive::text_oarchive, std::basic_string<char> >': /home/dinghe/miniconda3/envs/metamaps/include/boost/archive/detail/oserializer.hpp:93: undefined reference toboost::archive::text_oarchive_impl::save(std::string const&)' src/map/mash_map.o: In function load_primitive<boost::archive::text_iarchive, std::basic_string<char> >': /home/dinghe/miniconda3/envs/metamaps/include/boost/archive/detail/iserializer.hpp:108: undefined reference toboost::archive::text_iarchive_impl::load(std::string&)' src/map/mash_map.o: In function save_primitive<boost::archive::text_oarchive, std::basic_string<char> >': /home/dinghe/miniconda3/envs/metamaps/include/boost/archive/detail/oserializer.hpp:93: undefined reference toboost::archive::text_oarchive_impl::save(std::string const&)' /home/dinghe/miniconda3/envs/metamaps/include/boost/archive/detail/oserializer.hpp:93: undefined reference to boost::archive::text_oarchive_impl<boost::archive::text_oarchive>::save(std::string const&)' src/map/mash_map.o: In functionsave_primitive<boost::archive::binary_oarchive, std::basic_string >': /home/dinghe/miniconda3/envs/metamaps/include/boost/archive/detail/oserializer.hpp:93: undefined reference to boost::archive::basic_binary_oprimitive<boost::archive::binary_oarchive, char, std::char_traits<char> >::save(std::string const&)' src/map/mash_map.o: In functionload_primitive<boost::archive::binary_iarchive, std::basic_string >': /home/dinghe/miniconda3/envs/metamaps/include/boost/archive/detail/iserializer.hpp:108: undefined reference to boost::archive::basic_binary_iprimitive<boost::archive::binary_iarchive, char, std::char_traits<char> >::load(std::string&)' src/map/mash_map.o: In functionload_primitive<boost::archive::text_iarchive, std::basic_string >': /home/dinghe/miniconda3/envs/metamaps/include/boost/archive/detail/iserializer.hpp:108: undefined reference to boost::archive::text_iarchive_impl<boost::archive::text_iarchive>::load(std::string&)' /home/dinghe/miniconda3/envs/metamaps/include/boost/archive/detail/iserializer.hpp:108: undefined reference toboost::archive::text_iarchive_impl::load(std::string&)' collect2: error: ld returned 1 exit status make: *** [metamaps] Error 1

mkweskin commented 4 years ago

Similar to the suggestion of @zdk123, after creating and activating a conda environment with the requirements, I had to update my LD_LIBRARY_PATH before make:

./bootstrap.sh
./configure --with-boost=$CONDA_PREFIX --prefix=$CONDA_PREFIX
LD_LIBRARY_PATH=$CONDA_PREFIX/lib:$LD_LIBRARY_PATH
make
make install
AlexanderDilthey commented 4 years ago

@mkweskin Thank you for sharing!