Link errors
Sorry, I suspect this is not a bug, but it’s really giving me fits and I don’t see another venue. My OS version of boost is one minor version too old, so I built one from source, version 1.71. At the end, in the linking stage, I get some “undefined reference” errors. The first one is for boost::program_options::validate() and all of them appear to be program_options related.
At first It thought it just wasn’t finding the boost library, but cmake clearly shows they have been found, including the program_options library. Any idea what could be going on here? Output of entire process below:
[maple:~]$ cd metabat-201910/
[maple:metabat-201910]$ module load cmake
[maple:metabat-201910]$ module load gcc/8.2.0
[maple:metabat-201910]$ export CC=`which gcc`
[maple:metabat-201910]$ export CXX=`which g++`
[maple:metabat-201910]$ mkdir build
[maple:metabat-201910]$ cd build
[maple:build]$ BOOST_ROOT=/usr/local/apps/boost-1.71.0/ cmake -DCMAKE_INSTALL_PREFIX=/usr/local/apps//metabat-201910 -DCMAKE_LIBRARY_PATH=/usr/local/apps/boost-1.71.0/lib ..
-- The C compiler identification is GNU 8.2.0
-- The CXX compiler identification is GNU 8.2.0
-- Check for working C compiler: /usr/local/apps/gcc/gcc-8.2.0/bin/gcc
-- Check for working C compiler: /usr/local/apps/gcc/gcc-8.2.0/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/local/apps/gcc/gcc-8.2.0/bin/g++
-- Check for working CXX compiler: /usr/local/apps/gcc/gcc-8.2.0/bin/g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
Installing Release MetaBAT into /usr/local/apps/metabat-201910
CMake Warning at /cm/local/apps/cmake/3.12.3/share/cmake-3.12/Modules/FindBoost.cmake:847 (message):
New Boost version may have incorrect or missing dependencies and imported
targets
Call Stack (most recent call first):
/cm/local/apps/cmake/3.12.3/share/cmake-3.12/Modules/FindBoost.cmake:963 (_Boost_COMPONENT_DEPENDENCIES)
/cm/local/apps/cmake/3.12.3/share/cmake-3.12/Modules/FindBoost.cmake:1622 (_Boost_MISSING_DEPENDENCIES)
src/CMakeLists.txt:4 (find_package)
CMake Warning at /cm/local/apps/cmake/3.12.3/share/cmake-3.12/Modules/FindBoost.cmake:847 (message):
New Boost version may have incorrect or missing dependencies and imported
targets
Call Stack (most recent call first):
/cm/local/apps/cmake/3.12.3/share/cmake-3.12/Modules/FindBoost.cmake:963 (_Boost_COMPONENT_DEPENDENCIES)
/cm/local/apps/cmake/3.12.3/share/cmake-3.12/Modules/FindBoost.cmake:1622 (_Boost_MISSING_DEPENDENCIES)
src/CMakeLists.txt:4 (find_package)
CMake Warning at /cm/local/apps/cmake/3.12.3/share/cmake-3.12/Modules/FindBoost.cmake:847 (message):
New Boost version may have incorrect or missing dependencies and imported
targets
Call Stack (most recent call first):
/cm/local/apps/cmake/3.12.3/share/cmake-3.12/Modules/FindBoost.cmake:963 (_Boost_COMPONENT_DEPENDENCIES)
/cm/local/apps/cmake/3.12.3/share/cmake-3.12/Modules/FindBoost.cmake:1622 (_Boost_MISSING_DEPENDENCIES)
src/CMakeLists.txt:4 (find_package)
CMake Warning at /cm/local/apps/cmake/3.12.3/share/cmake-3.12/Modules/FindBoost.cmake:847 (message):
New Boost version may have incorrect or missing dependencies and imported
targets
Call Stack (most recent call first):
/cm/local/apps/cmake/3.12.3/share/cmake-3.12/Modules/FindBoost.cmake:963 (_Boost_COMPONENT_DEPENDENCIES)
/cm/local/apps/cmake/3.12.3/share/cmake-3.12/Modules/FindBoost.cmake:1622 (_Boost_MISSING_DEPENDENCIES)
src/CMakeLists.txt:4 (find_package)
CMake Warning at /cm/local/apps/cmake/3.12.3/share/cmake-3.12/Modules/FindBoost.cmake:847 (message):
New Boost version may have incorrect or missing dependencies and imported
targets
Call Stack (most recent call first):
/cm/local/apps/cmake/3.12.3/share/cmake-3.12/Modules/FindBoost.cmake:963 (_Boost_COMPONENT_DEPENDENCIES)
/cm/local/apps/cmake/3.12.3/share/cmake-3.12/Modules/FindBoost.cmake:1622 (_Boost_MISSING_DEPENDENCIES)
src/CMakeLists.txt:4 (find_package)
CMake Warning at /cm/local/apps/cmake/3.12.3/share/cmake-3.12/Modules/FindBoost.cmake:847 (message):
New Boost version may have incorrect or missing dependencies and imported
targets
Call Stack (most recent call first):
/cm/local/apps/cmake/3.12.3/share/cmake-3.12/Modules/FindBoost.cmake:963 (_Boost_COMPONENT_DEPENDENCIES)
/cm/local/apps/cmake/3.12.3/share/cmake-3.12/Modules/FindBoost.cmake:1622 (_Boost_MISSING_DEPENDENCIES)
src/CMakeLists.txt:4 (find_package)
CMake Warning at /cm/local/apps/cmake/3.12.3/share/cmake-3.12/Modules/FindBoost.cmake:847 (message):
New Boost version may have incorrect or missing dependencies and imported
targets
Call Stack (most recent call first):
/cm/local/apps/cmake/3.12.3/share/cmake-3.12/Modules/FindBoost.cmake:963 (_Boost_COMPONENT_DEPENDENCIES)
/cm/local/apps/cmake/3.12.3/share/cmake-3.12/Modules/FindBoost.cmake:1622 (_Boost_MISSING_DEPENDENCIES)
src/CMakeLists.txt:4 (find_package)
-- Boost version: 1.71.0
-- Found the following Boost libraries:
-- program_options
-- filesystem
-- system
-- graph
-- serialization
-- iostreams
-- regex
-- Found OpenMP_C: -fopenmp (found version "4.5")
-- Found OpenMP_CXX: -fopenmp (found version "4.5")
-- Found OpenMP: TRUE (found version "4.5")
Using OpenMP
Boost cmake dir:
Boost include: /usr/local/apps/boost-1.71.0/include
Boost libraries:/usr/local/apps/boost-1.71.0/lib/libboost_program_options.a/usr/local/apps/boost-1.71.0/lib/libboost_filesystem.a/usr/local/apps/boost-1.71.0/lib/libboost_system.a/usr/local/apps/boost-1.71.0/lib/libboost_graph.a/usr/local/apps/boost-1.71.0/lib/libboost_serialization.a/usr/local/apps/boost-1.71.0/lib/libboost_iostreams.a/usr/local/apps/boost-1.71.0/lib/libboost_regex.a
Boost lib ver:1_71
Boost lib dir:/usr/local/apps/boost-1.71.0/lib
-- Configuring done
-- Generating done
-- Build files have been written to: /ddn/home2/appl/metabat-201910/build
[maple:build]$ make
Scanning dependencies of target check_git_repository
[ 4%] Checking the git repository for changes...
Skipping creation of /ddn/home2/appl/metabat-201910/metabat_version.h as git is not available
[ 4%] Built target check_git_repository
Scanning dependencies of target zlib
[ 8%] Creating directories for 'zlib'
[ 12%] Performing download step (git clone) for 'zlib'
-- zlib download command succeeded. See also /ddn/home2/appl/metabat-201910/build/contrib/zlib-prefix/src/zlib-stamp/zlib-download-*.log
[ 16%] No patch step for 'zlib'
[ 20%] No update step for 'zlib'
[ 24%] Performing configure step for 'zlib'
Building static library libz.a version 1.2.11 with /usr/local/apps/gcc/gcc-8.2.0/bin/gcc.
Checking for size_t... Yes.
Checking for off64_t... Yes.
Checking for fseeko... Yes.
Checking for strerror... Yes.
Checking for unistd.h... Yes.
Checking for stdarg.h... Yes.
Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf().
Checking for vsnprintf() in stdio.h... Yes.
Checking for return value of vsnprintf()... Yes.
Checking for attribute(visibility) support... Yes.
[ 28%] Performing build step for 'zlib'
[ 32%] Performing install step for 'zlib'
-- zlib install command succeeded. See also /ddn/home2/appl/metabat-201910/build/contrib/zlib-prefix/src/zlib-stamp/zlib-install-*.log
[ 36%] Completed 'zlib'
[ 36%] Built target zlib
Scanning dependencies of target htslib
[ 40%] Creating directories for 'htslib'
[ 44%] Performing download step (git clone) for 'htslib'
-- htslib download command succeeded. See also /ddn/home2/appl/metabat-201910/build/contrib/htslib-prefix/src/htslib-stamp/htslib-download-*.log
[ 48%] No patch step for 'htslib'
[ 52%] No update step for 'htslib'
[ 56%] Performing configure step for 'htslib'
checking for gcc... /usr/local/apps/gcc/gcc-8.2.0/bin/gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /usr/local/apps/gcc/gcc-8.2.0/bin/gcc accepts -g... yes
checking for /usr/local/apps/gcc/gcc-8.2.0/bin/gcc option to accept ISO C89... none needed
checking for ranlib... ranlib
checking for grep that handles long lines and -e... /usr/bin/grep
checking for C compiler warning flags... -Wall
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking for _LARGEFILE_SOURCE value needed for large files... no
checking shared library type for unknown-Linux... plain .so
checking how to run the C preprocessor... /usr/local/apps/gcc/gcc-8.2.0/bin/gcc -E
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking for sys/param.h... yes
checking for getpagesize... yes
checking for working mmap... yes
checking for gmtime_r... yes
checking for fsync... yes
checking for drand48... yes
checking whether fdatasync is declared... yes
checking for fdatasync... yes
checking for library containing log... -lm
checking for zlib.h... yes
checking for inflate in -lz... yes
checking for library containing recv... none required
checking for libdeflate.h... no
checking for libdeflate_deflate_compress in -ldeflate... no
configure: WARNING: GCS support not enabled: requires libcurl support
configure: WARNING: S3 support not enabled: requires libcurl support
checking whether PTHREAD_MUTEX_RECURSIVE is declared... yes
configure: creating ./config.status
config.status: creating config.mk
config.status: creating htslib.pc.tmp
config.status: creating config.h
[ 60%] Performing build step for 'htslib'
[ 64%] Performing install step for 'htslib'
[ 68%] Completed 'htslib'
[ 68%] Built target htslib
Scanning dependencies of target metabat2
[ 72%] Building CXX object src/CMakeFiles/metabat2.dir/metabat2.cpp.o
[ 76%] Linking CXX executable metabat2
/usr/bin/ld: CMakeFiles/metabat2.dir/metabat2.cpp.o: in function `boost::program_options::typed_value<bool, char>::xparse(boost::any&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&) const':
metabat2.cpp:(.text._ZNK5boost15program_options11typed_valueIbcE6xparseERNS_3anyERKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaISB_EE[_ZNK5boost15program_options11typed_valueIbcE6xparseERNS_3anyERKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaISB_EE]+0x19): undefined reference to `boost::program_options::validate(boost::any&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, bool*, int)'
/usr/bin/ld: CMakeFiles/metabat2.dir/metabat2.cpp.o: in function `boost::program_options::typed_value<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, char>::xparse(boost::any&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&) const':
metabat2.cpp:(.text._ZNK5boost15program_options11typed_valueINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEcE6xparseERNS_3anyERKSt6vectorIS7_SaIS7_EE[_ZNK5boost15program_options11typed_valueINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEcE6xparseERNS_3anyERKSt6vectorIS7_SaIS7_EE]+0x19): undefined reference to `boost::program_options::validate(boost::any&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, int)'
/usr/bin/ld: CMakeFiles/metabat2.dir/metabat2.cpp.o: in function `boost::program_options::validation_error::validation_error(boost::program_options::validation_error::kind_t, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)':
metabat2.cpp:(.text._ZN5boost15program_options16validation_errorC2ENS1_6kind_tERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESA_i[_ZN5boost15program_options16validation_errorC5ENS1_6kind_tERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESA_i]+0x25): undefined reference to `boost::program_options::validation_error::get_template[abi:cxx11](boost::program_options::validation_error::kind_t)'
/usr/bin/ld: metabat2.cpp:(.text._ZN5boost15program_options16validation_errorC2ENS1_6kind_tERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESA_i[_ZN5boost15program_options16validation_errorC5ENS1_6kind_tERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESA_i]+0x3d): undefined reference to `boost::program_options::error_with_option_name::error_with_option_name(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)'
/usr/bin/ld: CMakeFiles/metabat2.dir/metabat2.cpp.o: in function `boost::program_options::basic_command_line_parser<char>::basic_command_line_parser(int, char const* const*)':
metabat2.cpp:(.text._ZN5boost15program_options25basic_command_line_parserIcEC2EiPKPKc[_ZN5boost15program_options25basic_command_line_parserIcEC5EiPKPKc]+0x128): undefined reference to `boost::program_options::to_internal(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: metabat2.cpp:(.text._ZN5boost15program_options25basic_command_line_parserIcEC2EiPKPKc[_ZN5boost15program_options25basic_command_line_parserIcEC5EiPKPKc]+0x1af): undefined reference to `boost::program_options::detail::cmdline::cmdline(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&)'
/usr/bin/ld: CMakeFiles/metabat2.dir/metabat2.cpp.o: in function `main':
metabat2.cpp:(.text.startup+0x1a1): undefined reference to `boost::program_options::options_description::options_description(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int, unsigned int)'
/usr/bin/ld: CMakeFiles/metabat2.dir/metabat2.cpp.o: in function `boost::program_options::typed_value<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, char>::name() const':
metabat2.cpp:(.text._ZNK5boost15program_options11typed_valueINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEcE4nameEv[_ZNK5boost15program_options11typed_valueINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEcE4nameEv]+0x1f): undefined reference to `boost::program_options::arg[abi:cxx11]'
/usr/bin/ld: CMakeFiles/metabat2.dir/metabat2.cpp.o: in function `boost::program_options::typed_value<double, char>::name[abi:cxx11]() const':
metabat2.cpp:(.text._ZNK5boost15program_options11typed_valueIdcE4nameB5cxx11Ev[_ZNK5boost15program_options11typed_valueIdcE4nameB5cxx11Ev]+0x1f): undefined reference to `boost::program_options::arg[abi:cxx11]'
/usr/bin/ld: CMakeFiles/metabat2.dir/metabat2.cpp.o: in function `boost::program_options::typed_value<unsigned long, char>::name[abi:cxx11]() const':
metabat2.cpp:(.text._ZNK5boost15program_options11typed_valueImcE4nameB5cxx11Ev[_ZNK5boost15program_options11typed_valueImcE4nameB5cxx11Ev]+0x1f): undefined reference to `boost::program_options::arg[abi:cxx11]'
/usr/bin/ld: CMakeFiles/metabat2.dir/metabat2.cpp.o: in function `boost::program_options::typed_value<unsigned long long, char>::name[abi:cxx11]() const':
metabat2.cpp:(.text._ZNK5boost15program_options11typed_valueIycE4nameB5cxx11Ev[_ZNK5boost15program_options11typed_valueIycE4nameB5cxx11Ev]+0x1f): undefined reference to `boost::program_options::arg[abi:cxx11]'
/usr/bin/ld: CMakeFiles/metabat2.dir/metabat2.cpp.o: in function `boost::program_options::typed_value<bool, char>::name[abi:cxx11]() const':
metabat2.cpp:(.text._ZNK5boost15program_options11typed_valueIbcE4nameB5cxx11Ev[_ZNK5boost15program_options11typed_valueIbcE4nameB5cxx11Ev]+0x1f): undefined reference to `boost::program_options::arg[abi:cxx11]'
/usr/bin/ld: CMakeFiles/metabat2.dir/metabat2.cpp.o: in function `void boost::program_options::validate<double, char>(boost::any&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, double*, long) [clone .constprop.1112]':
metabat2.cpp:(.text._ZN5boost15program_options8validateIdcEEvRNS_3anyERKSt6vectorINSt7__cxx1112basic_stringIT0_St11char_traitsIS7_ESaIS7_EEESaISB_EEPT_l.constprop.1112[_ZNK5boost15program_options11typed_valueIdcE6xparseERNS_3anyERKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaISB_EE]+0x54e): undefined reference to `boost::program_options::invalid_option_value::invalid_option_value(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: CMakeFiles/metabat2.dir/metabat2.cpp.o: in function `void boost::program_options::validate<unsigned long long, char>(boost::any&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, unsigned long long*, long) [clone .constprop.1113]':
metabat2.cpp:(.text._ZN5boost15program_options8validateIycEEvRNS_3anyERKSt6vectorINSt7__cxx1112basic_stringIT0_St11char_traitsIS7_ESaIS7_EEESaISB_EEPT_l.constprop.1113[_ZNK5boost15program_options11typed_valueIycE6xparseERNS_3anyERKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaISB_EE]+0x4f3): undefined reference to `boost::program_options::invalid_option_value::invalid_option_value(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: CMakeFiles/metabat2.dir/metabat2.cpp.o: in function `void boost::program_options::validate<unsigned long, char>(boost::any&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, unsigned long*, long) [clone .constprop.1111]':
metabat2.cpp:(.text._ZN5boost15program_options8validateImcEEvRNS_3anyERKSt6vectorINSt7__cxx1112basic_stringIT0_St11char_traitsIS7_ESaIS7_EEESaISB_EEPT_l.constprop.1111[_ZNK5boost15program_options11typed_valueImcE6xparseERNS_3anyERKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaISB_EE]+0x4f3): undefined reference to `boost::program_options::invalid_option_value::invalid_option_value(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: CMakeFiles/metabat2.dir/metabat2.cpp.o:(.rodata._ZTVN5boost16exception_detail19error_info_injectorINS_15program_options20invalid_option_valueEEE[_ZTVN5boost16exception_detail19error_info_injectorINS_15program_options20invalid_option_valueEEE]+0x30): undefined reference to `boost::program_options::error_with_option_name::substitute_placeholders(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const'
/usr/bin/ld: CMakeFiles/metabat2.dir/metabat2.cpp.o:(.rodata._ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_15program_options20invalid_option_valueEEEEE[_ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_15program_options20invalid_option_valueEEEEE]+0x38): undefined reference to `boost::program_options::error_with_option_name::substitute_placeholders(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const'
/usr/bin/ld: CMakeFiles/metabat2.dir/metabat2.cpp.o:(.rodata._ZTCN5boost10wrapexceptINS_15program_options20invalid_option_valueEEE0_NS_16exception_detail10clone_implINS4_19error_info_injectorIS2_EEEE[_ZTVN5boost10wrapexceptINS_15program_options20invalid_option_valueEEE]+0x38): undefined reference to `boost::program_options::error_with_option_name::substitute_placeholders(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const'
/usr/bin/ld: CMakeFiles/metabat2.dir/metabat2.cpp.o:(.rodata._ZTVN5boost10wrapexceptINS_15program_options20invalid_option_valueEEE[_ZTVN5boost10wrapexceptINS_15program_options20invalid_option_valueEEE]+0x38): undefined reference to `boost::program_options::error_with_option_name::substitute_placeholders(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const'
/usr/bin/ld: CMakeFiles/metabat2.dir/metabat2.cpp.o:(.rodata._ZTVN5boost16exception_detail19error_info_injectorINS_15program_options16validation_errorEEE[_ZTVN5boost16exception_detail19error_info_injectorINS_15program_options16validation_errorEEE]+0x30): undefined reference to `boost::program_options::error_with_option_name::substitute_placeholders(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const'
/usr/bin/ld: CMakeFiles/metabat2.dir/metabat2.cpp.o:(.rodata._ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_15program_options16validation_errorEEEEE[_ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_15program_options16validation_errorEEEEE]+0x38): more undefined references to `boost::program_options::error_with_option_name::substitute_placeholders(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const' follow
/usr/bin/ld: CMakeFiles/metabat2.dir/metabat2.cpp.o:(.rodata._ZTVN5boost15program_options11typed_valueINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEcEE[_ZTVN5boost15program_options11typed_valueINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEcEE]+0x38): undefined reference to `boost::program_options::value_semantic_codecvt_helper<char>::parse(boost::any&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, bool) const'
/usr/bin/ld: CMakeFiles/metabat2.dir/metabat2.cpp.o:(.rodata._ZTVN5boost15program_options11typed_valueImcEE[_ZTVN5boost15program_options11typed_valueImcEE]+0x38): undefined reference to `boost::program_options::value_semantic_codecvt_helper<char>::parse(boost::any&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, bool) const'
/usr/bin/ld: CMakeFiles/metabat2.dir/metabat2.cpp.o:(.rodata._ZTVN5boost15program_options11typed_valueIdcEE[_ZTVN5boost15program_options11typed_valueIdcEE]+0x38): undefined reference to `boost::program_options::value_semantic_codecvt_helper<char>::parse(boost::any&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, bool) const'
/usr/bin/ld: CMakeFiles/metabat2.dir/metabat2.cpp.o:(.rodata._ZTVN5boost15program_options11typed_valueIbcEE[_ZTVN5boost15program_options11typed_valueIbcEE]+0x38): undefined reference to `boost::program_options::value_semantic_codecvt_helper<char>::parse(boost::any&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, bool) const'
/usr/bin/ld: CMakeFiles/metabat2.dir/metabat2.cpp.o:(.rodata._ZTVN5boost15program_options11typed_valueIycEE[_ZTVN5boost15program_options11typed_valueIycEE]+0x38): undefined reference to `boost::program_options::value_semantic_codecvt_helper<char>::parse(boost::any&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, bool) const'
collect2: error: ld returned 1 exit status
src/CMakeFiles/metabat2.dir/build.make:91: recipe for target 'src/metabat2' failed
make[2]: *** [src/metabat2] Error 1
CMakeFiles/Makefile2:209: recipe for target 'src/CMakeFiles/metabat2.dir/all' failed
make[1]: *** [src/CMakeFiles/metabat2.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
[maple:build]$
Comments (4)
-
-
One more thing you could try. You mentioned that your OS version of boost is close to the MetaBAT build required version of 1.55.0.
You could edit the src/CMakeLists.txt to require a lesser version of Boost and see if that builds for you... I do not think that we searched for the absolute minimum version of Boost that is required, but know that, in our environment, 1.55.0 has all the necessary components to build.
-
reporter I’ve got it working now. I had built boost with our default version of gcc before discovering I would need a newer version of gcc for Metabat.
Once I recompiled boost with the newer version of gcc, everything worked.
FYI, boost 1.71 is working fine. It looks like 1.54 would have worked as well, but it had been compiled with the older gcc as well.
Thanks for your assistance.
-
reporter - changed status to resolved
See last report.
- Log in to comment
So this may be an issue with the version of cmake verses the version of boost. The way I understand it, Boost deprecated and then disabled the default way that cmake detects the libraries as of 1.70 and I am not sure what version of cmake is required to properly find them by default.
I am assuming you are using the 2.14 version of MetaBAT which should have this line in src/CMakeLists.txt which forces the old way of detecting boost, which has worked for my environments.
set(Boost_NO_BOOST_CMAKE ON) # for backwards comptibility of cmake and boost >= 1.70
You can also diagnose by setting VERBOSE=1 while making so you can see the actual linker command that CMake produces, to verify that the proper paths to the boost objects are provided.
However, I see you are using modules in your environment, and the build of boost can be tricky. Are you sure you are using the exact same environment to build MetaBAT you used to build boost 1.71? That could explain why the linker didn’t accept the boost objects.
I might be able to help further with the outputs of
cmake --version
VERBOSE=1 make
And, if that doesn’t work, and I hate to ask it, can you try with boost 1.69?
Alternatively, the docker image should work for you if you have docker, shifter or singularity available.