aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2020-07-30 11:17:21 +0200
committerThomas White <taw@physics.org>2020-07-30 11:17:21 +0200
commit1bc709a8adaf0f71d30efd013549a2fa28a0fec6 (patch)
treec4adafa09e2539e0b71191e5feabf7f69330dd7f /libcrystfel
parent1e5af53a425162fe83e0e01385213f5c64eecdb0 (diff)
Request that FFTW uses "double[2]", not "complex" for fftw_complex
Normally, FFTW uses the C99 "complex" type for fftw_complex, if complex.h is included before fftw3.h. We do not use complex.h, and want the double[2] version otherwise the code breaks horribly. Unfortunatley, under certain build scenarios, complex.h seems to get included via the GSL headers. Adding #define FFTW_NO_Complex prevents this.
Diffstat (limited to 'libcrystfel')
-rw-r--r--libcrystfel/src/asdf.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/libcrystfel/src/asdf.c b/libcrystfel/src/asdf.c
index e583aae3..77bd0d13 100644
--- a/libcrystfel/src/asdf.c
+++ b/libcrystfel/src/asdf.c
@@ -42,7 +42,6 @@
#include <gsl/gsl_linalg.h>
#include <gsl/gsl_multifit.h>
#include <gsl/gsl_fit.h>
-#include <fftw3.h>
#include "image.h"
#include "dirax.h"
@@ -57,6 +56,13 @@
#ifdef HAVE_FFTW
+#define FFTW_NO_Complex /* Please use "double[2]", not C99 "complex",
+ * despite complex.h possibly already being
+ * included. For more information, refer to:
+ * http://www.fftw.org/doc/Complex-numbers.html */
+
+#include <fftw3.h>
+
struct fftw_vars {
int N;
fftw_plan p;