dla-future: Adapt lapack/scalapack CMake variables for master branch and next version (#46570)

* dla-future: Add DLAF_ prefix to LAPACK_LIBRARY CMake variable in newer versions

* dla-future: Use spec.satisfies to check version constraint for LAPACK_LIBRARY variable prefix

Co-authored-by: Alberto Invernizzi <9337627+albestro@users.noreply.github.com>

---------

Co-authored-by: Alberto Invernizzi <9337627+albestro@users.noreply.github.com>
This commit is contained in:
Mikael Simberg 2024-09-26 09:33:27 +02:00 committed by GitHub
parent 4b05a2b78f
commit badb3bcee7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -223,14 +223,19 @@ def cmake_args(self):
)
else:
args.append(self.define("DLAF_WITH_MKL", spec["lapack"].name in INTEL_MATH_LIBRARIES))
add_dlaf_prefix = lambda x: x if spec.satisfies("@:0.6") else "DLAF_" + x
args.append(
self.define(
"LAPACK_LIBRARY",
add_dlaf_prefix("LAPACK_LIBRARY"),
" ".join([spec[dep].libs.ld_flags for dep in ["blas", "lapack"]]),
)
)
if spec.satisfies("+scalapack"):
args.append(self.define("SCALAPACK_LIBRARY", spec["scalapack"].libs.ld_flags))
args.append(
self.define(
add_dlaf_prefix("SCALAPACK_LIBRARY"), spec["scalapack"].libs.ld_flags
)
)
args.append(self.define_from_variant("DLAF_WITH_SCALAPACK", "scalapack"))