Skip to content

Commit

Permalink
Fixes #2469. Convert MAPL to use ESMF::ESMF target
Browse files Browse the repository at this point in the history
  • Loading branch information
mathomp4 committed Feb 6, 2024
1 parent 60b7bfa commit e3f7293
Show file tree
Hide file tree
Showing 27 changed files with 44 additions and 35 deletions.
6 changes: 3 additions & 3 deletions Apps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,23 @@ install(
DESTINATION bin/forcing_converter)

ecbuild_add_executable (TARGET Regrid_Util.x SOURCES Regrid_Util.F90)
target_link_libraries (Regrid_Util.x PRIVATE MAPL MPI::MPI_Fortran esmf)
target_link_libraries (Regrid_Util.x PRIVATE MAPL MPI::MPI_Fortran ESMF::ESMF)
target_include_directories (Regrid_Util.x PRIVATE $<BUILD_INTERFACE:${MAPL_SOURCE_DIR}/include>)
# CMake has an OpenMP issue with NAG Fortran: https://gitlab.kitware.com/cmake/cmake/-/issues/21280
if (NOT CMAKE_Fortran_COMPILER_ID MATCHES "NAG")
target_link_libraries(Regrid_Util.x PRIVATE OpenMP::OpenMP_Fortran)
endif ()

ecbuild_add_executable (TARGET time_ave_util.x SOURCES time_ave_util.F90)
target_link_libraries (time_ave_util.x PRIVATE MAPL MPI::MPI_Fortran esmf)
target_link_libraries (time_ave_util.x PRIVATE MAPL MPI::MPI_Fortran ESMF::ESMF)
target_include_directories (time_ave_util.x PRIVATE $<BUILD_INTERFACE:${MAPL_SOURCE_DIR}/include>)
# CMake has an OpenMP issue with NAG Fortran: https://gitlab.kitware.com/cmake/cmake/-/issues/21280
if (NOT CMAKE_Fortran_COMPILER_ID MATCHES "NAG")
target_link_libraries(time_ave_util.x PRIVATE OpenMP::OpenMP_Fortran)
endif ()

ecbuild_add_executable (TARGET Comp_Testing_Driver.x SOURCES Comp_Testing_Driver.F90)
target_link_libraries (Comp_Testing_Driver.x PRIVATE MAPL MPI::MPI_Fortran esmf)
target_link_libraries (Comp_Testing_Driver.x PRIVATE MAPL MPI::MPI_Fortran ESMF::ESMF)
target_include_directories (Comp_Testing_Driver.x PRIVATE $<BUILD_INTERFACE:${MAPL_SOURCE_DIR}/include>)
# CMake has an OpenMP issue with NAG Fortran: https://gitlab.kitware.com/cmake/cmake/-/issues/21280
if (NOT CMAKE_Fortran_COMPILER_ID MATCHES "NAG")
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
now required), NAG no longer needs this workaround.
- Refactor the CircleCI workflows for more flexibility
- Fix field utils issue - add npes argument to test subroutine decorators.
- Change MAPL CMake to use `ESMF::ESMF` target instead of `esmf` or `ESMF` as the imported target name
- Updated `FindESMF.cmake` to match that of ESMF `develop` as of commit `da8f410`. This will be in ESMF 8.6.1+
- Requires ESMA_cmake 3.40.0 or later as this adds the `ESMF::ESMF` target ALIAS for Baselibs and non-Baselibs builds

### Fixed

Expand Down
11 changes: 6 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -147,20 +147,21 @@ if (NOT Baselibs_FOUND)
add_definitions(-DH5_HAVE_PARALLEL)
endif()

if (NOT TARGET esmf)
if (NOT TARGET ESMF::ESMF)
find_package(ESMF 8.6.0 MODULE REQUIRED)

