diff options
author | RĂ©mi Lacroix <remi.lacroix@idris.fr> | 2021-01-21 16:29:00 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-21 09:29:00 -0600 |
commit | 6f166283ca5d8f283692d2da7beb5f559bddf7a0 (patch) | |
tree | ccbf107d7f1a8473e1c2886b822f606fd5af2951 | |
parent | 10baa48d95ff35de8a53853f547a7c2be48eb15d (diff) | |
download | spack-6f166283ca5d8f283692d2da7beb5f559bddf7a0.tar.gz spack-6f166283ca5d8f283692d2da7beb5f559bddf7a0.tar.bz2 spack-6f166283ca5d8f283692d2da7beb5f559bddf7a0.tar.xz spack-6f166283ca5d8f283692d2da7beb5f559bddf7a0.zip |
ArrayFire improvements (#20615)
* ArrayFire: Add version 3.7.2.
* ArrayFire: Allow using MKL as the FFTW provider.
* ArrayFire: Ensure the libraries are properly found.
The required backend(s) can be specified in the library query.
-rw-r--r-- | var/spack/repos/builtin/packages/arrayfire/package.py | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/var/spack/repos/builtin/packages/arrayfire/package.py b/var/spack/repos/builtin/packages/arrayfire/package.py index 68aa2bb989..474519834e 100644 --- a/var/spack/repos/builtin/packages/arrayfire/package.py +++ b/var/spack/repos/builtin/packages/arrayfire/package.py @@ -16,6 +16,7 @@ class Arrayfire(CMakePackage, CudaPackage): 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') variant('cuda', default=False, description='Enable Cuda backend') @@ -23,7 +24,7 @@ class Arrayfire(CMakePackage, CudaPackage): variant('opencl', default=False, description='Enable OpenCL backend') depends_on('boost@1.65:') - depends_on('fftw') + depends_on('fftw-api@3:') depends_on('blas') depends_on('cuda@7.5:', when='+cuda') depends_on('cudnn', when='+cuda') @@ -35,6 +36,22 @@ class Arrayfire(CMakePackage, CudaPackage): depends_on('fontconfig', when='+forge') depends_on('glfw@3.1.4:', when='+forge') + @property + def libs(self): + query_parameters = self.spec.last_query.extra_parameters + + libraries = [] + if 'cpu' in query_parameters: + libraries.append('libafcpu') + if 'cuda' in query_parameters and '+cuda' in self.spec: + libraries.append('libafcuda') + if 'opencl' in query_parameters and '+opencl' in self.spec: + libraries.append('libafopencl') + if not query_parameters or 'unified' in query_parameters: + libraries.append('libaf') + + return find_libraries(libraries, root=self.prefix, recursive=True) + def cmake_args(self): args = [] args.extend([ @@ -45,4 +62,9 @@ class Arrayfire(CMakePackage, CudaPackage): '-DAF_BUILD_OPENCL={0}'.format( 'ON' if '+opencl' in self.spec else 'OFF'), ]) + if '^mkl' in self.spec: + args.append('-DUSE_CPU_MKL=ON') + if '%intel' not in self.spec: + args.append('-DMKL_THREAD_LAYER=GNU OpenMP') + return args |