summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDom Heinzeller <dom.heinzeller@icloud.com>2023-11-09 12:40:53 -0700
committerGitHub <noreply@github.com>2023-11-09 11:40:53 -0800
commit4636a7f14fa9c1e31a61850667b8bd424a94d0c6 (patch)
tree876e2f6e61f8da91f177032eae6a0fe0b8134f7e
parent38f3f57a54381317bbce1c7974095b4ef6d7b856 (diff)
downloadspack-4636a7f14fa9c1e31a61850667b8bd424a94d0c6.tar.gz
spack-4636a7f14fa9c1e31a61850667b8bd424a94d0c6.tar.bz2
spack-4636a7f14fa9c1e31a61850667b8bd424a94d0c6.tar.xz
spack-4636a7f14fa9c1e31a61850667b8bd424a94d0c6.zip
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
-rw-r--r--var/spack/repos/builtin/packages/hdf5/package.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/hdf5/package.py b/var/spack/repos/builtin/packages/hdf5/package.py
index 0a3903e801..a9e0574877 100644
--- a/var/spack/repos/builtin/packages/hdf5/package.py
+++ b/var/spack/repos/builtin/packages/hdf5/package.py
@@ -711,6 +711,17 @@ class Hdf5(CMakePackage):
if not os.path.exists(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
@llnl.util.lang.memoized
def _output_version(self):