ELPA: Linking fixes for BLAS and OpenMP (#42747)
Co-authored-by: Phil Tooley <phil.tooley@amd.com>
This commit is contained in:
parent
3ebaf33915
commit
28d25affcc
1 changed files with 10 additions and 10 deletions
|
@ -176,16 +176,16 @@ def configure_args(self):
|
|||
|
||||
options += self.enable_or_disable("openmp")
|
||||
|
||||
# if using mkl with openmp support, link with openmp
|
||||
mkl_openmp_flag = (
|
||||
self.compiler.openmp_flag
|
||||
if self.spec.satisfies("^intel-oneapi-mkl threads=openmp")
|
||||
else ""
|
||||
)
|
||||
options += [
|
||||
"LDFLAGS={0} {1}".format(mkl_openmp_flag, spec["lapack"].libs.search_flags),
|
||||
"LIBS={0} {1}".format(spec["lapack"].libs.link_flags, spec["blas"].libs.link_flags),
|
||||
]
|
||||
# Additional linker search paths and link libs
|
||||
ldflags = [spec["blas"].libs.search_flags, spec["lapack"].libs.search_flags]
|
||||
libs = [spec["lapack"].libs.link_flags, spec["blas"].libs.link_flags]
|
||||
|
||||
# If using blas with openmp support, link with openmp
|
||||
# Needed for Spack-provided OneAPI MKL and for many externals
|
||||
if self.spec["blas"].satisfies("threads=openmp"):
|
||||
ldflags.append(self.compiler.openmp_flag)
|
||||
|
||||
options += [f'LDFLAGS={" ".join(ldflags)}', f'LIBS={" ".join(libs)}']
|
||||
|
||||
if "+mpi" in self.spec:
|
||||
options += [
|
||||
|
|
Loading…
Reference in a new issue