-
Notifications
You must be signed in to change notification settings - Fork 693
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
Remove unneeded redundant HDF5 linking #1935
base: develop
Are you sure you want to change the base?
Conversation
The regression test results:
|
The regression test results after resolving the conflict:
|
@islas Perhaps there have been changes to the modules on derecho, or perhaps my process was different, but I didn't find any issues in compiling with option 32 on derecho with the current I seem to recall that there is an HDF5 implementation of WRF's I/O API, and it may be that the |
@mgduda These changes were made independent of #1923. Testing with current develop/master/ or where As that PR removes the in-situ modification of specifying HDF5 libraries for use with netCDF, I think it might still be worth considering this PR since this (the HDF5 linking code in question) is more or less dead code now. It does look like the HDF5 I/O API assumes to use the NETCDF4_DEP_LIB (here). Whether one was co-opted for the other or vice versa (I think the dep_libs variable (netCDF or not) just became a catch-all for dependencies), the current logic would not have been ideal when using both netCDF and HDF5 as it could potentially load different library versions. The take away here I think should be that the current system already assumed sourcing HDF5 from netCDF only (this may have been overlooked on my part when reviewing #1923) - if there is a use case reinstate support for HDF5 independent of netCDF then the current logic [prior to PR 1923] would only have sufficed in that context and not when both are present, and thus would need to have been revisited / rewritten regardless. My overarching question is then - should this PR be about removing the traces of hazardous in-situ linkage of HDF5 via co-opting netCDF dependencies (which no longer works), or repairing linkage to HDF5 I/O API when netCDF is not present in such a manner that it does play nicely when it is? I think both are perfectly valid PRs and push in the right direction, though I view the former as an incremental step to the latter, especially in light of #1923. |
@weiwangncar I think that is fine |
@islas I've changed the base branch for this PR to |
@mgduda ready for approval? |
960245e
to
569fb07
Compare
If I understand correctly, WRFDA sometimes requires HDF5 even outside of its use in the WRF I/O API; see the installation instructions. Would this PR affect compilation of WRFDA with HDF5 if the NetCDF libraries were build without HDF5 support? |
TYPE: bug fix
KEYWORDS: hdf5, relink, duplicate, netCDF
SOURCE: internal
DESCRIPTION OF CHANGES:
Problem:
HDF5 linking is handled separately by
HDF5
(configure)/sw_hdf5_path
(Config.pl) and is not required anymore. Even if netCDF has HDF5 compression, those libraries should be provided vianc-config --libs
ornf-config
equivalent. This default injection of HDF5 causes compilation to fail in environments that don't have HDF5 loaded in path, but would otherwise build fine (ex. Derecho, 32 (serial),module load gcc netcdf
).How does netCDF find HDF5 if it has HDF5 compression but no library is listed now?
nc-config
when used in its shared library format should dictate which HDF5 to use - Unidata/netcdf-c#1257 (comment). This is important to follow so as to avoid library splicing or overlinking if conflicting HDF5 libraries are specified. Note that this is accomplished viaRPATH
For static builds we would use
--libs --static
- Unidata/netcdf-c#1383. In that case one should provide their own locations for HDF5 and other dependent libraries.This all likely should be addressed for zlib AND most likely conflicts with specifying
HDF5
(configure) /HDF5_PATH
(configure) /sw_hdf5_path
(Config.pl). In the latter case, users probably have either (1) a difficult time building and are maybe not even using the HDF5 they expect, (2) can't build as desired, or (3) have non-HDF5 enabled netCDF to allow supplying their own HDF5 usage within WRF. Solving that issue is outside the scope of this bug and would require discussion of all the methods to supply alternate libraries and their respective benefits/costs.Solution:
Remove non-configurable use of
sw_hdf5
/$(HDF5)
LIST OF MODIFIED FILES: list of changed files (use
git diff --name-status master
to get formatted list)M arch/Config.pl
M arch/preamble
TESTS CONDUCTED:
module purge
, compile withmodule load gcc netcdf
and 32 (serial) should configure properlyRELEASE NOTE:
Remove default HDF5 library linking in lieu of netCDF-informed HDF5 linking