diff options
author | RĂ©mi Lacroix <remi.lacroix@idris.fr> | 2021-01-21 16:29:11 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-21 09:29:11 -0600 |
commit | afa536fc1d1081cb4f8fa4693197adf437bd13a1 (patch) | |
tree | 7e92cd1eb6b610084f2ea5c6ff884cd0ba7cc910 /var | |
parent | 6f166283ca5d8f283692d2da7beb5f559bddf7a0 (diff) | |
download | spack-afa536fc1d1081cb4f8fa4693197adf437bd13a1.tar.gz spack-afa536fc1d1081cb4f8fa4693197adf437bd13a1.tar.bz2 spack-afa536fc1d1081cb4f8fa4693197adf437bd13a1.tar.xz spack-afa536fc1d1081cb4f8fa4693197adf437bd13a1.zip |
Plumed: Add a new ArrayFire variant. (#20624)
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/plumed/package.py | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/var/spack/repos/builtin/packages/plumed/package.py b/var/spack/repos/builtin/packages/plumed/package.py index 42e9012fb2..ad14b7d2cd 100644 --- a/var/spack/repos/builtin/packages/plumed/package.py +++ b/var/spack/repos/builtin/packages/plumed/package.py @@ -58,6 +58,9 @@ class Plumed(AutotoolsPackage): variant('shared', default=True, description='Builds shared libraries') variant('mpi', default=True, description='Activates MPI support') variant('gsl', default=True, description='Activates GSL support') + variant('arrayfire', default='none', + values=('none', 'cpu', 'cuda', 'opencl'), + description='Activates FireArray support') # Dependencies. LAPACK and BLAS are recommended but not essential. depends_on('zlib') @@ -66,6 +69,9 @@ class Plumed(AutotoolsPackage): # For libmatheval support through the 'function' module # which is enabled by default (or when optional_modules=all) depends_on('libmatheval', when='@:2.4.99') + depends_on('arrayfire', when='arrayfire=cpu') + depends_on('arrayfire+cuda', when='arrayfire=cuda') + depends_on('arrayfire+opencl', when='arrayfire=opencl') depends_on('mpi', when='+mpi') depends_on('gsl', when='+gsl') @@ -168,18 +174,31 @@ class Plumed(AutotoolsPackage): 'STATIC_LIBS=-mt_mpi' ]) + extra_libs = [] # Set flags to help find gsl - if '+gsl' in self.spec: - gsl_libs = self.spec['gsl'].libs - blas_libs = self.spec['blas'].libs - configure_opts.append('LDFLAGS={0}'.format( + if '+gsl' in spec: + gsl_libs = spec['gsl'].libs + blas_libs = spec['blas'].libs + extra_libs.append( (gsl_libs + blas_libs).ld_flags + ) + # Set flags to help with ArrayFire + if 'arrayfire=none' not in spec: + libaf = 'arrayfire:{0}'.format(spec.variants['arrayfire'].value) + extra_libs.append(spec[libaf].libs.search_flags) + + if extra_libs: + configure_opts.append('LDFLAGS={0}'.format( + ' '.join(extra_libs) )) # Additional arguments configure_opts.extend([ '--enable-shared={0}'.format('yes' if '+shared' in spec else 'no'), - '--enable-gsl={0}'.format('yes' if '+gsl' in spec else 'no') + '--enable-gsl={0}'.format('yes' if '+gsl' in spec else 'no'), + '--enable-af_cpu={0}'.format('yes' if 'arrayfire=cpu' in spec else 'no'), + '--enable-af_cuda={0}'.format('yes' if 'arrayfire=cuda' in spec else 'no'), + '--enable-af_ocl={0}'.format('yes' if 'arrayfire=ocl' in spec else 'no') ]) # Construct list of optional modules |