data61 / gossamer

Gossamer bioinformatics suite
Other
19 stars 18 forks source link

Boost error when compiling gossamer #28

Open mwaldron104 opened 4 years ago

mwaldron104 commented 4 years ago

I am trying to build gossamer on a RHEL 7.7 system, with boost version 1.58, and encountering this error:

Linking CXX executable testGossCmdBuildGraph libgosslib.a(PhysicalFileFactory.cc.o): In function boost::filesystem::copy_file(boost::filesystem::path const&, boost::filesystem::path const&)': PhysicalFileFactory.cc:(.text._ZN5boost10filesystem9copy_fileERKNS0_4pathES3_[_ZN5boost10filesystem9copy_fileERKNS0_4pathES3_]+0x24): undefined reference toboost::filesystem::detail::copy_file(boost::filesystem::path const&, boost::filesystem::path const&, boost::filesystem::detail::copy_option, boost::system::error_code*)' collect2: error: ld returned 1 exit status make[2]: [src/testGossCmdBuildGraph] Error 1 make[1]: [src/CMakeFiles/testGossCmdBuildGraph.dir/all] Error 2 make: *** [all] Error 2

The output of my cmake looks like this:

-- The C compiler identification is GNU 4.8.5 -- The CXX compiler identification is GNU 4.8.5 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- 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/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- This is a Unix-like platform -- The compiler is GNU -- Boost version: 1.58.0 -- Found the following Boost libraries: -- system -- iostreams -- program_options -- filesystem -- regex -- Looking for pthread.h -- Looking for pthread.h - found -- Looking for pthread_create -- Looking for pthread_create - not found -- Looking for pthread_create in pthreads -- Looking for pthread_create in pthreads - not found -- Looking for pthread_create in pthread -- Looking for pthread_create in pthread - found -- Found Threads: TRUE
-- Found ZLIB: /usr/lib64/libz.so (found version "1.2.7") -- Found BZip2: /usr/lib64/libbz2.so (found version "1.0.6") -- Looking for BZ2_bzCompressInit -- Looking for BZ2_bzCompressInit - found -- Found PkgConfig: /usr/bin/pkg-config (found version "0.27.1") -- Checking for module 'sqlite3' -- Found sqlite3, version 3.7.17 -- Found Sqlite: /usr/include
-- Looking for pandoc - found -- Manual pages will be built -- Configuring done -- Generating done

Deguerre commented 4 years ago

Hi. GCC 4.8 is unsupported by the GCC team, and has been for five years. This is a known problem with older GCCs and Boost.

There are several known workarounds, but by far, the easiest would be to upgrade your compiler. If you can't do that, let me know.

mwaldron104 commented 4 years ago

I switched to GCC 6.3.0, but still get an error. Do I need a newer version of BOOST? If so, what version?

-- The C compiler identification is GNU 6.3.0 -- The CXX compiler identification is GNU 6.3.0 -- Check for working C compiler: /nas/longleaf/apps/gcc/6.3.0/bin/gcc -- Check for working C compiler: /nas/longleaf/apps/gcc/6.3.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: /nas/longleaf/apps/gcc/6.3.0/bin/c++ -- Check for working CXX compiler: /nas/longleaf/apps/gcc/6.3.0/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- This is a Unix-like platform -- The compiler is GNU -- Boost version: 1.58.0 -- Found the following Boost libraries: -- system -- iostreams -- program_options -- filesystem -- regex -- Looking for pthread.h -- Looking for pthread.h - found -- Looking for pthread_create -- Looking for pthread_create - not found -- Looking for pthread_create in pthreads -- Looking for pthread_create in pthreads - not found -- Looking for pthread_create in pthread -- Looking for pthread_create in pthread - found -- Found Threads: TRUE
-- Found ZLIB: /usr/lib64/libz.so (found version "1.2.7") -- Found BZip2: /usr/lib64/libbz2.so (found version "1.0.6") -- Looking for BZ2_bzCompressInit -- Looking for BZ2_bzCompressInit - found -- Found PkgConfig: /usr/bin/pkg-config (found version "0.27.1") -- Checking for module 'sqlite3' -- Found sqlite3, version 3.7.17 -- Found Sqlite: /usr/include
-- Looking for pandoc - found -- Manual pages will be built -- Configuring done -- Generating done

