comparison src/fftw-3.3.3/configure.ac @ 95:89f5e221ed7b

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