preCICE installation does not find Boost despite correct linking during build

Hello,
I have installed preCICE v2.2.1 from source on a cluster. I also have Boost 1.72.0 installed from source at a custom prefix. I have added the following paths to the ~/.bashrc so that preCICE CMake build recipe finds it:

# preCICE
export PRECICE_ROOT=$HOME/precice/build/
export LD_LIBRARY_PATH=$PRECICE_ROOT:$LD_LIBRARY_PATH
export LIBRARY_PATH=$PRECICE_ROOT:$LIBRARY_PATH
export CPLUS_INCLUDE_PATH=$PRECICE_ROOT:$CPLUS_INCLUDE_PATH
export PKG_CONFIG_PATH="${PRECICE_ROOT}/lib/pkgconfig:${PKG_CONFIG_PATH}"
export CMAKE_PREFIX_PATH=$PRECICE_ROOT

# Boost Library paths
export BOOST_ROOT=$HOME/boost-installation
export LIBRARY_PATH=$BOOST_ROOT/lib:$LIBRARY_PATH
export LD_LIBRARY_PATH=$BOOST_ROOT/lib:$LD_LIBRARY_PATH
export CPLUS_INCLUDE_PATH=$BOOST_ROOT/include:$CPLUS_INCLUDE_PATH

and in the preCICE CMake log I also see that Boost 1.72.0 is identified hence I take this as confirmation that the installation is picked. I use the following CMake command for configuring the preCICE installation:

cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$PRECICE_ROOT -DPRECICE_PETScMapping=OFF \
  -DPRECICE_PythonActions=OFF -DMPI_CXX_COMPILER=mpigcc -DBoost_NO_BOOST_CMAKE=TRUE -DBoost_NO_SYSTEM_PATHS=TRUE \
  -DBOOST_ROOT:PATHNAME=$BOOST_ROOT -DBoost_LIBRARY_DIRS:FILEPATH=$BOOST_ROOT/lib ..

The installation is successful except for a few CMake warnings of the sort:

Make Warning at /u/system/soft/SLE_12/packages/x86_64/cmake/3.13.3/share/cmake-3.13/Modules/FindBoost.cmake:880 (message):
  New Boost version may have incorrect or missing dependencies and imported
  targets
Call Stack (most recent call first):
  /u/system/soft/SLE_12/packages/x86_64/cmake/3.13.3/share/cmake-3.13/Modules/FindBoost.cmake:1002 (_Boost_COMPONENT_DEPENDENCIES)
  /u/system/soft/SLE_12/packages/x86_64/cmake/3.13.3/share/cmake-3.13/Modules/FindBoost.cmake:1670 (_Boost_MISSING_DEPENDENCIES)
  CMakeLists.txt:152 (find_package)

I am now installing another CMake project to with preCICE is linked. For this linking I have set the path export CMAKE_PREFIX_PATH=$PRECICE_ROOT. I have also made sure that the CMakeLists.txt of this project links preCICE:

find_package(precice REQUIRED CONFIG)
target_link_libraries(PARALLAX-Library PRIVATE precice::precice)

During the installation of this project I see a lot of errors of the sort:

ld: /u/idesai/precice/build/libprecice.so.2.2.1: undefined reference to `boost::log::v2_mt_posix::sinks::basic_text_ostream_backend<char>::flush()'
ld: /u/idesai/precice/build/libprecice.so.2.2.1: undefined reference to `boost::log::v2_mt_posix::basic_formatter<char> boost::log::v2_mt_posix::parse_formatter<char>(char const*, char const*)'
ld: /u/idesai/precice/build/libprecice.so.2.2.1: undefined reference to `boost::log::v2_mt_posix::sinks::basic_text_ostream_backend<char>::basic_text_ostream_backend()'
ld: /u/idesai/precice/build/libprecice.so.2.2.1: undefined reference to `boost::log::v2_mt_posix::aux::default_attribute_names::timestamp()'

so somehow preCICE does not seem to be able to find the Boost files. Surprisingly this comes up not in the preCICE installation but the installation of another project to which preCICE is linked. Any ideas what is going wrong?
I also see warnings before the error:

ld: warning: libboost_date_time.so.1.72.0, needed by /u/idesai/precice/build/libprecice.so.2.2.1, not found (try using -rpath or -rpath-link)
ld: warning: libboost_regex.so.1.72.0, needed by /u/idesai/precice/build/libprecice.so.2.2.1, not found (try using -rpath or -rpath-link)

I am unsure if this is relevant, currently I run the following command during the preCICE installation:

LIB=$PRECICE_ROOT/libprecice.so
patchelf --set-rpath /usr/lib64:$(patchelf --print-rpath $LIB) $LIB

can this be related?

Are you able to run the preCICE tests after compilation and do the solver dummies work?

Thanks for this reminder, I had disabled the tests in my build script as they would usually go through. Interestingly all the tests timeout:

test 1
      Start  1: precice.acceleration

1: Test command: /mpcdf/soft/SLE_12/packages/x86_64/intel_parallel_studio/2020.1/compilers_and_libraries_2020.1.217/linux/mpi/intel64/bin/mpiexec "-n" "4" "/u/idesai/precice/build/testprecice" "--run_test=AccelerationTests"
1: Environment variables: 
1:  PRECICE_ROOT=/u/idesai/precice
1:  OMPI_MCA_rmaps_base_oversubscribe=1
1: Test timeout computed to be: 20
 1/29 Test  #1: precice.acceleration ......................***Timeout  20.09 sec

The PRECICE_ROOT path here seems suspicious as I am installing in a separate /u/idesai/precice/build/ folder. I will also try the solverdummies now

I also tried compiling the solver dummies to check the preCICE installation and they are compiled, hence I am inclined to believe that the preCICE installation is successful and the problem may actually not be related to preCICE.

It is predicted that this error is a result of problems in the CMake build of the library to which preCICE is linked and has nothing to do with the preCICE build itself. A solution is being found with the developers of that library. This thread is closed here.

1 Like

Good to hear that you could track down the error source at least. Regarding the failing preCICE tests it might still be worth to collect the output file of the tests and to open an issue on GitHub. I think it would be interesting for the preCICE developers to understand what is going wrong and whether it is something they can/want to fix.

1 Like

Since this is a problem that one could face again in the future while installing preCICE, I am transfering the thread back to “installing preCICE”.

@IshaanDesai if you have more details, please document here. :slight_smile:

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.