From 4c86ecc5311cb7ab875eab29984e86da6e633690 Mon Sep 17 00:00:00 2001 From: Loris Ercole <30901257+lorisercole@users.noreply.github.com> Date: Tue, 23 Jan 2024 21:52:38 +0100 Subject: autodock-gpu: build with the specified `cuda_arch` (#42244) The CUDA target should be specified at build time, otherwise by default `autodock-gpu` will be built for compute capabilities 52, 60, 61, 70, which may cause errors on unsopported cards. --- var/spack/repos/builtin/packages/autodock-gpu/package.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/autodock-gpu/package.py b/var/spack/repos/builtin/packages/autodock-gpu/package.py index a3e5a4c329..e687cfd4ce 100644 --- a/var/spack/repos/builtin/packages/autodock-gpu/package.py +++ b/var/spack/repos/builtin/packages/autodock-gpu/package.py @@ -6,7 +6,7 @@ from spack.package import * -class AutodockGpu(MakefilePackage): +class AutodockGpu(MakefilePackage, CudaPackage): """AutoDock-GPU: AutoDock for GPUs and other accelerators. OpenCL and Cuda accelerated version of AutoDock 4.2.6. It leverages its embarrasingly parallelizable LGA by processing @@ -30,14 +30,19 @@ class AutodockGpu(MakefilePackage): multi=False, ) variant("overlap", default=False, description="Overlap CPU and GPU operations") + variant("cuda", default=True, description="Build with CUDA") depends_on("cuda") + conflicts("~cuda") # the cuda variant is mandatory + conflicts("+cuda", when="cuda_arch=none") + @property def build_targets(self): spec = self.spec return [ "DEVICE={0}".format(spec.variants["device"].value.upper()), + "TARGETS={0}".format(" ".join(spec.variants["cuda_arch"].value)), "GPU_INCLUDE_PATH={0}".format(spec["cuda"].prefix.include), "GPU_LIBRARY_PATH={0}".format(spec["cuda"].libs.directories[0]), "OVERLAP={0}".format("ON" if "+overlap" in spec else "OFF"), -- cgit v1.2.3-70-g09d2