Linking problems with preCICE and boost

Hi there,

I am trying to install preCICE on my new laptop (Ubuntu 24.04), but so far I had no luck getting it to run. Building works just fine. Once I want to make the dummy files (precice/examples/solverdummies/cpp), I get the following error:

~/repositories/precice/examples/solverdummies/cpp/build$ make
[ 50%] Building CXX object CMakeFiles/solverdummy.dir/solverdummy.cpp.o
[100%] Linking CXX executable solverdummy
/usr/bin/ld: warning: libboost_log_setup.so.1.82.0, needed by /usr/local/lib/libprecice.so.3.1.2, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libboost_log.so.1.82.0, needed by /usr/local/lib/libprecice.so.3.1.2, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libboost_program_options.so.1.82.0, needed by /usr/local/lib/libprecice.so.3.1.2, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libboost_thread.so.1.82.0, needed by /usr/local/lib/libprecice.so.3.1.2, not found (try using -rpath or -rpath-link)
/usr/bin/ld: /usr/local/lib/libprecice.so.3.1.2: undefined reference to `boost::log::v2_mt_posix::aux::stream_provider<char>::release_compound(boost::log::v2_mt_posix::aux::stream_provider<char>::stream_compound*)'
/usr/bin/ld: /usr/local/lib/libprecice.so.3.1.2: undefined reference to `boost::log::v2_mt_posix::aux::attach_attribute_name_info(boost::exception&, boost::log::v2_mt_posix::attribute_name const&)'
/usr/bin/ld: /usr/local/lib/libprecice.so.3.1.2: undefined reference to `boost::log::v2_mt_posix::filter boost::log::v2_mt_posix::parse_filter<char>(char const*, char const*)'
/usr/bin/ld: /usr/local/lib/libprecice.so.3.1.2: undefined reference to `boost::log::v2_mt_posix::attribute_name::get_id_from_string(char const*)'
/usr/bin/ld: /usr/local/lib/libprecice.so.3.1.2: undefined reference to `boost::detail::get_tss_data(void const*)'
/usr/bin/ld: /usr/local/lib/libprecice.so.3.1.2: undefined reference to `boost::log::v2_mt_posix::core::open_record(boost::log::v2_mt_posix::attribute_set const&)'
/usr/bin/ld: /usr/local/lib/libprecice.so.3.1.2: undefined reference to `boost::log::v2_mt_posix::aux::default_attribute_names::message()'
/usr/bin/ld: /usr/local/lib/libprecice.so.3.1.2: undefined reference to `boost::program_options::options_description::m_default_line_length'
/usr/bin/ld: /usr/local/lib/libprecice.so.3.1.2: undefined reference to `boost::log::v2_mt_posix::aux::once_block_sentry::commit()'
/usr/bin/ld: /usr/local/lib/libprecice.so.3.1.2: undefined reference to `boost::log::v2_mt_posix::attributes::named_scope::named_scope()'
/usr/bin/ld: /usr/local/lib/libprecice.so.3.1.2: undefined reference to `boost::log::v2_mt_posix::attribute::impl::operator new(unsigned long)'
/usr/bin/ld: /usr/local/lib/libprecice.so.3.1.2: undefined reference to `std::basic_istream<char, std::char_traits<char> >& boost::log::v2_mt_posix::trivial::operator>><char, std::char_traits<char> >(std::basic_istream<char, std::char_traits<char> >&, boost::log::v2_mt_posix::trivial::severity_level&)'
/usr/bin/ld: /usr/local/lib/libprecice.so.3.1.2: undefined reference to `boost::log::v2_mt_posix::parse_error::throw_(char const*, unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, boost::log::v2_mt_posix::attribute_name const&)'
/usr/bin/ld: /usr/local/lib/libprecice.so.3.1.2: undefined reference to `boost::log::v2_mt_posix::aux::default_attribute_names::severity()'
/usr/bin/ld: /usr/local/lib/libprecice.so.3.1.2: undefined reference to `boost::log::v2_mt_posix::parse_error::throw_(char const*, unsigned long, char const*, boost::log::v2_mt_posix::attribute_name const&)'
/usr/bin/ld: /usr/local/lib/libprecice.so.3.1.2: undefined reference to `boost::log::v2_mt_posix::aux::once_block_sentry::rollback()'
/usr/bin/ld: /usr/local/lib/libprecice.so.3.1.2: undefined reference to `void boost::log::v2_mt_posix::register_filter_factory<char>(boost::log::v2_mt_posix::attribute_name const&, boost::shared_ptr<boost::log::v2_mt_posix::filter_factory<char> > const&)'
/usr/bin/ld: /usr/local/lib/libprecice.so.3.1.2: undefined reference to `boost::log::v2_mt_posix::attribute_set::erase(boost::log::v2_mt_posix::attribute_name)'
/usr/bin/ld: /usr/local/lib/libprecice.so.3.1.2: undefined reference to `boost::log::v2_mt_posix::core::remove_sink(boost::shared_ptr<boost::log::v2_mt_posix::sinks::sink> const&)'
/usr/bin/ld: /usr/local/lib/libprecice.so.3.1.2: undefined reference to `boost::log::v2_mt_posix::aux::code_convert_impl(wchar_t const*, unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, unsigned long, std::locale const&)'
/usr/bin/ld: /usr/local/lib/libprecice.so.3.1.2: undefined reference to `void boost::log::v2_mt_posix::aux::put_integer<char>(boost::log::v2_mt_posix::aux::basic_ostringstreambuf<char, std::char_traits<char>, std::allocator<char> >&, unsigned int, unsigned int, char)'
/usr/bin/ld: /usr/local/lib/libprecice.so.3.1.2: undefined reference to `boost::detail::set_tss_data(void const*, void (*)(void (*)(void*), void*), void (*)(void*), void*, bool)'
/usr/bin/ld: /usr/local/lib/libprecice.so.3.1.2: undefined reference to `boost::log::v2_mt_posix::attribute_value_set::find(boost::log::v2_mt_posix::attribute_name) const'
/usr/bin/ld: /usr/local/lib/libprecice.so.3.1.2: undefined reference to `boost::log::v2_mt_posix::sources::aux::get_severity_level()'
/usr/bin/ld: /usr/local/lib/libprecice.so.3.1.2: undefined reference to `boost::log::v2_mt_posix::core::get()'
/usr/bin/ld: /usr/local/lib/libprecice.so.3.1.2: undefined reference to `boost::log::v2_mt_posix::sinks::basic_text_ostream_backend<char>::flush()'
/usr/bin/ld: /usr/local/lib/libprecice.so.3.1.2: undefined reference to `boost::log::v2_mt_posix::attribute_set::~attribute_set()'
/usr/bin/ld: /usr/local/lib/libprecice.so.3.1.2: undefined reference to `void boost::log::v2_mt_posix::aux::parse_date_time_format<char>(char const*, char const*, boost::log::v2_mt_posix::aux::date_time_format_parser_callback<char>&)'
/usr/bin/ld: /usr/local/lib/libprecice.so.3.1.2: undefined reference to `boost::log::v2_mt_posix::basic_formatter<char> boost::log::v2_mt_posix::parse_formatter<char>(char const*, char const*)'
/usr/bin/ld: /usr/local/lib/libprecice.so.3.1.2: undefined reference to `boost::log::v2_mt_posix::sinks::basic_text_ostream_backend<char>::~basic_text_ostream_backend()'
/usr/bin/ld: /usr/local/lib/libprecice.so.3.1.2: undefined reference to `void boost::log::v2_mt_posix::register_formatter_factory<char>(boost::log::v2_mt_posix::attribute_name const&, boost::shared_ptr<boost::log::v2_mt_posix::formatter_factory<char> > const&)'
/usr/bin/ld: /usr/local/lib/libprecice.so.3.1.2: undefined reference to `boost::log::v2_mt_posix::core::add_sink(boost::shared_ptr<boost::log::v2_mt_posix::sinks::sink> const&)'
/usr/bin/ld: /usr/local/lib/libprecice.so.3.1.2: undefined reference to `boost::log::v2_mt_posix::core::get_logging_enabled() const'
/usr/bin/ld: /usr/local/lib/libprecice.so.3.1.2: undefined reference to `boost::log::v2_mt_posix::core::push_record_move(boost::log::v2_mt_posix::record&)'
/usr/bin/ld: /usr/local/lib/libprecice.so.3.1.2: undefined reference to `boost::log::v2_mt_posix::sinks::basic_text_ostream_backend<char>::basic_text_ostream_backend()'
/usr/bin/ld: /usr/local/lib/libprecice.so.3.1.2: undefined reference to `boost::log::v2_mt_posix::attributes::timer::timer()'
/usr/bin/ld: /usr/local/lib/libprecice.so.3.1.2: undefined reference to `boost::log::v2_mt_posix::attribute_value_set::end() const'
/usr/bin/ld: /usr/local/lib/libprecice.so.3.1.2: undefined reference to `boost::log::v2_mt_posix::aux::stream_provider<char>::allocate_compound(boost::log::v2_mt_posix::record&)'
/usr/bin/ld: /usr/local/lib/libprecice.so.3.1.2: undefined reference to `boost::log::v2_mt_posix::attribute_set::attribute_set(boost::log::v2_mt_posix::attribute_set const&)'
/usr/bin/ld: /usr/local/lib/libprecice.so.3.1.2: undefined reference to `boost::log::v2_mt_posix::attribute_set::insert(boost::log::v2_mt_posix::attribute_name, boost::log::v2_mt_posix::attribute const&)'
/usr/bin/ld: /usr/local/lib/libprecice.so.3.1.2: undefined reference to `boost::program_options::basic_parsed_options<char> boost::program_options::parse_config_file<char>(std::basic_istream<char, std::char_traits<char> >&, boost::program_options::options_description const&, bool)'
/usr/bin/ld: /usr/local/lib/libprecice.so.3.1.2: undefined reference to `boost::log::v2_mt_posix::aux::once_block_sentry::enter_once_block() const'
/usr/bin/ld: /usr/local/lib/libprecice.so.3.1.2: undefined reference to `boost::log::v2_mt_posix::record_view::public_data::destroy(boost::log::v2_mt_posix::record_view::public_data const*)'
/usr/bin/ld: /usr/local/lib/libprecice.so.3.1.2: undefined reference to `boost::log::v2_mt_posix::sinks::basic_text_ostream_backend<char>::auto_flush(bool)'
/usr/bin/ld: /usr/local/lib/libprecice.so.3.1.2: undefined reference to `boost::log::v2_mt_posix::attribute_set::attribute_set()'
/usr/bin/ld: /usr/local/lib/libprecice.so.3.1.2: undefined reference to `boost::log::v2_mt_posix::attribute::impl::operator delete(void*, unsigned long)'
/usr/bin/ld: /usr/local/lib/libprecice.so.3.1.2: undefined reference to `boost::program_options::options_description::options_description(unsigned int, unsigned int)'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/solverdummy.dir/build.make:98: solverdummy] Error 1
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/solverdummy.dir/all] Error 2
make: *** [Makefile:101: all] Error 2

I tried to build preCICE from the source code and cmake, then switched to the package manager using the .deb file, but the result ist the same.

One possible error source might be some clash with conda. When installing from source, I get the following warning:

CMake Warning at CMakeLists.txt:486 (add_library):
  Cannot generate a safe runtime search path for target precice because files
  in some directories may conflict with libraries in implicit directories:

    runtime library [libxml2.so.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/damiche97/anaconda3/lib

  Some of these libraries may not be found correctly.


CMake Warning at CMakeLists.txt:574 (add_executable):
  Cannot generate a safe runtime search path for target testprecice because
  files in some directories may conflict with libraries in implicit
  directories:

    runtime library [libxml2.so.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/damiche97/anaconda3/lib

  Some of these libraries may not be found correctly.

But also when I deactivate conda and install preCICE (source/deb) it does not make a difference. Right now I am at a loss of ideas, what else to try. Does anyone have an idea, where I go wrong?

Best regards,
Michael

PS: I have been working with preCICE a bit, but I am still relatively new and also not really an expert with C++, so go easy on me :slight_smile: