summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Willmore <frankwillmore@gmail.com>2021-02-03 11:50:37 -0600
committerTamara Dahlgren <dahlgren1@llnl.gov>2021-02-17 17:07:46 -0800
commit805b412bb6968a9210ad265d73bfdeaa26a88356 (patch)
treef769d4563c4e6df70aca29548249f714a6d5c3b5
parent240726a2e1e7d95e2fc197a224cbae53a98b9ac1 (diff)
downloadspack-805b412bb6968a9210ad265d73bfdeaa26a88356.tar.gz
spack-805b412bb6968a9210ad265d73bfdeaa26a88356.tar.bz2
spack-805b412bb6968a9210ad265d73bfdeaa26a88356.tar.xz
spack-805b412bb6968a9210ad265d73bfdeaa26a88356.zip
adding environment to OneMKL packages so that examples will build (#21377)
-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 1a1594f525..2b9ce4f3fe 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 3eb94d1e64..d4c9f03d61 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'))