From b093929f91997cdeae3677a80d5885e362951083 Mon Sep 17 00:00:00 2001 From: Cory Bloor Date: Sun, 4 Sep 2022 20:18:33 -0600 Subject: rocthrust: add amdgpu_target and spack build test (#31203) This change adds support for building the rocthrust tests and adds the `amdgpu_target` variant to the `rocthrust` package. - [x] rocthrust: add amdgpu_target and spack build test - [x] Drop numactl as it is not a direct dependency --- var/spack/repos/builtin/packages/rocthrust/package.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/var/spack/repos/builtin/packages/rocthrust/package.py b/var/spack/repos/builtin/packages/rocthrust/package.py index 572ea2ce54..c19903013f 100644 --- a/var/spack/repos/builtin/packages/rocthrust/package.py +++ b/var/spack/repos/builtin/packages/rocthrust/package.py @@ -77,6 +77,11 @@ class Rocthrust(CMakePackage): deprecated=True, ) + amdgpu_targets = ROCmPackage.amdgpu_targets + + # the rocthrust library itself is header-only, but the build_type and amdgpu_target + # are relevant to the test client + variant("amdgpu_target", values=auto_or_any_combination_of(*amdgpu_targets)) variant( "build_type", default="Release", @@ -85,7 +90,8 @@ class Rocthrust(CMakePackage): ) depends_on("cmake@3.10.2:", type="build", when="@4.2.0:") depends_on("cmake@3.5.1:", type="build") - depends_on("numactl", when="@3.7.0:") + + depends_on("googletest@1.10.0:", type="test") for ver in [ "3.5.0", @@ -114,7 +120,13 @@ class Rocthrust(CMakePackage): env.set("CXX", self.spec["hip"].hipcc) def cmake_args(self): - args = [self.define("CMAKE_MODULE_PATH", "{0}/cmake".format(self.spec["hip"].prefix))] + args = [ + self.define("CMAKE_MODULE_PATH", "{0}/cmake".format(self.spec["hip"].prefix)), + self.define("BUILD_TEST", self.run_tests), + ] + + if "auto" not in self.spec.variants["amdgpu_target"]: + args.append(self.define_from_variant("AMDGPU_TARGETS", "amdgpu_target")) if self.spec.satisfies("^cmake@3.21.0:3.21.2"): args.append(self.define("__skip_rocmclang", "ON")) -- cgit v1.2.3-70-g09d2