From d9c5d91b6f633f1379f98f94da447e376c969ef0 Mon Sep 17 00:00:00 2001 From: Jon Rood Date: Mon, 10 Jun 2024 10:11:49 -0600 Subject: [PATCH] hdf5: solve cmake findhdf5 issue with hl components (#44423) * hdf5: solve cmake findhdf5 issue with hl components * Fix mistake. * Update var/spack/repos/builtin/packages/hdf5/package.py Co-authored-by: psakievich * Style. * Style. --------- Co-authored-by: psakievich --- var/spack/repos/builtin/packages/hdf5/package.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/var/spack/repos/builtin/packages/hdf5/package.py b/var/spack/repos/builtin/packages/hdf5/package.py index e235f8300fe..fd08a2d9be8 100644 --- a/var/spack/repos/builtin/packages/hdf5/package.py +++ b/var/spack/repos/builtin/packages/hdf5/package.py @@ -621,6 +621,18 @@ def link_debug_libs(self): libname = os.path.split(lib)[1] os.symlink(libname, libname.replace("_debug", "")) + @run_after("install") + def symlink_to_h5hl_wrappers(self): + if self.spec.satisfies("+hl"): + with working_dir(self.prefix.bin): + # CMake's FindHDF5 relies only on h5cc so it doesn't find the HL + # component unless it uses h5hlcc so we symlink h5cc to h5hlcc etc + symlink_files = {"h5cc": "h5lcc", "h5c++": "h5lc++"} + for old, new in symlink_files.items(): + if os.path.isfile(old): + os.remove(old) + symlink(new, old) + @property @llnl.util.lang.memoized def _output_version(self):