elpa: add cuda support, add libtool dep, fix parallel build failure (#17969)

This commit is contained in:
Harmen Stoppels 2020-08-11 17:01:49 +02:00 committed by GitHub
parent 09cc89a449
commit 313511bf1d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -8,7 +8,7 @@
from spack import *
class Elpa(AutotoolsPackage):
class Elpa(AutotoolsPackage, CudaPackage):
"""Eigenvalue solvers for Petaflop-Applications (ELPA)"""
homepage = 'http://elpa.mpcdf.mpg.de/'
@ -34,6 +34,7 @@ class Elpa(AutotoolsPackage):
depends_on('blas')
depends_on('lapack')
depends_on('scalapack')
depends_on('libtool', type='build')
def url_for_version(self, version):
t = 'http://elpa.mpcdf.mpg.de/html/Releases/{0}/elpa-{0}.tar.gz'
@ -62,13 +63,13 @@ def headers(self):
return hlist
build_directory = 'spack-build'
parallel = False
def configure_args(self):
spec = self.spec
options = []
# TODO: add --enable-gpu, --disable-sse-assembly, --enable-sparc64
# and --enable-neon-arch64
# TODO: --disable-sse-assembly, --enable-sparc64, --enable-neon-arch64
simd_features = ['vsx', 'sse', 'avx', 'avx2', 'avx512']
for feature in simd_features:
@ -85,6 +86,20 @@ def configure_args(self):
'CFLAGS=-O2'
])
if '+cuda' in spec:
prefix = spec['cuda'].prefix
options.append('--enable-gpu')
options.append('--with-cuda-path={0}'.format(prefix))
options.append('--with-cuda-sdk-path={0}'.format(prefix))
cuda_arch = spec.variants['cuda_arch'].value[0]
if cuda_arch != 'none':
options.append('--with-GPU-compute-capability=sm_{0}'.
format(cuda_arch))
else:
options.append('--disable-gpu')
if '+openmp' in spec:
options.append('--enable-openmp')
else:
@ -99,4 +114,6 @@ def configure_args(self):
'SCALAPACK_LDFLAGS={0}'.format(spec['scalapack'].libs.joined())
])
options.append('--disable-silent-rules')
return options