# ESMF as used in MAPL requires MPI
# NOTE: This looks odd because some versions of FindESMF.cmake out in the
# world provide an "esmf" target while others provide "ESMF". So we
# need this ugliness to support both.
if (TARGET esmf)
target_link_libraries(esmf INTERFACE MPI::MPI_Fortran)
if (TARGET ESMF::ESMF)
target_link_libraries(ESMF::ESMF INTERFACE MPI::MPI_Fortran)
else()
target_link_libraries(ESMF INTERFACE MPI::MPI_Fortran)
target_link_libraries(ESMF::ESMF INTERFACE MPI::MPI_Fortran)
# MAPL and GEOS use lowercase target due to historical reasons but
# the latest FindESMF.cmake file from ESMF produces an ESMF target.
add_library(esmf ALIAS ESMF)
add_library(ESMF::ESMF ALIAS ESMF)
add_library(ESMF::ESMF ALIAS esmf)
endif()
endif ()
else ()
Expand Down
2 changes: 1 addition & 1 deletion MAPL/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ esma_set_this()
esma_add_library (${this}
SRCS MAPL.F90
DEPENDENCIES MAPL.base MAPL.generic MAPL.pfio MAPL_cfio_r4 MAPL.gridcomps MAPL.orbit MAPL.griddedio MAPL.field_utils ${EXTDATA_TARGET}
esmf NetCDF::NetCDF_Fortran MPI::MPI_Fortran
ESMF::ESMF NetCDF::NetCDF_Fortran MPI::MPI_Fortran
$<$<BOOL:${BUILD_WITH_FLAP}>:FLAP::FLAP>
TYPE ${MAPL_LIBRARY_TYPE}
)
Expand Down
2 changes: 1 addition & 1 deletion MAPL_cfio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ endif ()

esma_add_library (${lib}
SRCS ${srcs}
DEPENDENCIES esmf NetCDF::NetCDF_Fortran
DEPENDENCIES ESMF::ESMF NetCDF::NetCDF_Fortran
TYPE ${LIBRARY_TYPE}
)

