FindMPI: Spetrum MPI 2019.06.24 and NVCC 10.1.243
Spectrum MPI 2019.06.24 adds -pthread
not only to the C++ flags but also to the linker lines.
Compiling with NVCC 10.1.243 with native CUDA language support for source files and using the MPI find module results in a
nvcc fatal : Unknown option 'pthread'
in the final link line that uses nvcc to link an executable.
We will need to prefix this with -Xlinker
. Maybe for the CUDA link line, adding -forward-unknown-to-host-linker
is also an option for CUDA 10.2.89+.
Refs.:
- https://gitlab.kitware.com/cmake/cmake/-/blob/26c12711598cd7b1eadaf8261773255599e10a29/Modules/FindMPI.cmake#L1157-1158
- https://github.com/ECP-WarpX/WarpX/issues/1132#issuecomment-654091290
- https://gitlab.kitware.com/cmake/cmake/-/blob/26c12711598cd7b1eadaf8261773255599e10a29/Modules/Compiler/NVIDIA-CUDA.cmake
Edited by Axel Huebl