Skip to content

Commit

Permalink
Merge pull request #366 from climbfuji/bugfix/hdf5_debug_jcsda_emc_sp…
Browse files Browse the repository at this point in the history
…ack_stack

Add symlinks for hdf5 library names when built in debug mode (cherry-picked from spack spack#40965)
  • Loading branch information
climbfuji authored Nov 10, 2023
2 parents 2170595 + fb0829d commit 4ac3371
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions var/spack/repos/builtin/packages/hdf5/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,17 @@ def fix_package_config(self):
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):
Expand Down

0 comments on commit 4ac3371

Please sign in to comment.