Expand Down
6 changes: 3 additions & 3 deletions Tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ set (srcs
if (BUILD_WITH_FARGPARSE)

ecbuild_add_executable (TARGET ExtDataDriver.x SOURCES ${srcs})
target_link_libraries (ExtDataDriver.x PRIVATE MAPL FARGPARSE::fargparse esmf)
target_link_libraries (ExtDataDriver.x PRIVATE MAPL FARGPARSE::fargparse ESMF::ESMF)
# CMake has an OpenMP issue with NAG Fortran: https://gitlab.kitware.com/cmake/cmake/-/issues/21280
if (NOT CMAKE_Fortran_COMPILER_ID MATCHES "NAG")
target_link_libraries(ExtDataDriver.x PRIVATE OpenMP::OpenMP_Fortran)
Expand All @@ -21,14 +21,14 @@ if (BUILD_WITH_FARGPARSE)
add_subdirectory(ExtData_Testing_Framework EXCLUDE_FROM_ALL)

ecbuild_add_executable (TARGET pfio_MAPL_demo.x SOURCES pfio_MAPL_demo.F90)
target_link_libraries (pfio_MAPL_demo.x PRIVATE MAPL FARGPARSE::fargparse esmf)
target_link_libraries (pfio_MAPL_demo.x PRIVATE MAPL FARGPARSE::fargparse ESMF::ESMF)
# CMake has an OpenMP issue with NAG Fortran: https://gitlab.kitware.com/cmake/cmake/-/issues/21280
if (NOT CMAKE_Fortran_COMPILER_ID MATCHES "NAG")
target_link_libraries(pfio_MAPL_demo.x PRIVATE OpenMP::OpenMP_Fortran)
endif ()
set_target_properties(pfio_MAPL_demo.x PROPERTIES Fortran_MODULE_DIRECTORY ${MODULE_DIRECTORY})
ecbuild_add_executable (TARGET MAPL_demo_fargparse.x SOURCES MAPL_demo_fargparse.F90)
target_link_libraries (MAPL_demo_fargparse.x PRIVATE MAPL FARGPARSE::fargparse esmf)
target_link_libraries (MAPL_demo_fargparse.x PRIVATE MAPL FARGPARSE::fargparse ESMF::ESMF)
# CMake has an OpenMP issue with NAG Fortran: https://gitlab.kitware.com/cmake/cmake/-/issues/21280
if (NOT CMAKE_Fortran_COMPILER_ID MATCHES "NAG")
target_link_libraries(MAPL_demo_fargparse.x PRIVATE OpenMP::OpenMP_Fortran)
Expand Down
4 changes: 2 additions & 2 deletions base/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ esma_add_library(
${this} SRCS ${srcs}
DEPENDENCIES MAPL.shared MAPL.constants MAPL.profiler MAPL.pfio MAPL_cfio_r4 MAPL.field_utils PFLOGGER::pflogger
GFTL_SHARED::gftl-shared-v2 GFTL_SHARED::gftl-shared-v1 GFTL::gftl-v2 GFTL::gftl-v1
esmf NetCDF::NetCDF_Fortran MPI::MPI_Fortran
ESMF::ESMF NetCDF::NetCDF_Fortran MPI::MPI_Fortran
TYPE ${MAPL_LIBRARY_TYPE})

# CMake has an OpenMP issue with NAG Fortran: https://gitlab.kitware.com/cmake/cmake/-/issues/21280
Expand All @@ -90,7 +90,7 @@ foreach(dir ${OSX_EXTRA_LIBRARY_PATH})
target_link_libraries(${this} PUBLIC "-Xlinker -rpath -Xlinker ${dir}")
endforeach()

ecbuild_add_executable (TARGET cub2latlon.x SOURCES cub2latlon_regridder.F90 DEPENDS esmf MAPL.shared)
ecbuild_add_executable (TARGET cub2latlon.x SOURCES cub2latlon_regridder.F90 DEPENDS ESMF::ESMF MAPL.shared)
target_link_libraries (cub2latlon.x PRIVATE ${this} MAPL.pfio MPI::MPI_Fortran)
# CMake has an OpenMP issue with NAG Fortran: https://gitlab.kitware.com/cmake/cmake/-/issues/21280
if (NOT CMAKE_Fortran_COMPILER_ID MATCHES "NAG")
Expand Down
2 changes: 1 addition & 1 deletion base/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ set (SRCS
# MAPL_Initialize.F90
# )
#target_link_libraries (base_extras MAPL.shared MAPL.pfunit
# esmf NetCDF::NetCDF_Fortran)
# ESMF::ESMF NetCDF::NetCDF_Fortran)

add_pfunit_ctest(MAPL.base.tests
TEST_SOURCES ${TEST_SRCS}
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/io/checkpoint_simulator/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ecbuild_add_executable (
SOURCES checkpoint_simulator.F90
DEFINITIONS USE_MPI)

target_link_libraries (${exe} PRIVATE MAPL.shared MPI::MPI_Fortran FARGPARSE::fargparse esmf )
target_link_libraries (${exe} PRIVATE MAPL.shared MPI::MPI_Fortran FARGPARSE::fargparse ESMF::ESMF )
target_include_directories (${exe} PUBLIC $<BUILD_INTERFACE:${MAPL_SOURCE_DIR}/include>)
set_target_properties (${exe} PROPERTIES Fortran_MODULE_DIRECTORY ${MODULE_DIRECTORY})

Expand Down
5 changes: 5 additions & 0 deletions cmake/FindESMF.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@ if(EXISTS ${ESMFMKFILE})
endif()
endif()

# Add target alias to facilitate unambiguous linking
if(NOT TARGET ESMF::ESMF)
add_library(ESMF::ESMF ALIAS ESMF)
endif()

# Add ESMF include directories
set(ESMF_INCLUDE_DIRECTORIES "")
separate_arguments(_ESMF_F90COMPILEPATHS UNIX_COMMAND ${ESMF_F90COMPILEPATHS})
Expand Down
2 changes: 1 addition & 1 deletion components.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ESMA_env:
ESMA_cmake:
local: ./ESMA_cmake
remote: ../ESMA_cmake.git
tag: v3.37.0
tag: v3.40.0
develop: develop

ecbuild:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set (srcs

esma_add_library (${this} SRCS ${srcs} DEPENDENCIES MAPL.shared MAPL TYPE ${MAPL_LIBRARY_TYPE})

target_link_libraries(${this} PRIVATE esmf)
target_link_libraries(${this} PRIVATE ESMF::ESMF)

target_include_directories (${this} PUBLIC $<BUILD_INTERFACE:${MAPL_SOURCE_DIR}/include>)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ esma_add_library (${this} SRCS ${srcs} DEPENDENCIES MAPL.shared MAPL TYPE ${MAPL
if (NOT CMAKE_Fortran_COMPILER_ID MATCHES "NAG")
target_link_libraries(${this} PRIVATE OpenMP::OpenMP_Fortran)
endif ()
target_link_libraries(${this} PRIVATE esmf)
target_link_libraries(${this} PRIVATE ESMF::ESMF)
target_include_directories (${this} PUBLIC $<BUILD_INTERFACE:${MAPL_SOURCE_DIR}/include>)
set_target_properties (${this} PROPERTIES Fortran_MODULE_DIRECTORY ${include_${this}})
#target_compile_definitions(${this} PRIVATE SYSTEM_DSO_SUFFIX="${CMAKE_SHARED_LIBRARY_SUFFIX}")
2 changes: 1 addition & 1 deletion docs/tutorial/grid_comps/leaf_comp_a/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ esma_add_library (${this} SRCS ${srcs} DEPENDENCIES MAPL.shared MAPL TYPE ${MAPL
if (NOT CMAKE_Fortran_COMPILER_ID MATCHES "NAG")
target_link_libraries(${this} PRIVATE OpenMP::OpenMP_Fortran)
endif ()
target_link_libraries(${this} PRIVATE esmf)
target_link_libraries(${this} PRIVATE ESMF::ESMF)
target_include_directories (${this} PUBLIC $<BUILD_INTERFACE:${MAPL_SOURCE_DIR}/include>)
set_target_properties (${this} PROPERTIES Fortran_MODULE_DIRECTORY ${include_${this}})
#target_compile_definitions(${this} PRIVATE SYSTEM_DSO_SUFFIX="${CMAKE_SHARED_LIBRARY_SUFFIX}")
2 changes: 1 addition & 1 deletion docs/tutorial/grid_comps/leaf_comp_b/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ esma_add_library (${this} SRCS ${srcs} DEPENDENCIES MAPL.shared MAPL TYPE ${MAPL
if (NOT CMAKE_Fortran_COMPILER_ID MATCHES "NAG")
target_link_libraries(${this} PRIVATE OpenMP::OpenMP_Fortran)
endif ()
target_link_libraries(${this} PRIVATE esmf)
target_link_libraries(${this} PRIVATE ESMF::ESMF)
target_include_directories (${this} PUBLIC $<BUILD_INTERFACE:${MAPL_SOURCE_DIR}/include>)
set_target_properties (${this} PROPERTIES Fortran_MODULE_DIRECTORY ${include_${this}})
#target_compile_definitions(${this} PRIVATE SYSTEM_DSO_SUFFIX="${CMAKE_SHARED_LIBRARY_SUFFIX}")
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ esma_add_library (${this} SRCS ${srcs} DEPENDENCIES MAPL.shared MAPL TYPE ${MAPL
if (NOT CMAKE_Fortran_COMPILER_ID MATCHES "NAG")
target_link_libraries(${this} PRIVATE OpenMP::OpenMP_Fortran)
endif ()
target_link_libraries(${this} PRIVATE esmf)
target_link_libraries(${this} PRIVATE ESMF::ESMF)
target_include_directories (${this} PUBLIC $<BUILD_INTERFACE:${MAPL_SOURCE_DIR}/include>)
set_target_properties (${this} PROPERTIES Fortran_MODULE_DIRECTORY ${include_${this}})
#target_compile_definitions(${this} PRIVATE SYSTEM_DSO_SUFFIX="${CMAKE_SHARED_LIBRARY_SUFFIX}")
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ esma_add_library (${this} SRCS ${srcs} DEPENDENCIES MAPL.shared MAPL TYPE ${MAPL
if (NOT CMAKE_Fortran_COMPILER_ID MATCHES "NAG")
target_link_libraries(${this} PRIVATE OpenMP::OpenMP_Fortran)
endif ()
target_link_libraries(${this} PRIVATE esmf)
target_link_libraries(${this} PRIVATE ESMF::ESMF)
target_include_directories (${this} PUBLIC $<BUILD_INTERFACE:${MAPL_SOURCE_DIR}/include>)
set_target_properties (${this} PROPERTIES Fortran_MODULE_DIRECTORY ${include_${this}})
#target_compile_definitions(${this} PRIVATE SYSTEM_DSO_SUFFIX="${CMAKE_SHARED_LIBRARY_SUFFIX}")
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ esma_add_library (${this} SRCS ${srcs} DEPENDENCIES MAPL.shared MAPL TYPE ${MAPL
if (NOT CMAKE_Fortran_COMPILER_ID MATCHES "NAG")
target_link_libraries(${this} PRIVATE OpenMP::OpenMP_Fortran)
endif ()
target_link_libraries(${this} PRIVATE esmf)
target_link_libraries(${this} PRIVATE ESMF::ESMF)
target_include_directories (${this} PUBLIC $<BUILD_INTERFACE:${MAPL_SOURCE_DIR}/include>)
set_target_properties (${this} PROPERTIES Fortran_MODULE_DIRECTORY ${include_${this}})
#target_compile_definitions(${this} PRIVATE SYSTEM_DSO_SUFFIX="${CMAKE_SHARED_LIBRARY_SUFFIX}")
4 changes: 2 additions & 2 deletions field_utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ esma_add_library(${this}

target_include_directories (${this} PUBLIC
$<BUILD_INTERFACE:${MAPL_SOURCE_DIR}/include>)
#target_link_libraries (${this} PUBLIC esmf NetCDF::NetCDF_Fortran)
target_link_libraries (${this} PUBLIC esmf)
#target_link_libraries (${this} PUBLIC ESMF::ESMF NetCDF::NetCDF_Fortran)
target_link_libraries (${this} PUBLIC ESMF::ESMF)

if (PFUNIT_FOUND)
# Turning off until test with GNU can be fixed
Expand Down
2 changes: 1 addition & 1 deletion generic/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ esma_add_library(${this}
)
target_include_directories (${this} PUBLIC
$<BUILD_INTERFACE:${MAPL_SOURCE_DIR}/include>)
target_link_libraries (${this} PUBLIC esmf NetCDF::NetCDF_Fortran)
target_link_libraries (${this} PUBLIC ESMF::ESMF NetCDF::NetCDF_Fortran)

# CMake has an OpenMP issue with NAG Fortran: https://gitlab.kitware.com/cmake/cmake/-/issues/21280
if (NOT CMAKE_Fortran_COMPILER_ID MATCHES "NAG")
Expand Down
2 changes: 1 addition & 1 deletion gridcomps/Cap/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ endif()

esma_add_library (${this} SRCS ${srcs} DEPENDENCIES MAPL.shared MAPL.constants MAPL.base MAPL.profiler MAPL.history
MAPL.ExtData ${EXTDATA2G_TARGET} TYPE ${MAPL_LIBRARY_TYPE})
target_link_libraries (${this} PUBLIC GFTL::gftl GFTL_SHARED::gftl-shared esmf NetCDF::NetCDF_Fortran
target_link_libraries (${this} PUBLIC GFTL::gftl GFTL_SHARED::gftl-shared ESMF::ESMF NetCDF::NetCDF_Fortran
PRIVATE MPI::MPI_Fortran
$<$<BOOL:${BUILD_WITH_FLAP}>:FLAP::FLAP>
$<$<BOOL:${BUILD_WITH_FARGPARSE}>:FARGPARSE::fargparse>)
Expand Down
2 changes: 1 addition & 1 deletion gridcomps/ExtData/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set (srcs

esma_add_library (${this} SRCS ${srcs} DEPENDENCIES MAPL.shared MAPL.constants MAPL.base MAPL.generic MAPL.pfio
MAPL.griddedio MAPL_cfio_r4 TYPE ${MAPL_LIBRARY_TYPE})
target_link_libraries (${this} PUBLIC GFTL::gftl GFTL_SHARED::gftl-shared esmf NetCDF::NetCDF_Fortran
target_link_libraries (${this} PUBLIC GFTL::gftl GFTL_SHARED::gftl-shared ESMF::ESMF NetCDF::NetCDF_Fortran
PRIVATE MPI::MPI_Fortran)

# CMake has an OpenMP issue with NAG Fortran: https://gitlab.kitware.com/cmake/cmake/-/issues/21280
Expand Down
2 changes: 1 addition & 1 deletion gridcomps/ExtData2G/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ set (srcs


esma_add_library (${this} SRCS ${srcs} DEPENDENCIES MAPL.shared MAPL.base MAPL.generic MAPL.griddedio TYPE ${MAPL_LIBRARY_TYPE})
target_link_libraries (${this} PUBLIC GFTL::gftl GFTL_SHARED::gftl-shared esmf NetCDF::NetCDF_Fortran
target_link_libraries (${this} PUBLIC GFTL::gftl GFTL_SHARED::gftl-shared ESMF::ESMF NetCDF::NetCDF_Fortran
PRIVATE MPI::MPI_Fortran)
target_include_directories (${this} PUBLIC $<BUILD_INTERFACE:${MAPL_SOURCE_DIR}/include>)

Expand Down
2 changes: 1 addition & 1 deletion gridcomps/History/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ set (srcs

esma_add_library (${this} SRCS ${srcs} DEPENDENCIES MAPL.shared MAPL.constants MAPL.base MAPL.generic MAPL.profiler MAPL.griddedio
TYPE ${MAPL_LIBRARY_TYPE})
target_link_libraries (${this} PUBLIC GFTL::gftl GFTL_SHARED::gftl-shared esmf NetCDF::NetCDF_Fortran
target_link_libraries (${this} PUBLIC GFTL::gftl GFTL_SHARED::gftl-shared ESMF::ESMF NetCDF::NetCDF_Fortran
PRIVATE MPI::MPI_Fortran)

# CMake has an OpenMP issue with NAG Fortran: https://gitlab.kitware.com/cmake/cmake/-/issues/21280
Expand Down
2 changes: 1 addition & 1 deletion gridcomps/Orbit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set (srcs
)

esma_add_library (${this} SRCS ${srcs} DEPENDENCIES MAPL.shared MAPL.constants MAPL.base MAPL.generic TYPE ${MAPL_LIBRARY_TYPE})
target_link_libraries (${this} PUBLIC GFTL::gftl GFTL_SHARED::gftl-shared esmf NetCDF::NetCDF_Fortran
target_link_libraries (${this} PUBLIC GFTL::gftl GFTL_SHARED::gftl-shared ESMF::ESMF NetCDF::NetCDF_Fortran
PRIVATE MPI::MPI_Fortran)

# CMake has an OpenMP issue with NAG Fortran: https://gitlab.kitware.com/cmake/cmake/-/issues/21280
Expand Down
2 changes: 1 addition & 1 deletion griddedio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ set (srcs

esma_add_library (${this} SRCS ${srcs} DEPENDENCIES MAPL.shared MAPL.constants MAPL.base MAPL.pfio
MAPL_cfio_r4 TYPE ${MAPL_LIBRARY_TYPE})
target_link_libraries (${this} PUBLIC GFTL::gftl GFTL_SHARED::gftl-shared esmf NetCDF::NetCDF_Fortran
target_link_libraries (${this} PUBLIC GFTL::gftl GFTL_SHARED::gftl-shared ESMF::ESMF NetCDF::NetCDF_Fortran
PRIVATE MPI::MPI_Fortran)

# CMake has an OpenMP issue with NAG Fortran: https://gitlab.kitware.com/cmake/cmake/-/issues/21280
Expand Down
2 changes: 1 addition & 1 deletion pfunit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ set (srcs

esma_add_library (${this} EXCLUDE_FROM_ALL SRCS ${srcs} NOINSTALL TYPE ${MAPL_LIBRARY_TYPE})

target_link_libraries (${this} MAPL.shared PFUNIT::pfunit esmf NetCDF::NetCDF_Fortran)
target_link_libraries (${this} MAPL.shared PFUNIT::pfunit ESMF::ESMF NetCDF::NetCDF_Fortran)
set_target_properties (${this} PROPERTIES Fortran_MODULE_DIRECTORY ${include_${this}})

0 comments on commit e3f7293

Please sign in to comment.