diff options
-rw-r--r-- | var/spack/repos/builtin/packages/hwloc/package.py | 5 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/libevent/package.py | 5 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/pmix/package.py | 26 |
3 files changed, 36 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/hwloc/package.py b/var/spack/repos/builtin/packages/hwloc/package.py index 4c67d3e32b..706328f7c5 100644 --- a/var/spack/repos/builtin/packages/hwloc/package.py +++ b/var/spack/repos/builtin/packages/hwloc/package.py @@ -146,6 +146,11 @@ class Hwloc(AutotoolsPackage, CudaPackage, ROCmPackage): url = "https://download.open-mpi.org/release/hwloc/v{0}/hwloc-{1}.tar.gz" return url.format(version.up_to(2), version) + @property + def libs(self): + libs = find_libraries("libhwloc", root=self.prefix, shared=True, recursive=True) + return LibraryList(libs) + def configure_args(self): args = [] diff --git a/var/spack/repos/builtin/packages/libevent/package.py b/var/spack/repos/builtin/packages/libevent/package.py index 9042a566d4..2a49064d95 100644 --- a/var/spack/repos/builtin/packages/libevent/package.py +++ b/var/spack/repos/builtin/packages/libevent/package.py @@ -49,6 +49,11 @@ class Libevent(AutotoolsPackage): return url.format(version) + @property + def libs(self): + libs = find_libraries("libevent", root=self.prefix, shared=True, recursive=True) + return LibraryList(libs) + def configure_args(self): spec = self.spec configure_args = [] diff --git a/var/spack/repos/builtin/packages/pmix/package.py b/var/spack/repos/builtin/packages/pmix/package.py index 999535b92f..39433e3f30 100644 --- a/var/spack/repos/builtin/packages/pmix/package.py +++ b/var/spack/repos/builtin/packages/pmix/package.py @@ -3,6 +3,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) import os +import platform from spack.package import * @@ -97,6 +98,18 @@ class Pmix(AutotoolsPackage): perl = which("perl") perl("./autogen.pl") + def find_external_lib_path(self, pkg_name, path_match_str=""): + spec = self.spec + tgt_libpath = "" + dir_list = spec[pkg_name].libs + for entry in dir_list: + if path_match_str == "" or (path_match_str != "" and path_match_str in entry): + tgt_libpath = entry + break + path_list = tgt_libpath.split(os.sep) + del path_list[-1] + return (os.sep).join(path_list) + def configure_args(self): spec = self.spec @@ -105,6 +118,19 @@ class Pmix(AutotoolsPackage): config_args.append("--with-libevent=" + spec["libevent"].prefix) config_args.append("--with-hwloc=" + spec["hwloc"].prefix) + # As of 09/22/22 pmix build does not detect the hwloc version + # for 32-bit architecture correctly. Since, we have only been + # able to test on 64-bit architecture, we are keeping this + # check for "64" in place. We will need to re-visit this when we + # have the fix in Pmix for 32-bit library version detection + if "64" in platform.machine(): + if spec["libevent"].external_path: + dep_libpath = self.find_external_lib_path("libevent", "64") + config_args.append("--with-libevent-libdir=" + dep_libpath) + if spec["hwloc"].external_path: + dep_libpath = self.find_external_lib_path("hwloc", "64") + config_args.append("--with-hwloc-libdir=" + dep_libpath) + config_args.extend(self.enable_or_disable("python-bindings", variant="python")) config_args.extend( |