diff options
author | Glenn Johnson <glenn-johnson@uiowa.edu> | 2020-10-12 07:06:26 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-12 14:06:26 +0200 |
commit | 9915ce0315c2de375dcb6c1911a3efe56cf75dd5 (patch) | |
tree | 817ad26269e6532d4b8d2ef1a5fffde8f85640d1 | |
parent | bd8c73ef1887564ed628748ce5c8ec0a85aa4a76 (diff) | |
download | spack-9915ce0315c2de375dcb6c1911a3efe56cf75dd5.tar.gz spack-9915ce0315c2de375dcb6c1911a3efe56cf75dd5.tar.bz2 spack-9915ce0315c2de375dcb6c1911a3efe56cf75dd5.tar.xz spack-9915ce0315c2de375dcb6c1911a3efe56cf75dd5.zip |
Change how CUDA variants are handled for libbeagle (#18984)
- Override the cuda_arch variant setup, with multi=False to ensure one
value is selected
- Use a conflicts statement rather than InstallError
-rw-r--r-- | var/spack/repos/builtin/packages/libbeagle/package.py | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/var/spack/repos/builtin/packages/libbeagle/package.py b/var/spack/repos/builtin/packages/libbeagle/package.py index a3ad61d363..9f06d01001 100644 --- a/var/spack/repos/builtin/packages/libbeagle/package.py +++ b/var/spack/repos/builtin/packages/libbeagle/package.py @@ -26,19 +26,22 @@ class Libbeagle(AutotoolsPackage, CudaPackage): depends_on('pkgconfig', type='build') depends_on('java', type='build') + cuda_arch_values = CudaPackage.cuda_arch_values + variant( + 'cuda_arch', + description='CUDA architecture', + default='none', + values=cuda_arch_values, + multi=False + ) + conflicts('cuda_arch=none', when='+cuda', + msg='must select a CUDA architecture') + def patch(self): # update cuda architecture if necessary if '+cuda' in self.spec: cuda_arch = self.spec.variants['cuda_arch'].value - archflag = '' - - if cuda_arch != 'none': - if len(cuda_arch) > 1: - raise InstallError( - 'libbeagle only supports compilation for a single GPU' - 'type.' - ) - archflag = '-arch compute_{0}'.format(cuda_arch[0]) + archflag = '-arch=compute_{0}'.format(cuda_arch) filter_file('-arch compute_13', '', 'libhmsbeagle/GPU/kernels/Makefile.am', |