gvbarroso / iSMC

The integrated Sequentially Markovian Coalescent
GNU General Public License v3.0
11 stars 3 forks source link

Problem with cmake #11

Closed pierrebarry closed 1 year ago

pierrebarry commented 2 years ago

Hello,

I am trying to install iSMC on my computer, but I encountered a problem while running cmake after I have installed all dependencies :

cmake -DCMAKE_INSTALL_PREFIX=$HOME/.local -DUSE_LIBSIMPLEZIPHMM=true

` CMake Warning: No source or binary directory provided. Both will be assumed to be the same as the current working directory, but note that this warning will become a fatal error in future CMake releases.

-- Static linkage requested. CMake Error at /home/labosea1/.local/lib/cmake/bpp-core3/bpp-core3-config.cmake:40 (get_property): get_property could not find TARGET bpp-core3-static. Perhaps it has not yet been created. Call Stack (most recent call first): /home/labosea1/.local/lib/cmake/bpp-phyl3/bpp-phyl3-config.cmake:33 (find_package) CMakeLists.txt:56 (FIND_PACKAGE)

-- bpp-core3 1.0.0 found: -- static lib: -- shared lib: /home/labosea1/.local/lib/libbpp-core3.so.1.0.0 -- includes: /home/labosea1/.local/include CMake Error at /home/labosea1/.local/lib/cmake/bpp-seq3/bpp-seq3-config.cmake:41 (get_property): get_property could not find TARGET bpp-seq3-static. Perhaps it has not yet been created. Call Stack (most recent call first): /home/labosea1/.local/lib/cmake/bpp-phyl3/bpp-phyl3-config.cmake:34 (find_package) CMakeLists.txt:56 (FIND_PACKAGE)

-- bpp-seq3 1.0.0 found: -- static lib: -- shared lib: /home/labosea1/.local/lib/libbpp-seq3.so.1.0.0 -- includes: /home/labosea1/.local/include CMake Error at /home/labosea1/.local/lib/cmake/bpp-phyl3/bpp-phyl3-config.cmake:43 (get_property): get_property could not find TARGET bpp-phyl3-static. Perhaps it has not yet been created. Call Stack (most recent call first): CMakeLists.txt:56 (FIND_PACKAGE)

-- bpp-phyl3 1.0.0 found: -- static lib: -- shared lib: /home/labosea1/.local/lib/libbpp-phyl3.so.1.0.0 -- includes: /home/labosea1/.local/include -- simpleziphmm 1.0.0 found: -- static lib: /home/labosea1/.local/lib/libsimpleziphmm.a -- shared lib: /home/labosea1/.local/lib/libsimpleziphmm.so.1.0.0 -- includes: /home/labosea1/.local/include -- Found Boost 1.70.0 at /usr/local/anaconda/lib/cmake/Boost-1.70.0 -- Requested configuration: QUIET COMPONENTS iostreams -- Found boost_headers 1.70.0 at /usr/local/anaconda/lib/cmake/boost_headers-1.70.0 -- Found boost_iostreams 1.70.0 at /usr/local/anaconda/lib/cmake/boost_iostreams-1.70.0 -- libboost_iostreams.a -- Adding boost_iostreams dependencies: headers -- Boost 1.36.0 found. -- Found Boost components: iostreams -- Boost libraries found here: includes: dynamic libraries: -- Library z found here: includes: /usr/include static libraries: /usr/lib/x86_64-linux-gnu/libz.a -- Library bz2 found here: includes: /usr/include static libraries: /usr/lib/x86_64-linux-gnu/libbz2.a -- Library blas found here: includes: /usr/include static libraries: /usr/lib/libblas.a -- Configuring incomplete, errors occurred! See also "/home/labosea1/iSMC/CMakeFiles/CMakeOutput.log". See also "/home/labosea1/iSMC/CMakeFiles/CMakeError.log". `

The "/home/labosea1/iSMC/CMakeFiles/CMakeError.log file contains :

