annotate src/fftw-3.3.8/configure.ac @ 168:ceec0dd9ec9c

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