Skip to content
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

Add nceplibs to libgfsphys.so #19

Merged
merged 1 commit into from
Nov 21, 2017
Merged

Add nceplibs to libgfsphys.so #19

merged 1 commit into from
Nov 21, 2017

Conversation

climbfuji
Copy link
Collaborator

This PR adds the NCEP LIBS to the compile/link command for libgfsphys.so. If these are not linked in, the code aborts because of undefined symbols in the library.

…not linked

in, the code aborts because of undefined symbols in the library
@llpcarson
Copy link
Contributor

Dom - I'm a bit confused by this change. You're including the nceplibs in the build of the libgfsphys.so? And, the location of that lib is added to the LD_LIBRARY_PATH. But, how does that help the executable find the nceplib routines at run-time?

@climbfuji
Copy link
Collaborator Author

@llpcarson the ncep libs are all static libraries and linked into libgfsphys.so at compile time. This PR doesn't change the LD_LIBRARY_PATH, are you referring to another PR or already existing code? In any case, if the ncep libs are not added to the linker line as described here in the PR, running the model fails: once ccpp loads libgfsphys,.so using dlopen(), it aborts because of undefined symbols (mainly from the w3 libraries)

@llpcarson
Copy link
Contributor

That's definitely an issue - but I thought we (Julie, Tim & I) solved this last summer by using the -Bexport_all_symbols at link time. This may be a more specific way to solve the same issue - but I'm confused about how the executable knows to search this lib (libgfsphys.so) after the ccpp loads the referenced routines. Oh wait - is the ccpp loading the entire library? I had assumed (!) that it was specifically only loading those needed by the suite. But, that wouldn't work, actually.

So - this is one way to solve the dependent libs issue, and probably a better way for a "stand-alone" release. I hope, though, in the longer term that we can reference pre-built libs on the NOAA platforms and not be in the business of supporting the libs for all users - which would then need to use something like -Bexport_all_symbols.

@climbfuji
Copy link
Collaborator Author

Ok, now I am a bit confused ... the -Bexport_all_symbols is still there, but as I said when trying to run the code it aborts, because it can't find certain symbols (such as stuff from w3 lib). What happens I believe is that the dlopen() does stuff independently of the main executable (which might have all the symbols) and treats libgfsphys.so as one entity that needs to contain all information. And I thought that we had agreed last week that it is better to ship the thirdparty libraries (aka NCEP libs) with the code - eventually even including esmf, so that we only rely on a compiler, mpi and netcdf library being present. But we can for sure discuss this later.

Copy link
Contributor

@llpcarson llpcarson left a comment

Choose a reason for hiding this comment

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

Approved.

@llpcarson
Copy link
Contributor

llpcarson commented Nov 21, 2017 via email

@climbfuji climbfuji merged commit f87010f into NCAR:features/ccpp Nov 21, 2017
@climbfuji climbfuji deleted the add_nceplibs_to_libgfsphys branch November 21, 2017 18:51
SamuelTrahanNOAA pushed a commit to SamuelTrahanNOAA/ccpp-physics that referenced this pull request Apr 3, 2020
…st_code

Updates to MYNN surface layer scheme (# 17 - based on latest code)
hannahcbarnes pushed a commit to hannahcbarnes/ccpp-physics that referenced this pull request Apr 28, 2020
Bug fixes to 3D diagnostic tendencies (based on NCAR#15)
SMoorthi-emc pushed a commit to SMoorthi-emc/ccpp-physics that referenced this pull request Nov 8, 2022
Modify the Thompson scheme to improve radiative fluxes and cloud cover for HR1
dustinswales pushed a commit that referenced this pull request Feb 8, 2023
Qingfu-Liu pushed a commit to Qingfu-Liu/ccpp-physics that referenced this pull request May 23, 2024
Add optional attribute to Fortran files.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants