Mercurial > hg > js-dsp-test
comparison fft/fftw/fftw-3.3.4/configure.ac @ 19:26056e866c29
Add FFTW to comparison table
author | Chris Cannam |
---|---|
date | Tue, 06 Oct 2015 13:08:39 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
18:8db794ca3e0b | 19:26056e866c29 |
---|---|
1 dnl Process this file with autoconf to produce a configure script. | |
2 | |
3 dnl Define the fftw version number as M4 macros, so that we can enforce | |
4 dnl the invariant that the minor version number in FFTW-X.Y.MINOR is the same | |
5 dnl as the revision number in SHARED_VERSION_INFO. | |
6 define(FFTW_MAJOR_VERSION, 3.3)dnl | |
7 define(FFTW_MINOR_VERSION, 4)dnl | |
8 | |
9 dnl Version number of the FFTW source package. | |
10 AC_INIT(fftw, FFTW_MAJOR_VERSION.FFTW_MINOR_VERSION, fftw@fftw.org) | |
11 AC_CONFIG_SRCDIR(kernel/ifftw.h) | |
12 | |
13 dnl Version number for libtool shared libraries. Libtool wants a string | |
14 dnl of the form CURRENT:REVISION:AGE. We adopt the convention that | |
15 dnl REVISION is the same as the FFTW minor version number. | |
16 dnl fftw-3.1.x was 4:x:1 | |
17 dnl fftw-3.2.x was 5:x:2 | |
18 dnl fftw-3.3.x was 6:x:3 for x < 4 and 7:x:4 for x >= 4 | |
19 SHARED_VERSION_INFO="7:FFTW_MINOR_VERSION:4" # CURRENT:REVISION:AGE | |
20 | |
21 AM_INIT_AUTOMAKE(1.7) | |
22 AM_CONFIG_HEADER(config.h) | |
23 AC_CONFIG_MACRO_DIR([m4]) | |
24 AM_MAINTAINER_MODE | |
25 AC_SUBST(SHARED_VERSION_INFO) | |
26 AC_DISABLE_SHARED dnl to hell with shared libraries | |
27 AC_CANONICAL_HOST | |
28 | |
29 dnl configure options | |
30 case "${host_cpu}" in | |
31 powerpc*) have_fma=yes;; | |
32 ia64*) have_fma=yes;; | |
33 hppa*) have_fma=yes;; | |
34 mips64*) have_fma=yes;; | |
35 *) have_fma=no;; | |
36 esac | |
37 | |
38 AC_ARG_ENABLE(fma, [AC_HELP_STRING([--enable-fma],[enable optimizations for machines with fused multiply-add])], have_fma=$enableval) | |
39 if test "$have_fma"x = "yes"x; then | |
40 AC_DEFINE(HAVE_FMA,1,[Define if you have a machine with fused multiply-add]) | |
41 fi | |
42 | |
43 | |
44 AC_ARG_ENABLE(debug, [AC_HELP_STRING([--enable-debug],[compile fftw with extra runtime checks for debugging])], ok=$enableval, ok=no) | |
45 if test "$ok" = "yes"; then | |
46 AC_DEFINE(FFTW_DEBUG,1,[Define to enable extra FFTW debugging code.]) | |
47 debug_malloc=yes | |
48 else | |
49 debug_malloc=no | |
50 fi | |
51 | |
52 AC_ARG_ENABLE(debug-malloc, [AC_HELP_STRING([--enable-debug-malloc],[enable malloc debugging version])], ok=$enableval, ok=$debug_malloc) | |
53 if test "$ok" = "yes"; then | |
54 AC_DEFINE(FFTW_DEBUG_MALLOC,1,[Define to enable debugging malloc.]) | |
55 fi | |
56 | |
57 AC_ARG_ENABLE(debug-alignment, [AC_HELP_STRING([--enable-debug-alignment],[enable alignment debugging hacks])], ok=$enableval, ok=no) | |
58 if test "$ok" = "yes"; then | |
59 AC_DEFINE(FFTW_DEBUG_ALIGNMENT,1,[Define to enable alignment debugging hacks.]) | |
60 fi | |
61 | |
62 AC_ARG_ENABLE(random-estimator, [AC_HELP_STRING([--enable-random-estimator],[enable pseudorandom estimator (debugging hack)])], ok=$enableval, ok=no) | |
63 if test "$ok" = "yes"; then | |
64 AC_DEFINE(FFTW_RANDOM_ESTIMATOR,1,[Define to enable pseudorandom estimate planning for debugging.]) | |
65 CHECK_PL_OPTS="--estimate" | |
66 fi | |
67 | |
68 AC_ARG_ENABLE(alloca, [AC_HELP_STRING([--disable-alloca],[disable use of the alloca() function (may be broken on mingw64)])], ok=$enableval, ok=yes) | |
69 if test "$ok" = "yes"; then | |
70 AC_DEFINE(FFTW_ENABLE_ALLOCA,1,[Define to enable the use of alloca().]) | |
71 fi | |
72 | |
73 AC_ARG_ENABLE(single, [AC_HELP_STRING([--enable-single],[compile fftw in single precision])], ok=$enableval, ok=no) | |
74 AC_ARG_ENABLE(float, [AC_HELP_STRING([--enable-float],[synonym for --enable-single])], ok=$enableval) | |
75 if test "$ok" = "yes"; then | |
76 AC_DEFINE(FFTW_SINGLE,1,[Define to compile in single precision.]) | |
77 AC_DEFINE(BENCHFFT_SINGLE,1,[Define to compile in single precision.]) | |
78 PRECISION=s | |
79 else | |
80 PRECISION=d | |
81 fi | |
82 AM_CONDITIONAL(SINGLE, test "$ok" = "yes") | |
83 | |
84 AC_ARG_ENABLE(long-double, [AC_HELP_STRING([--enable-long-double],[compile fftw in long-double precision])], ok=$enableval, ok=no) | |
85 if test "$ok" = "yes"; then | |
86 if test "$PRECISION" = "s"; then | |
87 AC_MSG_ERROR([--enable-single/--enable-long-double conflict]) | |
88 fi | |
89 AC_DEFINE(FFTW_LDOUBLE,1,[Define to compile in long-double precision.]) | |
90 AC_DEFINE(BENCHFFT_LDOUBLE,1,[Define to compile in long-double precision.]) | |
91 PRECISION=l | |
92 fi | |
93 AM_CONDITIONAL(LDOUBLE, test "$ok" = "yes") | |
94 | |
95 AC_ARG_ENABLE(quad-precision, [AC_HELP_STRING([--enable-quad-precision],[compile fftw in quadruple precision if available])], ok=$enableval, ok=no) | |
96 if test "$ok" = "yes"; then | |
97 if test "$PRECISION" != "d"; then | |
98 AC_MSG_ERROR([conflicting precisions specified]) | |
99 fi | |
100 AC_DEFINE(FFTW_QUAD,1,[Define to compile in quad precision.]) | |
101 AC_DEFINE(BENCHFFT_QUAD,1,[Define to compile in quad precision.]) | |
102 PRECISION=q | |
103 fi | |
104 AM_CONDITIONAL(QUAD, test "$ok" = "yes") | |
105 | |
106 AC_SUBST(PRECISION) | |
107 AC_SUBST(CHECK_PL_OPTS) | |
108 | |
109 AC_ARG_ENABLE(sse, [AC_HELP_STRING([--enable-sse],[enable SSE optimizations])], have_sse=$enableval, have_sse=no) | |
110 if test "$have_sse" = "yes"; then | |
111 if test "$PRECISION" != "s"; then | |
112 AC_MSG_ERROR([SSE requires single precision]) | |
113 fi | |
114 fi | |
115 | |
116 AC_ARG_ENABLE(sse2, [AC_HELP_STRING([--enable-sse2],[enable SSE/SSE2 optimizations])], have_sse2=$enableval, have_sse2=no) | |
117 if test "$have_sse" = "yes"; then have_sse2=yes; fi | |
118 if test "$have_sse2" = "yes"; then | |
119 AC_DEFINE(HAVE_SSE2,1,[Define to enable SSE/SSE2 optimizations.]) | |
120 if test "$PRECISION" != "d" -a "$PRECISION" != "s"; then | |
121 AC_MSG_ERROR([SSE2 requires single or double precision]) | |
122 fi | |
123 fi | |
124 AM_CONDITIONAL(HAVE_SSE2, test "$have_sse2" = "yes") | |
125 | |
126 AC_ARG_ENABLE(avx, [AC_HELP_STRING([--enable-avx],[enable AVX optimizations])], have_avx=$enableval, have_avx=no) | |
127 if test "$have_avx" = "yes"; then | |
128 AC_DEFINE(HAVE_AVX,1,[Define to enable AVX optimizations.]) | |
129 if test "$PRECISION" != "d" -a "$PRECISION" != "s"; then | |
130 AC_MSG_ERROR([AVX requires single or double precision]) | |
131 fi | |
132 fi | |
133 AM_CONDITIONAL(HAVE_AVX, test "$have_avx" = "yes") | |
134 | |
135 AC_ARG_ENABLE(altivec, [AC_HELP_STRING([--enable-altivec],[enable Altivec optimizations])], have_altivec=$enableval, have_altivec=no) | |
136 if test "$have_altivec" = "yes"; then | |
137 AC_DEFINE(HAVE_ALTIVEC,1,[Define to enable Altivec optimizations.]) | |
138 if test "$PRECISION" != "s"; then | |
139 AC_MSG_ERROR([Altivec requires single precision]) | |
140 fi | |
141 fi | |
142 AM_CONDITIONAL(HAVE_ALTIVEC, test "$have_altivec" = "yes") | |
143 | |
144 AC_ARG_ENABLE(neon, [AC_HELP_STRING([--enable-neon],[enable ARM NEON optimizations])], have_neon=$enableval, have_neon=no) | |
145 if test "$have_neon" = "yes"; then | |
146 AC_DEFINE(HAVE_NEON,1,[Define to enable ARM NEON optimizations.]) | |
147 if test "$PRECISION" != "s"; then | |
148 AC_MSG_ERROR([NEON requires single precision]) | |
149 fi | |
150 fi | |
151 AM_CONDITIONAL(HAVE_NEON, test "$have_neon" = "yes") | |
152 | |
153 dnl FIXME: | |
154 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) | |
155 dnl if test "$have_mips_ps" = "yes"; then | |
156 dnl AC_DEFINE(HAVE_MIPS_PS,1,[Define to enable MIPS paired-single optimizations.]) | |
157 dnl if test "$PRECISION" != "s"; then | |
158 dnl AC_MSG_ERROR([MIPS paired-single requires single precision]) | |
159 dnl fi | |
160 dnl fi | |
161 dnl AM_CONDITIONAL(HAVE_MIPS_PS, test "$have_mips_ps" = "yes") | |
162 | |
163 AC_ARG_WITH(slow-timer, [AC_HELP_STRING([--with-slow-timer],[use low-precision timers (SLOW)])], with_slow_timer=$withval, with_slow_timer=no) | |
164 if test "$with_slow_timer" = "yes"; then | |
165 AC_DEFINE(WITH_SLOW_TIMER,1,[Use low-precision timers, making planner very slow]) | |
166 fi | |
167 | |
168 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) | |
169 if test "$have_mips_zbus_timer" = "yes"; then | |
170 AC_DEFINE(HAVE_MIPS_ZBUS_TIMER,1,[Define to enable use of MIPS ZBus cycle-counter.]) | |
171 fi | |
172 | |
173 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) | |
174 AC_ARG_WITH(our-malloc16, [AC_HELP_STRING([--with-our-malloc16],[Obsolete alias for --with-our-malloc16])], with_our_malloc=$withval) | |
175 if test "$with_our_malloc" = "yes"; then | |
176 AC_DEFINE(WITH_OUR_MALLOC,1,[Use our own aligned malloc routine; mainly helpful for Windows systems lacking aligned allocation system-library routines.]) | |
177 fi | |
178 | |
179 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) | |
180 if test "$with_windows_f77_mangling" = "yes"; then | |
181 AC_DEFINE(WINDOWS_F77_MANGLING,1,[Use common Windows Fortran mangling styles for the Fortran interfaces.]) | |
182 fi | |
183 | |
184 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) | |
185 | |
186 dnl compute library suffix | |
187 case "$PRECISION" in | |
188 s) PREC_SUFFIX=f;; | |
189 d) PREC_SUFFIX=;; | |
190 l) PREC_SUFFIX=l;; | |
191 q) PREC_SUFFIX=q;; | |
192 esac | |
193 AC_SUBST(PREC_SUFFIX) | |
194 | |
195 dnl Checks for programs. | |
196 AC_PROG_CC | |
197 AM_PROG_CC_C_O | |
198 AX_COMPILER_VENDOR | |
199 AC_PROG_CC_STDC | |
200 AC_PROG_INSTALL | |
201 AC_PROG_LN_S | |
202 AC_PROG_MAKE_SET | |
203 AC_LIBTOOL_WIN32_DLL | |
204 AC_PROG_LIBTOOL | |
205 | |
206 AC_CHECK_PROG(OCAMLBUILD, ocamlbuild, ocamlbuild) | |
207 | |
208 dnl ----------------------------------------------------------------------- | |
209 | |
210 AC_ARG_ENABLE(mpi, [AC_HELP_STRING([--enable-mpi],[compile FFTW MPI library])], enable_mpi=$enableval, enable_mpi=no) | |
211 | |
212 if test "$enable_mpi" = "yes"; then | |
213 if test $PRECISION = q; then | |
214 AC_MSG_ERROR([quad precision is not supported in MPI]) | |
215 fi | |
216 ACX_MPI([],[AC_MSG_ERROR([could not find mpi library for --enable-mpi])]) | |
217 AC_CHECK_PROG(MPIRUN, mpirun, mpirun) | |
218 AC_SUBST(MPIRUN) | |
219 | |
220 save_CC=$CC | |
221 CC=$MPICC | |
222 AC_CHECK_SIZEOF(MPI_Fint, [], [#include <mpi.h>]) | |
223 CC=$save_CC | |
224 if test 0 = $ac_cv_sizeof_MPI_Fint; then | |
225 AC_MSG_WARN([sizeof(MPI_Fint) test failed]); | |
226 dnl As a backup, assume Fortran integer == C int | |
227 AC_CHECK_SIZEOF(int) | |
228 if test 0 = $ac_cv_sizeof_int; then AC_MSG_ERROR([sizeof(int) test failed]); fi | |
229 ac_cv_sizeof_MPI_Fint=$ac_cv_sizeof_int | |
230 fi | |
231 C_MPI_FINT=C_INT`expr $ac_cv_sizeof_MPI_Fint \* 8`_T | |
232 AC_SUBST(C_MPI_FINT) | |
233 fi | |
234 AM_CONDITIONAL(MPI, test "$enable_mpi" = "yes") | |
235 | |
236 dnl ----------------------------------------------------------------------- | |
237 | |
238 dnl determine CFLAGS first | |
239 AX_CC_MAXOPT | |
240 | |
241 case "${ax_cv_c_compiler_vendor}" in | |
242 intel) # Stop icc from defining __GNUC__, except on MacOS where this fails | |
243 case "${host_os}" in | |
244 *darwin*) ;; # icc -no-gcc fails to compile some system headers | |
245 *) | |
246 AX_CHECK_COMPILER_FLAGS([-no-gcc], [CC="$CC -no-gcc"]) | |
247 ;; | |
248 esac | |
249 ;; | |
250 | |
251 hp) # must (sometimes) manually increase cpp limits to handle fftw3.h | |
252 AX_CHECK_COMPILER_FLAGS([-Wp,-H128000], | |
253 [CC="$CC -Wp,-H128000"]) | |
254 ;; | |
255 | |
256 portland) # -Masmkeyword required for asm("") cycle counters | |
257 AX_CHECK_COMPILER_FLAGS([-Masmkeyword], | |
258 [CC="$CC -Masmkeyword"]) | |
259 ;; | |
260 esac | |
261 | |
262 dnl Determine SIMD CFLAGS at least for gcc and icc | |
263 case "${ax_cv_c_compiler_vendor}" in | |
264 gnu|intel) | |
265 # SSE/SSE2 | |
266 if test "$have_sse2" = "yes" -a "x$SSE2_CFLAGS" = x; then | |
267 if test "$PRECISION" = d; then flag=msse2; else flag=msse; fi | |
268 AX_CHECK_COMPILER_FLAGS(-$flag, [SSE2_CFLAGS="-$flag"], | |
269 [AC_MSG_ERROR([Need a version of gcc with -$flag])]) | |
270 fi | |
271 | |
272 # AVX | |
273 if test "$have_avx" = "yes" -a "x$AVX_CFLAGS" = x; then | |
274 AX_CHECK_COMPILER_FLAGS(-mavx, [AVX_CFLAGS="-mavx"], | |
275 [AC_MSG_ERROR([Need a version of gcc with -mavx])]) | |
276 fi | |
277 | |
278 if test "$have_altivec" = "yes" -a "x$ALTIVEC_CFLAGS" = x; then | |
279 # -DFAKE__VEC__ is a workaround because gcc-3.3 does not | |
280 # #define __VEC__ with -maltivec. | |
281 AX_CHECK_COMPILER_FLAGS(-faltivec, [ALTIVEC_CFLAGS="-faltivec"], | |
282 [AX_CHECK_COMPILER_FLAGS(-maltivec -mabi=altivec, | |
283 [ALTIVEC_CFLAGS="-maltivec -mabi=altivec -DFAKE__VEC__"], | |
284 [AX_CHECK_COMPILER_FLAGS(-fvec, [ALTIVEC_CFLAGS="-fvec"], | |
285 [AC_MSG_ERROR([Need a version of gcc with -maltivec])])])]) | |
286 fi | |
287 | |
288 if test "$have_neon" = "yes" -a "x$NEON_CFLAGS" = x; then | |
289 AX_CHECK_COMPILER_FLAGS(-mfpu=neon, [NEON_CFLAGS="-mfpu=neon"], | |
290 [AC_MSG_ERROR([Need a version of gcc with -mfpu=neon])]) | |
291 fi | |
292 | |
293 dnl FIXME: | |
294 dnl elif test "$have_mips_ps" = "yes"; then | |
295 dnl # Just punt here and use only new 4.2 compiler :( | |
296 dnl # Should add section for older compilers... | |
297 dnl AX_CHECK_COMPILER_FLAGS(-mpaired-single, | |
298 dnl [SIMD_CFLAGS="-mpaired-single"], | |
299 dnl #[AC_MSG_ERROR([Need a version of gcc with -mpaired-single])]) | |
300 dnl [AX_CHECK_COMPILER_FLAGS(-march=mips64, | |
301 dnl [SIMD_CFLAGS="-march=mips64"], | |
302 dnl [AC_MSG_ERROR( | |
303 dnl [Need a version of gcc with -mpaired-single or -march=mips64]) | |
304 dnl ])]) | |
305 dnl fi | |
306 ;; | |
307 esac | |
308 | |
309 AC_SUBST(SSE2_CFLAGS) | |
310 AC_SUBST(AVX_CFLAGS) | |
311 AC_SUBST(ALTIVEC_CFLAGS) | |
312 AC_SUBST(NEON_CFLAGS) | |
313 | |
314 dnl add stack alignment CFLAGS if so requested | |
315 if test "$with_incoming_stack_boundary"x != "no"x; then | |
316 case "${ax_cv_c_compiler_vendor}" in | |
317 gnu) | |
318 tentative_flags="-mincoming-stack-boundary=$with_incoming_stack_boundary"; | |
319 AX_CHECK_COMPILER_FLAGS($tentative_flags, | |
320 [STACK_ALIGN_CFLAGS=$tentative_flags]) | |
321 ;; | |
322 esac | |
323 fi | |
324 AC_SUBST(STACK_ALIGN_CFLAGS) | |
325 | |
326 dnl Checks for header files. | |
327 AC_HEADER_STDC | |
328 AC_CHECK_HEADERS([libintl.h malloc.h stddef.h stdlib.h string.h strings.h sys/time.h unistd.h limits.h c_asm.h intrinsics.h stdint.h mach/mach_time.h sys/sysctl.h]) | |
329 dnl c_asm.h: Header file for enabling asm() on Digital Unix | |
330 dnl intrinsics.h: cray unicos | |
331 dnl sys/sysctl.h: MacOS X altivec detection | |
332 | |
333 dnl altivec.h requires $ALTIVEC_CFLAGS | |
334 save_CFLAGS="$CFLAGS" | |
335 save_CPPFLAGS="$CPPFLAGS" | |
336 CFLAGS="$CFLAGS $ALTIVEC_CFLAGS" | |
337 CPPFLAGS="$CPPFLAGS $ALTIVEC_CFLAGS" | |
338 AC_CHECK_HEADERS([altivec.h]) | |
339 CFLAGS="$save_CFLAGS" | |
340 CPPFLAGS="$save_CPPFLAGS" | |
341 | |
342 | |
343 dnl Checks for typedefs, structures, and compiler characteristics. | |
344 AC_C_CONST | |
345 AC_C_INLINE | |
346 AC_TYPE_SIZE_T | |
347 AC_HEADER_TIME | |
348 AC_CHECK_TYPE([long double], | |
349 [AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define to 1 if the compiler supports `long double'])], | |
350 [ | |
351 if test $PRECISION = l; then | |
352 AC_MSG_ERROR([long double is not a supported type with your compiler.]) | |
353 fi | |
354 ]) | |
355 AC_CHECK_TYPE([hrtime_t],[AC_DEFINE(HAVE_HRTIME_T, 1, [Define to 1 if hrtime_t is defined in <sys/time.h>])],, | |
356 [ | |
357 #if HAVE_SYS_TIME_H | |
358 #include <sys/time.h> | |
359 #endif | |
360 ]) | |
361 | |
362 AC_CHECK_SIZEOF(int) | |
363 AC_CHECK_SIZEOF(unsigned int) | |
364 AC_CHECK_SIZEOF(long) | |
365 AC_CHECK_SIZEOF(unsigned long) | |
366 AC_CHECK_SIZEOF(long long) | |
367 AC_CHECK_SIZEOF(unsigned long long) | |
368 AC_CHECK_SIZEOF(size_t) | |
369 AC_CHECK_SIZEOF(ptrdiff_t) | |
370 | |
371 AC_CHECK_TYPES(uintptr_t, [], [AC_CHECK_SIZEOF(void *)], [$ac_includes_default | |
372 #ifdef HAVE_STDINT_H | |
373 # include <stdint.h> | |
374 #endif]) | |
375 | |
376 AC_CHECK_SIZEOF(float) | |
377 AC_CHECK_SIZEOF(double) | |
378 | |
379 dnl Check sizeof fftw_r2r_kind for Fortran interface [it has == sizeof(int) | |
380 dnl for years, but being paranoid]. Note: the definition here must match | |
381 dnl the one in api/fftw3.h! | |
382 AC_CHECK_SIZEOF(fftw_r2r_kind, [], [typedef enum { | |
383 FFTW_R2HC=0, FFTW_HC2R=1, FFTW_DHT=2, | |
384 FFTW_REDFT00=3, FFTW_REDFT01=4, FFTW_REDFT10=5, FFTW_REDFT11=6, | |
385 FFTW_RODFT00=7, FFTW_RODFT01=8, FFTW_RODFT10=9, FFTW_RODFT11=10 | |
386 } fftw_r2r_kind;]) | |
387 if test 0 = $ac_cv_sizeof_fftw_r2r_kind; then AC_MSG_ERROR([sizeof(fftw_r2r_kind) test failed]); fi | |
388 C_FFTW_R2R_KIND=C_INT`expr $ac_cv_sizeof_fftw_r2r_kind \* 8`_T | |
389 AC_SUBST(C_FFTW_R2R_KIND) | |
390 | |
391 dnl Checks for library functions. | |
392 AC_FUNC_ALLOCA | |
393 AC_FUNC_STRTOD | |
394 AC_FUNC_VPRINTF | |
395 AC_CHECK_LIB(m, sin) | |
396 | |
397 if test $PRECISION = q; then | |
398 AX_GCC_VERSION(4,6,0,[],[AC_MSG_ERROR([gcc 4.6 or later required for quad precision support])]) | |
399 AC_CHECK_LIB(quadmath, sinq, [], [AC_MSG_ERROR([quad precision requires libquadmath for quad-precision trigonometric routines])]) | |
400 LIBQUADMATH=-lquadmath | |
401 fi | |
402 AC_SUBST(LIBQUADMATH) | |
403 | |
404 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]) | |
405 AC_CHECK_DECLS([sinl, cosl, sinq, cosq],,,[#include <math.h>]) | |
406 AC_CHECK_DECLS([memalign],,,[ | |
407 #ifdef HAVE_MALLOC_H | |
408 #include <malloc.h> | |
409 #endif]) | |
410 AC_CHECK_DECLS([drand48, srand48, posix_memalign]) dnl in stdlib.h | |
411 | |
412 dnl Cray UNICOS _rtc() (real-time clock) intrinsic | |
413 AC_MSG_CHECKING([for _rtc intrinsic]) | |
414 rtc_ok=yes | |
415 AC_TRY_LINK([#ifdef HAVE_INTRINSICS_H | |
416 #include <intrinsics.h> | |
417 #endif], [_rtc()], [AC_DEFINE(HAVE__RTC,1,[Define if you have the UNICOS _rtc() intrinsic.])], [rtc_ok=no]) | |
418 AC_MSG_RESULT($rtc_ok) | |
419 | |
420 if test "$PRECISION" = "l"; then | |
421 AC_CHECK_FUNCS([cosl sinl tanl], [], [AC_MSG_ERROR([long-double precision requires long-double trigonometric routines])]) | |
422 fi | |
423 | |
424 AC_MSG_CHECKING([for isnan]) | |
425 AC_TRY_LINK([#include <math.h> | |
426 ], if (!isnan(3.14159)) isnan(2.7183);, ok=yes, ok=no) | |
427 if test "$ok" = "yes"; then | |
428 AC_DEFINE(HAVE_ISNAN,1,[Define if the isnan() function/macro is available.]) | |
429 fi | |
430 AC_MSG_RESULT(${ok}) | |
431 | |
432 dnl TODO | |
433 AX_GCC_ALIGNS_STACK() | |
434 | |
435 dnl override CFLAGS selection when debugging | |
436 if test "${enable_debug}" = "yes"; then | |
437 CFLAGS="-g" | |
438 fi | |
439 | |
440 dnl add gcc warnings, in debug/maintainer mode only | |
441 if test "$enable_debug" = yes || test "$USE_MAINTAINER_MODE" = yes; then | |
442 if test "$ac_test_CFLAGS" != "set"; then | |
443 if test $ac_cv_prog_gcc = yes; then | |
444 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 | |
445 fi | |
446 fi | |
447 fi | |
448 | |
449 dnl ----------------------------------------------------------------------- | |
450 | |
451 AC_ARG_ENABLE(fortran, [AC_HELP_STRING([--disable-fortran],[don't include Fortran-callable wrappers])], enable_fortran=$enableval, enable_fortran=yes) | |
452 | |
453 if test "$enable_fortran" = "yes"; then | |
454 AC_PROG_F77 | |
455 if test -z "$F77"; then | |
456 enable_fortran=no | |
457 AC_MSG_WARN([*** Couldn't find f77 compiler; using default Fortran wrappers.]) | |
458 else | |
459 AC_F77_DUMMY_MAIN([], [enable_fortran=no | |
460 AC_MSG_WARN([*** Couldn't figure out how to link C and Fortran; using default Fortran wrappers.])]) | |
461 fi | |
462 else | |
463 AC_DEFINE([DISABLE_FORTRAN], 1, [Define to disable Fortran wrappers.]) | |
464 fi | |
465 | |
466 if test "x$enable_fortran" = xyes; then | |
467 AC_F77_WRAPPERS | |
468 AC_F77_FUNC(f77foo) | |
469 AC_F77_FUNC(f77_foo) | |
470 f77_foo2=`echo $f77foo | sed 's/77/77_/'` | |
471 if test "$f77_foo" = "$f77_foo2"; then | |
472 AC_DEFINE(F77_FUNC_EQUIV, 1, [Define if F77_FUNC and F77_FUNC_ are equivalent.]) | |
473 | |
474 # Include g77 wrappers by default for GNU systems or gfortran | |
475 with_g77_wrappers=$ac_cv_f77_compiler_gnu | |
476 case $host_os in *gnu*) with_g77_wrappers=yes ;; esac | |
477 fi | |
478 else | |
479 with_g77_wrappers=no | |
480 fi | |
481 | |
482 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) | |
483 if test "x$with_g77_wrappers" = "xyes"; then | |
484 AC_DEFINE(WITH_G77_WRAPPERS,1,[Include g77-compatible wrappers in addition to any other Fortran wrappers.]) | |
485 fi | |
486 | |
487 dnl ----------------------------------------------------------------------- | |
488 have_smp="no" | |
489 AC_ARG_ENABLE(openmp, [AC_HELP_STRING([--enable-openmp],[use OpenMP directives for parallelism])], enable_openmp=$enableval, enable_openmp=no) | |
490 | |
491 if test "$enable_openmp" = "yes"; then | |
492 AC_DEFINE(HAVE_OPENMP,1,[Define to enable OpenMP]) | |
493 AX_OPENMP([], [AC_MSG_ERROR([don't know how to enable OpenMP])]) | |
494 fi | |
495 | |
496 AC_ARG_ENABLE(threads, [AC_HELP_STRING([--enable-threads],[compile FFTW SMP threads library])], enable_threads=$enableval, enable_threads=no) | |
497 | |
498 if test "$enable_threads" = "yes"; then | |
499 AC_DEFINE(HAVE_THREADS,1,[Define to enable SMP threads]) | |
500 fi | |
501 | |
502 AC_ARG_WITH(combined-threads, [AC_HELP_STRING([--with-combined-threads],[combine threads into main libfftw3])], with_combined_threads=$withval, with_combined_threads=no) | |
503 | |
504 if test "$with_combined_threads" = yes; then | |
505 if test "$enable_openmp" = "yes"; then | |
506 AC_MSG_ERROR([--with-combined-threads incompatible with --enable-openmp]) | |
507 fi | |
508 if test "$enable_threads" != "yes"; then | |
509 AC_MSG_ERROR([--with-combined-threads requires --enable-threads]) | |
510 fi | |
511 fi | |
512 | |
513 dnl Check for threads library... | |
514 THREADLIBS="" | |
515 if test "$enable_threads" = "yes"; then | |
516 # Win32 threads are the default on Windows: | |
517 if test -z "$THREADLIBS"; then | |
518 AC_MSG_CHECKING([for Win32 threads]) | |
519 AC_TRY_LINK([#include <windows.h>], | |
520 [_beginthreadex(0,0,0,0,0,0);], | |
521 [THREADLIBS=" "; AC_MSG_RESULT(yes)], | |
522 [AC_MSG_RESULT(no)]) | |
523 fi | |
524 | |
525 # POSIX threads, the default choice everywhere else: | |
526 if test -z "$THREADLIBS"; then | |
527 ACX_PTHREAD([THREADLIBS="$PTHREAD_LIBS " | |
528 CC="$PTHREAD_CC" | |
529 AC_DEFINE(USING_POSIX_THREADS, 1, [Define if we have and are using POSIX threads.])]) | |
530 fi | |
531 | |
532 if test -z "$THREADLIBS"; then | |
533 AC_MSG_ERROR([couldn't find threads library for --enable-threads]) | |
534 fi | |
535 AC_DEFINE(HAVE_THREADS, 1, [Define if we have a threads library.]) | |
536 fi | |
537 AC_SUBST(THREADLIBS) | |
538 AM_CONDITIONAL(THREADS, test "$enable_threads" = "yes") | |
539 AM_CONDITIONAL(OPENMP, test "$enable_openmp" = "yes") | |
540 AM_CONDITIONAL(SMP, test "$enable_threads" = "yes" -o "$enable_openmp" = "yes") | |
541 AM_CONDITIONAL(COMBINED_THREADS, test x"$with_combined_threads" = xyes) | |
542 | |
543 dnl ----------------------------------------------------------------------- | |
544 | |
545 AC_MSG_CHECKING([whether a cycle counter is available]) | |
546 save_CPPFLAGS=$CPPFLAGS | |
547 CPPFLAGS="$CPPFLAGS -I$srcdir/kernel" | |
548 AC_TRY_CPP([#include "cycle.h" | |
549 #ifndef HAVE_TICK_COUNTER | |
550 # error No cycle counter | |
551 #endif], [ok=yes], [ok=no]) | |
552 CPPFLAGS=$save_CPPFLAGS | |
553 AC_MSG_RESULT($ok) | |
554 if test $ok = no && test "x$with_slow_timer" = xno; then | |
555 echo "***************************************************************" | |
556 echo "WARNING: No cycle counter found. FFTW will use ESTIMATE mode " | |
557 echo " for all plans. See the manual for more information." | |
558 echo "***************************************************************" | |
559 fi | |
560 | |
561 dnl ----------------------------------------------------------------------- | |
562 | |
563 AC_DEFINE_UNQUOTED(FFTW_CC, "$CC $CFLAGS", [C compiler name and flags]) | |
564 | |
565 AC_CONFIG_FILES([ | |
566 Makefile | |
567 support/Makefile | |
568 genfft/Makefile | |
569 kernel/Makefile | |
570 simd-support/Makefile | |
571 | |
572 dft/Makefile | |
573 dft/scalar/Makefile | |
574 dft/scalar/codelets/Makefile | |
575 dft/simd/Makefile | |
576 dft/simd/common/Makefile | |
577 dft/simd/sse2/Makefile | |
578 dft/simd/avx/Makefile | |
579 dft/simd/altivec/Makefile | |
580 dft/simd/neon/Makefile | |
581 | |
582 rdft/Makefile | |
583 rdft/scalar/Makefile | |
584 rdft/scalar/r2cf/Makefile | |
585 rdft/scalar/r2cb/Makefile | |
586 rdft/scalar/r2r/Makefile | |
587 rdft/simd/Makefile | |
588 rdft/simd/common/Makefile | |
589 rdft/simd/sse2/Makefile | |
590 rdft/simd/avx/Makefile | |
591 rdft/simd/altivec/Makefile | |
592 rdft/simd/neon/Makefile | |
593 | |
594 reodft/Makefile | |
595 | |
596 threads/Makefile | |
597 | |
598 api/Makefile | |
599 | |
600 mpi/Makefile | |
601 | |
602 libbench2/Makefile | |
603 tests/Makefile | |
604 doc/Makefile | |
605 doc/FAQ/Makefile | |
606 | |
607 tools/Makefile | |
608 tools/fftw_wisdom.1 | |
609 tools/fftw-wisdom-to-conf | |
610 | |
611 m4/Makefile | |
612 | |
613 fftw.pc | |
614 ]) | |
615 | |
616 AC_OUTPUT |