Open dinhe878 opened 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
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 to
boost::archive::text_oarchive_implsave_primitive<boost::archive::binary_oarchive, std::basic_string<char> >': /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_traitsperl_matcher': /home/dinghe/miniconda3/envs/metagenome_pipeline/include/boost/regex/v4/perl_matcher.hpp:391: undefined reference to
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_traitsboost::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 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/metagenome_pipeline/include/boost/archive/detail/oserializer.hpp:93: undefined reference to
boost::archive::text_oarchive_implload_primitive<boost::archive::text_iarchive, std::basic_string<char> >': /home/dinghe/miniconda3/envs/metagenome_pipeline/include/boost/archive/detail/iserializer.hpp:108: undefined reference to
boost::archive::text_iarchive_implsave_primitive<boost::archive::text_oarchive, std::basic_string<char> >': /home/dinghe/miniconda3/envs/metagenome_pipeline/include/boost/archive/detail/oserializer.hpp:93: undefined reference to
boost::archive::text_oarchive_implboost::archive::text_oarchive_impl<boost::archive::text_oarchive>::save(std::string const&)' src/map/mash_map.o: In function
save_primitive<boost::archive::binary_oarchive, std::basic_stringboost::archive::basic_binary_oprimitive<boost::archive::binary_oarchive, char, std::char_traits<char> >::save(std::string const&)' src/map/mash_map.o: In function
load_primitive<boost::archive::binary_iarchive, std::basic_stringboost::archive::basic_binary_iprimitive<boost::archive::binary_iarchive, char, std::char_traits<char> >::load(std::string&)' src/map/mash_map.o: In function
load_primitive<boost::archive::text_iarchive, std::basic_stringboost::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 to
boost::archive::text_iarchive_implu_charType_64' /home/dinghe/miniconda3/envs/metagenome_pipeline/lib/libboost_regex.so: undefined reference to
icu_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 to
icu_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 to
icu_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 to
u_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 to
u_charFromName_64'
collect2: error: ld returned 1 exit status
make: *** [metamaps] Error 1
Any idea? Cheers, Ding
It looks like anaconda is missing ICU. You can install this package to provide it: https://anaconda.org/conda-forge/icu
Installed (and showed it has been installed), so same error...
Can you confirm where libicudata.so.64 is on your system?
/home/dinghe/miniconda3/envs/metagenome_pipeline/lib/libicudata.so.64
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
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 to
boost::archive::text_oarchive_implsave_primitive<boost::archive::binary_oarchive, std::basic_string<char> >': /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_traitsperl_matcher': /home/dinghe/miniconda3/envs/metamaps/include/boost/regex/v4/perl_matcher.hpp:391: undefined reference to
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_traitssave_primitive<boost::archive::text_oarchive, std::basic_string<char> >': /home/dinghe/miniconda3/envs/metamaps/include/boost/archive/detail/oserializer.hpp:93: undefined reference to
boost::archive::text_oarchive_implload_primitive<boost::archive::text_iarchive, std::basic_string<char> >': /home/dinghe/miniconda3/envs/metamaps/include/boost/archive/detail/iserializer.hpp:108: undefined reference to
boost::archive::text_iarchive_implsave_primitive<boost::archive::text_oarchive, std::basic_string<char> >': /home/dinghe/miniconda3/envs/metamaps/include/boost/archive/detail/oserializer.hpp:93: undefined reference to
boost::archive::text_oarchive_implboost::archive::text_oarchive_impl<boost::archive::text_oarchive>::save(std::string const&)' src/map/mash_map.o: In function
save_primitive<boost::archive::binary_oarchive, std::basic_stringboost::archive::basic_binary_oprimitive<boost::archive::binary_oarchive, char, std::char_traits<char> >::save(std::string const&)' src/map/mash_map.o: In function
load_primitive<boost::archive::binary_iarchive, std::basic_stringboost::archive::basic_binary_iprimitive<boost::archive::binary_iarchive, char, std::char_traits<char> >::load(std::string&)' src/map/mash_map.o: In function
load_primitive<boost::archive::text_iarchive, std::basic_stringboost::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 to
boost::archive::text_iarchive_impl
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
@mkweskin Thank you for sharing!
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