diff --git a/.circleci/config.yml b/.circleci/config.yml index 8d091c7..2145f46 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@6 workflows: build-test: diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 7696a7d..72178b5 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: @@ -27,6 +27,11 @@ jobs: cmake-build-type: ${{ matrix.build-type }} 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 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: uses: GEOS-ESM/CI-workflows/.github/workflows/spack_gcc_build.yml@project/geosgcm diff --git a/CHANGELOG.md b/CHANGELOG.md index 795f249..0e5718c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,16 @@ 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) +- Update CI to use Baselibs v9.0.0 + ## [4.28.0] - 2025-10-17 ### Changed 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)