From 2bf633b973bd71426b5d243d250a18559113a00f Mon Sep 17 00:00:00 2001 From: Rupert Nash Date: Tue, 19 Dec 2023 21:27:33 +0000 Subject: [PATCH] Tidy MPI CMake --- Code/CMakeLists.txt | 7 ++++++- Code/cmake/mpi.cmake | 12 ------------ 2 files changed, 6 insertions(+), 13 deletions(-) delete mode 100644 Code/cmake/mpi.cmake diff --git a/Code/CMakeLists.txt b/Code/CMakeLists.txt index 8d13e45f1..f08dc2c71 100644 --- a/Code/CMakeLists.txt +++ b/Code/CMakeLists.txt @@ -55,8 +55,11 @@ include(platform_checks) include(codesign) include(HemeLbDependency) +# We do NOT want the removed MPI 2 C++ bindings +# Requesting MPI 3 should be enough, but some configurations of +# e.g. OpenMPI enable them for C++ by default to be "helpful". set(MPI_CXX_SKIP_MPICXX ON) -find_package(MPI REQUIRED CXX) +find_package(MPI 3 REQUIRED CXX) find_hemelb_dependency(Boost REQUIRED) find_hemelb_dependency(tinyxml2 REQUIRED) @@ -65,6 +68,8 @@ find_hemelb_dependency(CTemplate REQUIRED) find_hemelb_dependency(ZLIB REQUIRED) # MPI and boost should always be available +# Note this is NOT the C++ bindings, this is the C bindings from C++ +# (ensures helpful MPI implementations do not sneak the MPI 2 C++ bindings back in) link_libraries(MPI::MPI_CXX) link_libraries(Boost::headers) diff --git a/Code/cmake/mpi.cmake b/Code/cmake/mpi.cmake deleted file mode 100644 index c4d57f6de..000000000 --- a/Code/cmake/mpi.cmake +++ /dev/null @@ -1,12 +0,0 @@ -# This file is part of HemeLB and is Copyright (C) -# the HemeLB team and/or their institutions, as detailed in the -# file AUTHORS. This software is provided under the terms of the -# license in the file LICENSE. -include_guard() - -# ------MPI------------------ -# Require MPI for this project: -find_package(MPI REQUIRED) -set(CMAKE_CXX_COMPILE_FLAGS "${CMAKE_CXX_COMPILE_FLAGS} ${MPI_COMPILE_FLAGS}") -set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} ${CMAKE_CXX_LINK_FLAGS}") -include_directories(${MPI_INCLUDE_PATH})