ELPA: Linking fixes for BLAS and OpenMP (#42747)

Co-authored-by: Phil Tooley <phil.tooley@amd.com>
This commit is contained in:
AMD Toolchain Support 2024-02-22 19:51:00 +05:30 committed by GitHub
parent 3ebaf33915
commit 28d25affcc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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 += [