Repository navigation
v5: Updates for FMS 2026.01.01, macOS and LLVM Flang fixes
This release updates ESMA_cmake to support FMS 2026.01.01 and includes major fixes and enhancements for macOS Darwin and LLVM Flang compilers.
NOTE: This MUST be used with ESMA-Baselibs v9.13.0 or higher
Key highlights:
- FMS 2026.01.01 CMake Integration:
ConfigureBaselibs.cmakenow uses FMS's installed CMake config package (find_package(fms)) rather than manually constructing targets, allowing modern transitive dependencies (such as YAML) to propagate to consumers automatically. Manuallibyamldiscovery and compile probes have been removed as FMS exports them directly. Support was also added for Baselibs directory layouts that install FMS CMake files tolib/cmake/fmsrather thanlib64/cmake/fms(common on Darwin). LegacyNETCDF_LIBRARIESis preserved for downstream tools likef2py. - Fortran Quad-Precision Detection: Centralized compiler probing (
quad_precision.F90) now tests whether the Fortran compiler supports 128-bit quad precision (selected_real_kind(33, 4931)). If unsupported (e.g. LLVM Flang on Darwin/Linux),NO_R16(used by CICE) andNO_QUAD_PRECISION(used by FVdycore) are defined globally so components fall back to 64-bit precision cleanly. - macOS & LLVM Flang Support: Defaults
BLA_VENDORtoGenericon Apple platforms when unset to link against macOS SDK BLAS/LAPACK stubs directly, avoiding unsupported framework flags with LLVM Flang and silencing case-mismatch warnings with NVPL on APFS. On Apple Silicon,LLVMFlang_Fortran.cmakenow passes-mcpu=apple-m1rather than-march=apple-m1. Furthermore,-fstack-arraysis omitted fromGEOS_Fortran_Release_Flagsso Flang uses its default heap allocation for array temporaries, avoiding stack overflows on platforms with restricted stack sizes. - Regression Testing:
compare_results()inesma_regression_run_helpers.cmakenow leveragesnccmp -dmfgsB(with--nans-are-equaland--tolerance) when available.
From CHANGELOG.md
Added
- In
compiler/checks/check_fortran_support.cmake, test for Fortran quad-precision floating point support (FORTRAN_COMPILER_SUPPORTS_QUAD_PRECISION). If unsupported (such as with LLVM Flang), globally define-DNO_R16 -DNO_QUAD_PRECISIONso components like CICE and FVdycore automatically fall back to 64-bit precision.
Changed
ConfigureBaselibs.cmakenow uses FMS's installed CMake config package instead of constructingFMS::fmsmanually, allowing its exported dependencies, including YAML, to propagate to consumers.- In
esma_regression_run_helpers.cmake,compare_results()now usesnccmp -dmfgsB(with optional--nans-are-equaland--tolerance) ifnccmpis available, falling back tocmp.
Removed
- Removed the FMS YAML compile probe,
Findlibyaml.cmake, and manual libyaml linkage; FMS 2026.01 and newer export YAML transitively through their CMake package.
Fixed
- Preserve Baselibs' legacy
NETCDF_LIBRARIESafter finding FMS so f2py and f2py3 modules continue to link NetCDF-Fortran and its static dependencies. - In
ConfigureBaselibs.cmake, support Baselibs installations on platforms like macOS (Darwin) that install FMS CMake configuration files intolib/cmake/fmsin addition tolib64/cmake/fms. - In
math_libraries.cmake, defaultBLA_VENDORtoGenericon Apple platforms if unset, using the system SDK'slibblas/liblapackto avoid unsupported framework compiler flags with LLVM Flang and prevent CMake from querying NVPL and triggering case-mismatch author warnings on case-insensitive filesystems. - In
compiler/flags/LLVMFlang_Fortran.cmake, use-mcpu=apple-m1instead of-march=apple-m1for Apple M processors, since LLVM Flang on AArch64 requires CPU names to be passed via-mcpu=rather than-march=. - In
compiler/flags/LLVMFlang_Fortran.cmake, omit-fstack-arraysfromGEOS_Fortran_Release_Flagsto allow Flang's default heap allocation for array temporaries, preventing stack overflows in routines with large automatic arrays (especially on platforms like macOS with fixed stack size limits).
What's Changed
- v5: Support nccmp in compare_results with tolerance and nans-are-equal options by @mathomp4 in #569
- Pass Fortran compiler ID into regression test run_case.cmake scripts by @pchakraborty in #571
- v5: Updates for FMS 2026.01.01 and macOS/Flang fixes by @mathomp4 in #574
- GitFlow: Merge develop into main for 9.13.0 release by @mathomp4 in #576
Full Changelog: v5.16.0...v5.17.0