summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2016-07-18 11:52:30 -0700
committerGitHub <noreply@github.com>2016-07-18 11:52:30 -0700
commit089189afaf8f131406ed0cd250dcdedd629362a3 (patch)
treefd727e5fd5510e8747931895346aba533b8cb426 /var
parent0a89342508c981fbf5cdf220a5821a1733ac29ab (diff)
parentb29b7595dda88831b7c0330b34df4c7b1e1c1734 (diff)
downloadspack-089189afaf8f131406ed0cd250dcdedd629362a3.tar.gz
spack-089189afaf8f131406ed0cd250dcdedd629362a3.tar.bz2
spack-089189afaf8f131406ed0cd250dcdedd629362a3.tar.xz
spack-089189afaf8f131406ed0cd250dcdedd629362a3.zip
Merge pull request #1238 from davydden/pkg/mkl_update
mkl: add provide blas/lapack
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/mkl/package.py38
1 files changed, 37 insertions, 1 deletions
diff --git a/var/spack/repos/builtin/packages/mkl/package.py b/var/spack/repos/builtin/packages/mkl/package.py
index 454e78d29c..6ea64f5313 100644
--- a/var/spack/repos/builtin/packages/mkl/package.py
+++ b/var/spack/repos/builtin/packages/mkl/package.py
@@ -9,7 +9,13 @@ class Mkl(IntelInstaller):
Note: You will have to add the download file to a
mirror so that Spack can find it. For instructions on how to set up a
- mirror, see http://software.llnl.gov/spack/mirrors.html"""
+ mirror, see http://software.llnl.gov/spack/mirrors.html.
+
+ To set the threading layer at run time set MKL_THREADING_LAYER
+ variable to one of the following values: INTEL, SEQUENTIAL, PGI.
+ To set interface layer at run time, use set the MKL_INTERFACE_LAYER
+ variable to LP64 or ILP64.
+ """
homepage = "https://software.intel.com/en-us/intel-mkl"
@@ -18,6 +24,11 @@ class Mkl(IntelInstaller):
version('11.3.3.210', 'f72546df27f5ebb0941b5d21fd804e34',
url="file://%s/l_mkl_11.3.3.210.tgz" % os.getcwd())
+ # virtual dependency
+ provides('blas')
+ provides('lapack')
+ # TODO: MKL also provides implementation of Scalapack.
+
def install(self, spec, prefix):
self.intel_prefix = os.path.join(prefix, "pkg")
@@ -26,3 +37,28 @@ class Mkl(IntelInstaller):
mkl_dir = os.path.join(self.intel_prefix, "mkl")
for f in os.listdir(mkl_dir):
os.symlink(os.path.join(mkl_dir, f), os.path.join(self.prefix, f))
+
+ def setup_dependent_package(self, module, dspec):
+ # For now use Single Dynamic Library:
+ # To set the threading layer at run time, use the
+ # mkl_set_threading_layer function or set MKL_THREADING_LAYER
+ # variable to one of the following values: INTEL, SEQUENTIAL, PGI.
+ # To set interface layer at run time, use the mkl_set_interface_layer
+ # function or set the MKL_INTERFACE_LAYER variable to LP64 or ILP64.
+
+ # Otherwise one would need to specify several libraries
+ # (e.g. mkl_intel_lp64;mkl_sequential;mkl_core), which reflect
+ # different interface and threading layers.
+
+ name = 'libmkl_rt.%s' % dso_suffix
+ libdir = find_library_path(name, self.prefix.lib64, self.prefix.lib)
+
+ self.spec.blas_shared_lib = join_path(libdir, name)
+ self.spec.lapack_shared_lib = self.spec.blas_shared_lib
+
+ def setup_dependent_environment(self, spack_env, run_env, dependent_spec):
+ # set up MKLROOT for everyone using MKL package
+ spack_env.set('MKLROOT', self.prefix)
+
+ def setup_environment(self, spack_env, env):
+ env.set('MKLROOT', self.prefix)