intel-oneapi-mkl: add missing compiler libraries for thread=openmp (#42087)
This commit is contained in:
parent
f7db6bf3f9
commit
51c02be909
@ -165,6 +165,7 @@ def setup_dependent_build_environment(self, env, dependent_spec):
|
|||||||
|
|
||||||
def _find_mkl_libs(self, shared):
|
def _find_mkl_libs(self, shared):
|
||||||
libs = []
|
libs = []
|
||||||
|
threading_libs = []
|
||||||
|
|
||||||
if self.spec.satisfies("+cluster"):
|
if self.spec.satisfies("+cluster"):
|
||||||
libs.extend([self._xlp64_lib("libmkl_scalapack"), "libmkl_cdft_core"])
|
libs.extend([self._xlp64_lib("libmkl_scalapack"), "libmkl_cdft_core"])
|
||||||
@ -177,6 +178,12 @@ def _find_mkl_libs(self, shared):
|
|||||||
libs.append("libmkl_intel_thread")
|
libs.append("libmkl_intel_thread")
|
||||||
else:
|
else:
|
||||||
libs.append("libmkl_gnu_thread")
|
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:
|
else:
|
||||||
libs.append("libmkl_sequential")
|
libs.append("libmkl_sequential")
|
||||||
|
|
||||||
@ -212,7 +219,10 @@ def _find_mkl_libs(self, shared):
|
|||||||
)
|
)
|
||||||
lib_path = lib_path if isdir(lib_path) else dirname(lib_path)
|
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)
|
resolved_libs = find_libraries(libs, lib_path, shared=shared)
|
||||||
|
|
||||||
# Add MPI libraries for cluster support. If MPI is not in the
|
# Add MPI libraries for cluster support. If MPI is not in the
|
||||||
# spec, then MKL is externally installed and application must
|
# spec, then MKL is externally installed and application must
|
||||||
# link with MPI libaries. If MPI is in spec, but there are no
|
# link with MPI libaries. If MPI is in spec, but there are no
|
||||||
@ -223,6 +233,9 @@ def _find_mkl_libs(self, shared):
|
|||||||
resolved_libs = resolved_libs + self.spec["mpi"].libs
|
resolved_libs = resolved_libs + self.spec["mpi"].libs
|
||||||
except spack.error.NoLibrariesError:
|
except spack.error.NoLibrariesError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
resolved_libs += threading_libs
|
||||||
|
|
||||||
return resolved_libs
|
return resolved_libs
|
||||||
|
|
||||||
def _xlp64_lib(self, lib):
|
def _xlp64_lib(self, lib):
|
||||||
|
Loading…
Reference in New Issue
Block a user