Slate package: resolves missing header issue (#19032)

* Changed make command to support new slate build variable 'blas='

* Updated to use package's "make install" target

* Added variant 'blas' to support switching blas provider and removed legacy 'mkl' variant.

* Fixed problem caused by systems which use a non-bash /bin/sh

* Removed blas= variant in preference for setting blas provider via spec syntax (e.g., ^openblas).

* Fixed formating

* Changed to MakefilePackage and cleaned up make argument generation

* Implemented "edit" method

* Removed blank line

* Sqitched to using mpi compiler wrapper variables

* Update var/spack/repos/builtin/packages/slate/package.py

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
This commit is contained in:
G-Ragghianti 2020-10-19 13:16:10 -04:00 committed by GitHub
parent 761b79e34f
commit 9cd2ab48ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,7 +6,7 @@
from spack import * from spack import *
class Slate(Package): class Slate(MakefilePackage):
"""The Software for Linear Algebra Targeting Exascale (SLATE) project is """The Software for Linear Algebra Targeting Exascale (SLATE) project is
to provide fundamental dense linear algebra capabilities to the US to provide fundamental dense linear algebra capabilities to the US
Department of Energy and to the high-performance computing (HPC) community Department of Energy and to the high-performance computing (HPC) community
@ -25,34 +25,36 @@ class Slate(Package):
variant('mpi', default=True, description='Build with MPI support.') variant('mpi', default=True, description='Build with MPI support.')
variant('openmp', default=True, description='Build with OpenMP support.') variant('openmp', default=True, description='Build with OpenMP support.')
depends_on('bash', type='build')
depends_on('scalapack')
depends_on('blas')
depends_on('cuda@9:10', when='+cuda') depends_on('cuda@9:10', when='+cuda')
depends_on('intel-mkl')
depends_on('mpi', when='+mpi') depends_on('mpi', when='+mpi')
conflicts('%gcc@:5') conflicts('%gcc@:5')
def setup_build_environment(self, env): def edit(self, spec, prefix):
if('+cuda' in self.spec): if '^openblas' in spec:
env.prepend_path('CPATH', self.spec['cuda'].prefix.include) blas = 'openblas'
env.prepend_path('CPATH', self.spec['intel-mkl'].prefix.mkl.include) elif '^intel-mkl' in spec:
blas = 'mkl'
def install(self, spec, prefix): elif '^essl' in spec:
f_cuda = "1" if spec.variants['cuda'].value else "0" blas = 'essl'
f_mpi = "1" if spec.variants['mpi'].value else "0" else:
f_openmp = "1" if spec.variants['openmp'].value else "0" raise InstallError('Supports only BLAS provider '
'openblas, intel-mkl, or essl')
comp_cxx = comp_for = '' config = [
'SHELL=bash',
'prefix=%s' % prefix,
'mpi=%i' % ('+mpi' in spec),
'cuda=%i' % ('+cuda' in spec),
'openmp=%i' % ('+openmp' in spec),
'blas=%s' % blas
]
if '+mpi' in spec: if '+mpi' in spec:
comp_cxx = 'mpicxx' config.append('CXX=' + spec['mpi'].mpicxx)
comp_for = 'mpif90' config.append('FC=' + spec['mpi'].mpifc)
make('mpi=' + f_mpi, 'mkl=1', 'cuda=' + f_cuda, 'openmp=' + f_openmp, with open('make.inc', 'w') as inc:
'CXX=' + comp_cxx, 'FC=' + comp_for) for line in config:
install_tree('lib', prefix.lib) inc.write('{0}\n'.format(line))
install_tree('test', prefix.test)
mkdirp(prefix.include)
install('include/slate/slate.hh', prefix.include)
install('lapack_api/lapack_slate.hh',
prefix.include + "/slate_lapack_api.hh")
install('scalapack_api/scalapack_slate.hh',
prefix.include + "/slate_scalapack_api.hh")