From 4150ea45ea9032058e41d3e08570425f9613a2fc Mon Sep 17 00:00:00 2001
From: Matthieu Schaller <matthieu.schaller@durham.ac.uk>
Date: Tue, 25 Jul 2017 17:10:09 +0100
Subject: [PATCH] Use fftw_alloc_real() instead of the specialized types in the
 FFT task. The specialized ones are not available in early versions of FFTW
 3.x

---
 src/runner_doiact_fft.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/runner_doiact_fft.c b/src/runner_doiact_fft.c
index a3e3f38fba..266cae61f4 100644
--- a/src/runner_doiact_fft.c
+++ b/src/runner_doiact_fft.c
@@ -179,11 +179,12 @@ void runner_do_grav_fft(struct runner* r, int timer) {
   // error("Top-level multipole %d not drifted", i);
 
   /* Allocates some memory for the density mesh */
-  double* restrict rho = fftw_alloc_real(N * N * N);
+  double* restrict rho = fftw_malloc(sizeof(double) * N * N * N);
   if (rho == NULL) error("Error allocating memory for density mesh");
 
   /* Allocates some memory for the mesh in Fourier space */
-  fftw_complex* restrict frho = fftw_alloc_complex(N * N * (N_half + 1));
+  fftw_complex* restrict frho =
+      fftw_malloc(sizeof(fftw_complex) * N * N * (N_half + 1));
   if (frho == NULL)
     error("Error allocating memory for transform of density mesh");
 
-- 
GitLab