From a6c2501c4071522ae0b8631f606aac5fae62311e Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Wed, 9 Oct 2024 11:58:18 -0400 Subject: [PATCH 1/3] Add ability to use MAPL as a library --- CMakeLists.txt | 7 ++++++- components.yaml | 2 ++ src/Shared/CMakeLists.txt | 8 +++++++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index dace94cb..4b64ea4c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.17) +cmake_minimum_required (VERSION 3.23) cmake_policy (SET CMP0053 NEW) cmake_policy (SET CMP0054 NEW) @@ -91,6 +91,11 @@ if (NOT Baselibs_FOUND) # endif () # ################################################# + find_package(MAPL 2.49 QUIET) + if (MAPL_FOUND) + message(STATUS "Found MAPL: ${MAPL_BASE_DIR} (found version \"${MAPL_VERSION})\"") + endif () + endif () ecbuild_declare_project() diff --git a/components.yaml b/components.yaml index 7b6cc643..142d0439 100644 --- a/components.yaml +++ b/components.yaml @@ -39,6 +39,8 @@ GEOS_Util: tag: v2.1.2 develop: main +# When updating the MAPL version, also update the MAPL version in the +# CMakeLists.txt file for non-Baselibs builds MAPL: local: ./src/Shared/@MAPL remote: ../MAPL.git diff --git a/src/Shared/CMakeLists.txt b/src/Shared/CMakeLists.txt index dbb6c28b..439c8228 100644 --- a/src/Shared/CMakeLists.txt +++ b/src/Shared/CMakeLists.txt @@ -1,9 +1,15 @@ esma_add_subdirectories ( - MAPL GMAO_Shared NCEP_Shared ) +if (NOT MAPL_FOUND) + message (STATUS "External MAPL library not found. Building MAPL from source.") + esma_add_subdirectory (MAPL) +else () + message (STATUS "MAPL library found. Using MAPL from ${MAPL_BASE_DIR}") +endif () + if (NOT FMS_FOUND) message (STATUS "FMS library not found. Building FMS from source.") # Special case - FMS is built twice with two From da9b36ad07ab2fbf7c261ceb69cbd14b4b089406 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Thu, 10 Oct 2024 11:29:36 -0400 Subject: [PATCH 2/3] Update to ESMA_cmake v3.52.0 --- README.md | 2 +- components.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 55ad4945..a6404123 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ | [CICE](https://github.com/GEOS-ESM/CICE) | [geos/v0.2.0](https://github.com/GEOS-ESM/CICE/releases/tag/geos%2Fv0.2.0) | | [CPLFCST_Etc](https://github.com/GEOS-ESM/CPLFCST_Etc) | [v1.0.1](https://github.com/GEOS-ESM/CPLFCST_Etc/releases/tag/v1.0.1) | | [ecbuild](https://github.com/GEOS-ESM/ecbuild) | [geos/v1.4.0](https://github.com/GEOS-ESM/ecbuild/releases/tag/geos%2Fv1.4.0) | -| [ESMA_cmake](https://github.com/GEOS-ESM/ESMA_cmake) | [v3.51.0](https://github.com/GEOS-ESM/ESMA_cmake/releases/tag/v3.51.0) | +| [ESMA_cmake](https://github.com/GEOS-ESM/ESMA_cmake) | [v3.52.0](https://github.com/GEOS-ESM/ESMA_cmake/releases/tag/v3.52.0) | | [ESMA_env](https://github.com/GEOS-ESM/ESMA_env) | [v4.29.0](https://github.com/GEOS-ESM/ESMA_env/releases/tag/v4.29.0) | | [FMS](https://github.com/GEOS-ESM/FMS) | [geos/2019.01.02+noaff.10](https://github.com/GEOS-ESM/FMS/releases/tag/geos%2F2019.01.02%2Bnoaff.10) | | [FVdycoreCubed_GridComp](https://github.com/GEOS-ESM/FVdycoreCubed_GridComp) | [v2.12.0](https://github.com/GEOS-ESM/FVdycoreCubed_GridComp/releases/tag/v2.12.0) | diff --git a/components.yaml b/components.yaml index 142d0439..38ef7362 100644 --- a/components.yaml +++ b/components.yaml @@ -11,7 +11,7 @@ env: cmake: local: ./@cmake remote: ../ESMA_cmake.git - tag: v3.51.0 + tag: v3.52.0 develop: develop ecbuild: From 3a117151549b3f88ab07506229186e34a4266a74 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Thu, 10 Oct 2024 11:32:50 -0400 Subject: [PATCH 3/3] Remove FMS bits in CMake --- CMakeLists.txt | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4b64ea4c..e6f4823d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -80,17 +80,6 @@ if (NOT Baselibs_FOUND) # Another issue with historical reasons, old/wrong zlib target used in GEOS add_library(ZLIB::zlib ALIAS ZLIB::ZLIB) - # Using FMS from spack requires updates to fvdycore due to interface changes - # in FMS 2022. This is commented for now until this transition can occur. - ################################################# - # find_package(FMS QUIET COMPONENTS R4 R8) # - # if (FMS_FOUND) # - # # We need aliases due to historical reasons # - # add_library(fms_r4 ALIAS FMS::fms_r4) # - # add_library(fms_r8 ALIAS FMS::fms_r8) # - # endif () # - ################################################# - find_package(MAPL 2.49 QUIET) if (MAPL_FOUND) message(STATUS "Found MAPL: ${MAPL_BASE_DIR} (found version \"${MAPL_VERSION})\"")