summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorAlberto Invernizzi <9337627+albestro@users.noreply.github.com>2024-01-18 14:14:16 +0100
committerGitHub <noreply@github.com>2024-01-18 08:14:16 -0500
commit51c02be9095c407f55c8d95d8d05a7895f578914 (patch)
tree954ac1fddb90dce3a7760f462e17bda2c54fe6a3 /var
parentf7db6bf3f90a8e1f46e6e940efe36cd3b056673b (diff)
downloadspack-51c02be9095c407f55c8d95d8d05a7895f578914.tar.gz
spack-51c02be9095c407f55c8d95d8d05a7895f578914.tar.bz2
spack-51c02be9095c407f55c8d95d8d05a7895f578914.tar.xz
spack-51c02be9095c407f55c8d95d8d05a7895f578914.zip
intel-oneapi-mkl: add missing compiler libraries for thread=openmp (#42087)
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/intel-oneapi-mkl/package.py13
1 files changed, 13 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 6c1a28ef3f..76d0b4d903 100644
--- a/var/spack/repos/builtin/packages/intel-oneapi-mkl/package.py
+++ b/var/spack/repos/builtin/packages/intel-oneapi-mkl/package.py
@@ -165,6 +165,7 @@ class IntelOneapiMkl(IntelOneApiLibraryPackage):
def _find_mkl_libs(self, shared):
libs = []
+ threading_libs = []
if self.spec.satisfies("+cluster"):
libs.extend([self._xlp64_lib("libmkl_scalapack"), "libmkl_cdft_core"])
@@ -177,6 +178,12 @@ class IntelOneapiMkl(IntelOneApiLibraryPackage):
libs.append("libmkl_intel_thread")
else:
libs.append("libmkl_gnu_thread")
+
+ # this is slightly different than what link-line advisor suggests.
+ # here it uses what the compiler suggests to use to enable openmp,
+ # instead of being explicit about in which path openmp libraries
+ # are located (e.g. intel libiomp5, gcc libgomp, clang libomp).
+ threading_libs += [self.compiler.openmp_flag]
else:
libs.append("libmkl_sequential")
@@ -212,7 +219,10 @@ class IntelOneapiMkl(IntelOneApiLibraryPackage):
)
lib_path = lib_path if isdir(lib_path) else dirname(lib_path)
+ # resolved_libs is populated as follows
+ # MKL-related + MPI-related + threading-related
resolved_libs = find_libraries(libs, lib_path, shared=shared)
+
# Add MPI libraries for cluster support. If MPI is not in the
# spec, then MKL is externally installed and application must
# link with MPI libaries. If MPI is in spec, but there are no
@@ -223,6 +233,9 @@ class IntelOneapiMkl(IntelOneApiLibraryPackage):
resolved_libs = resolved_libs + self.spec["mpi"].libs
except spack.error.NoLibrariesError:
pass
+
+ resolved_libs += threading_libs
+
return resolved_libs
def _xlp64_lib(self, lib):