JensUweUlrich / ReadBouncer

Fast and scalable nanopore adaptive sampling
GNU General Public License v3.0
33 stars 2 forks source link

compilation error #36

Closed Huanle closed 2 years ago

Huanle commented 2 years ago

Hi @JensUweUlrich ,

thanks a lot for developing readbouncer.

I was trying to compile following the compilation on linux instruction. I ran into errors at the 1st config stage.

$ cmake --build . --config Release
Consolidate compiler generated dependencies of target interfaces
[  0%] Built target interfaces
[  0%] Building CXX object IBF/CMakeFiles/IBF.dir/IBFBuild.cpp.o
In file included from /home/test/lhl/sw/ReadBouncer/src/IBF/IBF.hpp:3:0,
                 from /home/test/lhl/sw/ReadBouncer/src/IBF/IBFBuild.cpp:2:
/home/test/lhl/sw/ReadBouncer/src/IBF/IBFConfig.hpp:9:10: fatal error: filesystem: No such file or directory
 #include <filesystem>
          ^~~~~~~~~~~~
compilation terminated.
IBF/CMakeFiles/IBF.dir/build.make:75: recipe for target 'IBF/CMakeFiles/IBF.dir/IBFBuild.cpp.o' failed
make[2]: *** [IBF/CMakeFiles/IBF.dir/IBFBuild.cpp.o] Error 1
CMakeFiles/Makefile2:957: recipe for target 'IBF/CMakeFiles/IBF.dir/all' failed
make[1]: *** [IBF/CMakeFiles/IBF.dir/all] Error 2
Makefile:155: recipe for target 'all' failed
make: *** [all] Error 2

Can you please help to sort it out what's going wrong? Thanks heaps in advance.

JensUweUlrich commented 2 years ago

Hi @Huanle,

thanks for your message and your interest in using ReadBouncer.

Could you please tell me which compiler and compiler version you are using. It seems like you tried to build ReadBouncer with an older compiler that is missing std::filesystem. I recommend using gcc-9 and later. BTW: We also provide precompiled binaries for linux to avoid running into compilation (and linking) errors.

Best Jens

Huanle commented 2 years ago

Hi @JensUweUlrich ,

thanks a lot for your prompt reply. I was using the following compliler.

gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0 cmake version 3.21.0

I will give gcc-9 a go.

JensUweUlrich commented 2 years ago

Ok. std::filesystem is not supported in gcc-7. I will add gcc-8 or later as a requirement to the readme.

Don't hesitate to get back to me if you run into further troubles.

Huanle commented 2 years ago

Hi Hi @JensUweUlrich,

Thanks a lot for your kindness. I just ran into a new error after upgrading gcc7 to gcc8. It seems to be close to success though :-)

gcc --version gcc (Ubuntu 8.4.0-1ubuntu1~18.04) 8.4.0

cmake ../src

cmake --build . --config Release ..... [ 95%] Building CXX object minknow/CMakeFiles/ReadUntil.dir/Acquisition.cpp.o [ 95%] Building CXX object minknow/CMakeFiles/ReadUntil.dir/Analysis_Configuration.cpp.o [ 95%] Building CXX object minknow/CMakeFiles/ReadUntil.dir/Data.cpp.o In file included from /home/test/lhl/sw/ReadBouncer/src/minknow/Data.hpp:36, from /home/test/lhl/sw/ReadBouncer/src/minknow/Data.cpp:8: /home/test/lhl/sw/ReadBouncer/build/minknow/stduuid/include/uuid.h:20:10: fatal error: uuid/uuid.h: No such file or directory

include <uuid/uuid.h>

^~~~~ compilation terminated. minknow/CMakeFiles/ReadUntil.dir/build.make:298: recipe for target 'minknow/CMakeFiles/ReadUntil.dir/Data.cpp.o' failed make[2]: [minknow/CMakeFiles/ReadUntil.dir/Data.cpp.o] Error 1 CMakeFiles/Makefile2:1077: recipe for target 'minknow/CMakeFiles/ReadUntil.dir/all' failed make[1]: [minknow/CMakeFiles/ReadUntil.dir/all] Error 2 Makefile:155: recipe for target 'all' failed make: *** [all] Error 2

JensUweUlrich commented 2 years ago

Hi @Huanle

