Skip to content

Commit 0c1279c

Browse files
adding MPI dependency in CMakeLists.txt of mgbf and using Russ's gsi_hera.gnu.lua
1 parent e374f91 commit 0c1279c

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

modulefiles/gsi_hera.gnu.lua

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
help([[
22
]])
33

4-
prepend_path("MODULEPATH", "/contrib/spack-stack/spack-stack-1.6.0/envs/gsi-addon-dev-rocky8/install/modulefiles/Core")
4+
prepend_path("MODULEPATH", "/scratch4/NCEPDEV/stmp/role.epic/spack-stack/spack-stack-1.6.0/envs/gsi-addon-dev-rocky8/install/modulefiles/Core")
55
--Needed for openmpi build
6-
prepend_path("MODULEPATH", "/scratch1/NCEPDEV/jcsda/jedipara/spack-stack/modulefiles")
6+
--prepend_path("MODULEPATH", "/scratch1/NCEPDEV/jcsda/jedipara/spack-stack/modulefiles")
77

88
local python_ver=os.getenv("python_ver") or "3.11.6"
99
local stack_gnu_ver=os.getenv("stack_gnu_ver") or "9.2.0"
10-
local stack_openmpi_ver=os.getenv("stack_openmpi_ver") or "4.1.5"
10+
local stack_openmpi_ver=os.getenv("stack_openmpi_ver") or "4.1.6"
1111
local cmake_ver=os.getenv("cmake_ver") or "3.23.1"
1212
local prod_util_ver=os.getenv("prod_util_ver") or "2.1.1"
1313
local openblas_ver=os.getenv("openblas_ver") or "0.3.24"

src/mgbf/CMakeLists.txt

+4
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ endif()
3030
if(NOT CMAKE_BUILD_TYPE MATCHES "Debug")
3131
add_definitions(-DNDEBUG)
3232
endif()
33+
# Find MPI Package
34+
find_package(MPI REQUIRED)
3335

3436
list(APPEND MGBF_SRC
3537
kinds.f90
@@ -63,6 +65,8 @@ add_library(${PROJECT_NAME}::mgbf ALIAS mgbf)
6365
set_target_properties(mgbf PROPERTIES Fortran_MODULE_DIRECTORY "${module_dir}")
6466
target_include_directories(mgbf PUBLIC $<BUILD_INTERFACE:${module_dir}>
6567
$<INSTALL_INTERFACE:include/mgbf>)
68+
target_link_libraries(mgbf PUBLIC MPI::MPI_Fortran)
69+
6670

6771
install(DIRECTORY ${module_dir} DESTINATION ${CMAKE_INSTALL_PREFIX}/include)
6872

0 commit comments

Comments
 (0)