summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorRobert Cohn <rscohn2@gmail.com>2021-11-24 14:04:05 -0500
committerGitHub <noreply@github.com>2021-11-24 11:04:05 -0800
commit76ad803f25484612da2aa4523565d8b700419dc4 (patch)
treecb5087df6fba9830ee39b5139fb013618795d6f1 /var
parentdbf67d912c0ce7d2a26a67626154f3e2bd17a19b (diff)
downloadspack-76ad803f25484612da2aa4523565d8b700419dc4.tar.gz
spack-76ad803f25484612da2aa4523565d8b700419dc4.tar.bz2
spack-76ad803f25484612da2aa4523565d8b700419dc4.tar.xz
spack-76ad803f25484612da2aa4523565d8b700419dc4.zip
intel-oneapi-mkl: add cluster libs and option for static linking (#26256)
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/intel-oneapi-mkl/package.py33
1 files changed, 28 insertions, 5 deletions
diff --git a/var/spack/repos/builtin/packages/intel-oneapi-mkl/package.py b/var/spack/repos/builtin/packages/intel-oneapi-mkl/package.py
index 44d443f7b9..581c015b76 100644
--- a/var/spack/repos/builtin/packages/intel-oneapi-mkl/package.py
+++ b/var/spack/repos/builtin/packages/intel-oneapi-mkl/package.py
@@ -34,13 +34,18 @@ class IntelOneapiMkl(IntelOneApiLibraryPackage):
sha256='818b6bd9a6c116f4578cda3151da0612ec9c3ce8b2c8a64730d625ce5b13cc0c',
expand=False)
+ variant('shared', default=True, description='Builds shared library')
variant('ilp64', default=False,
description='Build with ILP64 support')
+ variant('cluster', default=False,
+ description='Build with cluster support: scalapack, blacs, etc')
depends_on('intel-oneapi-tbb')
+ # cluster libraries need mpi
+ depends_on('mpi', when='+cluster')
provides('fftw-api@3')
- provides('scalapack')
+ provides('scalapack', when='+cluster')
provides('mkl')
provides('lapack')
provides('blas')
@@ -59,13 +64,31 @@ class IntelOneapiMkl(IntelOneApiLibraryPackage):
include_path = join_path(self.component_path, 'include')
return find_headers('*', include_path)
+ # provide cluster libraries if +cluster variant is used or
+ # the scalapack virtual package was requested
+ def cluster(self):
+ return '+cluster' in self.spec
+
@property
def libs(self):
- mkl_libs = [self.xlp64_lib('libmkl_intel'), 'libmkl_sequential', 'libmkl_core']
+ shared = '+shared' in self.spec
+ mkl_libs = []
+ if self.cluster():
+ mkl_libs += [self.xlp64_lib('libmkl_scalapack'),
+ 'libmkl_cdft_core']
+ mkl_libs += [self.xlp64_lib('libmkl_intel'),
+ 'libmkl_sequential',
+ 'libmkl_core']
+ if self.cluster():
+ mkl_libs += [self.xlp64_lib('libmkl_blacs_intelmpi')]
libs = find_libraries(mkl_libs,
- join_path(self.component_path, 'lib', 'intel64'))
- libs += find_system_libraries(['libpthread', 'libm', 'libdl'])
- return libs
+ join_path(self.component_path, 'lib', 'intel64'),
+ shared=shared)
+ system_libs = find_system_libraries(['libpthread', 'libm', 'libdl'])
+ if shared:
+ return libs + system_libs
+ else:
+ return IntelOneApiStaticLibraryList(libs, system_libs)
def setup_dependent_build_environment(self, env, dependent_spec):
env.set('MKLROOT', self.component_path)