` Determining if the pthread_create exist failed with the following output: Change Dir: /home/labosea1/iSMC/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/local/anaconda/bin/make cmTC_d33c2/fast /usr/local/anaconda/bin/make -f CMakeFiles/cmTC_d33c2.dir/build.make CMakeFiles/cmTC_d33c2.dir/build make[1] : on entre dans le répertoire « /home/labosea1/iSMC/CMakeFiles/CMakeTmp » Building CXX object CMakeFiles/cmTC_d33c2.dir/CheckSymbolExists.cxx.o /usr/bin/c++ -std=c++14 -Wall -Weffc++ -Wshadow -Wconversion -O3 -no-pie -o CMakeFiles/cmTC_d33c2.dir/CheckSymbolExists.cxx.o -c /home/labosea1/iSMC/CMakeFiles/C$ Linking CXX executable cmTC_d33c2 /usr/local/anaconda/bin/cmake -E cmake_link_script CMakeFiles/cmTC_d33c2.dir/link.txt --verbose=1 /usr/bin/c++ -std=c++14 -Wall -Weffc++ -Wshadow -Wconversion -O3 -no-pie -rdynamic CMakeFiles/cmTC_d33c2.dir/CheckSymbolExists.cxx.o -o cmTC_d33c2 CMakeFiles/cmTC_d33c2.dir/CheckSymbolExists.cxx.o : Dans la fonction « main » : CheckSymbolExists.cxx:(.text.startup+0x6) : référence indéfinie vers « pthread_create » collect2: error: ld returned 1 exit status make[1]: [CMakeFiles/cmTC_d33c2.dir/build.make:87: cmTC_d33c2] Error 1 make[1] : on quitte le répertoire « /home/labosea1/iSMC/CMakeFiles/CMakeTmp » make: [Makefile:121: cmTC_d33c2/fast] Error 2

File /home/labosea1/iSMC/CMakeFiles/CMakeTmp/CheckSymbolExists.cxx: / /

include

int main(int argc, char** argv) { (void)argv;

ifndef pthread_create

return ((int*)(&pthread_create))[argc];

else

(void)argc; return 0;

endif

} `

It seems that the problem comes from the Threads library, but I checked and it is already installed on my computer. Do you have an idea how to solve this problem ?

Thank you for your help,

Pierre Barry

gvbarroso commented 2 years ago

To be honest I am still learning to debug these cmake errors myself. For starters I don't see where you requested static linkage (if that is what you intended?). Could you try again with dynamic linkage instead?

jydu commented 2 years ago

Hi, the Bio++ libraries do not install static libraries by default, you need to compile them with the -DBUILD_STATIC=ON argument. (Note that static linkage is not supported on mac.)

Julien.

pierrebarry commented 2 years ago

Thank you very much, it worked !

Unfortunately, when I run make in the iSMC files, I have an other error :

cmake -DCMAKE_INSTALL_PREFIX=$HOME/.local -DBUILD_STATIC=ON

CMake Warning: No source or binary directory provided. Both will be assumed to be the same as the current working directory, but note that this warning will become a fatal error in future CMake releases. -- Static linkage requested. -- bpp-core3 1.0.0 found: -- static lib: /home/labosea1/.local/lib/libbpp-core3.a -- shared lib: /home/labosea1/.local/lib/libbpp-core3.so.1.0.0 -- includes: /home/labosea1/.local/include -- bpp-seq3 1.0.0 found: -- static lib: /home/labosea1/.local/lib/libbpp-seq3.a -- shared lib: /home/labosea1/.local/lib/libbpp-seq3.so.1.0.0 -- includes: /home/labosea1/.local/include -- bpp-phyl3 1.0.0 found: -- static lib: /home/labosea1/.local/lib/libbpp-phyl3.a -- shared lib: /home/labosea1/.local/lib/libbpp-phyl3.so.1.0.0 -- includes: /home/labosea1/.local/include -- simpleziphmm 1.0.0 found: -- static lib: /home/labosea1/.local/lib/libsimpleziphmm.a -- shared lib: /home/labosea1/.local/lib/libsimpleziphmm.so.1.0.0 -- includes: /home/labosea1/.local/include -- Found Boost 1.70.0 at /usr/local/anaconda/lib/cmake/Boost-1.70.0 -- Requested configuration: QUIET COMPONENTS iostreams -- Found boost_headers 1.70.0 at /usr/local/anaconda/lib/cmake/boost_headers-1.70.0 -- Found boost_iostreams 1.70.0 at /usr/local/anaconda/lib/cmake/boost_iostreams-1.70.0 -- libboost_iostreams.a -- Adding boost_iostreams dependencies: headers -- Boost 1.36.0 found. -- Found Boost components: iostreams -- Boost libraries found here: includes: dynamic libraries: -- Library z found here: includes: /usr/include static libraries: /usr/lib/x86_64-linux-gnu/libz.a -- Library bz2 found here: includes: /usr/include static libraries: /usr/lib/x86_64-linux-gnu/libbz2.a -- Library blas found here: includes: /usr/include static libraries: /usr/lib/libblas.a -- Configuring done -- Generating done -- Build files have been written to: /home/labosea1/iSMC

