From 6254f03c58fdd0d258377e4a0c080786f5cc7021 Mon Sep 17 00:00:00 2001 From: Evan Parker Date: Thu, 27 Aug 2026 22:37:55 +0000 Subject: [PATCH 1/4] Rename internal ESMF time-manager library to libmpas_esmf_time MPAS's bundled ESMF time manager (src/external/esmf_time_f90, built from ESMF_Stubs.F90 and friends) was installed as libesmf.{so,a} -- the same file name used by the real Earth System Modeling Framework. The two libraries share nothing but the name: MPAS's exports 12 esmf_stubs_* symbols and zero real ESMF symbols. When MPAS is built inside an environment that also provides real ESMF -- any module-based HPC software stack, spack-stack included -- both appear on the loader search path under the same SONAME. LD_LIBRARY_PATH is searched before DT_RUNPATH, so the module-provided real ESMF is loaded in place of these stubs, even though the executable's own RUNPATH ($ORIGIN/../lib) points at the correct file. Every MPAS and mpas-jedi executable then aborts at startup with symbol lookup error: libmpas_framework.so: undefined symbol: esmf_stubs_mp_esmf_initialize_ Setting OUTPUT_NAME removes the collision. The CMake target keeps the name `esmf`, so MPAS/CMakeLists.txt, the ${PROJECT_NAME}::external::esmf alias, the MPASExportsExternal export set, and downstream consumers that alias the same target (mpas-jedi/CMakeLists.txt) are all unaffected -- only the on-disk file name changes. Nothing in MPAS or mpas-jedi refers to -lesmf or libesmf by name. Verified on Ubuntu 24.04 with Intel oneAPI 2025.3 against spack-stack 2.1.1 providing esmf@8.9.1, using JCSDA jedi-bundle 8.0.0. --- src/external/esmf_time_f90/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/external/esmf_time_f90/CMakeLists.txt b/src/external/esmf_time_f90/CMakeLists.txt index 6546880fb4..6948ba1b99 100644 --- a/src/external/esmf_time_f90/CMakeLists.txt +++ b/src/external/esmf_time_f90/CMakeLists.txt @@ -22,6 +22,11 @@ add_library(esmf ${_esmf_time_src}) mpas_fortran_target(esmf) add_library(${PROJECT_NAME}::external::esmf ALIAS esmf) +# This library is MPAS's bundled ESMF time-manager stubs, not real ESMF. Naming the +# file libesmf lets the loader substitute a real ESMF found via LD_LIBRARY_PATH, +# breaking every MPAS executable. The target keeps its name: it is aliased/exported. +set_target_properties(esmf PROPERTIES OUTPUT_NAME mpas_esmf_time) + target_compile_definitions(esmf PRIVATE HIDE_MPI=1) target_include_directories(esmf PUBLIC $) From d13071b15a50a3adf368bc29891a4e5a1d51a6d2 Mon Sep 17 00:00:00 2001 From: Evan Parker Date: Fri, 28 Aug 2026 14:41:44 -0600 Subject: [PATCH 2/4] Update ESMF library naming and properties --- src/external/esmf_time_f90/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/external/esmf_time_f90/CMakeLists.txt b/src/external/esmf_time_f90/CMakeLists.txt index 6948ba1b99..8c4a72d4d6 100644 --- a/src/external/esmf_time_f90/CMakeLists.txt +++ b/src/external/esmf_time_f90/CMakeLists.txt @@ -22,10 +22,10 @@ add_library(esmf ${_esmf_time_src}) mpas_fortran_target(esmf) add_library(${PROJECT_NAME}::external::esmf ALIAS esmf) -# This library is MPAS's bundled ESMF time-manager stubs, not real ESMF. Naming the +# This library is MPAS's bundled ESMF time-manager stubs, not the full ESMF. Naming the # file libesmf lets the loader substitute a real ESMF found via LD_LIBRARY_PATH, -# breaking every MPAS executable. The target keeps its name: it is aliased/exported. -set_target_properties(esmf PROPERTIES OUTPUT_NAME mpas_esmf_time) +# breaking every MPAS executable. The target changes the alias to "libesmf_time". +set_target_properties(esmf PROPERTIES OUTPUT_NAME libesmf_time) target_compile_definitions(esmf PRIVATE HIDE_MPI=1) From c607b4ef949159fae0b1d136d98abd5f4f4b163c Mon Sep 17 00:00:00 2001 From: Evan Parker Date: Fri, 28 Aug 2026 16:01:02 -0600 Subject: [PATCH 3/4] Rename output library from libesmf_time to esmf_time --- src/external/esmf_time_f90/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/external/esmf_time_f90/CMakeLists.txt b/src/external/esmf_time_f90/CMakeLists.txt index 8c4a72d4d6..734597e3ec 100644 --- a/src/external/esmf_time_f90/CMakeLists.txt +++ b/src/external/esmf_time_f90/CMakeLists.txt @@ -25,7 +25,7 @@ add_library(${PROJECT_NAME}::external::esmf ALIAS esmf) # This library is MPAS's bundled ESMF time-manager stubs, not the full ESMF. Naming the # file libesmf lets the loader substitute a real ESMF found via LD_LIBRARY_PATH, # breaking every MPAS executable. The target changes the alias to "libesmf_time". -set_target_properties(esmf PROPERTIES OUTPUT_NAME libesmf_time) +set_target_properties(esmf PROPERTIES OUTPUT_NAME esmf_time) target_compile_definitions(esmf PRIVATE HIDE_MPI=1) From 2309e703223406f5e9865a47375abe3f39f75e23 Mon Sep 17 00:00:00 2001 From: Evan Parker Date: Fri, 28 Aug 2026 16:03:40 -0600 Subject: [PATCH 4/4] Rename esmf library output to libesmf_time Change the output name of the esmf library to avoid conflicts. --- src/external/esmf_time_f90/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/external/esmf_time_f90/CMakeLists.txt b/src/external/esmf_time_f90/CMakeLists.txt index 734597e3ec..d9a531886d 100644 --- a/src/external/esmf_time_f90/CMakeLists.txt +++ b/src/external/esmf_time_f90/CMakeLists.txt @@ -24,7 +24,8 @@ add_library(${PROJECT_NAME}::external::esmf ALIAS esmf) # This library is MPAS's bundled ESMF time-manager stubs, not the full ESMF. Naming the # file libesmf lets the loader substitute a real ESMF found via LD_LIBRARY_PATH, -# breaking every MPAS executable. The target changes the alias to "libesmf_time". +# breaking every MPAS executable. Changing the output name results in the library +# being installed as libesmf_time.{so,a} and resolves the name conflict. set_target_properties(esmf PROPERTIES OUTPUT_NAME esmf_time) target_compile_definitions(esmf PRIVATE HIDE_MPI=1)