From 736fddc079663e10e0fa593efc78e1a5e2530605 Mon Sep 17 00:00:00 2001 From: Brian Van Essen Date: Tue, 24 May 2022 04:17:46 +0200 Subject: Bugfix hwloc find cuda (#30788) * Added autotools configure flags to ensure that hwloc finds the correct version of CUDA that it was concretized against, rather than the first one that package config finds. * Added support for finding the correct version of ROCm libraries. Fixed Flake8. * Fixed guard on finding ROCm library --- var/spack/repos/builtin/packages/hwloc/package.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/var/spack/repos/builtin/packages/hwloc/package.py b/var/spack/repos/builtin/packages/hwloc/package.py index 995f027e5b..0f412b4a12 100644 --- a/var/spack/repos/builtin/packages/hwloc/package.py +++ b/var/spack/repos/builtin/packages/hwloc/package.py @@ -156,6 +156,11 @@ class Hwloc(AutotoolsPackage): if '+rocm' not in self.spec: args.append('--disable-rsmi') + if '+rocm' in self.spec: + args.append('--with-rocm={0}'.format(self.spec['rocm'].prefix)) + args.append('--with-rocm-version={0}'.format( + self.spec['rocm'].version)) + if '+netloc' in self.spec: args.append('--enable-netloc') @@ -168,4 +173,9 @@ class Hwloc(AutotoolsPackage): args.extend(self.enable_or_disable('pci')) args.extend(self.enable_or_disable('shared')) + if '+cuda' in self.spec: + args.append('--with-cuda={0}'.format(self.spec['cuda'].prefix)) + args.append('--with-cuda-version={0}'.format( + self.spec['cuda'].version)) + return args -- cgit v1.2.3-70-g09d2