make

make[1] : on entre dans le répertoire « /home/labosea1/iSMC » make[2] : on entre dans le répertoire « /home/labosea1/iSMC » make[2] : on quitte le répertoire « /home/labosea1/iSMC » make[2] : on entre dans le répertoire « /home/labosea1/iSMC » [ 3%] Linking CXX executable ismc_mapper2 CMakeFiles/ismc_mapper2.dir/mapper2.cpp.o : Dans la fonction « boost::iostreams::detail::zlib_decompressor_impl<std::allocator >::~zlib_decompressor_impl() » : /usr/include/boost/iostreams/filter/zlib.hpp:369 : référence indéfinie vers « boost::iostreams::detail::zlib_base::reset(bool, bool) » /usr/include/boost/iostreams/filter/zlib.hpp:369 : référence indéfinie vers « boost::iostreams::detail::zlib_base::~zlib_base() » CMakeFiles/ismc_mapper2.dir/mapper2.cpp.o : Dans la fonction « boost::iostreams::gzip_error::gzip_error(int) » : /usr/include/boost/iostreams/filter/gzip.hpp:165 : référence indéfinie vers « boost::iostreams::zlib::okay » CMakeFiles/ismc_mapper2.dir/mapper2.cpp.o : Dans la fonction « boost::iostreams::zlib_params::zlib_params(int, int, int, int, int, bool, bool) » : /usr/include/boost/iostreams/filter/zlib.hpp:122 : référence indéfinie vers « boost::iostreams::zlib::default_compression » /usr/include/boost/iostreams/filter/zlib.hpp:122 : référence indéfinie vers « boost::iostreams::zlib::deflated » /usr/include/boost/iostreams/filter/zlib.hpp:122 : référence indéfinie vers « boost::iostreams::zlib::default_strategy » CMakeFiles/ismc_mapper2.dir/mapper2.cpp.o : Dans la fonction « boost::iostreams::detail::zlib_decompressor_impl<std::allocator >::zlib_decompressor_impl(boost::iostreams::zlib_params const&) » : /usr/include/boost/iostreams/filter/zlib.hpp:364 : référence indéfinie vers « boost::iostreams::detail::zlib_base::zlib_base() » CMakeFiles/ismc_mapper2.dir/mapper2.cpp.o : Dans la fonction « void boost::iostreams::detail::zlib_base::init<std::allocator >(boost::iostreams::zlib_params const&, bool, boost::iostreams::detail::zlib_allocator<std::allocator, boost::iostreams::detail::zlib_allocator_traits<std::allocator >::type>&) » : /usr/include/boost/iostreams/filter/zlib.hpp:185 : référence indéfinie vers « boost::iostreams::detail::zlib_base::do_init(boost::iostreams::zlib_params const&, bool, void ()(void, unsigned int, unsigned int), void ()(void, void), void) » CMakeFiles/ismc_mapper2.dir/mapper2.cpp.o : Dans la fonction « boost::iostreams::detail::gzip_header::gzip_header() » : /usr/include/boost/iostreams/filter/gzip.hpp:327 : référence indéfinie vers « boost::iostreams::detail::gzip_header::reset() » CMakeFiles/ismc_mapper2.dir/mapper2.cpp.o : Dans la fonction « boost::iostreams::detail::gzip_footer::gzip_footer() » : /usr/include/boost/iostreams/filter/gzip.hpp:369 : référence indéfinie vers « boost::iostreams::detail::gzip_footer::reset() » CMakeFiles/ismc_mapper2.dir/mapper2.cpp.o : Dans la fonction « boost::iostreams::detail::zlib_decompressor_impl<std::allocator >::~zlib_decompressor_impl() » : /usr/include/boost/iostreams/filter/zlib.hpp:369 : référence indéfinie vers « boost::iostreams::detail::zlib_base::reset(bool, bool) » /usr/include/boost/iostreams/filter/zlib.hpp:369 : référence indéfinie vers « boost::iostreams::detail::zlib_base::~zlib_base() » /usr/include/boost/iostreams/filter/zlib.hpp:369 : référence indéfinie vers « boost::iostreams::detail::zlib_base::reset(bool, bool) » /usr/include/boost/iostreams/filter/zlib.hpp:369 : référence indéfinie vers « boost::iostreams::detail::zlib_base::~zlib_base() » CMakeFiles/ismc_mapper2.dir/mapper2.cpp.o : Dans la fonction « boost::iostreams::detail::zlib_decompressor_impl<std::allocator >::filter(char const&, char const, char&, char, bool) » : /usr/include/boost/iostreams/filter/zlib.hpp:384 : référence indéfinie vers « boost::iostreams::detail::zlib_base::before(char const&, char const, char&, char) » /usr/include/boost/iostreams/filter/zlib.hpp:385 : référence indéfinie vers « boost::iostreams::zlib::sync_flush » /usr/include/boost/iostreams/filter/zlib.hpp:385 : référence indéfinie vers « boost::iostreams::detail::zlib_base::xinflate(int) » /usr/include/boost/iostreams/filter/zlib.hpp:386 : référence indéfinie vers « boost::iostreams::detail::zlib_base::after(char const&, char&, bool) » /usr/include/boost/iostreams/filter/zlib.hpp:387 : référence indéfinie vers « boost::iostreams::zlib_error::check(int) » /usr/include/boost/iostreams/filter/zlib.hpp:388 : référence indéfinie vers « boost::iostreams::zlib::stream_end » CMakeFiles/ismc_mapper2.dir/mapper2.cpp.o : Dans la fonction « boost::iostreams::detail::zlib_decompressor_impl<std::allocator >::close() » : /usr/include/boost/iostreams/filter/zlib.hpp:394 : référence indéfinie vers « boost::iostreams::detail::zlib_base::reset(bool, bool) » CMakeFiles/ismc_mapper2.dir/mapper2.cpp.o : Dans la fonction « long boost::iostreams::basic_gzip_decompressor<std::allocator >::write<boost::iostreams::detail::linked_streambuf<char, std::char_traits > >(boost::iostreams::detail::linked_streambuf<char, std::char_traits >&, char const, long) » : /usr/include/boost/iostreams/filter/gzip.hpp:453 : référence indéfinie vers « boost::iostreams::detail::gzip_footer::process(char) » /usr/include/boost/iostreams/filter/gzip.hpp:428 : référence indéfinie vers « boost::iostreams::detail::gzip_header::process(char) » /usr/include/boost/iostreams/filter/gzip.hpp:423 : référence indéfinie vers « boost::iostreams::detail::gzip_header::reset() » /usr/include/boost/iostreams/filter/gzip.hpp:424 : référence indéfinie vers « boost::iostreams::detail::gzip_footer::reset() » CMakeFiles/ismc_mapper2.dir/mapper2.cpp.o : Dans la fonction « long boost::iostreams::basic_gzip_decompressor<std::allocator >::read<boost::iostreams::detail::linked_streambuf<char, std::char_traits > >(boost::iostreams::detail::linked_streambuf<char, std::char_traits >&, char*, long) » : /usr/include/boost/iostreams/filter/gzip.hpp:504 : référence indéfinie vers « boost::iostreams::detail::gzip_footer::process(char) » /usr/include/boost/iostreams/filter/gzip.hpp:469 : référence indéfinie vers « boost::iostreams::detail::gzip_header::reset() » /usr/include/boost/iostreams/filter/gzip.hpp:470 : référence indéfinie vers « boost::iostreams::detail::gzip_footer::reset() » /usr/include/boost/iostreams/filter/gzip.hpp:515 : référence indéfinie vers « boost::iostreams::detail::gzip_header::reset() » /usr/include/boost/iostreams/filter/gzip.hpp:516 : référence indéfinie vers « boost::iostreams::detail::gzip_footer::reset() » /usr/include/boost/iostreams/filter/gzip.hpp:479 : référence indéfinie vers « boost::iostreams::detail::gzip_header::process(char) » collect2: error: ld returned 1 exit status make[2]: [src/CMakeFiles/ismc_mapper2.dir/build.make:93: src/ismc_mapper2] Error 1 make[2] : on quitte le répertoire « /home/labosea1/iSMC » make[1]: [CMakeFiles/Makefile2:127: src/CMakeFiles/ismc_mapper2.dir/all] Error 2 make[1] : on quitte le répertoire « /home/labosea1/iSMC » make: *** [Makefile:152: all] Error 2

I imagined that it is related to the Boot_iostreams library, but I don't know enough to understand this error. Is it possible that it is related to the message Requested configuration: QUIET COMPONENTS iostreams after running cmake ?

Thank you for your help,

Pierre

jydu commented 1 year ago

I did some update of the CMake files (also in simple-ziphmm). Hopefully this resolves that issue too? If not, feel free to reopen the issue...