Chris@82
|
1
|
Chris@82
|
2
|
Chris@82
|
3 dnl Process this file with autoconf to produce a configure script.
|
Chris@82
|
4
|
Chris@82
|
5 dnl Define the fftw version number as M4 macros, so that we can enforce
|
Chris@82
|
6 dnl the invariant that the minor version number in FFTW-X.Y.MINOR is the same
|
Chris@82
|
7 dnl as the revision number in SHARED_VERSION_INFO.
|
Chris@82
|
8 define(FFTW_MAJOR_VERSION, 3.3)dnl
|
Chris@82
|
9 define(FFTW_MINOR_VERSION, 8)dnl
|
Chris@82
|
10
|
Chris@82
|
11 dnl Version number of the FFTW source package.
|
Chris@82
|
12 AC_INIT(fftw, FFTW_MAJOR_VERSION.FFTW_MINOR_VERSION, fftw@fftw.org)
|
Chris@82
|
13 AC_CONFIG_SRCDIR(kernel/ifftw.h)
|
Chris@82
|
14
|
Chris@82
|
15 dnl Version number for libtool shared libraries. Libtool wants a string
|
Chris@82
|
16 dnl of the form CURRENT:REVISION:AGE. We adopt the convention that
|
Chris@82
|
17 dnl REVISION is the same as the FFTW minor version number.
|
Chris@82
|
18 dnl fftw-3.1.x was 4:x:1
|
Chris@82
|
19 dnl fftw-3.2.x was 5:x:2
|
Chris@82
|
20 dnl fftw-3.3.x was 6:x:3 for x < 4
|
Chris@82
|
21 dnl fftw-3.3.4 was 7:x:4
|
Chris@82
|
22 dnl fftw-3.3.5 was 8:x:5 (added planner hooks)
|
Chris@82
|
23 dnl fftw-3.3.6 was 8:x:6 (8:x:6 is a bug, should have been 8:x:5. No API changes)
|
Chris@82
|
24 dnl fftw-3.3.6.1 fixes the 8:x:6 screwup
|
Chris@82
|
25 dnl fftw-3.3.7 was 8:x:5 (No API changes)
|
Chris@82
|
26 dnl fftw-3.3.8 was 8:x:5 (No API changes)
|
Chris@82
|
27 SHARED_VERSION_INFO="8:FFTW_MINOR_VERSION:5" # CURRENT:REVISION:AGE
|
Chris@82
|
28
|
Chris@82
|
29 AM_INIT_AUTOMAKE(1.7)
|
Chris@82
|
30 AM_CONFIG_HEADER(config.h)
|
Chris@82
|
31 AC_CONFIG_MACRO_DIR([m4])
|
Chris@82
|
32 AM_MAINTAINER_MODE
|
Chris@82
|
33 AC_SUBST(SHARED_VERSION_INFO)
|
Chris@82
|
34 AC_DISABLE_SHARED dnl to hell with shared libraries
|
Chris@82
|
35 AC_CANONICAL_HOST
|
Chris@82
|
36
|
Chris@82
|
37 dnl configure options
|
Chris@82
|
38 case "${host_cpu}" in
|
Chris@82
|
39 powerpc*) arch_prefers_fma=yes;;
|
Chris@82
|
40 ia64*) arch_prefers_fma=yes;;
|
Chris@82
|
41 hppa*) arch_prefers_fma=yes;;
|
Chris@82
|
42 mips64*) arch_prefers_fma=yes;;
|
Chris@82
|
43 *) arch_prefers_fma=no;;
|
Chris@82
|
44 esac
|
Chris@82
|
45
|
Chris@82
|
46 AC_ARG_ENABLE(debug, [AC_HELP_STRING([--enable-debug],[compile fftw with extra runtime checks for debugging])], ok=$enableval, ok=no)
|
Chris@82
|
47 if test "$ok" = "yes"; then
|
Chris@82
|
48 AC_DEFINE(FFTW_DEBUG,1,[Define to enable extra FFTW debugging code.])
|
Chris@82
|
49 fi
|
Chris@82
|
50
|
Chris@82
|
51 AC_ARG_ENABLE(doc, [AC_HELP_STRING([--disable-doc],[disable building the documentation])], build_doc=$enableval, build_doc=yes)
|
Chris@82
|
52 AM_CONDITIONAL(BUILD_DOC, test x"$build_doc" = xyes)
|
Chris@82
|
53
|
Chris@82
|
54 AC_ARG_ENABLE(random-estimator, [AC_HELP_STRING([--enable-random-estimator],[enable pseudorandom estimator (debugging hack)])], ok=$enableval, ok=no)
|
Chris@82
|
55 if test "$ok" = "yes"; then
|
Chris@82
|
56 AC_DEFINE(FFTW_RANDOM_ESTIMATOR,1,[Define to enable pseudorandom estimate planning for debugging.])
|
Chris@82
|
57 CHECK_PL_OPTS="--estimate"
|
Chris@82
|
58 fi
|
Chris@82
|
59
|
Chris@82
|
60 AC_ARG_ENABLE(alloca, [AC_HELP_STRING([--disable-alloca],[disable use of the alloca() function (may be broken on mingw64)])], ok=$enableval, ok=yes)
|
Chris@82
|
61 if test "$ok" = "yes"; then
|
Chris@82
|
62 AC_DEFINE(FFTW_ENABLE_ALLOCA,1,[Define to enable the use of alloca().])
|
Chris@82
|
63 fi
|
Chris@82
|
64
|
Chris@82
|
65 AC_ARG_ENABLE(single, [AC_HELP_STRING([--enable-single],[compile fftw in single precision])], ok=$enableval, ok=no)
|
Chris@82
|
66 AC_ARG_ENABLE(float, [AC_HELP_STRING([--enable-float],[synonym for --enable-single])], ok=$enableval)
|
Chris@82
|
67 if test "$ok" = "yes"; then
|
Chris@82
|
68 AC_DEFINE(FFTW_SINGLE,1,[Define to compile in single precision.])
|
Chris@82
|
69 AC_DEFINE(BENCHFFT_SINGLE,1,[Define to compile in single precision.])
|
Chris@82
|
70 PRECISION=s
|
Chris@82
|
71 else
|
Chris@82
|
72 PRECISION=d
|
Chris@82
|
73 fi
|
Chris@82
|
74 AM_CONDITIONAL(SINGLE, test "$ok" = "yes")
|
Chris@82
|
75
|
Chris@82
|
76 AC_ARG_ENABLE(long-double, [AC_HELP_STRING([--enable-long-double],[compile fftw in long-double precision])], ok=$enableval, ok=no)
|
Chris@82
|
77 if test "$ok" = "yes"; then
|
Chris@82
|
78 if test "$PRECISION" = "s"; then
|
Chris@82
|
79 AC_MSG_ERROR([--enable-single/--enable-long-double conflict])
|
Chris@82
|
80 fi
|
Chris@82
|
81 AC_DEFINE(FFTW_LDOUBLE,1,[Define to compile in long-double precision.])
|
Chris@82
|
82 AC_DEFINE(BENCHFFT_LDOUBLE,1,[Define to compile in long-double precision.])
|
Chris@82
|
83 PRECISION=l
|
Chris@82
|
84 fi
|
Chris@82
|
85 AM_CONDITIONAL(LDOUBLE, test "$ok" = "yes")
|
Chris@82
|
86
|
Chris@82
|
87 AC_ARG_ENABLE(quad-precision, [AC_HELP_STRING([--enable-quad-precision],[compile fftw in quadruple precision if available])], ok=$enableval, ok=no)
|
Chris@82
|
88 if test "$ok" = "yes"; then
|
Chris@82
|
89 if test "$PRECISION" != "d"; then
|
Chris@82
|
90 AC_MSG_ERROR([conflicting precisions specified])
|
Chris@82
|
91 fi
|
Chris@82
|
92 AC_DEFINE(FFTW_QUAD,1,[Define to compile in quad precision.])
|
Chris@82
|
93 AC_DEFINE(BENCHFFT_QUAD,1,[Define to compile in quad precision.])
|
Chris@82
|
94 PRECISION=q
|
Chris@82
|
95 fi
|
Chris@82
|
96 AM_CONDITIONAL(QUAD, test "$ok" = "yes")
|
Chris@82
|
97
|
Chris@82
|
98 AC_SUBST(PRECISION)
|
Chris@82
|
99 AC_SUBST(CHECK_PL_OPTS)
|
Chris@82
|
100
|
Chris@82
|
101 dnl SSE/SSE2 theory:
|
Chris@82
|
102 dnl
|
Chris@82
|
103 dnl Historically, you had to supply --enable-sse in single precision and --enable-sse2
|
Chris@82
|
104 dnl in double precision.
|
Chris@82
|
105 dnl
|
Chris@82
|
106 dnl This behavior is pointless in 2016. --enable-sse2 now works in both precisions,
|
Chris@82
|
107 dnl and is interpreted as --enable-sse in single precision. The old flag --enable--se
|
Chris@82
|
108 dnl is still supported in single-precision only.
|
Chris@82
|
109 AC_ARG_ENABLE(sse, [AC_HELP_STRING([--enable-sse],[enable SSE optimizations])], have_sse=$enableval, have_sse=no)
|
Chris@82
|
110 if test "$have_sse" = "yes"; then
|
Chris@82
|
111 if test "$PRECISION" != "s"; then
|
Chris@82
|
112 AC_MSG_ERROR([SSE requires single precision])
|
Chris@82
|
113 fi
|
Chris@82
|
114 fi
|
Chris@82
|
115
|
Chris@82
|
116 AC_ARG_ENABLE(sse2, [AC_HELP_STRING([--enable-sse2],[enable SSE/SSE2 optimizations])], have_sse2=$enableval, have_sse2=no)
|
Chris@82
|
117 if test "$have_sse" = "yes"; then have_sse2=yes; fi
|
Chris@82
|
118 if test "$have_sse2" = "yes"; then
|
Chris@82
|
119 AC_DEFINE(HAVE_SSE2,1,[Define to enable SSE/SSE2 optimizations.])
|
Chris@82
|
120 if test "$PRECISION" != "d" -a "$PRECISION" != "s"; then
|
Chris@82
|
121 AC_MSG_ERROR([SSE2 requires single or double precision])
|
Chris@82
|
122 fi
|
Chris@82
|
123 fi
|
Chris@82
|
124 AM_CONDITIONAL(HAVE_SSE2, test "$have_sse2" = "yes")
|
Chris@82
|
125
|
Chris@82
|
126 AC_ARG_ENABLE(avx, [AC_HELP_STRING([--enable-avx],[enable AVX optimizations])], have_avx=$enableval, have_avx=no)
|
Chris@82
|
127 if test "$have_avx" = "yes"; then
|
Chris@82
|
128 AC_DEFINE(HAVE_AVX,1,[Define to enable AVX optimizations.])
|
Chris@82
|
129 if test "$PRECISION" != "d" -a "$PRECISION" != "s"; then
|
Chris@82
|
130 AC_MSG_ERROR([AVX requires single or double precision])
|
Chris@82
|
131 fi
|
Chris@82
|
132 fi
|
Chris@82
|
133 AM_CONDITIONAL(HAVE_AVX, test "$have_avx" = "yes")
|
Chris@82
|
134
|
Chris@82
|
135 AC_ARG_ENABLE(avx2, [AC_HELP_STRING([--enable-avx2],[enable AVX2 optimizations])], have_avx2=$enableval, have_avx2=no)
|
Chris@82
|
136 if test "$have_avx2" = "yes"; then
|
Chris@82
|
137 AC_DEFINE(HAVE_AVX2,1,[Define to enable AVX2 optimizations.])
|
Chris@82
|
138 if test "$PRECISION" != "d" -a "$PRECISION" != "s"; then
|
Chris@82
|
139 AC_MSG_ERROR([AVX2 requires single or double precision])
|
Chris@82
|
140 fi
|
Chris@82
|
141 fi
|
Chris@82
|
142 AM_CONDITIONAL(HAVE_AVX2, test "$have_avx2" = "yes")
|
Chris@82
|
143
|
Chris@82
|
144 AC_ARG_ENABLE(avx512, [AC_HELP_STRING([--enable-avx512],[enable AVX512 optimizations])], have_avx512=$enableval, have_avx512=no)
|
Chris@82
|
145 if test "$have_avx512" = "yes"; then
|
Chris@82
|
146 AC_DEFINE(HAVE_AVX512,1,[Define to enable AVX512 optimizations.])
|
Chris@82
|
147 if test "$PRECISION" != "d" -a "$PRECISION" != "s"; then
|
Chris@82
|
148 AC_MSG_ERROR([AVX512 requires single or double precision])
|
Chris@82
|
149 fi
|
Chris@82
|
150 fi
|
Chris@82
|
151 AM_CONDITIONAL(HAVE_AVX512, test "$have_avx512" = "yes")
|
Chris@82
|
152
|
Chris@82
|
153 dnl 128-bit AVX is special. There is no reason to use it on Intel processors
|
Chris@82
|
154 dnl since SSE2 is just as fast. However, on AMD processors we can both use
|
Chris@82
|
155 dnl FMA4, and 128-bit SIMD is better than 256-bit since core pairs in a
|
Chris@82
|
156 dnl compute unit can execute two 128-bit instructions independently.
|
Chris@82
|
157 AC_ARG_ENABLE(avx-128-fma, [AC_HELP_STRING([--enable-avx-128-fma],[enable AVX128/FMA optimizations])], have_avx_128_fma=$enableval, have_avx_128_fma=no)
|
Chris@82
|
158 if test "$have_avx_128_fma" = "yes"; then
|
Chris@82
|
159 AC_DEFINE(HAVE_AVX_128_FMA,1,[Define to enable 128-bit FMA AVX optimization])
|
Chris@82
|
160 AVX_128_FMA_CFLAGS="${AVX_CFLAGS} -mfma4"
|
Chris@82
|
161 AC_SUBST(AVX_128_FMA_CFLAGS)
|
Chris@82
|
162 fi
|
Chris@82
|
163 AM_CONDITIONAL(HAVE_AVX_128_FMA, test "$have_avx_128_fma" = "yes")
|
Chris@82
|
164
|
Chris@82
|
165 AC_ARG_ENABLE(kcvi, [AC_HELP_STRING([--enable-kcvi],[enable Knights Corner vector instructions optimizations])], have_kcvi=$enableval, have_kcvi=no)
|
Chris@82
|
166 if test "$have_kcvi" = "yes"; then
|
Chris@82
|
167 AC_DEFINE(HAVE_KCVI,1,[Define to enable KCVI optimizations.])
|
Chris@82
|
168 if test "$PRECISION" != "d" -a "$PRECISION" != "s"; then
|
Chris@82
|
169 AC_MSG_ERROR([Knights Corner vector instructions requires single or double precision])
|
Chris@82
|
170 fi
|
Chris@82
|
171 fi
|
Chris@82
|
172 AM_CONDITIONAL(HAVE_KCVI, test "$have_kcvi" = "yes")
|
Chris@82
|
173
|
Chris@82
|
174 AC_ARG_ENABLE(altivec, [AC_HELP_STRING([--enable-altivec],[enable Altivec optimizations])], have_altivec=$enableval, have_altivec=no)
|
Chris@82
|
175 if test "$have_altivec" = "yes"; then
|
Chris@82
|
176 AC_DEFINE(HAVE_ALTIVEC,1,[Define to enable Altivec optimizations.])
|
Chris@82
|
177 if test "$PRECISION" != "s"; then
|
Chris@82
|
178 AC_MSG_ERROR([Altivec requires single precision])
|
Chris@82
|
179 fi
|
Chris@82
|
180 fi
|
Chris@82
|
181 AM_CONDITIONAL(HAVE_ALTIVEC, test "$have_altivec" = "yes")
|
Chris@82
|
182
|
Chris@82
|
183 AC_ARG_ENABLE(vsx, [AC_HELP_STRING([--enable-vsx],[enable IBM VSX optimizations])], have_vsx=$enableval, have_vsx=no)
|
Chris@82
|
184 if test "$have_vsx" = "yes"; then
|
Chris@82
|
185 AC_DEFINE(HAVE_VSX,1,[Define to enable IBM VSX optimizations.])
|
Chris@82
|
186 fi
|
Chris@82
|
187 AM_CONDITIONAL(HAVE_VSX, test "$have_vsx" = "yes")
|
Chris@82
|
188
|
Chris@82
|
189 AC_ARG_ENABLE(neon, [AC_HELP_STRING([--enable-neon],[enable ARM NEON optimizations])], have_neon=$enableval, have_neon=no)
|
Chris@82
|
190 if test "$have_neon" = "yes"; then
|
Chris@82
|
191 AC_DEFINE(HAVE_NEON,1,[Define to enable ARM NEON optimizations.])
|
Chris@82
|
192 case "${host_cpu}" in
|
Chris@82
|
193 aarch64)
|
Chris@82
|
194 ;;
|
Chris@82
|
195 *)
|
Chris@82
|
196 if test "$PRECISION" != "s"; then
|
Chris@82
|
197 AC_MSG_ERROR([NEON requires single precision])
|
Chris@82
|
198 fi
|
Chris@82
|
199 ;;
|
Chris@82
|
200 esac
|
Chris@82
|
201 fi
|
Chris@82
|
202 AM_CONDITIONAL(HAVE_NEON, test "$have_neon" = "yes")
|
Chris@82
|
203
|
Chris@82
|
204 AC_ARG_ENABLE(armv8-pmccntr-el0, [AC_HELP_STRING([--enable-armv8-pmccntr-el0],[enable the cycle counter on ARMv8 via the PMCCNTR_EL0 register (see README-perfcounters for details and mandatory instructions)])], have_armv8pmccntrel0=$enableval)
|
Chris@82
|
205 if test "$have_armv8pmccntrel0"x = "yes"x; then
|
Chris@82
|
206 AC_DEFINE(HAVE_ARMV8_PMCCNTR_EL0,1,[Define if you have enabled the PMCCNTR_EL0 cycle counter on ARMv8])
|
Chris@82
|
207 fi
|
Chris@82
|
208
|
Chris@82
|
209 AC_ARG_ENABLE(armv8-cntvct-el0, [AC_HELP_STRING([--enable-armv8-cntvct-el0],[enable the cycle counter on ARMv8 via the CNTVCT_EL0 register (see README-perfcounters for details and mandatory instructions)])], have_armv8cntvctel0=$enableval)
|
Chris@82
|
210 if test "$have_armv8cntvctel0"x = "yes"x; then
|
Chris@82
|
211 AC_DEFINE(HAVE_ARMV8_CNTVCT_EL0,1,[Define if you have enabled the CNTVCT_EL0 cycle counter on ARMv8])
|
Chris@82
|
212 fi
|
Chris@82
|
213
|
Chris@82
|
214 AC_ARG_ENABLE(armv7a-cntvct, [AC_HELP_STRING([--enable-armv7a-cntvct],[enable the cycle counter on Armv7a via the CNTVCT register (see README-perfcounters for details and mandatory instructions)])], have_armv7acntvct=$enableval)
|
Chris@82
|
215 if test "$have_armv7acntvct"x = "yes"x; then
|
Chris@82
|
216 AC_DEFINE(HAVE_ARMV7A_CNTVCT,1,[Define if you have enabled the CNTVCT cycle counter on ARMv7a])
|
Chris@82
|
217 fi
|
Chris@82
|
218
|
Chris@82
|
219 AC_ARG_ENABLE(armv7a-pmccntr, [AC_HELP_STRING([--enable-armv7a-pmccntr],[enable the cycle counter on Armv7a via the PMCCNTR register (see README-perfcounters for details and mandatory instructions)])], have_armv7apmccntr=$enableval)
|
Chris@82
|
220 if test "$have_armv7apmccntr"x = "yes"x; then
|
Chris@82
|
221 AC_DEFINE(HAVE_ARMV7A_PMCCNTR,1,[Define if you have enabled the PMCCNTR cycle counter on ARMv7a])
|
Chris@82
|
222 fi
|
Chris@82
|
223
|
Chris@82
|
224 AC_ARG_ENABLE(generic-simd128, [AC_HELP_STRING([--enable-generic-simd128],[enable generic (gcc) 128-bit SIMD optimizations])], have_generic_simd128=$enableval, have_generic_simd128=no)
|
Chris@82
|
225 if test "$have_generic_simd128" = "yes"; then
|
Chris@82
|
226 AC_DEFINE(HAVE_GENERIC_SIMD128,1,[Define to enable generic (gcc) 128-bit SIMD optimizations.])
|
Chris@82
|
227 fi
|
Chris@82
|
228 AM_CONDITIONAL(HAVE_GENERIC_SIMD128, test "$have_generic_simd128" = "yes")
|
Chris@82
|
229
|
Chris@82
|
230 AC_ARG_ENABLE(generic-simd256, [AC_HELP_STRING([--enable-generic-simd256],[enable generic (gcc) 256-bit SIMD optimizations])], have_generic_simd256=$enableval, have_generic_simd256=no)
|
Chris@82
|
231 if test "$have_generic_simd256" = "yes"; then
|
Chris@82
|
232 AC_DEFINE(HAVE_GENERIC_SIMD256,1,[Define to enable generic (gcc) 256-bit SIMD optimizations.])
|
Chris@82
|
233 fi
|
Chris@82
|
234 AM_CONDITIONAL(HAVE_GENERIC_SIMD256, test "$have_generic_simd256" = "yes")
|
Chris@82
|
235
|
Chris@82
|
236
|
Chris@82
|
237 dnl FIXME:
|
Chris@82
|
238 dnl AC_ARG_ENABLE(mips-ps, [AC_HELP_STRING([--enable-mips-ps],[enable MIPS pair-single optimizations])], have_mips_ps=$enableval, have_mips_ps=no)
|
Chris@82
|
239 dnl if test "$have_mips_ps" = "yes"; then
|
Chris@82
|
240 dnl AC_DEFINE(HAVE_MIPS_PS,1,[Define to enable MIPS paired-single optimizations.])
|
Chris@82
|
241 dnl if test "$PRECISION" != "s"; then
|
Chris@82
|
242 dnl AC_MSG_ERROR([MIPS paired-single requires single precision])
|
Chris@82
|
243 dnl fi
|
Chris@82
|
244 dnl fi
|
Chris@82
|
245 dnl AM_CONDITIONAL(HAVE_MIPS_PS, test "$have_mips_ps" = "yes")
|
Chris@82
|
246
|
Chris@82
|
247 AC_ARG_WITH(slow-timer, [AC_HELP_STRING([--with-slow-timer],[use low-precision timers (SLOW)])], with_slow_timer=$withval, with_slow_timer=no)
|
Chris@82
|
248 if test "$with_slow_timer" = "yes"; then
|
Chris@82
|
249 AC_DEFINE(WITH_SLOW_TIMER,1,[Use low-precision timers, making planner very slow])
|
Chris@82
|
250 fi
|
Chris@82
|
251
|
Chris@82
|
252 AC_ARG_ENABLE(mips_zbus_timer, [AC_HELP_STRING([--enable-mips-zbus-timer],[use MIPS ZBus cycle-counter])], have_mips_zbus_timer=$enableval, have_mips_zbus_timer=no)
|
Chris@82
|
253 if test "$have_mips_zbus_timer" = "yes"; then
|
Chris@82
|
254 AC_DEFINE(HAVE_MIPS_ZBUS_TIMER,1,[Define to enable use of MIPS ZBus cycle-counter.])
|
Chris@82
|
255 fi
|
Chris@82
|
256
|
Chris@82
|
257 AC_ARG_WITH(our-malloc, [AC_HELP_STRING([--with-our-malloc],[use our aligned malloc (helpful for Win32)])], with_our_malloc=$withval, with_our_malloc=no)
|
Chris@82
|
258 AC_ARG_WITH(our-malloc16, [AC_HELP_STRING([--with-our-malloc16],[Obsolete alias for --with-our-malloc16])], with_our_malloc=$withval)
|
Chris@82
|
259 if test "$with_our_malloc" = "yes"; then
|
Chris@82
|
260 AC_DEFINE(WITH_OUR_MALLOC,1,[Use our own aligned malloc routine; mainly helpful for Windows systems lacking aligned allocation system-library routines.])
|
Chris@82
|
261 fi
|
Chris@82
|
262
|
Chris@82
|
263 AC_ARG_WITH(windows-f77-mangling, [AC_HELP_STRING([--with-windows-f77-mangling],[use common Win32 Fortran interface styles])], with_windows_f77_mangling=$withval, with_windows_f77_mangling=no)
|
Chris@82
|
264 if test "$with_windows_f77_mangling" = "yes"; then
|
Chris@82
|
265 AC_DEFINE(WINDOWS_F77_MANGLING,1,[Use common Windows Fortran mangling styles for the Fortran interfaces.])
|
Chris@82
|
266 fi
|
Chris@82
|
267
|
Chris@82
|
268 AC_ARG_WITH(incoming-stack-boundary, [AC_HELP_STRING([--with-incoming-stack-boundary=X],[Assume that stack is aligned to (1<<X) bytes])], with_incoming_stack_boundary=$withval, with_incoming_stack_boundary=no)
|
Chris@82
|
269
|
Chris@82
|
270
|
Chris@82
|
271 AC_ARG_ENABLE(fma, [AC_HELP_STRING([--enable-fma],[enable if the machine architecture "naturally" prefers fused multiply-add instructions])], arch_prefers_fma=$enableval)
|
Chris@82
|
272 if test "$arch_prefers_fma"x = "yes"x; then
|
Chris@82
|
273 AC_DEFINE(ARCH_PREFERS_FMA,1,[Define if the machine architecture "naturally" prefers fused multiply-add instructions])
|
Chris@82
|
274 fi
|
Chris@82
|
275
|
Chris@82
|
276 dnl compute library suffix
|
Chris@82
|
277 case "$PRECISION" in
|
Chris@82
|
278 s) PREC_SUFFIX=f;;
|
Chris@82
|
279 d) PREC_SUFFIX=;;
|
Chris@82
|
280 l) PREC_SUFFIX=l;;
|
Chris@82
|
281 q) PREC_SUFFIX=q;;
|
Chris@82
|
282 esac
|
Chris@82
|
283 AC_SUBST(PREC_SUFFIX)
|
Chris@82
|
284
|
Chris@82
|
285 dnl Checks for programs.
|
Chris@82
|
286 AC_PROG_CC
|
Chris@82
|
287 AM_PROG_CC_C_O
|
Chris@82
|
288 AX_COMPILER_VENDOR
|
Chris@82
|
289 AC_PROG_CC_STDC
|
Chris@82
|
290 AC_PROG_INSTALL
|
Chris@82
|
291 AC_PROG_LN_S
|
Chris@82
|
292 AC_PROG_MAKE_SET
|
Chris@82
|
293 AC_LIBTOOL_WIN32_DLL
|
Chris@82
|
294 AC_PROG_LIBTOOL
|
Chris@82
|
295 AC_PROG_RANLIB
|
Chris@82
|
296
|
Chris@82
|
297 AC_CHECK_PROG(OCAMLBUILD, ocamlbuild, ocamlbuild)
|
Chris@82
|
298
|
Chris@82
|
299 dnl -----------------------------------------------------------------------
|
Chris@82
|
300
|
Chris@82
|
301 AC_ARG_ENABLE(mpi, [AC_HELP_STRING([--enable-mpi],[compile FFTW MPI library])], enable_mpi=$enableval, enable_mpi=no)
|
Chris@82
|
302
|
Chris@82
|
303 if test "$enable_mpi" = "yes"; then
|
Chris@82
|
304 if test $PRECISION = q; then
|
Chris@82
|
305 AC_MSG_ERROR([quad precision is not supported in MPI])
|
Chris@82
|
306 fi
|
Chris@82
|
307 ACX_MPI([],[AC_MSG_ERROR([could not find mpi library for --enable-mpi])])
|
Chris@82
|
308 AC_CHECK_PROG(MPIRUN, mpirun, mpirun)
|
Chris@82
|
309 AC_SUBST(MPIRUN)
|
Chris@82
|
310
|
Chris@82
|
311 save_CC=$CC
|
Chris@82
|
312 CC=$MPICC
|
Chris@82
|
313 AC_CHECK_SIZEOF(MPI_Fint, [], [#include <mpi.h>])
|
Chris@82
|
314 CC=$save_CC
|
Chris@82
|
315 if test 0 = $ac_cv_sizeof_MPI_Fint; then
|
Chris@82
|
316 AC_MSG_WARN([sizeof(MPI_Fint) test failed]);
|
Chris@82
|
317 dnl As a backup, assume Fortran integer == C int
|
Chris@82
|
318 AC_CHECK_SIZEOF(int)
|
Chris@82
|
319 if test 0 = $ac_cv_sizeof_int; then AC_MSG_ERROR([sizeof(int) test failed]); fi
|
Chris@82
|
320 ac_cv_sizeof_MPI_Fint=$ac_cv_sizeof_int
|
Chris@82
|
321 fi
|
Chris@82
|
322 C_MPI_FINT=C_INT`expr $ac_cv_sizeof_MPI_Fint \* 8`_T
|
Chris@82
|
323 AC_SUBST(C_MPI_FINT)
|
Chris@82
|
324 fi
|
Chris@82
|
325 AM_CONDITIONAL(MPI, test "$enable_mpi" = "yes")
|
Chris@82
|
326
|
Chris@82
|
327 dnl -----------------------------------------------------------------------
|
Chris@82
|
328
|
Chris@82
|
329 dnl determine CFLAGS first
|
Chris@82
|
330 AX_CC_MAXOPT
|
Chris@82
|
331
|
Chris@82
|
332 case "${ax_cv_c_compiler_vendor}" in
|
Chris@82
|
333 intel) # Stop icc from defining __GNUC__, except on MacOS where this fails
|
Chris@82
|
334 case "${host_os}" in
|
Chris@82
|
335 *darwin*) ;; # icc -no-gcc fails to compile some system headers
|
Chris@82
|
336 *)
|
Chris@82
|
337 AX_CHECK_COMPILER_FLAGS([-no-gcc], [CC="$CC -no-gcc"])
|
Chris@82
|
338 ;;
|
Chris@82
|
339 esac
|
Chris@82
|
340 ;;
|
Chris@82
|
341
|
Chris@82
|
342 hp) # must (sometimes) manually increase cpp limits to handle fftw3.h
|
Chris@82
|
343 AX_CHECK_COMPILER_FLAGS([-Wp,-H128000],
|
Chris@82
|
344 [CC="$CC -Wp,-H128000"])
|
Chris@82
|
345 ;;
|
Chris@82
|
346
|
Chris@82
|
347 portland) # -Masmkeyword required for asm("") cycle counters
|
Chris@82
|
348 AX_CHECK_COMPILER_FLAGS([-Masmkeyword],
|
Chris@82
|
349 [CC="$CC -Masmkeyword"])
|
Chris@82
|
350 ;;
|
Chris@82
|
351 esac
|
Chris@82
|
352
|
Chris@82
|
353 dnl Determine SIMD CFLAGS at least for gcc and icc
|
Chris@82
|
354 case "${ax_cv_c_compiler_vendor}" in
|
Chris@82
|
355 gnu|intel)
|
Chris@82
|
356 # SSE/SSE2
|
Chris@82
|
357 if test "$have_sse2" = "yes" -a "x$SSE2_CFLAGS" = x; then
|
Chris@82
|
358 if test "$PRECISION" = d; then flag=msse2; else flag=msse; fi
|
Chris@82
|
359 AX_CHECK_COMPILER_FLAGS(-$flag, [SSE2_CFLAGS="-$flag"],
|
Chris@82
|
360 [AC_MSG_ERROR([Need a version of gcc with -$flag])])
|
Chris@82
|
361 fi
|
Chris@82
|
362
|
Chris@82
|
363 # AVX
|
Chris@82
|
364 if test "$have_avx" = "yes" -a "x$AVX_CFLAGS" = x; then
|
Chris@82
|
365 AX_CHECK_COMPILER_FLAGS(-mavx, [AVX_CFLAGS="-mavx"],
|
Chris@82
|
366 [AC_MSG_ERROR([Need a version of gcc with -mavx])])
|
Chris@82
|
367 fi
|
Chris@82
|
368
|
Chris@82
|
369 # AVX2
|
Chris@82
|
370 # gcc-4.8 works with -march=core-avx2, but -mavx2 is not enough.
|
Chris@82
|
371 # Later versions seem to happy with -mavx2, so try the arch one first.
|
Chris@82
|
372 if test "$have_avx2" = "yes" -a "x$AVX2_CFLAGS" = x; then
|
Chris@82
|
373 AX_CHECK_COMPILER_FLAGS(-march=core-avx2, [AVX2_CFLAGS="-march=core-avx2"],
|
Chris@82
|
374 [AX_CHECK_COMPILER_FLAGS(-mavx2, [AVX2_CFLAGS="-mavx2"],
|
Chris@82
|
375 [AC_MSG_ERROR([Need a version of gcc with either -march=core-avx2 or -mavx2])])])
|
Chris@82
|
376 AX_CHECK_COMPILER_FLAGS(-mfma, [AVX2_CFLAGS="$AVX2_CFLAGS -mfma"],
|
Chris@82
|
377 [AC_MSG_WARN([Need a version of gcc with -mfma (harmless for icc)])])
|
Chris@82
|
378 fi
|
Chris@82
|
379
|
Chris@82
|
380 # AVX512
|
Chris@82
|
381 if test "$have_avx512" = "yes" -a "x$AVX512_CFLAGS" = x; then
|
Chris@82
|
382 AX_CHECK_COMPILER_FLAGS(-mavx512f, [AVX512_CFLAGS="-mavx512f"],
|
Chris@82
|
383 [AC_MSG_ERROR([Need a version of gcc with -mavx512f])])
|
Chris@82
|
384 fi
|
Chris@82
|
385
|
Chris@82
|
386 if test "$host_vendor" = "apple"; then
|
Chris@82
|
387 # We need to tell gcc to use an external assembler to get AVX/AVX2 with gcc on OS X
|
Chris@82
|
388 AX_CHECK_COMPILER_FLAGS([-Wa,-q], [CFLAGS="$CFLAGS -Wa,-q"])
|
Chris@82
|
389 # Disable the new compact unwinding format so we avoid warnings/potential errors.
|
Chris@82
|
390 AX_CHECK_COMPILER_FLAGS([-Wl,-no_compact_unwind], [CFLAGS="$CFLAGS -Wl,-no_compact_unwind"])
|
Chris@82
|
391 fi
|
Chris@82
|
392
|
Chris@82
|
393 # KCVI
|
Chris@82
|
394 if test "$have_kcvi" = "yes" -a "x$KCVI_CFLAGS" = x; then
|
Chris@82
|
395 AX_CHECK_COMPILER_FLAGS(-mmic, [KCVI_CFLAGS="-mmic"],
|
Chris@82
|
396 [AC_MSG_ERROR([Need a version of icc with -mmic])])
|
Chris@82
|
397 fi
|
Chris@82
|
398
|
Chris@82
|
399 if test "$have_altivec" = "yes" -a "x$ALTIVEC_CFLAGS" = x; then
|
Chris@82
|
400 # -DFAKE__VEC__ is a workaround because gcc-3.3 does not
|
Chris@82
|
401 # #define __VEC__ with -maltivec.
|
Chris@82
|
402 AX_CHECK_COMPILER_FLAGS(-faltivec, [ALTIVEC_CFLAGS="-faltivec"],
|
Chris@82
|
403 [AX_CHECK_COMPILER_FLAGS(-maltivec -mabi=altivec,
|
Chris@82
|
404 [ALTIVEC_CFLAGS="-maltivec -mabi=altivec -DFAKE__VEC__"],
|
Chris@82
|
405 [AX_CHECK_COMPILER_FLAGS(-fvec, [ALTIVEC_CFLAGS="-fvec"],
|
Chris@82
|
406 [AC_MSG_ERROR([Need a version of gcc with -maltivec])])])])
|
Chris@82
|
407 fi
|
Chris@82
|
408
|
Chris@82
|
409 case "${host_cpu}" in
|
Chris@82
|
410 aarch64)
|
Chris@82
|
411 ;;
|
Chris@82
|
412 *)
|
Chris@82
|
413 if test "$have_neon" = "yes" -a "x$NEON_CFLAGS" = x; then
|
Chris@82
|
414 AX_CHECK_COMPILER_FLAGS(-mfpu=neon, [NEON_CFLAGS="-mfpu=neon"],
|
Chris@82
|
415 [AC_MSG_ERROR([Need a version of gcc with -mfpu=neon])])
|
Chris@82
|
416 fi
|
Chris@82
|
417 ;;
|
Chris@82
|
418 esac
|
Chris@82
|
419
|
Chris@82
|
420 if test "$have_vsx" = "yes" -a "x$VSX_CFLAGS" = x; then
|
Chris@82
|
421 AX_CHECK_COMPILER_FLAGS(-mvsx, [VSX_CFLAGS="-mvsx"],
|
Chris@82
|
422 [AC_MSG_ERROR([Need a version of gcc with -mvsx])])
|
Chris@82
|
423 fi
|
Chris@82
|
424
|
Chris@82
|
425 dnl FIXME:
|
Chris@82
|
426 dnl elif test "$have_mips_ps" = "yes"; then
|
Chris@82
|
427 dnl # Just punt here and use only new 4.2 compiler :(
|
Chris@82
|
428 dnl # Should add section for older compilers...
|
Chris@82
|
429 dnl AX_CHECK_COMPILER_FLAGS(-mpaired-single,
|
Chris@82
|
430 dnl [SIMD_CFLAGS="-mpaired-single"],
|
Chris@82
|
431 dnl #[AC_MSG_ERROR([Need a version of gcc with -mpaired-single])])
|
Chris@82
|
432 dnl [AX_CHECK_COMPILER_FLAGS(-march=mips64,
|
Chris@82
|
433 dnl [SIMD_CFLAGS="-march=mips64"],
|
Chris@82
|
434 dnl [AC_MSG_ERROR(
|
Chris@82
|
435 dnl [Need a version of gcc with -mpaired-single or -march=mips64])
|
Chris@82
|
436 dnl ])])
|
Chris@82
|
437 dnl fi
|
Chris@82
|
438 ;;
|
Chris@82
|
439
|
Chris@82
|
440 clang)
|
Chris@82
|
441
|
Chris@82
|
442 if test "$have_avx" = "yes" -a "x$AVX_CFLAGS" = x; then
|
Chris@82
|
443 AX_CHECK_COMPILER_FLAGS(-mavx, [AVX_CFLAGS="-mavx"],
|
Chris@82
|
444 [AC_MSG_ERROR([Need a version of clang with -mavx])])
|
Chris@82
|
445 fi
|
Chris@82
|
446
|
Chris@82
|
447 if test "$have_avx2" = "yes" -a "x$AVX2_CFLAGS" = x; then
|
Chris@82
|
448 AX_CHECK_COMPILER_FLAGS(-mavx2, [AVX2_CFLAGS="-mavx2"],
|
Chris@82
|
449 [AC_MSG_ERROR([Need a version of clang with -mavx2])])
|
Chris@82
|
450 AX_CHECK_COMPILER_FLAGS(-mfma, [AVX2_CFLAGS="$AVX2_CFLAGS -mfma"])
|
Chris@82
|
451 fi
|
Chris@82
|
452
|
Chris@82
|
453 if test "$have_vsx" = "yes" -a "x$VSX_CFLAGS" = x; then
|
Chris@82
|
454 # clang appears to need both -mvsx and -maltivec for VSX
|
Chris@82
|
455 AX_CHECK_COMPILER_FLAGS(-maltivec, [VSX_CFLAGS="-maltivec"],
|
Chris@82
|
456 [AC_MSG_ERROR([Need a version of gcc with -maltivec])])
|
Chris@82
|
457 AX_CHECK_COMPILER_FLAGS(-mvsx, [VSX_CFLAGS="-mvsx $VSX_CFLAGS"],
|
Chris@82
|
458 [AC_MSG_ERROR([Need a version of gcc with -mvsx])])
|
Chris@82
|
459 fi
|
Chris@82
|
460 ;;
|
Chris@82
|
461
|
Chris@82
|
462 ibm)
|
Chris@82
|
463 if test "$have_vsx" = "yes" -a "x$VSX_CFLAGS" = x; then
|
Chris@82
|
464 # Note that IBM xlC uses -qaltivec for VSX too.
|
Chris@82
|
465 AX_CHECK_COMPILER_FLAGS(-qaltivec, [VSX_CFLAGS="-qaltivec"],
|
Chris@82
|
466 [AC_MSG_ERROR([Need a version of gcc with -qaltivec])])
|
Chris@82
|
467 fi
|
Chris@82
|
468 ;;
|
Chris@82
|
469 esac
|
Chris@82
|
470
|
Chris@82
|
471 AC_SUBST(SSE2_CFLAGS)
|
Chris@82
|
472 AC_SUBST(AVX_CFLAGS)
|
Chris@82
|
473 AC_SUBST(AVX2_CFLAGS)
|
Chris@82
|
474 AC_SUBST(AVX512_CFLAGS)
|
Chris@82
|
475 AC_SUBST(KCVI_CFLAGS)
|
Chris@82
|
476 AC_SUBST(ALTIVEC_CFLAGS)
|
Chris@82
|
477 AC_SUBST(VSX_CFLAGS)
|
Chris@82
|
478 AC_SUBST(NEON_CFLAGS)
|
Chris@82
|
479
|
Chris@82
|
480 dnl add stack alignment CFLAGS if so requested
|
Chris@82
|
481 if test "$with_incoming_stack_boundary"x != "no"x; then
|
Chris@82
|
482 case "${ax_cv_c_compiler_vendor}" in
|
Chris@82
|
483 gnu)
|
Chris@82
|
484 tentative_flags="-mincoming-stack-boundary=$with_incoming_stack_boundary";
|
Chris@82
|
485 AX_CHECK_COMPILER_FLAGS($tentative_flags,
|
Chris@82
|
486 [STACK_ALIGN_CFLAGS=$tentative_flags])
|
Chris@82
|
487 ;;
|
Chris@82
|
488 esac
|
Chris@82
|
489 fi
|
Chris@82
|
490 AC_SUBST(STACK_ALIGN_CFLAGS)
|
Chris@82
|
491
|
Chris@82
|
492 dnl Checks for header files.
|
Chris@82
|
493 AC_HEADER_STDC
|
Chris@82
|
494 AC_CHECK_HEADERS([fcntl.h fenv.h limits.h malloc.h stddef.h sys/time.h])
|
Chris@82
|
495 dnl c_asm.h: Header file for enabling asm() on Digital Unix
|
Chris@82
|
496 dnl intrinsics.h: cray unicos
|
Chris@82
|
497 dnl sys/sysctl.h: MacOS X altivec detection
|
Chris@82
|
498
|
Chris@82
|
499 dnl altivec.h requires $ALTIVEC_CFLAGS (we use this for VSX too, which uses the same header)
|
Chris@82
|
500 save_CFLAGS="$CFLAGS"
|
Chris@82
|
501 save_CPPFLAGS="$CPPFLAGS"
|
Chris@82
|
502 CFLAGS="$CFLAGS $ALTIVEC_CFLAGS $VSX_CFLAGS"
|
Chris@82
|
503 CPPFLAGS="$CPPFLAGS $ALTIVEC_CFLAGS $VSX_CFLAGS"
|
Chris@82
|
504 AC_CHECK_HEADERS([altivec.h])
|
Chris@82
|
505 CFLAGS="$save_CFLAGS"
|
Chris@82
|
506 CPPFLAGS="$save_CPPFLAGS"
|
Chris@82
|
507
|
Chris@82
|
508 dnl Checks for typedefs, structures, and compiler characteristics.
|
Chris@82
|
509 AC_C_CONST
|
Chris@82
|
510 AC_C_INLINE
|
Chris@82
|
511 AC_TYPE_SIZE_T
|
Chris@82
|
512 AC_TYPE_UINT32_T
|
Chris@82
|
513 AC_TYPE_UINT64_T
|
Chris@82
|
514 AC_HEADER_TIME
|
Chris@82
|
515 AC_CHECK_TYPE([long double],
|
Chris@82
|
516 [AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define to 1 if the compiler supports `long double'])],
|
Chris@82
|
517 [
|
Chris@82
|
518 if test $PRECISION = l; then
|
Chris@82
|
519 AC_MSG_ERROR([long double is not a supported type with your compiler.])
|
Chris@82
|
520 fi
|
Chris@82
|
521 ])
|
Chris@82
|
522 AC_CHECK_TYPE([hrtime_t],[AC_DEFINE(HAVE_HRTIME_T, 1, [Define to 1 if hrtime_t is defined in <sys/time.h>])],,
|
Chris@82
|
523 [
|
Chris@82
|
524 #if HAVE_SYS_TIME_H
|
Chris@82
|
525 #include <sys/time.h>
|
Chris@82
|
526 #endif
|
Chris@82
|
527 ])
|
Chris@82
|
528
|
Chris@82
|
529 AC_CHECK_SIZEOF(int)
|
Chris@82
|
530 AC_CHECK_SIZEOF(unsigned int)
|
Chris@82
|
531 AC_CHECK_SIZEOF(long)
|
Chris@82
|
532 AC_CHECK_SIZEOF(unsigned long)
|
Chris@82
|
533 AC_CHECK_SIZEOF(long long)
|
Chris@82
|
534 AC_CHECK_SIZEOF(unsigned long long)
|
Chris@82
|
535 AC_CHECK_SIZEOF(size_t)
|
Chris@82
|
536 AC_CHECK_SIZEOF(ptrdiff_t)
|
Chris@82
|
537
|
Chris@82
|
538 AC_CHECK_TYPES([ptrdiff_t])
|
Chris@82
|
539 AC_CHECK_TYPES(uintptr_t, [], [AC_CHECK_SIZEOF(void *)], [$ac_includes_default
|
Chris@82
|
540 #ifdef HAVE_STDINT_H
|
Chris@82
|
541 # include <stdint.h>
|
Chris@82
|
542 #endif])
|
Chris@82
|
543
|
Chris@82
|
544 AC_CHECK_SIZEOF(float)
|
Chris@82
|
545 AC_CHECK_SIZEOF(double)
|
Chris@82
|
546
|
Chris@82
|
547 dnl Check sizeof fftw_r2r_kind for Fortran interface [it has == sizeof(int)
|
Chris@82
|
548 dnl for years, but being paranoid]. Note: the definition here must match
|
Chris@82
|
549 dnl the one in api/fftw3.h!
|
Chris@82
|
550 AC_CHECK_SIZEOF(fftw_r2r_kind, [], [typedef enum {
|
Chris@82
|
551 FFTW_R2HC=0, FFTW_HC2R=1, FFTW_DHT=2,
|
Chris@82
|
552 FFTW_REDFT00=3, FFTW_REDFT01=4, FFTW_REDFT10=5, FFTW_REDFT11=6,
|
Chris@82
|
553 FFTW_RODFT00=7, FFTW_RODFT01=8, FFTW_RODFT10=9, FFTW_RODFT11=10
|
Chris@82
|
554 } fftw_r2r_kind;])
|
Chris@82
|
555 if test 0 = $ac_cv_sizeof_fftw_r2r_kind; then AC_MSG_ERROR([sizeof(fftw_r2r_kind) test failed]); fi
|
Chris@82
|
556 C_FFTW_R2R_KIND=C_INT`expr $ac_cv_sizeof_fftw_r2r_kind \* 8`_T
|
Chris@82
|
557 AC_SUBST(C_FFTW_R2R_KIND)
|
Chris@82
|
558
|
Chris@82
|
559 dnl Checks for library functions.
|
Chris@82
|
560 AC_FUNC_ALLOCA
|
Chris@82
|
561 AC_FUNC_STRTOD
|
Chris@82
|
562 AC_FUNC_VPRINTF
|
Chris@82
|
563 AC_CHECK_LIB(m, sin)
|
Chris@82
|
564
|
Chris@82
|
565 if test $PRECISION = q; then
|
Chris@82
|
566 AX_GCC_VERSION(4,6,0,[],[AC_MSG_ERROR([gcc 4.6 or later required for quad precision support])])
|
Chris@82
|
567 AC_CHECK_LIB(quadmath, sinq, [], [AC_MSG_ERROR([quad precision requires libquadmath for quad-precision trigonometric routines])])
|
Chris@82
|
568 LIBQUADMATH=-lquadmath
|
Chris@82
|
569 fi
|
Chris@82
|
570 AC_SUBST(LIBQUADMATH)
|
Chris@82
|
571
|
Chris@82
|
572 AC_CHECK_FUNCS([BSDgettimeofday gettimeofday gethrtime read_real_time time_base_to_time drand48 sqrt memset posix_memalign memalign _mm_malloc _mm_free clock_gettime mach_absolute_time sysctl abort sinl cosl snprintf memmove strchr getpagesize])
|
Chris@82
|
573 AC_CHECK_DECLS([sinl, cosl, sinq, cosq],,,[#include <math.h>])
|
Chris@82
|
574 AC_CHECK_DECLS([memalign],,,[
|
Chris@82
|
575 #ifdef HAVE_MALLOC_H
|
Chris@82
|
576 #include <malloc.h>
|
Chris@82
|
577 #endif])
|
Chris@82
|
578 AC_CHECK_DECLS([drand48, srand48, posix_memalign]) dnl in stdlib.h
|
Chris@82
|
579
|
Chris@82
|
580 dnl Cray UNICOS _rtc() (real-time clock) intrinsic
|
Chris@82
|
581 AC_MSG_CHECKING([for _rtc intrinsic])
|
Chris@82
|
582 rtc_ok=yes
|
Chris@82
|
583 AC_TRY_LINK([#ifdef HAVE_INTRINSICS_H
|
Chris@82
|
584 #include <intrinsics.h>
|
Chris@82
|
585 #endif], [_rtc()], [AC_DEFINE(HAVE__RTC,1,[Define if you have the UNICOS _rtc() intrinsic.])], [rtc_ok=no])
|
Chris@82
|
586 AC_MSG_RESULT($rtc_ok)
|
Chris@82
|
587
|
Chris@82
|
588 if test "$PRECISION" = "l"; then
|
Chris@82
|
589 AC_CHECK_FUNCS([cosl sinl tanl], [], [AC_MSG_ERROR([long-double precision requires long-double trigonometric routines])])
|
Chris@82
|
590 fi
|
Chris@82
|
591
|
Chris@82
|
592 AC_MSG_CHECKING([for isnan])
|
Chris@82
|
593 AC_TRY_LINK([#include <math.h>
|
Chris@82
|
594 ], if (!isnan(3.14159)) isnan(2.7183);, ok=yes, ok=no)
|
Chris@82
|
595 if test "$ok" = "yes"; then
|
Chris@82
|
596 AC_DEFINE(HAVE_ISNAN,1,[Define if the isnan() function/macro is available.])
|
Chris@82
|
597 fi
|
Chris@82
|
598 AC_MSG_RESULT(${ok})
|
Chris@82
|
599
|
Chris@82
|
600 dnl TODO
|
Chris@82
|
601 AX_GCC_ALIGNS_STACK()
|
Chris@82
|
602
|
Chris@82
|
603 dnl override CFLAGS selection when debugging
|
Chris@82
|
604 if test "${enable_debug}" = "yes"; then
|
Chris@82
|
605 CFLAGS="-g"
|
Chris@82
|
606 fi
|
Chris@82
|
607
|
Chris@82
|
608 dnl add gcc warnings, in debug/maintainer mode only
|
Chris@82
|
609 if test "$enable_debug" = yes || test "$USE_MAINTAINER_MODE" = yes; then
|
Chris@82
|
610 if test "$ac_test_CFLAGS" != "set"; then
|
Chris@82
|
611 if test $ac_cv_prog_gcc = yes; then
|
Chris@82
|
612 CFLAGS="$CFLAGS -Wall -W -Wcast-qual -Wpointer-arith -Wcast-align -pedantic -Wno-long-long -Wshadow -Wbad-function-cast -Wwrite-strings -Wstrict-prototypes -Wredundant-decls -Wnested-externs" # -Wundef -Wconversion -Wmissing-prototypes -Wmissing-declarations
|
Chris@82
|
613 fi
|
Chris@82
|
614 fi
|
Chris@82
|
615 fi
|
Chris@82
|
616
|
Chris@82
|
617 dnl check for a proper indent in maintainer mode
|
Chris@82
|
618 if test "$USE_MAINTAINER_MODE" = yes; then
|
Chris@82
|
619 AC_PATH_PROG(INDENT, indent, indent)
|
Chris@82
|
620 # if INDENT is set to 'indent' then we didn't find indent
|
Chris@82
|
621 if test "$INDENT" != indent ; then
|
Chris@82
|
622 AC_MSG_CHECKING(if $INDENT is GNU indent)
|
Chris@82
|
623 if $INDENT --version 2>/dev/null | head -n 1|grep "GNU indent" > /dev/null ; then
|
Chris@82
|
624 AC_MSG_RESULT(yes)
|
Chris@82
|
625 INDENT="$INDENT -kr -cs -i5 -l800 -fca -nfc1 -sc -sob -cli4 -TR -Tplanner -TV"
|
Chris@82
|
626 else
|
Chris@82
|
627 AC_MSG_RESULT(no)
|
Chris@82
|
628 AC_MSG_WARN($INDENT does not appear to be GNU indent.)
|
Chris@82
|
629 fi
|
Chris@82
|
630 else
|
Chris@82
|
631 AC_MSG_WARN(no indent program found: codelets will be ugly)
|
Chris@82
|
632 INDENT=cat
|
Chris@82
|
633 fi
|
Chris@82
|
634 fi
|
Chris@82
|
635
|
Chris@82
|
636 dnl -----------------------------------------------------------------------
|
Chris@82
|
637
|
Chris@82
|
638 AC_ARG_ENABLE(fortran, [AC_HELP_STRING([--disable-fortran],[don't include Fortran-callable wrappers])], enable_fortran=$enableval, enable_fortran=yes)
|
Chris@82
|
639
|
Chris@82
|
640 if test "$enable_fortran" = "yes"; then
|
Chris@82
|
641 AC_PROG_F77
|
Chris@82
|
642 if test -z "$F77"; then
|
Chris@82
|
643 enable_fortran=no
|
Chris@82
|
644 AC_MSG_WARN([*** Couldn't find f77 compiler; using default Fortran wrappers.])
|
Chris@82
|
645 else
|
Chris@82
|
646 AC_F77_DUMMY_MAIN([], [enable_fortran=no
|
Chris@82
|
647 AC_MSG_WARN([*** Couldn't figure out how to link C and Fortran; using default Fortran wrappers.])])
|
Chris@82
|
648 fi
|
Chris@82
|
649 else
|
Chris@82
|
650 AC_DEFINE([DISABLE_FORTRAN], 1, [Define to disable Fortran wrappers.])
|
Chris@82
|
651 fi
|
Chris@82
|
652
|
Chris@82
|
653 if test "x$enable_fortran" = xyes; then
|
Chris@82
|
654 AC_F77_WRAPPERS
|
Chris@82
|
655 AC_F77_FUNC(f77foo)
|
Chris@82
|
656 AC_F77_FUNC(f77_foo)
|
Chris@82
|
657 f77_foo2=`echo $f77foo | sed 's/77/77_/'`
|
Chris@82
|
658 if test "$f77_foo" = "$f77_foo2"; then
|
Chris@82
|
659 AC_DEFINE(F77_FUNC_EQUIV, 1, [Define if F77_FUNC and F77_FUNC_ are equivalent.])
|
Chris@82
|
660
|
Chris@82
|
661 # Include g77 wrappers by default for GNU systems or gfortran
|
Chris@82
|
662 with_g77_wrappers=$ac_cv_f77_compiler_gnu
|
Chris@82
|
663 case $host_os in *gnu*) with_g77_wrappers=yes ;; esac
|
Chris@82
|
664 fi
|
Chris@82
|
665 else
|
Chris@82
|
666 with_g77_wrappers=no
|
Chris@82
|
667 fi
|
Chris@82
|
668
|
Chris@82
|
669 AC_ARG_WITH(g77-wrappers, [AC_HELP_STRING([--with-g77-wrappers],[force inclusion of g77-compatible wrappers in addition to any other Fortran compiler that is detected])], with_g77_wrappers=$withval)
|
Chris@82
|
670 if test "x$with_g77_wrappers" = "xyes"; then
|
Chris@82
|
671 AC_DEFINE(WITH_G77_WRAPPERS,1,[Include g77-compatible wrappers in addition to any other Fortran wrappers.])
|
Chris@82
|
672 fi
|
Chris@82
|
673
|
Chris@82
|
674 dnl -----------------------------------------------------------------------
|
Chris@82
|
675 have_smp="no"
|
Chris@82
|
676 AC_ARG_ENABLE(openmp, [AC_HELP_STRING([--enable-openmp],[use OpenMP directives for parallelism])], enable_openmp=$enableval, enable_openmp=no)
|
Chris@82
|
677
|
Chris@82
|
678 if test "$enable_openmp" = "yes"; then
|
Chris@82
|
679 AC_DEFINE(HAVE_OPENMP,1,[Define to enable OpenMP])
|
Chris@82
|
680 AX_OPENMP([], [AC_MSG_ERROR([don't know how to enable OpenMP])])
|
Chris@82
|
681 fi
|
Chris@82
|
682
|
Chris@82
|
683 AC_ARG_ENABLE(threads, [AC_HELP_STRING([--enable-threads],[compile FFTW SMP threads library])], enable_threads=$enableval, enable_threads=no)
|
Chris@82
|
684
|
Chris@82
|
685 if test "$enable_threads" = "yes"; then
|
Chris@82
|
686 AC_DEFINE(HAVE_THREADS,1,[Define to enable SMP threads])
|
Chris@82
|
687 fi
|
Chris@82
|
688
|
Chris@82
|
689 AC_ARG_WITH(combined-threads, [AC_HELP_STRING([--with-combined-threads],[combine threads into main libfftw3])], with_combined_threads=$withval, with_combined_threads=no)
|
Chris@82
|
690
|
Chris@82
|
691 if test "$with_combined_threads" = yes; then
|
Chris@82
|
692 if test "$enable_openmp" = "yes"; then
|
Chris@82
|
693 AC_MSG_ERROR([--with-combined-threads incompatible with --enable-openmp])
|
Chris@82
|
694 fi
|
Chris@82
|
695 if test "$enable_threads" != "yes"; then
|
Chris@82
|
696 AC_MSG_ERROR([--with-combined-threads requires --enable-threads])
|
Chris@82
|
697 fi
|
Chris@82
|
698 fi
|
Chris@82
|
699
|
Chris@82
|
700 dnl Check for threads library...
|
Chris@82
|
701 THREADLIBS=""
|
Chris@82
|
702 if test "$enable_threads" = "yes"; then
|
Chris@82
|
703 # Win32 threads are the default on Windows:
|
Chris@82
|
704 if test -z "$THREADLIBS"; then
|
Chris@82
|
705 AC_MSG_CHECKING([for Win32 threads])
|
Chris@82
|
706 AC_TRY_LINK([#include <windows.h>],
|
Chris@82
|
707 [_beginthreadex(0,0,0,0,0,0);],
|
Chris@82
|
708 [THREADLIBS=" "; AC_MSG_RESULT(yes)],
|
Chris@82
|
709 [AC_MSG_RESULT(no)])
|
Chris@82
|
710 fi
|
Chris@82
|
711
|
Chris@82
|
712 # POSIX threads, the default choice everywhere else:
|
Chris@82
|
713 if test -z "$THREADLIBS"; then
|
Chris@82
|
714 ACX_PTHREAD([THREADLIBS="$PTHREAD_LIBS "
|
Chris@82
|
715 CC="$PTHREAD_CC"
|
Chris@82
|
716 AC_DEFINE(USING_POSIX_THREADS, 1, [Define if we have and are using POSIX threads.])])
|
Chris@82
|
717 fi
|
Chris@82
|
718
|
Chris@82
|
719 if test -z "$THREADLIBS"; then
|
Chris@82
|
720 AC_MSG_ERROR([couldn't find threads library for --enable-threads])
|
Chris@82
|
721 fi
|
Chris@82
|
722 AC_DEFINE(HAVE_THREADS, 1, [Define if we have a threads library.])
|
Chris@82
|
723 fi
|
Chris@82
|
724 AC_SUBST(THREADLIBS)
|
Chris@82
|
725 AM_CONDITIONAL(THREADS, test "$enable_threads" = "yes")
|
Chris@82
|
726 AM_CONDITIONAL(OPENMP, test "$enable_openmp" = "yes")
|
Chris@82
|
727 AM_CONDITIONAL(SMP, test "$enable_threads" = "yes" -o "$enable_openmp" = "yes")
|
Chris@82
|
728 AM_CONDITIONAL(COMBINED_THREADS, test x"$with_combined_threads" = xyes)
|
Chris@82
|
729
|
Chris@82
|
730 dnl -----------------------------------------------------------------------
|
Chris@82
|
731
|
Chris@82
|
732 AC_MSG_CHECKING([whether a cycle counter is available])
|
Chris@82
|
733 save_CPPFLAGS=$CPPFLAGS
|
Chris@82
|
734 CPPFLAGS="$CPPFLAGS -I$srcdir/kernel"
|
Chris@82
|
735 AC_TRY_CPP([#include "cycle.h"
|
Chris@82
|
736 #ifndef HAVE_TICK_COUNTER
|
Chris@82
|
737 # error No cycle counter
|
Chris@82
|
738 #endif], [ok=yes], [ok=no])
|
Chris@82
|
739 CPPFLAGS=$save_CPPFLAGS
|
Chris@82
|
740 AC_MSG_RESULT($ok)
|
Chris@82
|
741 if test $ok = no && test "x$with_slow_timer" = xno; then
|
Chris@82
|
742 echo "***************************************************************"
|
Chris@82
|
743 echo "WARNING: No cycle counter found. FFTW will use ESTIMATE mode "
|
Chris@82
|
744 echo " for all plans. See the manual for more information."
|
Chris@82
|
745 echo "***************************************************************"
|
Chris@82
|
746 fi
|
Chris@82
|
747
|
Chris@82
|
748 dnl -----------------------------------------------------------------------
|
Chris@82
|
749
|
Chris@82
|
750 AC_DEFINE_UNQUOTED(FFTW_CC, "$CC $CFLAGS", [C compiler name and flags])
|
Chris@82
|
751
|
Chris@82
|
752 AC_CONFIG_FILES([
|
Chris@82
|
753 Makefile
|
Chris@82
|
754 support/Makefile
|
Chris@82
|
755 genfft/Makefile
|
Chris@82
|
756 kernel/Makefile
|
Chris@82
|
757 simd-support/Makefile
|
Chris@82
|
758
|
Chris@82
|
759 dft/Makefile
|
Chris@82
|
760 dft/scalar/Makefile
|
Chris@82
|
761 dft/scalar/codelets/Makefile
|
Chris@82
|
762 dft/simd/Makefile
|
Chris@82
|
763 dft/simd/common/Makefile
|
Chris@82
|
764 dft/simd/sse2/Makefile
|
Chris@82
|
765 dft/simd/avx/Makefile
|
Chris@82
|
766 dft/simd/avx-128-fma/Makefile
|
Chris@82
|
767 dft/simd/avx2/Makefile
|
Chris@82
|
768 dft/simd/avx2-128/Makefile
|
Chris@82
|
769 dft/simd/avx512/Makefile
|
Chris@82
|
770 dft/simd/kcvi/Makefile
|
Chris@82
|
771 dft/simd/altivec/Makefile
|
Chris@82
|
772 dft/simd/vsx/Makefile
|
Chris@82
|
773 dft/simd/neon/Makefile
|
Chris@82
|
774 dft/simd/generic-simd128/Makefile
|
Chris@82
|
775 dft/simd/generic-simd256/Makefile
|
Chris@82
|
776
|
Chris@82
|
777 rdft/Makefile
|
Chris@82
|
778 rdft/scalar/Makefile
|
Chris@82
|
779 rdft/scalar/r2cf/Makefile
|
Chris@82
|
780 rdft/scalar/r2cb/Makefile
|
Chris@82
|
781 rdft/scalar/r2r/Makefile
|
Chris@82
|
782 rdft/simd/Makefile
|
Chris@82
|
783 rdft/simd/common/Makefile
|
Chris@82
|
784 rdft/simd/sse2/Makefile
|
Chris@82
|
785 rdft/simd/avx/Makefile
|
Chris@82
|
786 rdft/simd/avx-128-fma/Makefile
|
Chris@82
|
787 rdft/simd/avx2/Makefile
|
Chris@82
|
788 rdft/simd/avx2-128/Makefile
|
Chris@82
|
789 rdft/simd/avx512/Makefile
|
Chris@82
|
790 rdft/simd/kcvi/Makefile
|
Chris@82
|
791 rdft/simd/altivec/Makefile
|
Chris@82
|
792 rdft/simd/vsx/Makefile
|
Chris@82
|
793 rdft/simd/neon/Makefile
|
Chris@82
|
794 rdft/simd/generic-simd128/Makefile
|
Chris@82
|
795 rdft/simd/generic-simd256/Makefile
|
Chris@82
|
796
|
Chris@82
|
797 reodft/Makefile
|
Chris@82
|
798
|
Chris@82
|
799 threads/Makefile
|
Chris@82
|
800
|
Chris@82
|
801 api/Makefile
|
Chris@82
|
802
|
Chris@82
|
803 mpi/Makefile
|
Chris@82
|
804
|
Chris@82
|
805 libbench2/Makefile
|
Chris@82
|
806 tests/Makefile
|
Chris@82
|
807 doc/Makefile
|
Chris@82
|
808 doc/FAQ/Makefile
|
Chris@82
|
809
|
Chris@82
|
810 tools/Makefile
|
Chris@82
|
811 tools/fftw_wisdom.1
|
Chris@82
|
812 tools/fftw-wisdom-to-conf
|
Chris@82
|
813
|
Chris@82
|
814 m4/Makefile
|
Chris@82
|
815
|
Chris@82
|
816 fftw.pc
|
Chris@82
|
817 ])
|
Chris@82
|
818
|
Chris@82
|
819 AC_OUTPUT
|