Skip to content

Rename internal ESMF time-manager library to libesmf_time in CMake builds - #1506

Merged
mgduda merged 1 commit into
MPAS-Dev:hotfix-v8.4.2from
eap:bugfix/external-esmf-fix
Sep 4, 2026
Merged

Rename internal ESMF time-manager library to libesmf_time in CMake builds#1506
mgduda merged 1 commit into
MPAS-Dev:hotfix-v8.4.2from
eap:bugfix/external-esmf-fix

Conversation

@eap

@eap eap commented Aug 27, 2026

Copy link
Copy Markdown

MPAS ships its own small ESMF time manager under src/external/esmf_time_f90. It isn't ESMF, it's a handful of stub routines that provide the clock and calendar interface MPAS needs. Until now it was built into a file called libesmf.so (or libesmf.a), which is exactly the name the real Earth System Modeling Framework uses.

This isn't a problem unless MPAS-model is built in an environment with the full ESMF library and other components dependent on it. When that happens there are two different files named libesmf.so causing conflicts either in MPAS or elsewhere. Usuaally get a bunch of lines like this

symbol lookup error: libmpas_framework.so: undefined symbol: esmf_stubs_mp_esmf_initialize_

This PR gives the MPAS-model library a unique name; esmf_time to prevent the conflict.

  • The build target is still named esmf, so everything that refers to it by that name inside mpas keeps working when referencing MPAS::external::esmf.
  • Nothing in MPAS or mpas-jedi refers to the library by its file name, so there's nothing else to update.

Once this is accepted into develop I'll make a cherry pick for the 8.4.2 hotfix branch so it can get added to the 8.4.2 release.

Fixes: https://github.com/JCSDA-internal/mpas-jedi/issues/919

Comment thread src/external/esmf_time_f90/CMakeLists.txt Outdated
@eap
eap requested a review from jim-p-w August 28, 2026 20:42
Comment thread src/external/esmf_time_f90/CMakeLists.txt Outdated
@eap
eap requested a review from jim-p-w August 28, 2026 22:01

@jim-p-w jim-p-w left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks for finding this bug!

@eap

eap commented Sep 1, 2026

Copy link
Copy Markdown
Author

Anything blocking this merge?

@mgduda

mgduda commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

@eap I think we can target the hotfix-v8.4.2 branch with this PR. That will get the fix into the upcoming v8.4.2 bug-fix release, and the fixes from that release will subsequently be merged to the develop branch.

The library built from src/external/esmf_time_f90 contains MPAS's bundled
ESMF time-manager stubs, not the full ESMF. Naming the output file libesmf
lets the dynamic loader substitute a real ESMF library found via
LD_LIBRARY_PATH, which breaks every MPAS executable.

Set the target's OUTPUT_NAME to esmf_time so the library is built and
installed as libesmf_time.{so,a}, resolving the name conflict. The CMake
target and alias names are unchanged.
@eap
eap force-pushed the bugfix/external-esmf-fix branch from 2309e70 to 4927a8b Compare September 2, 2026 21:27
@eap
eap changed the base branch from develop to hotfix-v8.4.2 September 2, 2026 21:27
@eap

eap commented Sep 2, 2026

Copy link
Copy Markdown
Author

@mgduda - I updated the base branch and re-targeted the PR; this pull request is now targeting the hotfix-v8.4.2 branch

@mgduda

mgduda commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

@mgduda - I updated the base branch and re-targeted the PR; this pull request is now targeting the hotfix-v8.4.2 branch

@eap Thanks! We're dealing with some HPC downtime right now, but I expect we can get this merged tomorrow. The v8.4.2 release should (hopefully!) be out within a week.

@mgduda mgduda added bug fix Build System Changes related to the build system, either `Make` or `CMake`. labels Sep 3, 2026
@mgduda mgduda changed the title Rename internal ESMF time-manager library to libmpas_esmf_time Rename internal ESMF time-manager library to libesmf_time in CMake builds Sep 3, 2026
@mgduda
mgduda merged commit 301c1d3 into MPAS-Dev:hotfix-v8.4.2 Sep 4, 2026
mgduda added a commit that referenced this pull request Sep 4, 2026
This merge addresses several issues in the MPAS-Atmosphere model and in the MPAS
infrastructure. Specific changes include:

 * Fix an issue with the naming of MPAS's internal ESMF time-keeping library in
   CMake builds of MPAS. (PR #1506)

 * Fix an issue with restart runs in MPAS-Atmosphere on GPUs. (PR #1503)

 * Address a lack of TKE in MPAS-Atmosphere with the 1.5-order prognostic TKE
   option when there is no TKE in the initial conditions (for example, in
   real-data cases). (PR #1499)

 * Correct the ordering of the 'lbc_ni' and 'lbc_nr' scalars in the atmosphere
   core's Registry.xml file. Note that unless LBCs are provided for 'ni' and
   'nr', the previously incorrect order of 'lbc_ni' and 'lbc_nr' would not
   affect results, as both fields would be filled with zero values. (PR #1498)

 * Change the default value of the config_number_of_sub_steps namelist option
   from 2 to 4 in the atmosphere core's Registry.xml file to address an issue in
   convection-permitting simulations where noise can sometimes appear in the jet
   streams using the previous default value of 2. The noise, when present, also
   produces unphysical features in horizontal kinetic energy spectra at high
   wavenumbers. (PR #1496)

   Note: Increasing the number of sub-steps from 2 to 4 can be expected to
   increase the computational cost of the dynamics by ~10% and the
   computational cost of a full-physics simulation by ~5%.

 * Work around an issue with continuation lines in instances of the
   PACKAGE_LOGIC_PRINT macro that prevented successful compilation of
   MPAS-Atmosphere with the 'nvfortran' compiler. (PR #1495)

* hotfix-v8.4.2:
  Rename bundled ESMF time-manager library output to esmf_time
  Fix for GPU-enabled restart runs
  Correct order of lbc_ni and lbc_nr in the atmosphere core's Registry.xml file
  add minimum value for Kh and Kv to allow for zero initial tke
  Change default value of atmosphere core config_number_of_sub_steps from 2 to 4
  Work around nvfortran issue with continuation lines in PACKAGE_LOGIC_PRINT macro
  Update version number to 8.4.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug fix Build System Changes related to the build system, either `Make` or `CMake`.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants