CP2K: fix multiple use of spec["fftw"] (#42724)

fftw object was originally created with spec["fftw:openmp"], but
referencing spec["fftw"] overwrites the 'last_query' in the spec object,
so later use of fftw.libs was not returing FFTW OpenMP libs.

Also allow the post-install fixup to support amdfftw as well as fftw.

Co-authored-by: Branden Moore <branden.moore@amd.com>
Co-authored-by: Phil Tooley <phil.tooley@amd.com>
Co-authored-by: Greg Becker <becker33@llnl.gov>
This commit is contained in:
AMD Toolchain Support 2024-02-19 15:51:11 +05:30 committed by GitHub
parent baa203f115
commit c6faab10aa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -384,7 +384,7 @@ def edit(self, pkg, spec, prefix):
}
dflags = ["-DNDEBUG"] if spec.satisfies("@:2023.2") else []
if spec["fftw-api"].name in ("intel-mkl", "intel-parallel-studio", "intel-oneapi-mkl"):
if fftw.name in ("intel-mkl", "intel-parallel-studio", "intel-oneapi-mkl"):
cppflags = ["-D__FFTW3_MKL", "-I{0}".format(fftw_header_dir)]
else:
cppflags = ["-D__FFTW3", "-I{0}".format(fftw_header_dir)]
@ -888,7 +888,8 @@ def fix_package_config(self):
content += " " + self.spec["lapack"].libs.ld_flags
content += " " + self.spec["fftw-api"].libs.ld_flags
if (self.spec["fftw-api"].name == "fftw") and ("+openmp" in self.spec["fftw"]):
fftw = self.spec["fftw-api"]
if fftw.name in ["fftw", "amdfftw"] and fftw.satisfies("+openmp"):
content += " -lfftw3_omp"
content += "\n"