make error Linking CXX executable metabat2
I have an error while running "make" command:
Scanning dependencies of target zlib
[ 4%] Creating directories for 'zlib'
[ 8%] Performing download step (git clone) for 'zlib'
-- zlib download command succeeded. See also /media/data/Namsp/berkeleylab-metabat-d6ea400244b8/build/contrib/zlib-prefix/src/zlib-stamp/zlib-download-.log
[ 12%] No patch step for 'zlib'
[ 16%] No update step for 'zlib'
[ 20%] Performing configure step for 'zlib'
Checking for gcc...
Building static library libz.a version 1.2.11 with 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.
[ 24%] Performing build step for 'zlib'
[ 28%] Performing install step for 'zlib'
-- zlib install command succeeded. See also /media/data/Namsp/berkeleylab-metabat-d6ea400244b8/build/contrib/zlib-prefix/src/zlib-stamp/zlib-install-.log
[ 32%] Completed 'zlib'
[ 32%] Built target zlib
Scanning dependencies of target htslib
[ 36%] Creating directories for 'htslib'
[ 40%] Performing download step (git clone) for 'htslib'
-- htslib download command succeeded. See also /media/data/Namsp/berkeleylab-metabat-d6ea400244b8/build/contrib/htslib-prefix/src/htslib-stamp/htslib-download-.log
[ 44%] No patch step for 'htslib'
[ 48%] No update step for 'htslib'
[ 52%] Performing configure step for 'htslib'
checking for gcc... 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 gcc accepts -g... yes
checking for 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 pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking shared library type for unknown-Linux... plain .so
checking whether the compiler accepts -fvisibility=hidden... yes
checking how to run the C preprocessor... 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 for srand48_deterministic... no
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 whether htscodecs files are present... yes
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 for library containing regcomp... none required
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
config.status: linking htscodecs_bundled.mk to htscodecs.mk
[ 56%] Performing build step for 'htslib'
Updating htscodecs/htscodecs/version.h : #define HTSCODECS_VERSION_TEXT "1.2.2"
[ 60%] Performing install step for 'htslib'
[ 64%] Completed 'htslib'
[ 64%] Built target htslib
Scanning dependencies of target check_git_repository
[ 68%] Checking the git repository for changes...
Creating new /media/data/Namsp/berkeleylab-metabat-d6ea400244b8/metabat_version.h with false
[ 68%] Built target check_git_repository
Scanning dependencies of target metabat2
[ 72%] Building CXX object src/CMakeFiles/metabat2.dir/metabat2.cpp.o
[ 76%] Linking CXX executable metabat2
CMakeFiles/metabat2.dir/metabat2.cpp.o: In function main':
metabat2.cpp:(.text.startup+0xa37): undefined reference to
boost::filesystem::path::parent_path() const'
metabat2.cpp:(.text.startup+0xa6e): undefined reference to boost::filesystem::path::parent_path() const'
metabat2.cpp:(.text.startup+0xab2): undefined reference to
boost::filesystem::path::parent_path() const'
metabat2.cpp:(.text.startup+0xabc): undefined reference to boost::filesystem::detail::create_directory(boost::filesystem::path const&, boost::system::error_code*)'
metabat2.cpp:(.text.startup+0x2332): undefined reference to
boost::filesystem::path::parent_path() const'
CMakeFiles/metabat2.dir/metabat2.cpp.o: In function _GLOBAL__sub_I__Z9CacheSizev':
metabat2.cpp:(.text.startup+0x5c44): undefined reference to
boost::system::generic_category()'
metabat2.cpp:(.text.startup+0x5c49): undefined reference to boost::system::generic_category()'
metabat2.cpp:(.text.startup+0x5c4e): undefined reference to
boost::system::system_category()'
collect2: error: ld returned 1 exit status
make[2]: [src/CMakeFiles/metabat2.dir/build.make:92: src/metabat2] Error 1
make[1]: [CMakeFiles/Makefile2:210: src/CMakeFiles/metabat2.dir/all] Error 2
make: ** [Makefile:141: all] Error 2
I'm using g++ (GCC) 7.3.1
Please help me!
Comments (2)
-
-
- changed status to invalid
install boost properly with its libraries and it should work
- Log in to comment
It looks like you did not install boost correctly on your machine. Boost includes both headers and libraries and this error is in the linking phase attempting to link to the boost libraries that are not found or the wrong version. Typically you must include the boost “development” package or build it yourself.
See examples on how to install the boost prerequisites here: https://bitbucket.org/berkeleylab/metabat/src/master/INSTALL.md