New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Libs.private #343
Add Libs.private #343
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I built preCICE as a static library using -DBUILD_SHARED_LIBS=OFF
.
Then I tried to build the C++ (and C) solver dummies, which failed with an error for finding Eigen, MPI, and NumPy:
-- Configuring done
CMake Error at CMakeLists.txt:6 (add_executable):
Target "solverdummy" links to target "Eigen3::Eigen" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?
CMake Error at CMakeLists.txt:6 (add_executable):
Target "solverdummy" links to target "MPI::MPI_CXX" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?
CMake Error at CMakeLists.txt:6 (add_executable):
Target "solverdummy" links to target "NumPy::NumPy" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?
This seems to be a different issue (@fsimonis). I then tried to build the OpenFOAM adapter with preCICE as a static library, by using the --static
option in pkg-config --silence-errors --libs --static libprecice
.
Since the OpenFOAM adapter is a shared library, I got an error regarding relocation, which I solved by rebuilding preCICE with:
CMAKE_CXX_FLAGS = -fPIC
Maybe we should integrate this by default.
The current issue, as @fsimonis expected, is for MPI during linking:
undefined symbol: _ZN3MPI8Datatype4FreeEv (/home/makish/OpenFOAM/makish-5.0/platforms/linux64GccDPInt32Opt/lib/libpreciceAdapterFunctionObject.so)
undefined symbol: _ZN3MPI3Win4FreeEv (/home/makish/OpenFOAM/makish-5.0/platforms/linux64GccDPInt32Opt/lib/libpreciceAdapterFunctionObject.so)
undefined symbol: ompi_mpi_cxx_op_intercept (/home/makish/OpenFOAM/makish-5.0/platforms/linux64GccDPInt32Opt/lib/libpreciceAdapterFunctionObject.so)
undefined symbol: _ZN3MPI4CommC2Ev (/home/makish/OpenFOAM/makish-5.0/platforms/linux64GccDPInt32Opt/lib/libpreciceAdapterFunctionObject.so)
OpenMPI also provides a pkg-config module:
|
I assume that we also need Here are the flags & paths that pkg-config returns on my system:
|
We are currently confused about why this is happening but we don't consider it a high priority. We decided to postpone it. |
This is not worth the hassle until we have a real reason to do provide this. |
This PR:
Libs.private
to the configured.pc
file.TODO
Closes #313