Issue configuring an external project that uses Damaris with CMake
The following CMake error has been found when compiling opm-common with Damaris support:
# CMake command:
cmake ../../opm-simulators -DUSE_DAMARIS_LIB=ON -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF \
-DCMAKE_INSTALL_PREFIX:PATH=$INSTALL_PREFIX -DUSE_MPI=ON -DCMAKE_BUILD_TYPE:STRING=Debug \
-DCMAKE_CXX_FLAGS="-Wno-shadow -Wno-cast-function-type" -DCMAKE_DISABLE_FIND_PACKAGE_CUDA=1 \
-DCMAKE_DISABLE_FIND_PACKAGE_OpenCL=1
# Error:
...
CMake Error at /home/jbowden/opmbuild/opm-common/cmake/Modules/LibtoolArchives.cmake:39 (get_property):
get_property could not find TARGET Boost::python::numpy. Perhaps it has
not yet been created.
Call Stack (most recent call first):
/home/jbowden/opmbuild/opm-common/cmake/Modules/OpmProject.cmake:24 (linker_cmdline)
/home/jbowden/opmbuild/opm-common/cmake/Modules/OpmProject.cmake:95 (configure_pc_file)
/home/jbowden/opmbuild/opm-common/cmake/Modules/OpmLibMain.cmake:191 (opm_cmake_config)
CMakeLists.txt:288 (include)
A workaround was found via moving the position of the Boost::numpy string in files:
Damaris install directory/share/cmake/damaris/DamarisConfig.cmake
Damaris install directory/share/cmake/damaris/DamarisTargets.cmake
so that it directly followed the other Boost::XYZ library includes.
Then the link.txt files for flow and flow_distribute_z aslo require modification bay replacing string Boost::numpy with the actual Boost numpy library:
e.g. on an Ubunto 20.04 system, this may be: /lib/x86_64-linux-gnu/libboost_numpy38.so.1.71.0