Compilation error: Linking CXX executable testGossCmdBuildGraph libgossapp.a(GossCmdBuildGraph.cc.o): In function boost::program_options::variables_map::operator[](std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const': GossCmdBuildGraph.cc:(.text._ZNK5boost15program_options13variables_mapixERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZNK5boost15program_options13variables_mapixERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x1d): undefined reference toboost::program_options::abstract_variables_map::operator[](std::cxx11::basic_string<char, std::char_traits, std::allocator > const&) const' libgosslib.a(App.cc.o): In function boost::program_options::basic_command_line_parser<char>::basic_command_line_parser(int, char const* const*)': App.cc:(.text._ZN5boost15program_options25basic_command_line_parserIcEC2EiPKPKc[_ZN5boost15program_options25basic_command_line_parserIcEC5EiPKPKc]+0x7a): undefined reference toboost::program_options::detail::cmdline::cmdline(std::vector<std::cxx11::basic_string<char, std::char_traits, std::allocator >, std::allocator<std::cxx11::basic_string<char, std::char_traits, std::allocator > > > const&)' libgosslib.a(App.cc.o): In function `std::vector<std::cxx11::basic_string<char, std::char_traits, std::allocator >, std::allocator<std::cxx11::basic_string<char, std::char_traits, std::allocator > > > boost::program_options::to_internal<std::cxx11::basic_string<char, std::char_traits, std::allocator > >(std::vector<std::cxx11::basic_string<char, std::char_traits, std::allocator >, std::allocator<std::cxx11::basic_string<char, std::char_traits, std::allocator > > > const&)': App.cc:(.text._ZN5boost15program_options11to_internalINSt7cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEESt6vectorIS7_SaIS7_EERKS8_IT_SaISB_EE[_ZN5boost15program_options11to_internalINSt7cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEESt6vectorIS7_SaIS7_EERKS8_IT_SaISB_EE]+0x5f): undefined reference to `boost::program_options::to_internal(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)' collect2: error: ld returned 1 exit status make[2]: [src/testGossCmdBuildGraph] Error 1 make[1]: [src/CMakeFiles/testGossCmdBuildGraph.dir/all] Error 2 make: *** [all] Error 2

as7a5 commented 4 years ago

I am getting the same error. used gcc/6.1.0,6.3.0. No matter which compiler/boost/cmake I use the error is the same. The output also similar to that of mwaldron104.

yaowei2010 commented 4 years ago

Hi, similar issue on installation, and my OS is CentoOS

[ 73%] Building CXX object src/CMakeFiles/gossapp.dir/GossCmdThreadPairs.cc.o [ 74%] Building CXX object src/CMakeFiles/gossapp.dir/GossCmdThreadReads.cc.o [ 75%] Building CXX object src/CMakeFiles/gossapp.dir/GossCmdTrimGraph.cc.o [ 76%] Building CXX object src/CMakeFiles/gossapp.dir/GossCmdTrimPaths.cc.o [ 77%] Linking CXX static library libgossapp.a [ 77%] Built target gossapp Scanning dependencies of target goss [ 78%] Building CXX object src/CMakeFiles/goss.dir/goss.cc.o [ 79%] Linking CXX executable goss libgosslib.a(PhysicalFileFactory.cc.o): In function boost::filesystem::copy_file(boost::filesystem::path const&, boost::filesystem::path const&)': PhysicalFileFactory.cc:(.text._ZN5boost10filesystem9copy_fileERKNS0_4pathES3_[_ZN5boost10filesystem9copy_fileERKNS0_4pathES3_]+0x24): undefined reference toboost::filesystem::detail::copy_file(boost::filesystem::path const&, boost::filesystem::path const&, boost::filesystem::copy_option, boost::system::error_code*)' collect2: error: ld returned 1 exit status make[2]: [src/goss] Error 1 make[1]: [src/CMakeFiles/goss.dir/all] Error 2 make: *** [all] Error 2