MKL: Provide scalapack (#2974)

This commit is contained in:
Carlos Bederián 2017-02-04 04:18:31 +02:00 committed by Todd Gamblin
parent 4c1c284e56
commit 384698157a
2 changed files with 58 additions and 2 deletions

View File

@ -55,8 +55,8 @@ class IntelMkl(IntelInstaller):
# virtual dependency # virtual dependency
provides('blas') provides('blas')
provides('lapack') provides('lapack')
provides('scalapack')
provides('mkl') provides('mkl')
# TODO: MKL also provides implementation of Scalapack.
@property @property
def blas_libs(self): def blas_libs(self):
@ -83,6 +83,34 @@ def blas_libs(self):
def lapack_libs(self): def lapack_libs(self):
return self.blas_libs return self.blas_libs
@property
def scalapack_libs(self):
libnames = ['libmkl_scalapack']
if self.spec.satisfies('^openmpi'):
libnames.append('libmkl_blacs_openmpi')
elif self.spec.satisfies('^mpich@1'):
libnames.append('libmkl_blacs')
elif self.spec.satisfies('^mpich@2:'):
libnames.append('libmkl_blacs_intelmpi')
elif self.spec.satisfies('^mvapich2'):
libnames.append('libmkl_blacs_intelmpi')
elif self.spec.satisfies('^mpt'):
libnames.append('libmkl_blacs_sgimpt')
# TODO: ^intel-parallel-studio can mean intel mpi, a compiler or a lib
# elif self.spec.satisfies('^intel-parallel-studio'):
# libnames.append('libmkl_blacs_intelmpi')
else:
raise InstallError("No MPI found for scalapack")
shared = True if '+shared' in self.spec else False
integer = 'ilp64' if '+ilp64' in self.spec else 'lp64'
libs = find_libraries(
['{0}_{1}'.format(l, integer) for l in libnames],
root=join_path(self.prefix.lib, 'intel64'),
shared=shared
)
return libs
def install(self, spec, prefix): def install(self, spec, prefix):
self.intel_prefix = os.path.join(prefix, "pkg") self.intel_prefix = os.path.join(prefix, "pkg")
IntelInstaller.install(self, spec, prefix) IntelInstaller.install(self, spec, prefix)

View File

@ -77,7 +77,7 @@ class IntelParallelStudio(IntelInstaller):
# virtual dependency # virtual dependency
provides('blas', when='+mkl') provides('blas', when='+mkl')
provides('lapack', when='+mkl') provides('lapack', when='+mkl')
# TODO: MKL also provides implementation of Scalapack. provides('scalapack', when='+mkl')
@property @property
def blas_libs(self): def blas_libs(self):
@ -104,6 +104,34 @@ def blas_libs(self):
def lapack_libs(self): def lapack_libs(self):
return self.blas_libs return self.blas_libs
@property
def scalapack_libs(self):
libnames = ['libmkl_scalapack']
if self.spec.satisfies('^openmpi'):
libnames.append('libmkl_blacs_openmpi')
elif self.spec.satisfies('^mpich@1'):
libnames.append('libmkl_blacs')
elif self.spec.satisfies('^mpich@2:'):
libnames.append('libmkl_blacs_intelmpi')
elif self.spec.satisfies('^mvapich2'):
libnames.append('libmkl_blacs_intelmpi')
elif self.spec.satisfies('^mpt'):
libnames.append('libmkl_blacs_sgimpt')
# TODO: ^intel-parallel-studio can mean intel mpi, a compiler or a lib
# elif self.spec.satisfies('^intel-parallel-studio'):
# libnames.append('libmkl_blacs_intelmpi')
else:
raise InstallError("No MPI found for scalapack")
shared = True if '+shared' in self.spec else False
integer = 'ilp64' if '+ilp64' in self.spec else 'lp64'
libs = find_libraries(
['{0}_{1}'.format(l, integer) for l in libnames],
root=join_path(self.prefix, 'mkl', 'lib', 'intel64'),
shared=shared
)
return libs
def url_for_version(self, version): def url_for_version(self, version):
"""Assume the tarball is in the current directory.""" """Assume the tarball is in the current directory."""