Skip to content

Commit 338a9e3

Browse files
committed
Warn about MPI link failures with CMake < 3.20.1
Closes #1114
1 parent 8dfb74c commit 338a9e3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/CMakeLists.txt

+6
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,12 @@ endif()
562562
if (FLAMEGPU_ENABLE_MPI)
563563
find_package(MPI REQUIRED)
564564
if (MPI_CXX_FOUND)
565+
# If CMake is older than 3.20.1, FindMPI may incorrectly wrap link options when CUDA is enabled.
566+
# It is not guaranteed to be a problem, so we should warn rather than error.
567+
# https://gitlab.kitware.com/cmake/cmake/-/issues/21887
568+
if(CMAKE_VERSION VERSION_LESS 3.20.1)
569+
message(WARNING "CMake < 3.20.1 may result in link errors with FLAMEGPU_ENABLE_MPI=ON for some MPI installations. Consider using CMake >= 3.20.1.")
570+
endif()
565571
# This sets up include directories and lib
566572
target_link_libraries(${PROJECT_NAME} PUBLIC MPI::MPI_CXX)
567573
target_compile_definitions(${PROJECT_NAME} PUBLIC FLAMEGPU_ENABLE_MPI)

0 commit comments

Comments
 (0)