From f044194b06d393dea67d48c27973df1e68e5ba53 Mon Sep 17 00:00:00 2001 From: Martin Lang <67915889+lang-m@users.noreply.github.com> Date: Mon, 22 Jul 2024 19:54:49 +0200 Subject: [PATCH] libvdwxc: Fix configure with gcc-14 (#45093) --- .../builtin/packages/libvdwxc/fftw-detection.patch | 13 +++++++++++++ .../repos/builtin/packages/libvdwxc/package.py | 9 +++++++++ 2 files changed, 22 insertions(+) create mode 100644 var/spack/repos/builtin/packages/libvdwxc/fftw-detection.patch diff --git a/var/spack/repos/builtin/packages/libvdwxc/fftw-detection.patch b/var/spack/repos/builtin/packages/libvdwxc/fftw-detection.patch new file mode 100644 index 00000000000..f009188f52c --- /dev/null +++ b/var/spack/repos/builtin/packages/libvdwxc/fftw-detection.patch @@ -0,0 +1,13 @@ +diff --git a/configure b/configure +index 494ea9f..1ca6516 100755 +--- a/configure ++++ b/configure +@@ -17006,7 +17006,7 @@ int + main () + { + +- fftw_plan *plan; ++ fftw_plan plan; + fftw_complex *a1, *a2; + fftw_execute_dft(plan, a1, a2); + diff --git a/var/spack/repos/builtin/packages/libvdwxc/package.py b/var/spack/repos/builtin/packages/libvdwxc/package.py index 53cbef94bea..e0e7241d951 100644 --- a/var/spack/repos/builtin/packages/libvdwxc/package.py +++ b/var/spack/repos/builtin/packages/libvdwxc/package.py @@ -54,3 +54,12 @@ def configure_args(self): args += ["--without-mpi"] return args + + # misuse of fftw_plan in m4 for fftw detection (configure fails with gcc 14) + # two patches for (1) m4 macro from upstream and (2) pre-generated configure in tarball + patch( + "https://gitlab.com/libvdwxc/libvdwxc/-/commit/9340f857515c4a2e56d2aa7cf3a21c41ba8559c3.diff", + sha256="b9ad695e54a25d7ffa92f783bb0a31d3b421225f97958972e32ba42893844b80", + when="@:0.4.0", + ) + patch("fftw-detection.patch", when="@:0.4.0")