FindMPI: Clarify behavior with MPI compiler wrapper
In our team, we are wondering what the expected behavior of FindMPI is, if MPI compiler wrappers are used as C++ compiler (more specifically the cray wrappers). What we observe is that variables like MPI_CXX_HEADER_DIR
and MPI_CXX_LIB_NAMES
are empty.
This can cause issues in downstream projects that have GPU code. When these parts link against our library, which has MPI as a dependency, the include directories and libraries are not propagated to the GPU compiler. Currently, we work around by using MPI_ASSUME_NO_BUILTIN_MPI=ON
for configuring our project.
So the question is, if this is the expected behavior. By digging into FindMPI.cmake
we found a comment: https://gitlab.kitware.com/cmake/cmake/-/blob/v3.26.4/Modules/FindMPI.cmake#L1232, which reads like at least the include directories should be set.