From 10f0caa32c0aa9380682863c83e0174443070169 Mon Sep 17 00:00:00 2001 From: Stack-1 Date: Tue, 14 Oct 2025 12:01:53 +0200 Subject: [PATCH] [FIX] Workflow MPI try --- CMakeLists.txt | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index abadd5ea..3144480b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -369,24 +369,27 @@ if(MPI_FOUND) file(MAKE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}) set(_mpi_mod_found FALSE) - foreach(_mod_name mpi.mod MPI.mod) - foreach(_inc ${_mpi_fortran_inc}) - if(EXISTS "${_inc}/${_mod_name}") - file(COPY "${_inc}/${_mod_name}" DESTINATION "${CMAKE_Fortran_MODULE_DIRECTORY}") - message(STATUS "Copied ${_mod_name} from ${_inc}") - set(_mpi_mod_found TRUE) + if(_mpi_fortran_inc) + foreach(_mod_name mpi.mod MPI.mod) + foreach(_inc ${_mpi_fortran_inc}) + if(EXISTS "${_inc}/${_mod_name}") + file(COPY "${_inc}/${_mod_name}" DESTINATION "${CMAKE_Fortran_MODULE_DIRECTORY}") + message(STATUS "Copied ${_mod_name} from ${_inc}") + set(_mpi_mod_found TRUE) + break() + endif() + endforeach() + if(_mpi_mod_found) break() endif() endforeach() - if(_mpi_mod_found) - break() - endif() - endforeach() + endif() if(NOT _mpi_mod_found) - message(WARNING "mpi.mod not found in MPI include paths; assuming mpifort provides it internally.") + message(WARNING "mpi.mod not found in MPI include paths; assuming mpifort provides it internally. Skipping copy.") endif() + # ------------------------------------------------------------ # Enable MPI Fortran module support # ------------------------------------------------------------