that looks weird. Seems like CMake did not set the include path for stduuid correctly. I sucessfully built ReadBouncer with gcc-8 today. I would suggest to delete everything within your build directory and repeat the entire build workflow with the following comands:

cmake ../src/
cmake --build . --config Release
cmake --build . --config Release --target package

Cheers Jens

Huanle commented 2 years ago

Thanks a lot @JensUweUlrich for your advice.

I deleted the build folder and then repeated the processes. This time it proceeded further before it failed again. But the same error remains.

...... [ 97%] Generating minknow/proto/minknow_api/rpc_options.pb.cc, minknow/proto/minknow_api/rpc_options.pb.h, minknow/proto/minknow_api/rpc_options.grpc.pb.cc, minknow/proto/minknow_api/rpc_options.grpc.pb.h [ 97%] Building CXX object minknow/CMakeFiles/ReadUntil.dir/Acquisition.cpp.o [ 97%] Building CXX object minknow/CMakeFiles/ReadUntil.dir/Analysis_Configuration.cpp.o [ 97%] Building CXX object minknow/CMakeFiles/ReadUntil.dir/Data.cpp.o In file included from /home/test/lhl/sw/ReadBouncer/src/minknow/Data.hpp:36, from /home/test/lhl/sw/ReadBouncer/src/minknow/Data.cpp:8: /home/test/lhl/sw/ReadBouncer/build/minknow/stduuid/include/uuid.h:20:10: fatal error: uuid/uuid.h: No such file or directory

include <uuid/uuid.h>

^~~~~ compilation terminated. minknow/CMakeFiles/ReadUntil.dir/build.make:298: recipe for target 'minknow/CMakeFiles/ReadUntil.dir/Data.cpp.o' failed make[2]: [minknow/CMakeFiles/ReadUntil.dir/Data.cpp.o] Error 1 CMakeFiles/Makefile2:1077: recipe for target 'minknow/CMakeFiles/ReadUntil.dir/all' failed make[1]: [minknow/CMakeFiles/ReadUntil.dir/all] Error 2 Makefile:155: recipe for target 'all' failed make: *** [all] Error 2

JensUweUlrich commented 2 years ago

Hi @Huanle

I guess I know what's going on here. Could you try to install uuid with the following statements?:

apt install uuid-dev

I expect this will solve the issue.

Huanle commented 2 years ago

thanks a lot again for your patience and continuous help @JensUweUlrich . Again, this time it proceeded further. But a different error pops up.

