diff --git a/var/spack/repos/builtin/packages/qmcpack/package.py b/var/spack/repos/builtin/packages/qmcpack/package.py index ec6f1e0f16c74e233fc2611441e973708c2984bf..f25a289a0f5ed4fceaf34cd93b6fc1564f93b487 100644 --- a/var/spack/repos/builtin/packages/qmcpack/package.py +++ b/var/spack/repos/builtin/packages/qmcpack/package.py @@ -215,9 +215,15 @@ def cmake_args(self): if '+cuda' in spec: args.append('-DQMC_CUDA=1') - cuda_arch = spec.variants['cuda_arch'].value + cuda_arch_list = spec.variants['cuda_arch'].value + cuda_arch = cuda_arch_list[0] + if len(cuda_arch_list) > 1: + raise InstallError( + 'QMCPACK only supports compilation for a single ' + 'GPU architecture at a time' + ) if cuda_arch != 'none': - args.append('-DCUDA_ARCH=sm_{0}'.format(cuda_arch[0])) + args.append('-DCUDA_ARCH=sm_{0}'.format(cuda_arch)) else: # This is the default value set in QMCPACK's CMake # Not possible to set default value for cuda_arch,