cannam@95: dnl Process this file with autoconf to produce a configure script. cannam@95: AC_INIT(fftw, 3.3.3, fftw@fftw.org) cannam@95: AC_CONFIG_SRCDIR(kernel/ifftw.h) cannam@95: # fftw-3.1.x was 4:X:1 cannam@95: # fftw-3.2.x was 5:X:2 cannam@95: # fftw-3.3.x was 6:X:3 cannam@95: SHARED_VERSION_INFO="6:2:3" # CURRENT:REVISION:AGE cannam@95: cannam@95: AM_INIT_AUTOMAKE(1.7) cannam@95: AM_CONFIG_HEADER(config.h) cannam@95: AC_CONFIG_MACRO_DIR([m4]) cannam@95: AM_MAINTAINER_MODE cannam@95: AC_SUBST(SHARED_VERSION_INFO) cannam@95: AC_DISABLE_SHARED dnl to hell with shared libraries cannam@95: AC_CANONICAL_HOST cannam@95: cannam@95: dnl configure options cannam@95: case "${host_cpu}" in cannam@95: powerpc*) have_fma=yes;; cannam@95: ia64*) have_fma=yes;; cannam@95: hppa*) have_fma=yes;; cannam@95: mips64*) have_fma=yes;; cannam@95: *) have_fma=no;; cannam@95: esac cannam@95: cannam@95: AC_ARG_ENABLE(fma, [AC_HELP_STRING([--enable-fma],[enable optimizations for machines with fused multiply-add])], have_fma=$enableval) cannam@95: if test "$have_fma"x = "yes"x; then cannam@95: AC_DEFINE(HAVE_FMA,1,[Define if you have a machine with fused multiply-add]) cannam@95: fi cannam@95: cannam@95: cannam@95: AC_ARG_ENABLE(debug, [AC_HELP_STRING([--enable-debug],[compile fftw with extra runtime checks for debugging])], ok=$enableval, ok=no) cannam@95: if test "$ok" = "yes"; then cannam@95: AC_DEFINE(FFTW_DEBUG,1,[Define to enable extra FFTW debugging code.]) cannam@95: debug_malloc=yes cannam@95: else cannam@95: debug_malloc=no cannam@95: fi cannam@95: cannam@95: AC_ARG_ENABLE(debug-malloc, [AC_HELP_STRING([--enable-debug-malloc],[enable malloc debugging version])], ok=$enableval, ok=$debug_malloc) cannam@95: if test "$ok" = "yes"; then cannam@95: AC_DEFINE(FFTW_DEBUG_MALLOC,1,[Define to enable debugging malloc.]) cannam@95: fi cannam@95: cannam@95: AC_ARG_ENABLE(debug-alignment, [AC_HELP_STRING([--enable-debug-alignment],[enable alignment debugging hacks])], ok=$enableval, ok=no) cannam@95: if test "$ok" = "yes"; then cannam@95: AC_DEFINE(FFTW_DEBUG_ALIGNMENT,1,[Define to enable alignment debugging hacks.]) cannam@95: fi cannam@95: cannam@95: AC_ARG_ENABLE(random-estimator, [AC_HELP_STRING([--enable-random-estimator],[enable pseudorandom estimator (debugging hack)])], ok=$enableval, ok=no) cannam@95: if test "$ok" = "yes"; then cannam@95: AC_DEFINE(FFTW_RANDOM_ESTIMATOR,1,[Define to enable pseudorandom estimate planning for debugging.]) cannam@95: CHECK_PL_OPTS="--estimate" cannam@95: fi cannam@95: cannam@95: AC_ARG_ENABLE(alloca, [AC_HELP_STRING([--disable-alloca],[disable use of the alloca() function (may be broken on mingw64)])], ok=$enableval, ok=yes) cannam@95: if test "$ok" = "yes"; then cannam@95: AC_DEFINE(FFTW_ENABLE_ALLOCA,1,[Define to enable the use of alloca().]) cannam@95: fi cannam@95: cannam@95: AC_ARG_ENABLE(single, [AC_HELP_STRING([--enable-single],[compile fftw in single precision])], ok=$enableval, ok=no) cannam@95: AC_ARG_ENABLE(float, [AC_HELP_STRING([--enable-float],[synonym for --enable-single])], ok=$enableval) cannam@95: if test "$ok" = "yes"; then cannam@95: AC_DEFINE(FFTW_SINGLE,1,[Define to compile in single precision.]) cannam@95: AC_DEFINE(BENCHFFT_SINGLE,1,[Define to compile in single precision.]) cannam@95: PRECISION=s cannam@95: else cannam@95: PRECISION=d cannam@95: fi cannam@95: AM_CONDITIONAL(SINGLE, test "$ok" = "yes") cannam@95: cannam@95: AC_ARG_ENABLE(long-double, [AC_HELP_STRING([--enable-long-double],[compile fftw in long-double precision])], ok=$enableval, ok=no) cannam@95: if test "$ok" = "yes"; then cannam@95: if test "$PRECISION" = "s"; then cannam@95: AC_MSG_ERROR([--enable-single/--enable-long-double conflict]) cannam@95: fi cannam@95: AC_DEFINE(FFTW_LDOUBLE,1,[Define to compile in long-double precision.]) cannam@95: AC_DEFINE(BENCHFFT_LDOUBLE,1,[Define to compile in long-double precision.]) cannam@95: PRECISION=l cannam@95: fi cannam@95: AM_CONDITIONAL(LDOUBLE, test "$ok" = "yes") cannam@95: cannam@95: AC_ARG_ENABLE(quad-precision, [AC_HELP_STRING([--enable-quad-precision],[compile fftw in quadruple precision if available])], ok=$enableval, ok=no) cannam@95: if test "$ok" = "yes"; then cannam@95: if test "$PRECISION" != "d"; then cannam@95: AC_MSG_ERROR([conflicting precisions specified]) cannam@95: fi cannam@95: AC_DEFINE(FFTW_QUAD,1,[Define to compile in quad precision.]) cannam@95: AC_DEFINE(BENCHFFT_QUAD,1,[Define to compile in quad precision.]) cannam@95: PRECISION=q cannam@95: fi cannam@95: AM_CONDITIONAL(QUAD, test "$ok" = "yes") cannam@95: cannam@95: AC_SUBST(PRECISION) cannam@95: AC_SUBST(CHECK_PL_OPTS) cannam@95: cannam@95: AC_ARG_ENABLE(sse, [AC_HELP_STRING([--enable-sse],[enable SSE optimizations])], have_sse=$enableval, have_sse=no) cannam@95: if test "$have_sse" = "yes"; then cannam@95: if test "$PRECISION" != "s"; then cannam@95: AC_MSG_ERROR([SSE requires single precision]) cannam@95: fi cannam@95: fi cannam@95: cannam@95: AC_ARG_ENABLE(sse2, [AC_HELP_STRING([--enable-sse2],[enable SSE/SSE2 optimizations])], have_sse2=$enableval, have_sse2=no) cannam@95: if test "$have_sse" = "yes"; then have_sse2=yes; fi cannam@95: if test "$have_sse2" = "yes"; then cannam@95: AC_DEFINE(HAVE_SSE2,1,[Define to enable SSE/SSE2 optimizations.]) cannam@95: if test "$PRECISION" != "d" -a "$PRECISION" != "s"; then cannam@95: AC_MSG_ERROR([SSE2 requires single or double precision]) cannam@95: fi cannam@95: fi cannam@95: AM_CONDITIONAL(HAVE_SSE2, test "$have_sse2" = "yes") cannam@95: cannam@95: AC_ARG_ENABLE(avx, [AC_HELP_STRING([--enable-avx],[enable AVX optimizations])], have_avx=$enableval, have_avx=no) cannam@95: if test "$have_avx" = "yes"; then cannam@95: AC_DEFINE(HAVE_AVX,1,[Define to enable AVX optimizations.]) cannam@95: if test "$PRECISION" != "d" -a "$PRECISION" != "s"; then cannam@95: AC_MSG_ERROR([AVX requires single or double precision]) cannam@95: fi cannam@95: fi cannam@95: AM_CONDITIONAL(HAVE_AVX, test "$have_avx" = "yes") cannam@95: cannam@95: AC_ARG_ENABLE(altivec, [AC_HELP_STRING([--enable-altivec],[enable Altivec optimizations])], have_altivec=$enableval, have_altivec=no) cannam@95: if test "$have_altivec" = "yes"; then cannam@95: AC_DEFINE(HAVE_ALTIVEC,1,[Define to enable Altivec optimizations.]) cannam@95: if test "$PRECISION" != "s"; then cannam@95: AC_MSG_ERROR([Altivec requires single precision]) cannam@95: fi cannam@95: fi cannam@95: AM_CONDITIONAL(HAVE_ALTIVEC, test "$have_altivec" = "yes") cannam@95: cannam@95: AC_ARG_ENABLE(neon, [AC_HELP_STRING([--enable-neon],[enable ARM NEON optimizations])], have_neon=$enableval, have_neon=no) cannam@95: if test "$have_neon" = "yes"; then cannam@95: AC_DEFINE(HAVE_NEON,1,[Define to enable ARM NEON optimizations.]) cannam@95: if test "$PRECISION" != "s"; then cannam@95: AC_MSG_ERROR([NEON requires single precision]) cannam@95: fi cannam@95: fi cannam@95: AM_CONDITIONAL(HAVE_NEON, test "$have_neon" = "yes") cannam@95: cannam@95: dnl FIXME: cannam@95: 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) cannam@95: dnl if test "$have_mips_ps" = "yes"; then cannam@95: dnl AC_DEFINE(HAVE_MIPS_PS,1,[Define to enable MIPS paired-single optimizations.]) cannam@95: dnl if test "$PRECISION" != "s"; then cannam@95: dnl AC_MSG_ERROR([MIPS paired-single requires single precision]) cannam@95: dnl fi cannam@95: dnl fi cannam@95: dnl AM_CONDITIONAL(HAVE_MIPS_PS, test "$have_mips_ps" = "yes") cannam@95: cannam@95: AC_ARG_WITH(slow-timer, [AC_HELP_STRING([--with-slow-timer],[use low-precision timers (SLOW)])], with_slow_timer=$withval, with_slow_timer=no) cannam@95: if test "$with_slow_timer" = "yes"; then cannam@95: AC_DEFINE(WITH_SLOW_TIMER,1,[Use low-precision timers, making planner very slow]) cannam@95: fi cannam@95: cannam@95: 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) cannam@95: if test "$have_mips_zbus_timer" = "yes"; then cannam@95: AC_DEFINE(HAVE_MIPS_ZBUS_TIMER,1,[Define to enable use of MIPS ZBus cycle-counter.]) cannam@95: fi cannam@95: cannam@95: 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) cannam@95: AC_ARG_WITH(our-malloc16, [AC_HELP_STRING([--with-our-malloc16],[Obsolete alias for --with-our-malloc16])], with_our_malloc=$withval) cannam@95: if test "$with_our_malloc" = "yes"; then cannam@95: AC_DEFINE(WITH_OUR_MALLOC,1,[Use our own aligned malloc routine; mainly helpful for Windows systems lacking aligned allocation system-library routines.]) cannam@95: fi cannam@95: cannam@95: 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) cannam@95: if test "$with_windows_f77_mangling" = "yes"; then cannam@95: AC_DEFINE(WINDOWS_F77_MANGLING,1,[Use common Windows Fortran mangling styles for the Fortran interfaces.]) cannam@95: fi cannam@95: cannam@95: AC_ARG_WITH(incoming-stack-boundary, [AC_HELP_STRING([--with-incoming-stack-boundary=X],[Assume that stack is aligned to (1<]) cannam@95: CC=$save_CC cannam@95: if test 0 = $ac_cv_sizeof_MPI_Fint; then cannam@95: AC_MSG_WARN([sizeof(MPI_Fint) test failed]); cannam@95: dnl As a backup, assume Fortran integer == C int cannam@95: AC_CHECK_SIZEOF(int) cannam@95: if test 0 = $ac_cv_sizeof_int; then AC_MSG_ERROR([sizeof(int) test failed]); fi cannam@95: ac_cv_sizeof_MPI_Fint=$ac_cv_sizeof_int cannam@95: fi cannam@95: C_MPI_FINT=C_INT`expr $ac_cv_sizeof_MPI_Fint \* 8`_T cannam@95: AC_SUBST(C_MPI_FINT) cannam@95: fi cannam@95: AM_CONDITIONAL(MPI, test "$enable_mpi" = "yes") cannam@95: cannam@95: dnl ----------------------------------------------------------------------- cannam@95: cannam@95: dnl determine CFLAGS first cannam@95: AX_CC_MAXOPT cannam@95: cannam@95: case "${ax_cv_c_compiler_vendor}" in cannam@95: intel) # Stop icc from defining __GNUC__, except on MacOS where this fails cannam@95: case "${host_os}" in cannam@95: *darwin*) ;; # icc -no-gcc fails to compile some system headers cannam@95: *) cannam@95: AX_CHECK_COMPILER_FLAGS([-no-gcc], [CC="$CC -no-gcc"]) cannam@95: ;; cannam@95: esac cannam@95: ;; cannam@95: cannam@95: hp) # must (sometimes) manually increase cpp limits to handle fftw3.h cannam@95: AX_CHECK_COMPILER_FLAGS([-Wp,-H128000], cannam@95: [CC="$CC -Wp,-H128000"]) cannam@95: ;; cannam@95: cannam@95: portland) # -Masmkeyword required for asm("") cycle counters cannam@95: AX_CHECK_COMPILER_FLAGS([-Masmkeyword], cannam@95: [CC="$CC -Masmkeyword"]) cannam@95: ;; cannam@95: esac cannam@95: cannam@95: dnl Determine SIMD CFLAGS at least for gcc and icc cannam@95: case "${ax_cv_c_compiler_vendor}" in cannam@95: gnu|intel) cannam@95: # SSE/SSE2 cannam@95: if test "$have_sse2" = "yes" -a "x$SSE2_CFLAGS" = x; then cannam@95: if test "$PRECISION" = d; then flag=msse2; else flag=msse; fi cannam@95: AX_CHECK_COMPILER_FLAGS(-$flag, [SSE2_CFLAGS="-$flag"], cannam@95: [AC_MSG_ERROR([Need a version of gcc with -$flag])]) cannam@95: fi cannam@95: cannam@95: # AVX cannam@95: if test "$have_avx" = "yes" -a "x$AVX_CFLAGS" = x; then cannam@95: AX_CHECK_COMPILER_FLAGS(-mavx, [AVX_CFLAGS="-mavx"], cannam@95: [AC_MSG_ERROR([Need a version of gcc with -mavx])]) cannam@95: fi cannam@95: cannam@95: if test "$have_altivec" = "yes" -a "x$ALTIVEC_CFLAGS" = x; then cannam@95: # -DFAKE__VEC__ is a workaround because gcc-3.3 does not cannam@95: # #define __VEC__ with -maltivec. cannam@95: AX_CHECK_COMPILER_FLAGS(-faltivec, [ALTIVEC_CFLAGS="-faltivec"], cannam@95: [AX_CHECK_COMPILER_FLAGS(-maltivec -mabi=altivec, cannam@95: [ALTIVEC_CFLAGS="-maltivec -mabi=altivec -DFAKE__VEC__"], cannam@95: [AX_CHECK_COMPILER_FLAGS(-fvec, [ALTIVEC_CFLAGS="-fvec"], cannam@95: [AC_MSG_ERROR([Need a version of gcc with -maltivec])])])]) cannam@95: fi cannam@95: cannam@95: if test "$have_neon" = "yes" -a "x$NEON_CFLAGS" = x; then cannam@95: AX_CHECK_COMPILER_FLAGS(-mfpu=neon, [NEON_CFLAGS="-mfpu=neon"], cannam@95: [AC_MSG_ERROR([Need a version of gcc with -mfpu=neon])]) cannam@95: fi cannam@95: cannam@95: dnl FIXME: cannam@95: dnl elif test "$have_mips_ps" = "yes"; then cannam@95: dnl # Just punt here and use only new 4.2 compiler :( cannam@95: dnl # Should add section for older compilers... cannam@95: dnl AX_CHECK_COMPILER_FLAGS(-mpaired-single, cannam@95: dnl [SIMD_CFLAGS="-mpaired-single"], cannam@95: dnl #[AC_MSG_ERROR([Need a version of gcc with -mpaired-single])]) cannam@95: dnl [AX_CHECK_COMPILER_FLAGS(-march=mips64, cannam@95: dnl [SIMD_CFLAGS="-march=mips64"], cannam@95: dnl [AC_MSG_ERROR( cannam@95: dnl [Need a version of gcc with -mpaired-single or -march=mips64]) cannam@95: dnl ])]) cannam@95: dnl fi cannam@95: ;; cannam@95: esac cannam@95: cannam@95: AC_SUBST(SSE2_CFLAGS) cannam@95: AC_SUBST(AVX_CFLAGS) cannam@95: AC_SUBST(ALTIVEC_CFLAGS) cannam@95: AC_SUBST(NEON_CFLAGS) cannam@95: cannam@95: dnl add stack alignment CFLAGS if so requested cannam@95: if test "$with_incoming_stack_boundary"x != "no"x; then cannam@95: case "${ax_cv_c_compiler_vendor}" in cannam@95: gnu) cannam@95: tentative_flags="-mincoming-stack-boundary=$with_incoming_stack_boundary"; cannam@95: AX_CHECK_COMPILER_FLAGS($tentative_flags, cannam@95: [STACK_ALIGN_CFLAGS=$tentative_flags]) cannam@95: ;; cannam@95: esac cannam@95: fi cannam@95: AC_SUBST(STACK_ALIGN_CFLAGS) cannam@95: cannam@95: dnl Checks for header files. cannam@95: AC_HEADER_STDC cannam@95: 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]) cannam@95: dnl c_asm.h: Header file for enabling asm() on Digital Unix cannam@95: dnl intrinsics.h: cray unicos cannam@95: dnl sys/sysctl.h: MacOS X altivec detection cannam@95: cannam@95: dnl altivec.h requires $ALTIVEC_CFLAGS cannam@95: save_CFLAGS="$CFLAGS" cannam@95: save_CPPFLAGS="$CPPFLAGS" cannam@95: CFLAGS="$CFLAGS $ALTIVEC_CFLAGS" cannam@95: CPPFLAGS="$CPPFLAGS $ALTIVEC_CFLAGS" cannam@95: AC_CHECK_HEADERS([altivec.h]) cannam@95: CFLAGS="$save_CFLAGS" cannam@95: CPPFLAGS="$save_CPPFLAGS" cannam@95: cannam@95: cannam@95: dnl Checks for typedefs, structures, and compiler characteristics. cannam@95: AC_C_CONST cannam@95: AC_C_INLINE cannam@95: AC_TYPE_SIZE_T cannam@95: AC_HEADER_TIME cannam@95: AC_CHECK_TYPE([long double], cannam@95: [AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define to 1 if the compiler supports `long double'])], cannam@95: [ cannam@95: if test $PRECISION = l; then cannam@95: AC_MSG_ERROR([long double is not a supported type with your compiler.]) cannam@95: fi cannam@95: ]) cannam@95: AC_CHECK_TYPE([hrtime_t],[AC_DEFINE(HAVE_HRTIME_T, 1, [Define to 1 if hrtime_t is defined in ])],, cannam@95: [ cannam@95: #if HAVE_SYS_TIME_H cannam@95: #include cannam@95: #endif cannam@95: ]) cannam@95: cannam@95: AC_CHECK_SIZEOF(int) cannam@95: AC_CHECK_SIZEOF(unsigned int) cannam@95: AC_CHECK_SIZEOF(long) cannam@95: AC_CHECK_SIZEOF(unsigned long) cannam@95: AC_CHECK_SIZEOF(long long) cannam@95: AC_CHECK_SIZEOF(unsigned long long) cannam@95: AC_CHECK_SIZEOF(size_t) cannam@95: AC_CHECK_SIZEOF(ptrdiff_t) cannam@95: cannam@95: AC_CHECK_TYPES(uintptr_t, [], [AC_CHECK_SIZEOF(void *)], [$ac_includes_default cannam@95: #ifdef HAVE_STDINT_H cannam@95: # include cannam@95: #endif]) cannam@95: cannam@95: AC_CHECK_SIZEOF(float) cannam@95: AC_CHECK_SIZEOF(double) cannam@95: cannam@95: dnl Check sizeof fftw_r2r_kind for Fortran interface [it has == sizeof(int) cannam@95: dnl for years, but being paranoid]. Note: the definition here must match cannam@95: dnl the one in api/fftw3.h! cannam@95: AC_CHECK_SIZEOF(fftw_r2r_kind, [], [typedef enum { cannam@95: FFTW_R2HC=0, FFTW_HC2R=1, FFTW_DHT=2, cannam@95: FFTW_REDFT00=3, FFTW_REDFT01=4, FFTW_REDFT10=5, FFTW_REDFT11=6, cannam@95: FFTW_RODFT00=7, FFTW_RODFT01=8, FFTW_RODFT10=9, FFTW_RODFT11=10 cannam@95: } fftw_r2r_kind;]) cannam@95: if test 0 = $ac_cv_sizeof_fftw_r2r_kind; then AC_MSG_ERROR([sizeof(fftw_r2r_kind) test failed]); fi cannam@95: C_FFTW_R2R_KIND=C_INT`expr $ac_cv_sizeof_fftw_r2r_kind \* 8`_T cannam@95: AC_SUBST(C_FFTW_R2R_KIND) cannam@95: cannam@95: dnl Checks for library functions. cannam@95: AC_FUNC_ALLOCA cannam@95: AC_FUNC_STRTOD cannam@95: AC_FUNC_VPRINTF cannam@95: AC_CHECK_LIB(m, sin) cannam@95: cannam@95: if test $PRECISION = q; then cannam@95: AX_GCC_VERSION(4,6,0,[],[AC_MSG_ERROR([gcc 4.6 or later required for quad precision support])]) cannam@95: AC_CHECK_LIB(quadmath, sinq, [], [AC_MSG_ERROR([quad precision requires libquadmath for quad-precision trigonometric routines])]) cannam@95: LIBQUADMATH=-lquadmath cannam@95: fi cannam@95: AC_SUBST(LIBQUADMATH) cannam@95: cannam@95: 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]) cannam@95: AC_CHECK_DECLS([drand48, srand48, memalign, posix_memalign, sinl, cosl, sinq, cosq]) cannam@95: cannam@95: dnl Cray UNICOS _rtc() (real-time clock) intrinsic cannam@95: AC_MSG_CHECKING([for _rtc intrinsic]) cannam@95: rtc_ok=yes cannam@95: AC_TRY_LINK([#ifdef HAVE_INTRINSICS_H cannam@95: #include cannam@95: #endif], [_rtc()], [AC_DEFINE(HAVE__RTC,1,[Define if you have the UNICOS _rtc() intrinsic.])], [rtc_ok=no]) cannam@95: AC_MSG_RESULT($rtc_ok) cannam@95: cannam@95: if test "$PRECISION" = "l"; then cannam@95: AC_CHECK_FUNCS([cosl sinl tanl], [], [AC_MSG_ERROR([long-double precision requires long-double trigonometric routines])]) cannam@95: fi cannam@95: cannam@95: AC_MSG_CHECKING([for isnan]) cannam@95: AC_TRY_LINK([#include cannam@95: ], if (!isnan(3.14159)) isnan(2.7183);, ok=yes, ok=no) cannam@95: if test "$ok" = "yes"; then cannam@95: AC_DEFINE(HAVE_ISNAN,1,[Define if the isnan() function/macro is available.]) cannam@95: fi cannam@95: AC_MSG_RESULT(${ok}) cannam@95: cannam@95: dnl TODO cannam@95: AX_GCC_ALIGNS_STACK() cannam@95: cannam@95: dnl override CFLAGS selection when debugging cannam@95: if test "${enable_debug}" = "yes"; then cannam@95: CFLAGS="-g" cannam@95: fi cannam@95: cannam@95: dnl add gcc warnings, in debug/maintainer mode only cannam@95: if test "$enable_debug" = yes || test "$USE_MAINTAINER_MODE" = yes; then cannam@95: if test "$ac_test_CFLAGS" != "set"; then cannam@95: if test $ac_cv_prog_gcc = yes; then cannam@95: 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 cannam@95: fi cannam@95: fi cannam@95: fi cannam@95: cannam@95: dnl ----------------------------------------------------------------------- cannam@95: cannam@95: AC_ARG_ENABLE(fortran, [AC_HELP_STRING([--disable-fortran],[don't include Fortran-callable wrappers])], enable_fortran=$enableval, enable_fortran=yes) cannam@95: cannam@95: if test "$enable_fortran" = "yes"; then cannam@95: AC_PROG_F77 cannam@95: if test -z "$F77"; then cannam@95: enable_fortran=no cannam@95: AC_MSG_WARN([*** Couldn't find f77 compiler; using default Fortran wrappers.]) cannam@95: else cannam@95: AC_F77_DUMMY_MAIN([], [enable_fortran=no cannam@95: AC_MSG_WARN([*** Couldn't figure out how to link C and Fortran; using default Fortran wrappers.])]) cannam@95: fi cannam@95: else cannam@95: AC_DEFINE([DISABLE_FORTRAN], 1, [Define to disable Fortran wrappers.]) cannam@95: fi cannam@95: cannam@95: if test "x$enable_fortran" = xyes; then cannam@95: AC_F77_WRAPPERS cannam@95: AC_F77_FUNC(f77foo) cannam@95: AC_F77_FUNC(f77_foo) cannam@95: f77_foo2=`echo $f77foo | sed 's/77/77_/'` cannam@95: if test "$f77_foo" = "$f77_foo2"; then cannam@95: AC_DEFINE(F77_FUNC_EQUIV, 1, [Define if F77_FUNC and F77_FUNC_ are equivalent.]) cannam@95: cannam@95: # Include g77 wrappers by default for GNU systems or gfortran cannam@95: with_g77_wrappers=$ac_cv_f77_compiler_gnu cannam@95: case $host_os in *gnu*) with_g77_wrappers=yes ;; esac cannam@95: fi cannam@95: else cannam@95: with_g77_wrappers=no cannam@95: fi cannam@95: cannam@95: 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) cannam@95: if test "x$with_g77_wrappers" = "xyes"; then cannam@95: AC_DEFINE(WITH_G77_WRAPPERS,1,[Include g77-compatible wrappers in addition to any other Fortran wrappers.]) cannam@95: fi cannam@95: cannam@95: dnl ----------------------------------------------------------------------- cannam@95: have_smp="no" cannam@95: AC_ARG_ENABLE(openmp, [AC_HELP_STRING([--enable-openmp],[use OpenMP directives for parallelism])], enable_openmp=$enableval, enable_openmp=no) cannam@95: cannam@95: if test "$enable_openmp" = "yes"; then cannam@95: AC_DEFINE(HAVE_OPENMP,1,[Define to enable OpenMP]) cannam@95: AX_OPENMP([], [AC_MSG_ERROR([don't know how to enable OpenMP])]) cannam@95: fi cannam@95: cannam@95: AC_ARG_ENABLE(threads, [AC_HELP_STRING([--enable-threads],[compile FFTW SMP threads library])], enable_threads=$enableval, enable_threads=no) cannam@95: cannam@95: if test "$enable_threads" = "yes"; then cannam@95: AC_DEFINE(HAVE_THREADS,1,[Define to enable SMP threads]) cannam@95: fi cannam@95: cannam@95: AC_ARG_WITH(combined-threads, [AC_HELP_STRING([--with-combined-threads],[combine threads into main libfftw3])], with_combined_threads=$withval, with_combined_threads=no) cannam@95: cannam@95: if test "$with_combined_threads" = yes; then cannam@95: if test "$enable_openmp" = "yes"; then cannam@95: AC_MSG_ERROR([--with-combined-threads incompatible with --enable-openmp]) cannam@95: fi cannam@95: if test "$enable_threads" != "yes"; then cannam@95: AC_MSG_ERROR([--with-combined-threads requires --enable-threads]) cannam@95: fi cannam@95: fi cannam@95: cannam@95: dnl Check for threads library... cannam@95: THREADLIBS="" cannam@95: if test "$enable_threads" = "yes"; then cannam@95: # POSIX threads, the default choice: cannam@95: if test -z "$THREADLIBS"; then cannam@95: ACX_PTHREAD([THREADLIBS="$PTHREAD_LIBS " cannam@95: CC="$PTHREAD_CC" cannam@95: AC_DEFINE(USING_POSIX_THREADS, 1, [Define if we have and are using POSIX threads.])]) cannam@95: fi cannam@95: cannam@95: if test -z "$THREADLIBS"; then cannam@95: AC_MSG_CHECKING([for Win32 threads]) cannam@95: AC_TRY_LINK([#include ], cannam@95: [_beginthreadex(0,0,0,0,0,0);], cannam@95: [THREADLIBS=" "; AC_MSG_RESULT(yes)], cannam@95: [AC_MSG_RESULT(no)]) cannam@95: fi cannam@95: cannam@95: if test -z "$THREADLIBS"; then cannam@95: AC_MSG_ERROR([couldn't find threads library for --enable-threads]) cannam@95: fi cannam@95: AC_DEFINE(HAVE_THREADS, 1, [Define if we have a threads library.]) cannam@95: fi cannam@95: AC_SUBST(THREADLIBS) cannam@95: AM_CONDITIONAL(THREADS, test "$enable_threads" = "yes") cannam@95: AM_CONDITIONAL(OPENMP, test "$enable_openmp" = "yes") cannam@95: AM_CONDITIONAL(SMP, test "$enable_threads" = "yes" -o "$enable_openmp" = "yes") cannam@95: AM_CONDITIONAL(COMBINED_THREADS, test x"$with_combined_threads" = xyes) cannam@95: cannam@95: dnl ----------------------------------------------------------------------- cannam@95: cannam@95: AC_MSG_CHECKING([whether a cycle counter is available]) cannam@95: save_CPPFLAGS=$CPPFLAGS cannam@95: CPPFLAGS="$CPPFLAGS -I$srcdir/kernel" cannam@95: AC_TRY_CPP([#include "cycle.h" cannam@95: #ifndef HAVE_TICK_COUNTER cannam@95: # error No cycle counter cannam@95: #endif], [ok=yes], [ok=no]) cannam@95: CPPFLAGS=$save_CPPFLAGS cannam@95: AC_MSG_RESULT($ok) cannam@95: if test $ok = no && test "x$with_slow_timer" = xno; then cannam@95: echo "***************************************************************" cannam@95: echo "WARNING: No cycle counter found. FFTW will use ESTIMATE mode " cannam@95: echo " for all plans. See the manual for more information." cannam@95: echo "***************************************************************" cannam@95: fi cannam@95: cannam@95: dnl ----------------------------------------------------------------------- cannam@95: cannam@95: AC_DEFINE_UNQUOTED(FFTW_CC, "$CC $CFLAGS", [C compiler name and flags]) cannam@95: cannam@95: AC_CONFIG_FILES([ cannam@95: Makefile cannam@95: support/Makefile cannam@95: genfft/Makefile cannam@95: kernel/Makefile cannam@95: simd-support/Makefile cannam@95: cannam@95: dft/Makefile cannam@95: dft/scalar/Makefile cannam@95: dft/scalar/codelets/Makefile cannam@95: dft/simd/Makefile cannam@95: dft/simd/common/Makefile cannam@95: dft/simd/sse2/Makefile cannam@95: dft/simd/avx/Makefile cannam@95: dft/simd/altivec/Makefile cannam@95: dft/simd/neon/Makefile cannam@95: cannam@95: rdft/Makefile cannam@95: rdft/scalar/Makefile cannam@95: rdft/scalar/r2cf/Makefile cannam@95: rdft/scalar/r2cb/Makefile cannam@95: rdft/scalar/r2r/Makefile cannam@95: rdft/simd/Makefile cannam@95: rdft/simd/common/Makefile cannam@95: rdft/simd/sse2/Makefile cannam@95: rdft/simd/avx/Makefile cannam@95: rdft/simd/altivec/Makefile cannam@95: rdft/simd/neon/Makefile cannam@95: cannam@95: reodft/Makefile cannam@95: cannam@95: threads/Makefile cannam@95: cannam@95: api/Makefile cannam@95: cannam@95: mpi/Makefile cannam@95: cannam@95: libbench2/Makefile cannam@95: tests/Makefile cannam@95: doc/Makefile cannam@95: doc/FAQ/Makefile cannam@95: cannam@95: tools/Makefile cannam@95: tools/fftw_wisdom.1 cannam@95: tools/fftw-wisdom-to-conf cannam@95: cannam@95: m4/Makefile cannam@95: cannam@95: fftw.pc cannam@95: ]) cannam@95: cannam@95: AC_OUTPUT