diff options
author | AMD Toolchain Support <73240730+amd-toolchain-support@users.noreply.github.com> | 2024-02-19 15:51:11 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-19 11:21:11 +0100 |
commit | c6faab10aab0bc833c2df24cb3a60c0f40bced2e (patch) | |
tree | 9549dda60be459cbc20b524608ebecd9637fb4e6 | |
parent | baa203f115816bcae8cb32817b6fc00cb826ac50 (diff) | |
download | spack-c6faab10aab0bc833c2df24cb3a60c0f40bced2e.tar.gz spack-c6faab10aab0bc833c2df24cb3a60c0f40bced2e.tar.bz2 spack-c6faab10aab0bc833c2df24cb3a60c0f40bced2e.tar.xz spack-c6faab10aab0bc833c2df24cb3a60c0f40bced2e.zip |
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>
-rw-r--r-- | var/spack/repos/builtin/packages/cp2k/package.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/var/spack/repos/builtin/packages/cp2k/package.py b/var/spack/repos/builtin/packages/cp2k/package.py index ea01e433eb..8e62699904 100644 --- a/var/spack/repos/builtin/packages/cp2k/package.py +++ b/var/spack/repos/builtin/packages/cp2k/package.py @@ -384,7 +384,7 @@ class MakefileBuilder(makefile.MakefileBuilder): } 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 @@ class MakefileBuilder(makefile.MakefileBuilder): 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" |