From 6d11a958c929e01923c31650a477fa4881fd1347 Mon Sep 17 00:00:00 2001 From: scivision Date: Thu, 21 Dec 2023 08:59:44 -0500 Subject: [PATCH] only check MPI-3 Fortran if needed --- cmake/mpi.cmake | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/cmake/mpi.cmake b/cmake/mpi.cmake index 0b004e1..1eb7c11 100644 --- a/cmake/mpi.cmake +++ b/cmake/mpi.cmake @@ -19,7 +19,12 @@ include(${CMAKE_CURRENT_LIST_DIR}/openmpi.cmake) set(CMAKE_REQUIRED_LIBRARIES MPI::MPI_Fortran) +if(MPI_Fortran_HAVE_F08_MODULE) + return() +endif() + # sometimes factory FindMPI.cmake doesn't define this +message(CHECK_START "Checking for Fortran MPI-3 binding") check_source_compiles(Fortran [=[ program test @@ -32,6 +37,9 @@ end program MPI_Fortran_HAVE_F08_MODULE ) -if(NOT MPI_Fortran_HAVE_F08_MODULE) - message(FATAL_ERROR "Fortran MPI-3 binding not present.") +if(MPI_Fortran_HAVE_F08_MODULE) + message(CHECK_PASS "yes") +else() + message(CHECK_FAIL "no") + message(WARNING "MPI-3 Fortran module mpi_f08 not found, builds may fail.") endif()