... ^ [100%] Linking CXX executable ReadBouncer ../basecaller/Guppy/libGuppyCppClient.a(text_file_backend.o): In function boost::log::v2s_mt_posix::sinks::(anonymous namespace)::file_counter_formatter::file_counter_formatter(boost::log::v2s_mt_posix::sinks::(anonymous namespace)::file_counter_formatter const&)': text_file_backend.cpp:(.text+0x1a34): undefined reference tostd::cxx11::basic_ostringstream<char, std::char_traits, std::allocator >::basic_ostringstream()' ../basecaller/Guppy/libGuppyCppClient.a(text_file_backend.o): In function `boost::log::v2s_mt_posix::aux::light_function<std::cxx11::basic_string<char, std::char_traits, std::allocator > (unsigned int)>::impl<boost::_bi::bind_t<boost::_bi::unspecified, boost::log::v2s_mt_posix::sinks::(anonymous namespace)::file_counter_formatter, boost::_bi::list2<boost::_bi::value<std::cxx11::basic_string<char, std::char_traits, std::allocator > >, boost::arg<1> > > >::clone_impl(void const*)': text_file_backend.cpp:(.text+0x1bb0): undefined reference to std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()' ../basecaller/Guppy/libGuppyCppClient.a(text_file_backend.o): In functionboost::_bi::bind_t<boost::_bi::unspecified, boost::log::v2s_mt_posix::sinks::(anonymous namespace)::file_counter_formatter, boost::_bi::list2<boost::_bi::value<std::cxx11::basic_string<char, std::char_traits, std::allocator > >, boost::arg<1> > >::bind_t(boost::_bi::bind_t<boost::_bi::unspecified, boost::log::v2s_mt_posix::sinks::(anonymous namespace)::file_counter_formatter, boost::_bi::list2<boost::_bi::value<std::cxx11::basic_string<char, std::char_traits, std::allocator > >, boost::arg<1> > > const&)': text_file_backend.cpp:(.text+0x1d24): undefined reference to std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()' ../basecaller/Guppy/libGuppyCppClient.a(text_file_backend.o): In functionboost::_bi::bind_t<boost::_bi::unspecified, boost::log::v2s_mt_posix::sinks::(anonymous namespace)::file_counter_formatter, boost::_bi::list_av_2<std::cxx11::basic_string<char, std::char_traits, std::allocator >, boost::arg<1> >::type> boost::bind<boost::log::v2s_mt_posix::sinks::(anonymous namespace)::file_counter_formatter, std::cxx11::basic_string<char, std::char_traits, std::allocator >, boost::arg<1> >(boost::log::v2s_mt_posix::sinks::(anonymous namespace)::file_counter_formatter, std::cxx11::basic_string<char, std::char_traits, std::allocator >, boost::arg<1>) [clone .isra.0]': text_file_backend.cpp:(.text+0x1f44): undefined reference to std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()' text_file_backend.cpp:(.text+0x1f8f): undefined reference tostd::cxx11::basic_ostringstream<char, std::char_traits, std::allocator >::basic_ostringstream()' ../basecaller/Guppy/libGuppyCppClient.a(text_file_backend.o):text_file_backend.cpp:(.text+0x237b): more undefined references to std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()' follow ../basecaller/Guppy/libGuppyCppClient.a(io_utils.cpp.o): In functionstd::__cxx11::basic_string<char, std::char_traits, std::allocator > common::debugPrintVector(bass::data_wrappers::VecView const&, bool, int, int)': /home/jens/software/GuppyCPPClient/src/ont_core/common/io_utils.cpp:391: undefined reference to `std::cxx11::basic_stringstream<char, std::char_traits, std::allocator >::basic_stringstream()' ../basecaller/Guppy/libGuppyCppClient.a(io_utils.cpp.o): In function std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > common::debugPrintPosteriors<float>(bass::data_wrappers::MatView<float> const&, int)': /home/jens/software/GuppyCPPClient/src/ont_core/common/io_utils.cpp:277: undefined reference tostd::cxx11::basic_stringstream<char, std::char_traits, std::allocator >::basic_stringstream()' ../basecaller/Guppy/libGuppyCppClient.a(io_utils.cpp.o): In function `std::cxx11::basic_string<char, std::char_traits, std::allocator > common::debugPrintPosteriors(bass::data_wrappers::MatView const&, int)': /home/jens/software/GuppyCPPClient/src/ont_core/common/io_utils.cpp:277: undefined reference to std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream()' ../basecaller/Guppy/libGuppyCppClient.a(io_utils.cpp.o): In functionstd::cxx11::basic_string<char, std::char_traits, std::allocator > common::debugPrintPosteriors(bass::data_wrappers::BandMatView const&, int)': /home/jens/software/GuppyCPPClient/src/ont_core/common/io_utils.cpp:309: undefined reference to std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream()' ../basecaller/Guppy/libGuppyCppClient.a(io_utils.cpp.o): In functionstd::__cxx11::basic_string<char, std::char_traits, std::allocator > common::debugPrintPosteriors(bass::data_wrappers::BandMatView const&, int)': /home/jens/software/GuppyCPPClient/src/ont_core/common/io_utils.cpp:309: undefined reference to `std::cxx11::basic_stringstream<char, std::char_traits, std::allocator >::basic_stringstream()' ../basecaller/Guppy/libGuppyCppClient.a(io_utils.cpp.o):/home/jens/software/GuppyCPPClient/src/ont_core/common/io_utils.cpp:360: more undefined references to std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream()' follow ../basecaller/Guppy/libGuppyCppClient.a(state_formatter.cpp.o): In functioncommon::diagnostics::state::IndentationFormatter::operator()[abi:cxx11](std::vector<common::diagnostics::state::StateRecord, std::allocator > const&) const': /home/jens/software/GuppyCPPClient/src/ont_core/common/diagnostics/state/state_formatter.cpp:83: undefined reference to std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()' ../basecaller/Guppy/libGuppyCppClient.a(state_formatter.cpp.o): In functioncommon::diagnostics::state::JsonFormatter::operator()[abi:cxx11](std::vector<common::diagnostics::state::StateRecord, std::allocator > const&) const': /home/jens/software/GuppyCPPClient/src/ont_core/common/diagnostics/state/state_formatter.cpp:136: undefined reference to std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()' ../basecaller/Guppy/libGuppyCppClient.a(read_holder.cpp.o): In functioncommon::ValueFormatter::Format[abi:cxx11](float const&) const': /home/jens/software/GuppyCPPClient/src/ont_core/common/utils.h:586: undefined reference to std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()' ../basecaller/Guppy/libGuppyCppClient.a(read_holder.cpp.o): In functioncommon::ValueFormatter::Format[abi:cxx11](double const&) const': /home/jens/software/GuppyCPPClient/src/ont_core/common/utils.h:601: undefined reference to std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()' ../basecaller/Guppy/libGuppyCppClient.a(client_connection_state.cpp.o): In functionbasecall_service::transition_description[abi:cxx11](basecall_service::ClientStatus, basecall_service::ClientStatus)': /home/jens/software/GuppyCPPClient/src/ont_core/basecall_client/client_connection_state.cpp:151: undefined reference to std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()' ../basecaller/Guppy/libGuppyCppClient.a(client_connection_state.cpp.o):/home/jens/software/GuppyCPPClient/src/ont_core/basecall_client/client_connection_state.cpp:269: more undefined references tostd::cxx11::basic_ostringstream<char, std::char_traits, std::allocator >::basic_ostringstream()' follow ../basecaller/Guppy/libGuppyCppClient.a(ipc_tools.cpp.o): In function ipc_tools::current_version_as_string[abi:cxx11]()': /home/jens/software/GuppyCPPClient/src/ont_core/ipc_tools/ipc_tools.cpp:22: undefined reference tostd::__cxx11::basic_stringstream<char, std::char_traits, std::allocator >::basic_stringstream()' ../basecaller/Guppy/libGuppyCppClient.a(read_processing_protocol.cpp.o): In function basecall_service::ReadProcessingProtocol::push_into_server(basecall_service::RequestBrokerAdapter*)': /home/jens/software/GuppyCPPClient/src/ont_core/basecall_client/read_processing_protocol.cpp:146: undefined reference tostd::cxx11::basic_ostringstream<char, std::char_traits, std::allocator >::basic_ostringstream()' ../basecaller/Guppy/libGuppyCppClient.a(read_processing_protocol.cpp.o): In function basecall_service::ReadProcessingProtocol::pull_from_server(basecall_service::RequestBrokerAdapter*)': /home/jens/software/GuppyCPPClient/src/ont_core/basecall_client/read_processing_protocol.cpp:183: undefined reference tostd::cxx11::basic_ostringstream<char, std::char_traits, std::allocator >::basic_ostringstream()' /home/jens/software/GuppyCPPClient/src/ont_core/basecall_client/read_processing_protocol.cpp:366: undefined reference to std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()' /home/jens/software/GuppyCPPClient/src/ont_core/basecall_client/read_processing_protocol.cpp:474: undefined reference tostd::cxx11::basic_ostringstream<char, std::char_traits, std::allocator >::basic_ostringstream()' ../basecaller/Guppy/libGuppyCppClient.a(connection_protocol.cpp.o): In function basecall_service::ConnectionProtocol::load_file_on_server(ipc_tools::MessageType, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int)': /home/jens/software/GuppyCPPClient/src/ont_core/basecall_client/connection_protocol.cpp:186: undefined reference tostd::__cxx11::basic_ostringstream<char, std::char_traits, std::allocator >::basic_ostringstream()' ../basecaller/Guppy/libGuppyCppClient.a(connection_protocol.cpp.o):/home/jens/software/GuppyCPPClient/src/ont_core/basecall_client/connection_protocol.cpp:224: more undefined references to `std::__cxx11::basic_ostringstream<char, std::char_traits, std::allocator >::basic_ostringstream()' follow collect2: error: ld returned 1 exit status main/CMakeFiles/ReadBouncer.dir/build.make:149: recipe for target 'main/ReadBouncer' failed make[2]: [main/ReadBouncer] Error 1 CMakeFiles/Makefile2:5485: recipe for target 'main/CMakeFiles/ReadBouncer.dir/all' failed make[1]: [main/CMakeFiles/ReadBouncer.dir/all] Error 2 Makefile:155: recipe for target 'all' failed make: *** [all] Error 2

