Skip to content

Commit 31d9f2b

Browse files
committed
Warn about MPI link failures with CMake < 3.20.1
Closes #1114
1 parent 55c8415 commit 31d9f2b

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
@@ -587,6 +587,12 @@ endif()
587587
if (FLAMEGPU_ENABLE_MPI)
588588
find_package(MPI REQUIRED)
589589
if (MPI_CXX_FOUND)
590+
# If CMake is older than 3.20.1, FindMPI may incorrectly wrap link options when CUDA is enabled.
591+
# It is not guaranteed to be a problem, so we should warn rather than error.
592+
# https://gitlab.kitware.com/cmake/cmake/-/issues/21887
593+
if(CMAKE_VERSION VERSION_LESS 3.20.1)
594+
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.")
595+
endif()
590596
# This sets up include directories and lib
591597
target_link_libraries(${PROJECT_NAME} PUBLIC MPI::MPI_CXX)
592598
target_compile_definitions(${PROJECT_NAME} PUBLIC FLAMEGPU_ENABLE_MPI)

0 commit comments

Comments
 (0)