diff options
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/nsimd/package.py | 25 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/rust/package.py | 11 |
2 files changed, 16 insertions, 20 deletions
diff --git a/var/spack/repos/builtin/packages/nsimd/package.py b/var/spack/repos/builtin/packages/nsimd/package.py index 1d22be943e..f9706f834d 100644 --- a/var/spack/repos/builtin/packages/nsimd/package.py +++ b/var/spack/repos/builtin/packages/nsimd/package.py @@ -2,10 +2,6 @@ # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) - -from spack import * - - class Nsimd(CMakePackage): """NSIMD is a vectorization library that abstracts SIMD programming. It was designed to exploit the maximum power of processors @@ -28,11 +24,8 @@ class Nsimd(CMakePackage): 'NEON128', 'AARCH64', 'SVE', ), multi=False) - variant('optionals', - default=(), - description='Optional SIMD features', - values=('FMA', 'FP16'), - multi=True) + variant('optionals', values=any_combination_of('FMA', 'FP16'), + description='Optional SIMD features',) conflicts('simd=none', msg="SIMD instruction set not defined") @@ -56,10 +49,14 @@ class Nsimd(CMakePackage): python(*options) def cmake_args(self): + # Required SIMD argument simd = self.spec.variants['simd'].value - optionals = ';'.join(self.spec.variants['optionals'].value) - cmake_args = [ - "-DSIMD={0}".format(simd), - "-DSIMD_OPTIONALS={0}".format(optionals), - ] + cmake_args = ["-DSIMD={0}".format(simd)] + + # Optional SIMD instructions to be turned on explicitly + optionals_value = self.spec.variants['optionals'].value + if optionals_value != 'none': + optionals_arg = ';'.join(optionals_value) + cmake_args.append("-DSIMD_OPTIONALS={0}".format(optionals_arg)) + return cmake_args diff --git a/var/spack/repos/builtin/packages/rust/package.py b/var/spack/repos/builtin/packages/rust/package.py index abfd4e8e0b..e61e962013 100644 --- a/var/spack/repos/builtin/packages/rust/package.py +++ b/var/spack/repos/builtin/packages/rust/package.py @@ -2,8 +2,6 @@ # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) - -from spack import * from six import iteritems @@ -56,9 +54,7 @@ class Rust(Package): description='Install Rust source files' ) variant( - 'extra_targets', - default=(), - multi=True, + 'extra_targets', default='none', multi=True, description='Triples for extra targets to enable. For supported targets, see: https://doc.rust-lang.org/nightly/rustc/platform-support.html' ) @@ -502,7 +498,10 @@ class Rust(Package): ar = which('ar', required=True) - extra_targets = list(self.spec.variants['extra_targets'].value) + extra_targets = [] + if self.spec.variants['extra_targets'].value != 'none': + extra_targets = list(self.spec.variants['extra_targets'].value) + targets = [self.get_rust_target()] + extra_targets target_spec = 'target=[' + \ ','.join('"{0}"'.format(target) for target in targets) + ']' |