JensUweUlrich commented 2 years ago

Hi @Huanle

I pushed some changes to the master branch that should fix the problem. Again, I recommend to make a clean build.

Cheers Jens

Huanle commented 2 years ago

Hi @JensUweUlrich ,

thanks a lot! This time, I re-cloned the git repo and repeat the installation commands. The error message remains.

/home/test/lhl/sw/ReadBouncer/src/main/main.cpp: In function ‘std::vector<interleave::IBFMeta> getIBF(ConfigReader, bool, bool)’:
/home/test/lhl/sw/ReadBouncer/src/main/main.cpp:312:52: warning: control reaches end of non-void function [-Wreturn-type]
  std::vector<interleave::IBFMeta> DepletionFilters{};
                                                    ^
[100%] Linking CXX executable ReadBouncer
../basecaller/Guppy/libGuppyCppClient_gcc-8.a(operations.o): In function `boost::filesystem::detail::copy_file(boost::filesystem::path const&, boost::filesystem::path const&, unsigned int, boost::system::error_code*)':
operations.cpp:(.text+0x382): undefined reference to `statx'
operations.cpp:(.text+0x561): undefined reference to `statx'
../basecaller/Guppy/libGuppyCppClient_gcc-8.a(operations.o): In function `boost::filesystem::detail::copy_directory(boost::filesystem::path const&, boost::filesystem::path const&, boost::system::error_code*)':
operations.cpp:(.text+0x71c): undefined reference to `statx'
../basecaller/Guppy/libGuppyCppClient_gcc-8.a(operations.o): In function `boost::filesystem::detail::equivalent(boost::filesystem::path const&, boost::filesystem::path const&, boost::system::error_code*)':
operations.cpp:(.text+0x18b1): undefined reference to `statx'
operations.cpp:(.text+0x18e4): undefined reference to `statx'
../basecaller/Guppy/libGuppyCppClient_gcc-8.a(operations.o):operations.cpp:(.text+0x196c): more undefined references to `statx' follow
collect2: error: ld returned 1 exit status
main/CMakeFiles/ReadBouncer.dir/build.make:149: recipe for target 'main/ReadBouncer' failed
make[2]: *** [main/ReadBouncer] Error 1
CMakeFiles/Makefile2:5485: recipe for target 'main/CMakeFiles/ReadBouncer.dir/all' failed
make[1]: *** [main/CMakeFiles/ReadBouncer.dir/all] Error 2
Makefile:155: recipe for target 'all' failed
make: *** [all] Error 2
JensUweUlrich commented 2 years ago

Hi @Huanle

That was a different kind of error. Your system kernel doesn't support statx system calls, that are used by Boost, which is part of our precompiled GuppyClientLib. I upgraded the GuppyClientLib to use Boost-1.77 with the usage of statx system calls as describd here. Please update your repository before trying to build again. I hope this fixes your problem.

Huanle commented 2 years ago

Thank you very much @JensUweUlrich for your patience and for being very helpful all the time. You are right. After cloning the new repo and repeating the installation. I think now I am even closer to success though a new error came up :-).

Consolidate compiler generated dependencies of target config
[100%] Built target config
Consolidate compiler generated dependencies of target ReadBouncer
[100%] Linking CXX executable ReadBouncer
../basecaller/Guppy/libGuppyCppClient_gcc-8.a: file not recognized: File format not recognized
collect2: error: ld returned 1 exit status
main/CMakeFiles/ReadBouncer.dir/build.make:149: recipe for target 'main/ReadBouncer' failed
make[2]: *** [main/ReadBouncer] Error 1
CMakeFiles/Makefile2:5485: recipe for target 'main/CMakeFiles/ReadBouncer.dir/all' failed
make[1]: *** [main/CMakeFiles/ReadBouncer.dir/all] Error 2
Makefile:155: recipe for target 'all' failed
make: *** [all] Error 2
JensUweUlrich commented 2 years ago

The libGuppyCppClient_linux_x86_64.tar.gz was corrupted. I uploaded it again.

Huanle commented 2 years ago

Hi @JensUweUlrich , Many many thanks. It's been successfully compiled.