diff options
author | Massimiliano Culpo <massimiliano.culpo@gmail.com> | 2022-04-09 16:07:37 +0200 |
---|---|---|
committer | Massimiliano Culpo <massimiliano.culpo@gmail.com> | 2022-04-12 08:39:15 +0200 |
commit | a708844e870720a1be4f4f3c4b47b28d4acef321 (patch) | |
tree | 18db81bc8d60ece7d04cc7c377f53ad2bd070036 | |
parent | 4dd5bcb3ef31ab99f7011c4add9e8dbd19404f64 (diff) | |
download | spack-a708844e870720a1be4f4f3c4b47b28d4acef321.tar.gz spack-a708844e870720a1be4f4f3c4b47b28d4acef321.tar.bz2 spack-a708844e870720a1be4f4f3c4b47b28d4acef321.tar.xz spack-a708844e870720a1be4f4f3c4b47b28d4acef321.zip |
nsimd: remove custom phases, refactor variants
-rw-r--r-- | var/spack/repos/builtin/packages/nsimd/package.py | 53 |
1 files changed, 13 insertions, 40 deletions
diff --git a/var/spack/repos/builtin/packages/nsimd/package.py b/var/spack/repos/builtin/packages/nsimd/package.py index f74b622154..4199eca101 100644 --- a/var/spack/repos/builtin/packages/nsimd/package.py +++ b/var/spack/repos/builtin/packages/nsimd/package.py @@ -5,10 +5,11 @@ class Nsimd(CMakePackage): """NSIMD is a vectorization library that abstracts SIMD programming. It was designed to exploit the maximum power of processors - at a low development cost.""" + at a low development cost. + """ homepage = "https://agenium-scale.github.io/nsimd/" - url = "https://github.com/agenium-scale/nsimd/archive/v1.0.tar.gz" + url = "https://github.com/agenium-scale/nsimd/archive/v1.0.tar.gz" maintainers = ['eschnett'] @@ -28,39 +29,16 @@ class Nsimd(CMakePackage): 'CPU', 'SSE2', 'SSE42', 'AVX', 'AVX2', 'AVX512_KNL', 'AVX512_SKYLAKE', 'NEON128', 'AARCH64', - 'SVE', 'SVE128', 'SVE256', 'SVE512', 'SVE1024', 'SVE2048', - 'VMX', 'VSX', - 'CUDA', 'ROCM', + 'SVE', conditional( + 'SVE128', 'SVE256', 'SVE512', 'SVE1024', 'SVE2048', when='@2:' + ), + conditional('VMX', 'VSX', when='@3:'), + conditional('CUDA', 'ROCM', when='@2:') ), multi=False) - variant('optionals', values=any_combination_of('FMA', 'FP16'), + variant('optionals', values=any_combination_of('FMA', 'FP16'), when='@:1', description='Optional SIMD features',) - conflicts('simd=SVE128', when=('@:1'), - msg="SIMD extension not available in version @:1") - conflicts('simd=SVE256', when=('@:1'), - msg="SIMD extension not available in version @:1") - conflicts('simd=SVE512', when=('@:1'), - msg="SIMD extension not available in version @:1") - conflicts('simd=SVE1024', when=('@:1'), - msg="SIMD extension not available in version @:1") - conflicts('simd=SVE2048', when=('@:1'), - msg="SIMD extension not available in version @:1") - conflicts('simd=VMX', when=('@:2'), - msg="SIMD extension not available in version @:2") - conflicts('simd=VSX', when=('@:2'), - msg="SIMD extension not available in version @:2") - conflicts('simd=CUDA', when=('@:1'), - msg="SIMD extension not available in version @:1") - conflicts('simd=ROCM', when=('@:1'), - msg="SIMD extension not available in version @:1") - conflicts('optionals=FMA', when=('@2:'), - msg="SIMD optionals not available in version @2:") - conflicts('optionals=FP16', when=('@2:'), - msg="SIMD optionals not available in version @2:") - conflicts('optionals=FMA,FP16', when=('@2:'), - msg="SIMD optionals not available in version @2:") - # Requires a C++14 compiler for building. # The C++ interface requires a C++11 compiler to use. depends_on('cmake@2.8.7:', type='build') @@ -69,17 +47,12 @@ class Nsimd(CMakePackage): depends_on('py-chardet', type='build', when='@3:') depends_on('py-requests', type='build', when='@3:') - # Add a 'generate_code' phase in the beginning - phases = ['generate_code'] + CMakePackage.phases - - def generate_code(self, spec, prefix): + @run_before('cmake') + def generate_code(self): """Auto-generates code in the build directory""" + spec = self.spec if self.spec.satisfies("@:1"): - options = [ - 'egg/hatch.py', - '--all', - '--force', - ] + options = ['egg/hatch.py', '--all', '--force'] python = spec['python'].command python(*options) |