Skip to content

Commit

Permalink
Fix up MPI detection for Spack builds
Browse files Browse the repository at this point in the history
  • Loading branch information
mathomp4 committed Mar 15, 2024
1 parent 53409fd commit d4fc84d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,16 @@ foreach (dir cmake @cmake cmake@)
set (ESMA_CMAKE_PATH "${CMAKE_CURRENT_LIST_DIR}/${dir}" CACHE PATH "Path to ESMA_cmake code")
endif ()
endforeach ()

# We need to find MPI before we go into esma
# for the MPI stack detection to work
set(MPI_DETERMINE_LIBRARY_VERSION TRUE)
find_package(MPI)

include (esma)

# Add CMake for when not using Baselibs
if (NOT Baselibs_FOUND)
set(MPI_DETERMINE_LIBRARY_VERSION TRUE)
find_package(MPI)

find_package(NetCDF REQUIRED C Fortran)
add_definitions(-DHAS_NETCDF4)
Expand Down

0 comments on commit d4fc84d

Please sign in to comment.