Skip to content

Commit 9df06ac

Browse files
jbakosievan-charmworks
authored andcommitted
Move finding MPI before Fortran is required
Otherwise if a fortran compiler is unavailable FindMPI.cmake errors out since there is no mpifc available either.
1 parent 2046ad1 commit 9df06ac

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

CMakeLists.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,15 @@ project(Charm++ LANGUAGES CXX C ASM VERSION 7.0.0)
3131
find_package(Threads)
3232
find_package(OpenMP) # Do this before Fortran, in case we don't have a Fortran compiler
3333

34+
set(CMK_BUILD_MPI 0)
35+
set(CMK_BUILD_ON_MPI 0)
36+
set(CMK_CXX_MPI_BINDINGS 1) # Always true, this just checked for a conflict with old mpich versions.
37+
if(${NETWORK} STREQUAL "mpi")
38+
set(CMK_BUILD_MPI 1)
39+
set(CMK_BUILD_ON_MPI 1)
40+
find_package(MPI REQUIRED)
41+
endif()
42+
3443
# We need C++11 for (almost) all targets
3544
set(CMAKE_CXX_STANDARD 11)
3645
set(CMAKE_CXX_STANDARD_REQUIRED ON)
@@ -407,15 +416,6 @@ elseif(${NETWORK} MATCHES "mpi-cray")
407416
set(CHARM_PLATFORM "${NETWORK}")
408417
endif()
409418

410-
set(CMK_BUILD_MPI 0)
411-
set(CMK_BUILD_ON_MPI 0)
412-
set(CMK_CXX_MPI_BINDINGS 1) # Always true, this just checked for a conflict with old mpich versions.
413-
if(${NETWORK} STREQUAL "mpi")
414-
set(CMK_BUILD_MPI 1)
415-
set(CMK_BUILD_ON_MPI 1)
416-
find_package(MPI REQUIRED)
417-
endif()
418-
419419
set(CMK_BUILD_ON_UCX 0)
420420
if(${NETWORK} STREQUAL "ucx")
421421
set(CMK_BUILD_ON_UCX 1)

0 commit comments

Comments
 (0)