From 39d623a971a7d24337bece534eae6f98e35cd7d1 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Wed, 15 Oct 2025 11:42:40 -0400 Subject: [PATCH 1/9] v12: Updates for mixed-precision FMS --- external_libraries/FindBaselibs.cmake | 99 +++++-------------- .../check_fms1_io_support.cmake | 9 +- 2 files changed, 27 insertions(+), 81 deletions(-) diff --git a/external_libraries/FindBaselibs.cmake b/external_libraries/FindBaselibs.cmake index 0b437fc..612e7a3 100644 --- a/external_libraries/FindBaselibs.cmake +++ b/external_libraries/FindBaselibs.cmake @@ -344,80 +344,31 @@ if (Baselibs_FOUND) message(STATUS "LIBYAML_LIBRARIES: ${LIBYAML_LIBRARIES}") endif () - # - fms_r4 - if (FV_PRECISION STREQUAL R4 OR FV_PRECISION STREQUAL R4R8) - # Use find_path and find_library to find the include and library - find_path(FMS_INCLUDE_DIR_R4 NAMES fms.mod PATHS ${BASEDIR}/FMS/include_r4) - find_library(FMS_LIBRARIES_R4 NAMES fms_r4 PATHS ${BASEDIR}/FMS/lib ${BASEDIR}/FMS/lib64) - # We also need the path of where the library is for the INTERFACE_LINK_DIRECTORIES - get_filename_component(FMS_LIBRARIES_DIR_R4 ${FMS_LIBRARIES_R4} DIRECTORY) - add_library(FMS::fms_r4 STATIC IMPORTED) - set_target_properties(FMS::fms_r4 PROPERTIES - IMPORTED_LOCATION ${FMS_LIBRARIES_R4} - INCLUDE_DIRECTORIES "${FMS_INCLUDE_DIR_R4}" - INTERFACE_INCLUDE_DIRECTORIES "${FMS_INCLUDE_DIR_R4}" - INTERFACE_LINK_LIBRARIES "NetCDF::NetCDF_Fortran;MPI::MPI_Fortran" - INTERFACE_LINK_DIRECTORIES "${FMS_LIBRARIES_DIR_R4}" - ) - if (FMS_BUILT_WITH_YAML) - target_link_libraries(FMS::fms_r4 INTERFACE ${LIBYAML_LIBRARIES}) - endif () - # We will set FMS_R4_FOUND if both FMS_LIBRARIES_R4 and FMS_INCLUDE_DIR_R4 are found - # and are valid files and directories respectively - if (EXISTS ${FMS_LIBRARIES_R4} AND IS_DIRECTORY ${FMS_INCLUDE_DIR_R4}) - message(STATUS "Found FMS::fms_r4: ${FMS_LIBRARIES_R4}") - message(STATUS "FMS::fms_r4 include directory: ${FMS_INCLUDE_DIR_R4}") - set(FMS_R4_FOUND TRUE CACHE BOOL "fms_r4 Found" FORCE) - else () - message(FATAL_ERROR "FMS::fms_r4 not found") - endif() - endif() - - # - fms_r8 - if (FV_PRECISION STREQUAL R8 OR FV_PRECISION STREQUAL R4R8) - # Use find_path and find_library to find the include and library - find_path(FMS_INCLUDE_DIR_R8 NAMES fms.mod PATHS ${BASEDIR}/FMS/include_r8) - find_library(FMS_LIBRARIES_R8 NAMES fms_r8 PATHS ${BASEDIR}/FMS/lib ${BASEDIR}/FMS/lib64) - # We also need the path of where the library is for the INTERFACE_LINK_DIRECTORIES - get_filename_component(FMS_LIBRARIES_DIR_R8 ${FMS_LIBRARIES_R8} DIRECTORY) - add_library(FMS::fms_r8 STATIC IMPORTED) - set_target_properties(FMS::fms_r8 PROPERTIES - IMPORTED_LOCATION ${FMS_LIBRARIES_R8} - INCLUDE_DIRECTORIES "${FMS_INCLUDE_DIR_R8}" - INTERFACE_INCLUDE_DIRECTORIES "${FMS_INCLUDE_DIR_R8}" - INTERFACE_LINK_LIBRARIES "NetCDF::NetCDF_Fortran;MPI::MPI_Fortran" - INTERFACE_LINK_DIRECTORIES "${FMS_LIBRARIES_DIR_R8}" - ) - if (FMS_BUILT_WITH_YAML) - target_link_libraries(FMS::fms_r8 INTERFACE ${LIBYAML_LIBRARIES}) - endif () - # We will set FMS_R8_FOUND if both FMS_LIBRARIES_R8 and FMS_INCLUDE_DIR_R8 are found - # and are valid files and directories respectively - if (EXISTS ${FMS_LIBRARIES_R8} AND IS_DIRECTORY ${FMS_INCLUDE_DIR_R8}) - message(STATUS "Found FMS::fms_r8: ${FMS_LIBRARIES_R8}") - message(STATUS "FMS::fms_r8 include directory: ${FMS_INCLUDE_DIR_R8}") - set(FMS_R8_FOUND TRUE CACHE BOOL "fms_r8 Found" FORCE) - else () - message(FATAL_ERROR "FMS::fms_r8 not found") - endif() - endif() - - if (FV_PRECISION STREQUAL R4R8) - # We will set FMS_FOUND if both fms_r4 and fms_r8 are found - # and are valid files and directories respectively - if (FMS_R4_FOUND AND FMS_R8_FOUND) - set(FMS_FOUND TRUE CACHE BOOL "FMS Found" FORCE) - endif() - elseif (FV_PRECISION STREQUAL R4) - if (FMS_R4_FOUND) - set(FMS_FOUND TRUE CACHE BOOL "FMS Found" FORCE) - endif() - elseif (FV_PRECISION STREQUAL R8) - if (FMS_R8_FOUND) - set(FMS_FOUND TRUE CACHE BOOL "FMS Found" FORCE) - endif() - else() - message(FATAL_ERROR "FMS Detection failed in odd way") + # - fms + # Use find_path and find_library to find the include and library + find_path(FMS_INCLUDE_DIR NAMES fms.mod PATHS ${BASEDIR}/FMS/include) + find_library(FMS_LIBRARIES NAMES fms PATHS ${BASEDIR}/FMS/lib ${BASEDIR}/FMS/lib64) + # We also need the path of where the library is for the INTERFACE_LINK_DIRECTORIES + get_filename_component(FMS_LIBRARIES_DIR ${FMS_LIBRARIES} DIRECTORY) + add_library(FMS::fms STATIC IMPORTED) + set_target_properties(FMS::fms PROPERTIES + IMPORTED_LOCATION ${FMS_LIBRARIES} + INCLUDE_DIRECTORIES "${FMS_INCLUDE_DIR}" + INTERFACE_INCLUDE_DIRECTORIES "${FMS_INCLUDE_DIR}" + INTERFACE_LINK_LIBRARIES "NetCDF::NetCDF_Fortran;MPI::MPI_Fortran" + INTERFACE_LINK_DIRECTORIES "${FMS_LIBRARIES_DIR}" + ) + if (FMS_BUILT_WITH_YAML) + target_link_libraries(FMS::fms INTERFACE ${LIBYAML_LIBRARIES}) + endif () + # We will set FMS_FOUND if both FMS_LIBRARIES and FMS_INCLUDE_DIR are found + # and are valid files and directories respectively + if (EXISTS ${FMS_LIBRARIES} AND IS_DIRECTORY ${FMS_INCLUDE_DIR}) + message(STATUS "Found FMS::fms: ${FMS_LIBRARIES}") + message(STATUS "FMS::fms include directory: ${FMS_INCLUDE_DIR}") + set(FMS_FOUND TRUE CACHE BOOL "fms Found" FORCE) + else () + message(FATAL_ERROR "FMS::fms not found") endif() if (FMS_FOUND) diff --git a/external_libraries/check_fms1_io_support.cmake b/external_libraries/check_fms1_io_support.cmake index c96250c..6cd9539 100644 --- a/external_libraries/check_fms1_io_support.cmake +++ b/external_libraries/check_fms1_io_support.cmake @@ -3,12 +3,7 @@ set(_CHECK_FMS1_IO_SUPPORT_DIR "${CMAKE_CURRENT_LIST_DIR}") macro(check_fms1_io_support result_var) # Get include directories from the FMS target - # We default to FMS::fms_r4 - set(FMS_TARGET FMS::fms_r4) - # but if FV_PRECISION is set to R8, we use FMS::fms_r8 - if(FV_PRECISION STREQUAL R8) - set(FMS_TARGET FMS::fms_r8) - endif() + set(FMS_TARGET FMS::fms) get_target_property(FMS_INCLUDE_DIRS ${FMS_TARGET} INTERFACE_INCLUDE_DIRECTORIES) # Handle cases where properties might not be set @@ -24,7 +19,7 @@ macro(check_fms1_io_support result_var) # Save the current value set(_SAVED_CMAKE_TRY_COMPILE_TARGET_TYPE ${CMAKE_TRY_COMPILE_TARGET_TYPE}) - + # Set to static library (compile only, no linking) set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) From 2d78ced6b17db8be61bbc4ba7a87c49b99874730 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Mon, 3 Nov 2025 08:50:52 -0500 Subject: [PATCH 2/9] Update changelog for v5 release --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 795f249..a4f0709 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Deprecated +## [5.0.0] - 2025-11-03 + +### Changed + +- Update FMS detection and use for FMS 2025 support + - FMS 2025 is now built in multi-precision support so that we have `FMS::fms` targets and not the separate `FMS::fms_r4` and `FMS::fms_r8` targets + - Because of this change, we update the major version number to 5.0.0 + - Requires Baselibs v9.0.0 or higher (which has FMS 2025) + ## [4.28.0] - 2025-10-17 ### Changed From c1e818624cbd30582378fd2100350a643d57a279 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Mon, 3 Nov 2025 09:15:07 -0500 Subject: [PATCH 3/9] Update CI to use Baselibs 9.0.0 --- .circleci/config.yml | 4 ++-- .github/workflows/workflow.yml | 1 + CHANGELOG.md | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8d091c7..811c877 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,11 +1,11 @@ version: 2.1 # Anchors in case we need to override the defaults from the orb -#baselibs_version: &baselibs_version v8.18.0 +#baselibs_version: &baselibs_version v9.0.0 #bcs_version: &bcs_version v12.0.0 orbs: - ci: geos-esm/circleci-tools@5 + ci: geos-esm/circleci-tools@dev:0c1043b737b0a5d8ced06a7ef52ffe57207a79c4 workflows: build-test: diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 7696a7d..e91ca5d 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -27,6 +27,7 @@ jobs: cmake-build-type: ${{ matrix.build-type }} fixture-repo: GEOS-ESM/GEOSgcm fixture-ref: feature/sdrabenh/gcm_v12 + baselibs-version: v9.0.0 spack_build: uses: GEOS-ESM/CI-workflows/.github/workflows/spack_gcc_build.yml@project/geosgcm diff --git a/CHANGELOG.md b/CHANGELOG.md index a4f0709..0e5718c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - FMS 2025 is now built in multi-precision support so that we have `FMS::fms` targets and not the separate `FMS::fms_r4` and `FMS::fms_r8` targets - Because of this change, we update the major version number to 5.0.0 - Requires Baselibs v9.0.0 or higher (which has FMS 2025) +- Update CI to use Baselibs v9.0.0 ## [4.28.0] - 2025-10-17 From 6d3fade63fdae83cea83a02b42bd0120741a9647 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Mon, 3 Nov 2025 09:17:35 -0500 Subject: [PATCH 4/9] Remove gfortran-14 tests --- .github/workflows/workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index e91ca5d..9d96f57 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -19,7 +19,7 @@ jobs: build_gcm: strategy: matrix: - compiler: [ifort, gfortran-14, gfortran-15] + compiler: [ifort, gfortran-15] build-type: [Debug] uses: GEOS-ESM/CI-workflows/.github/workflows/geosgcm_build_tests.yml@project/geosgcm with: From 8ea43c4a54ea46d55fd7f204ad18adfd42f31188 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Mon, 3 Nov 2025 09:49:27 -0500 Subject: [PATCH 5/9] Do not run mepo develop --- .github/workflows/workflow.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 9d96f57..3bbfe7a 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -28,6 +28,9 @@ jobs: fixture-repo: GEOS-ESM/GEOSgcm fixture-ref: feature/sdrabenh/gcm_v12 baselibs-version: v9.0.0 + # We need to not run mepo develop for now as it will "override" components + # that have been specifically checked out for the fixture + run-mepo-develop: false spack_build: uses: GEOS-ESM/CI-workflows/.github/workflows/spack_gcc_build.yml@project/geosgcm From 0e741b0d6460ae842df85bec59118a840141aebb Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Mon, 3 Nov 2025 10:09:35 -0500 Subject: [PATCH 6/9] Update fixture ref --- .github/workflows/workflow.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 3bbfe7a..c8c19b8 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -26,7 +26,8 @@ jobs: compiler: ${{ matrix.compiler }} cmake-build-type: ${{ matrix.build-type }} fixture-repo: GEOS-ESM/GEOSgcm - fixture-ref: feature/sdrabenh/gcm_v12 + #fixture-ref: feature/sdrabenh/gcm_v12 + fixture-ref: feature/v12-remove-mom5 baselibs-version: v9.0.0 # We need to not run mepo develop for now as it will "override" components # that have been specifically checked out for the fixture From 713f1bb03e24b8e1dd02d6a3f2283b9b07efb4b9 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Mon, 3 Nov 2025 10:20:49 -0500 Subject: [PATCH 7/9] Clarify comment --- .github/workflows/workflow.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index c8c19b8..cb2bda0 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -26,11 +26,11 @@ jobs: compiler: ${{ matrix.compiler }} cmake-build-type: ${{ matrix.build-type }} fixture-repo: GEOS-ESM/GEOSgcm - #fixture-ref: feature/sdrabenh/gcm_v12 - fixture-ref: feature/v12-remove-mom5 + fixture-ref: feature/sdrabenh/gcm_v12 baselibs-version: v9.0.0 # We need to not run mepo develop for now as it will "override" components - # that have been specifically checked out for the fixture + # that have been specifically checked out for the fixture. We will need + # to restore this once we have updated the fixture run-mepo-develop: false spack_build: From 778130bb16a0ad11714c3835873378351b1cfd88 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Mon, 3 Nov 2025 11:03:57 -0500 Subject: [PATCH 8/9] Clarify comment 2 --- .github/workflows/workflow.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index cb2bda0..72178b5 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -29,8 +29,8 @@ jobs: fixture-ref: feature/sdrabenh/gcm_v12 baselibs-version: v9.0.0 # We need to not run mepo develop for now as it will "override" components - # that have been specifically checked out for the fixture. We will need - # to restore this once we have updated the fixture + # that have been specifically put in components.yaml for this fixture. + # We'll need to undo this once we have updated the fixture run-mepo-develop: false spack_build: From 7e495cde52bb4b4df7943dd87522b9466e45a196 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Mon, 3 Nov 2025 11:36:30 -0500 Subject: [PATCH 9/9] Update to orb v6 --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 811c877..2145f46 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,7 +5,7 @@ version: 2.1 #bcs_version: &bcs_version v12.0.0 orbs: - ci: geos-esm/circleci-tools@dev:0c1043b737b0a5d8ced06a7ef52ffe57207a79c4 + ci: geos-esm/circleci-tools@6 workflows: build-test: