-
Notifications
You must be signed in to change notification settings - Fork 261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Heads up: future versions of spack-stack (1.7.0+) will have shared+static ESMF and MAPL libraries #2094
Comments
Note: I'm going to look at fixing up MAPL to be "safe". That is, if ESMF is only static, or if a user chooses to link to the ESMF static library, then MAPL is forced to be built as static (and vice versa). Of course, with spack this is fairly trivial with requirements and I'll look to make a PR to the MAPL package to effect this. But I sort of want to belt and suspender it so CMake has no choice. |
@climbfuji I am wondering about the scope of cmake build system update needed. I mean something like a good starting point to add options like add_library(objlib OBJECT ${libsrc}) as STATIC or SHARED ? @DusanJovic-NOAA @junwang-noaa @BrianCurtis-NOAA There should be a good time period for testing enough, I think. |
@jkbk2004 I do not understand what you mean by "good starting point to add options like add_library(objlib OBJECT ${libsrc}) as STATIC or SHARED". Where should we add this? Can you please be a little bit more specific. Thanks. |
@DusanJovic-NOAA If I search STATIC build options, it shows
|
Those are all either definitions of imported targets in various find modules or local libraries. Are you suggesting that we change all local libraries (like ccpp_framework or cice oy hycom) to shared libraries? Why would we do that, what problem will that solve? If I understand correctly this issue is about adding esmf and mapl shared libraries in addition to static to spack-stack installation. The ufs-weather-model already links with many shared libraries from spack-stack, for example:
Once spack-stack installation with both static and shared version of esmf and mapl becomes available we can try to use it and if there are issues in 'finding' consistent versions of esmf and mapl, we'll just need to fix corresponding find modules or config-file package if provided by either of these two libraries. I do not see how this situation is different than for example hdf5 and netcdf, both of which provide static and shared libraries. |
I agree with Dusan, this is the best way to proceed. We can make a test stack available on Hercules/Orion pretty soon with both shared and static ESMF and MAPL and a few other features that have been requested for the next release. |
@DusanJovic-NOAA @climbfuji thanks for all the comment! |
@Hang-Lei-NOAA was this a potential cause to the problems you're seeing with these two libraries on WCOSS2? |
No , I don’t think so. The issue on wcoss2 are still old versions of libraries, but just changed results. Not failure. It could be caused by using modified netcdf. |
Description
This is a heads up that future versions of spack-stack (1.7.0+; 1.7.0 to be released in March 2024) will have both shared and static
esmf
andmapl
libraries. Until now, and including spack-stack-1.6.0, we turned off the shared builds ofesmf
andmapl
because of the following reason:If
esmf
is static, thenmapl
needs to be static. Ifesmf
is shared, thenmapl
needs to be shared. Violate these requirements and you'll be hit withdouble-free corruption
segmentation faults when an executable unwinds its stack upon exit (see JCSDA/spack#372 and esmf-org/esmf#209 for more information). Historically, the UFS wants everything to be static, so this was the configuration in spack-stack until now.spack-stack however needs to support more than just the UFS, and other modeling systems such as GEOS rely on dynamic libraries rather than static libraries. There is no reason why we should restrict the
esmf
build to static only because of the UFS. If the UFS requires a staticesmf
, but its build system uses the shared version when both are available, then the UFS needs to be fixed (not spack-stack trimmed down to staticesmf
). Similar story formapl
.Solution
The UFS build system needs to be updated so that it uses/prefers the static versions of
esmf
andmapl
if found.Alternatives
Not fixing the UFS build system means being unable to update to spack-stack-1.7.0 and later versions.
Related to
The text was updated successfully, but these errors were encountered: