v4: External library refactoring and configurable ESMF versioning
This release refactors external library configuration and improves build system stability across multi-package environments. Target creation for NetCDF, HDF5, ESMF, and FMS is now modularized into ConfigureBaselibs.cmake and ConfigureExternalLibraries.cmake, which esma.cmake includes automatically based on Baselibs_FOUND to eliminate redundant find_package boilerplate in downstream projects. Additionally, ESMF minimum version gating is now configurable via ESMA_ESMF_MIN_VERSION (default 8.6.1), allowing projects like MAPL3 to easily specify higher ESMF requirements before include(esma) while maintaining consistent version enforcement across Baselibs and Spack builds.
Toolchain and build stability fixes include suppressing compiler -save-temps in Ninja Debug builds to prevent parallel compile collisions, guarding ZLIB::zlib target aliases against duplicate declarations (e.g. from zlib-ng), and gating FMS lookups on FV_PRECISION so non-FMS libraries like MAPL can configure without requiring FMS. Finally, this release introduces the copy_restarts() helper function in esma_regression_run_helpers.cmake for regression testing and updates GitHub Actions workflow dependencies to current major versions.
From CHANGELOG.md
Fixed
- Suppress compiler
-save-tempsin Debug builds generated with Ninja, because Intel and GNU Fortran compilers write these intermediates in the shared build working directory using the source basename, allowing parallel compile rules for files such asAPI.F90to overwrite one another - In
external_libraries/FindESMF.cmake, keep ESMF wrapper link options inINTERFACE_LINK_OPTIONSrather than treating them as libraries, allowing CMake to de-duplicate shared linker flags while preserving ESMF's link setup - In
ConfigureExternalLibraries.cmake, guard the historicalZLIB::zlibalias creation withif(NOT TARGET ZLIB::zlib); some ZLIB providers (e.g. zlib-ng's CMake config package) already export a target with that exact name - In
ConfigureExternalLibraries.cmake, only look for FMS viafind_packagewhenFV_PRECISIONis defined. Library projects like MAPL don't use FMS and don't setFV_PRECISION, so they no longer require it; this mirrors the existingFV_PRECISIONconvention already used inConfigureBaselibs.cmakefor the Baselibs case - In
ConfigureBaselibs.cmake, enforce a minimum ESMF version (matchingConfigureExternalLibraries.cmake) by checkingESMF_VERSIONexplicitly, since Baselibs'esmf.mkhas no CMake-style version string forfind_package()to check
Removed
- Removed dependency-target creation (NetCDF, HDF5, ESMF, FMS, etc.) from
external_libraries/FindBaselibs.cmake; it now only locatesBASEDIRand setsBaselibs_FOUND
Added
- Added
ESMA_ESMF_MIN_VERSIONvariable, settable by a downstream project beforeinclude(esma), to control the minimum ESMF version required byConfigureBaselibs.cmake/ConfigureExternalLibraries.cmake(defaults to8.6.1if unset). This lets projects with newer ESMF requirements (e.g. MAPL3 requiring 9.0.0) avoid needing their own version-guard boilerplate - Added
external_libraries/ConfigureBaselibs.cmaketo create the NetCDF/HDF5/ESMF/FMS dependency targets when building against a Baselibs installation (Baselibs_FOUND) - Added
external_libraries/ConfigureExternalLibraries.cmaketo create the same dependency targets viafind_packagewhen dependencies are supplied by Spack or another non-Baselibs package manager - Added
copy_restarts()function toesma_regression_run_helpers.cmaketo copy per-checkpoint restart subdirectories (excludinglast) from a run'scheckpointsdirectory into the experiment directory, for use in regression test comparisons.
Changed
- Update GitHub Actions workflow dependencies to use the current major versions of
actions/checkoutandactions/upload-artifact - Split external library configuration out of
FindBaselibs.cmakeintoConfigureBaselibs.cmakeandConfigureExternalLibraries.cmake.esma.cmakenowinclude()s the appropriate one automatically based onBaselibs_FOUNDright after includingFindBaselibs, so top-level projects no longer need to duplicate the non-Baselibsfind_packagecalls in their ownCMakeLists.txt
What's Changed
- v4: Add copy_restarts helper for regression tests by @pchakraborty in #562
- v4: Split external library configuration out of FindBaselibs.cmake by @mathomp4 in #559
Full Changelog: v4.42.0...v4.43.0