summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--var/spack/repos/builtin/packages/likwid/package.py18
1 files changed, 12 insertions, 6 deletions
diff --git a/var/spack/repos/builtin/packages/likwid/package.py b/var/spack/repos/builtin/packages/likwid/package.py
index 4398dd330f..f7ebb21048 100644
--- a/var/spack/repos/builtin/packages/likwid/package.py
+++ b/var/spack/repos/builtin/packages/likwid/package.py
@@ -188,12 +188,18 @@ class Likwid(Package):
"HWLOC_INCLUDE_DIR = {0}".format(spec["hwloc"].prefix.include),
"config.mk",
)
- filter_file(
- "^#HWLOC_LIB_DIR.*",
- "HWLOC_LIB_DIR = {0}".format(spec["hwloc"].prefix.lib),
- "config.mk",
- )
- filter_file("^#HWLOC_LIB_NAME.*", "HWLOC_LIB_NAME = hwloc", "config.mk")
+ ll = spec["hwloc"].libs
+ if len(ll.directories) > 0 and len(ll.names) > 0:
+ filter_file(
+ "^#HWLOC_LIB_DIR.*",
+ "HWLOC_LIB_DIR = {0}".format(ll.directories[0]),
+ "config.mk",
+ )
+ filter_file(
+ "^#HWLOC_LIB_NAME.*", "HWLOC_LIB_NAME = {0}".format(ll.names[0]), "config.mk"
+ )
+ else:
+ raise InstallError("Failed to find library path and/or name of hwloc dependency")
# https://github.com/RRZE-HPC/likwid/issues/287
if self.spec.satisfies("@:5.0.2 %gcc@10:"):