Add symlinks for hdf5 library names when built in debug mode (#40965)

* Add symlinks for hdf5 library names when built in debug mode
* Only apply bug fix for debug libs when build type is Debug
This commit is contained in:
Dom Heinzeller 2023-11-09 12:40:53 -07:00 committed by GitHub
parent 38f3f57a54
commit 4636a7f14f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -711,6 +711,17 @@ def fix_package_config(self):
if not os.path.exists(tgt_filename): if not os.path.exists(tgt_filename):
symlink(src_filename, tgt_filename) symlink(src_filename, tgt_filename)
@run_after("install")
def link_debug_libs(self):
# When build_type is Debug, the hdf5 build appends _debug to all library names.
# Dependents of hdf5 (netcdf-c etc.) can't handle those, thus make symlinks.
if "build_type=Debug" in self.spec:
libs = find(self.prefix.lib, "libhdf5*_debug.*", recursive=False)
with working_dir(self.prefix.lib):
for lib in libs:
libname = os.path.split(lib)[1]
os.symlink(libname, libname.replace("_debug", ""))
@property @property
@llnl.util.lang.memoized @llnl.util.lang.memoized
def _output_version(self): def _output_version(self):