summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorFrank Willmore <frankwillmore@gmail.com>2021-02-03 11:50:37 -0600
committerGitHub <noreply@github.com>2021-02-03 09:50:37 -0800
commit8be833b2420103ecd2322c13fec0a1f7a8b7d4c5 (patch)
tree2dba9ae8da891db42d4675b41f25786bdd997387 /var
parent61641ecff2d9aad26340a7f3ab80c29f0d8ba690 (diff)
downloadspack-8be833b2420103ecd2322c13fec0a1f7a8b7d4c5.tar.gz
spack-8be833b2420103ecd2322c13fec0a1f7a8b7d4c5.tar.bz2
spack-8be833b2420103ecd2322c13fec0a1f7a8b7d4c5.tar.xz
spack-8be833b2420103ecd2322c13fec0a1f7a8b7d4c5.zip
adding environment to OneMKL packages so that examples will build (#21377)
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/intel-oneapi-mkl/package.py22
-rw-r--r--var/spack/repos/builtin/packages/intel-oneapi-tbb/package.py20
2 files changed, 42 insertions, 0 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 388969c068..a92981bafc 100644
--- a/var/spack/repos/builtin/packages/intel-oneapi-mkl/package.py
+++ b/var/spack/repos/builtin/packages/intel-oneapi-mkl/package.py
@@ -31,3 +31,25 @@ class IntelOneapiMkl(IntelOneApiLibraryPackage):
releases=releases,
url_name='onemkl')
super(IntelOneapiMkl, self).__init__(spec)
+
+ def _join_prefix(self, path):
+ return join_path(self.prefix, 'mkl', 'latest', path)
+
+ def _ld_library_path(self):
+ dirs = ['lib/intel64']
+ for dir in dirs:
+ yield self._join_prefix(dir)
+
+ def _library_path(self):
+ dirs = ['lib/intel64']
+ for dir in dirs:
+ yield self._join_prefix(dir)
+
+ def setup_run_environment(self, env):
+ env.prepend_path('PATH', self._join_prefix('bin/intel64'))
+ env.prepend_path('CPATH', self._join_prefix('include'))
+ for dir in self._library_path():
+ env.prepend_path('LIBRARY_PATH', dir)
+ for dir in self._ld_library_path():
+ env.prepend_path('LD_LIBRARY_PATH', dir)
+ env.set('MKLROOT', join_path(self.prefix, 'mkl', 'latest'))
diff --git a/var/spack/repos/builtin/packages/intel-oneapi-tbb/package.py b/var/spack/repos/builtin/packages/intel-oneapi-tbb/package.py
index 357f15b525..d80afbb020 100644
--- a/var/spack/repos/builtin/packages/intel-oneapi-tbb/package.py
+++ b/var/spack/repos/builtin/packages/intel-oneapi-tbb/package.py
@@ -27,3 +27,23 @@ class IntelOneapiTbb(IntelOneApiLibraryPackage):
releases=releases,
url_name='tbb_oneapi')
super(IntelOneapiTbb, self).__init__(spec)
+
+ def _join_prefix(self, path):
+ return join_path(self.prefix, 'tbb', 'latest', path)
+
+ def _ld_library_path(self):
+ dirs = ['lib/intel64/gcc4.8']
+ for dir in dirs:
+ yield self._join_prefix(dir)
+
+ def _library_path(self):
+ dirs = ['lib/intel64/gcc4.8']
+ for dir in dirs:
+ yield self._join_prefix(dir)
+
+ def setup_run_environment(self, env):
+ for dir in self._library_path():
+ env.prepend_path('LIBRARY_PATH', dir)
+ for dir in self._ld_library_path():
+ env.prepend_path('LD_LIBRARY_PATH', dir)
+ env.set('TBBROOT', join_path(self.prefix, 'tbb', 'latest'))