diff options
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/arrayfire/package.py | 46 |
1 files changed, 31 insertions, 15 deletions
diff --git a/var/spack/repos/builtin/packages/arrayfire/package.py b/var/spack/repos/builtin/packages/arrayfire/package.py index 5d1a65428b..8827aa371d 100644 --- a/var/spack/repos/builtin/packages/arrayfire/package.py +++ b/var/spack/repos/builtin/packages/arrayfire/package.py @@ -4,7 +4,6 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * -from spack.pkg.builtin.boost import Boost class Arrayfire(CMakePackage, CudaPackage): @@ -14,22 +13,18 @@ class Arrayfire(CMakePackage, CudaPackage): homepage = "https://arrayfire.org/docs/index.htm" git = "https://github.com/arrayfire/arrayfire.git" + maintainers = ['umar456'] - version('master', submodules=True) - version('3.7.3', submodules=True, tag='v3.7.3') - version('3.7.2', submodules=True, tag='v3.7.2') - version('3.7.0', submodules=True, tag='v3.7.0') + version('master') + version('3.8.1', commit='823e8e399fe8c120c6ec7ec75f09e6106b3074ca', tag='v3.8.1') + version('3.7.3', commit='59ac7b980d1ae124aae914fb29cbf086c948954d', submodules=True, tag='v3.7.3') + version('3.7.2', commit='218dd2c99300e77496239ade76e94b0def65d032', submodules=True, tag='v3.7.2') + version('3.7.0', commit='fbea2aeb6f7f2d277dcb0ab425a77bb18ed22291', submodules=True, tag='v3.7.0') - variant('cuda', default=False, description='Enable Cuda backend') - variant('forge', default=False, description='Enable graphics library') + variant('forge', default=False, description='Enable graphics library') variant('opencl', default=False, description='Enable OpenCL backend') - depends_on('boost@1.65:') - - # TODO: replace this with an explicit list of components of Boost, - # for instance depends_on('boost +filesystem') - # See https://github.com/spack/spack/pull/22303 for reference - depends_on(Boost.with_default_variants) + depends_on('boost@1.70:') depends_on('fftw-api@3:') depends_on('blas') depends_on('cuda@7.5:', when='+cuda') @@ -42,6 +37,9 @@ class Arrayfire(CMakePackage, CudaPackage): depends_on('fontconfig', when='+forge') depends_on('glfw@3.1.4:', when='+forge') + conflicts('cuda_arch=none', when='+cuda', + msg='CUDA architecture is required') + @property def libs(self): query_parameters = self.spec.last_query.extra_parameters @@ -64,10 +62,28 @@ class Arrayfire(CMakePackage, CudaPackage): self.define_from_variant('AF_BUILD_CUDA', 'cuda'), self.define_from_variant('AF_BUILD_FORGE', 'forge'), self.define_from_variant('AF_BUILD_OPENCL', 'opencl'), + self.define('BUILD_TESTING', self.run_tests), ]) + + if '+cuda' in self.spec: + arch_list = ['{}.{}'.format(arch[:-1], arch[-1]) + for arch in self.spec.variants['cuda_arch'].value] + args.append(self.define('CUDA_architecture_build_targets', + arch_list)) + if '^mkl' in self.spec: - args.append('-DUSE_CPU_MKL=ON') + if self.version >= Version('3.8.0'): + args.append(self.define('AF_COMPUTE_LIBRARY', 'Intel-MKL')) + else: + args.append(self.define('USE_CPU_MKL', True)) + args.append(self.define('USE_OPENCL_MKL', True)) if '%intel' not in self.spec: - args.append('-DMKL_THREAD_LAYER=GNU OpenMP') + args.append(self.define('MKL_THREAD_LAYER', 'GNU OpenMP')) + else: + if self.version >= Version('3.8.0'): + args.append(self.define('AF_COMPUTE_LIBRARY', 'FFTW/LAPACK/BLAS')) + else: + args.append(self.define('USE_CPU_MKL', False)) + args.append(self.define('USE_OPENCL_MKL', False)) return args |