annotate src/fftw-3.3.3/configure.ac @ 169:223a55898ab9 tip default

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