From c3034b53e3ca10da5d13417bb4344dd771ac03a7 Mon Sep 17 00:00:00 2001 From: Brian Van Essen Date: Wed, 31 Jan 2018 12:10:42 -0700 Subject: [PATCH] Adding support for the Accelerate library on OS X (#7068) * Adding support for the Accelerate library on OS X * Fixed guard on variable and added another depends_on statement to make sure that openblas gets selected even when openmp_blas variant is not turned on. --- var/spack/repos/builtin/packages/elemental/package.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/var/spack/repos/builtin/packages/elemental/package.py b/var/spack/repos/builtin/packages/elemental/package.py index 2b6de080f6..ad0bb404c2 100644 --- a/var/spack/repos/builtin/packages/elemental/package.py +++ b/var/spack/repos/builtin/packages/elemental/package.py @@ -69,8 +69,8 @@ class Elemental(CMakePackage): variant('build_type', default='Release', description='The build type to build', values=('Debug', 'Release')) - variant('blas', default='openblas', values=('openblas', 'mkl', 'essl'), - description='Enable the use of OpenBlas/MKL/ESSL') + variant('blas', default='openblas', values=('openblas', 'mkl', 'accelerate', 'essl'), + description='Enable the use of OpenBlas/MKL/Accelerate/ESSL') variant('mpfr', default=False, description='Support GNU MPFR\'s' 'arbitrary-precision floating-point arithmetic') @@ -78,6 +78,7 @@ class Elemental(CMakePackage): # Note that #1712 forces us to enumerate the different blas variants depends_on('blas', when='~openmp_blas ~int64_blas') # Hack to forward variant to openblas package + depends_on('openblas', when='blas=openblas ~openmp_blas ~int64_blas') # Allow Elemental to build internally when using 8-byte ints depends_on('openblas threads=openmp', when='blas=openblas +openmp_blas ~int64_blas') @@ -85,6 +86,8 @@ class Elemental(CMakePackage): depends_on('intel-mkl threads=openmp', when='blas=mkl +openmp_blas ~int64_blas') depends_on('intel-mkl@2017.1 +openmp +ilp64', when='blas=mkl +openmp_blas +int64_blas') + depends_on('veclibfort', when='blas=accelerate') + depends_on('essl -cuda', when='blas=essl -openmp_blas ~int64_blas') depends_on('essl threads=openmp', when='blas=essl +openmp_blas ~int64_blas') @@ -229,6 +232,8 @@ def cmake_args(self): elif 'blas=mkl' in spec: args.extend([ '-DHydrogen_USE_MKL:BOOL=%s' % ('blas=mkl' in spec)]) + elif 'blas=accelerate' in spec: + args.extend(['-DHydrogen_USE_ACCELERATE:BOOL=TRUE']) elif 'blas=essl' in spec: args.extend([ '-DHydrogen_USE_ESSL:BOOL=%s' % ('blas=essl' in spec)])