Chris@10: Chris@10:
Chris@10:Chris@10: Next: Installation on non-Unix systems, Chris@10: Previous: Installation and Customization, Chris@10: Up: Installation and Customization Chris@10:
FFTW comes with a configure
program in the GNU style.
Chris@10: Installation can be as simple as:
Chris@10:
Chris@10:
./configure Chris@10: make Chris@10: make install Chris@10:Chris@10:
This will build the uniprocessor complex and real transform libraries
Chris@10: along with the test programs. (We recommend that you use GNU
Chris@10: make
if it is available; on some systems it is called
Chris@10: gmake
.) The “make install
” command installs the fftw
Chris@10: and rfftw libraries in standard places, and typically requires root
Chris@10: privileges (unless you specify a different install directory with the
Chris@10: --prefix
flag to configure
). You can also type
Chris@10: “make check
” to put the FFTW test programs through their paces.
Chris@10: If you have problems during configuration or compilation, you may want
Chris@10: to run “make distclean
” before trying again; this ensures that
Chris@10: you don't have any stale files left over from previous compilation
Chris@10: attempts.
Chris@10:
Chris@10:
The configure
script chooses the gcc
compiler by default,
Chris@10: if it is available; you can select some other compiler with:
Chris@10:
./configure CC="<the name of your C compiler>" Chris@10:Chris@10:
The configure
script knows good CFLAGS
(C compiler flags)
Chris@10: for a few systems. If your system is not known, the configure
Chris@10: script will print out a warning. In this case, you should re-configure
Chris@10: FFTW with the command
Chris@10:
./configure CFLAGS="<write your CFLAGS here>" Chris@10:Chris@10:
and then compile as usual. If you do find an optimal set of
Chris@10: CFLAGS
for your system, please let us know what they are (along
Chris@10: with the output of config.guess
) so that we can include them in
Chris@10: future releases.
Chris@10:
Chris@10:
configure
supports all the standard flags defined by the GNU
Chris@10: Coding Standards; see the INSTALL
file in FFTW or
Chris@10: the GNU web page.
Chris@10: Note especially --help
to list all flags and
Chris@10: --enable-shared
to create shared, rather than static, libraries.
Chris@10: configure
also accepts a few FFTW-specific flags, particularly:
Chris@10:
Chris@10:
--enable-float
: Produces a single-precision version of FFTW
Chris@10: (float
) instead of the default double-precision (double
).
Chris@10: See Precision.
Chris@10:
Chris@10: --enable-long-double
: Produces a long-double precision version of
Chris@10: FFTW (long double
) instead of the default double-precision
Chris@10: (double
). The configure
script will halt with an error
Chris@10: message if long double
is the same size as double
on your
Chris@10: machine/compiler. See Precision.
Chris@10:
Chris@10: --enable-quad-precision
: Produces a quadruple-precision version
Chris@10: of FFTW using the nonstandard __float128
type provided by
Chris@10: gcc
4.6 or later on x86, x86-64, and Itanium architectures,
Chris@10: instead of the default double-precision (double
). The
Chris@10: configure
script will halt with an error message if the
Chris@10: compiler is not gcc
version 4.6 or later or if gcc
's
Chris@10: libquadmath
library is not installed. See Precision.
Chris@10:
Chris@10: --enable-threads
: Enables compilation and installation of the
Chris@10: FFTW threads library (see Multi-threaded FFTW), which provides a
Chris@10: simple interface to parallel transforms for SMP systems. By default,
Chris@10: the threads routines are not compiled.
Chris@10:
Chris@10: --enable-openmp
: Like --enable-threads
, but using OpenMP
Chris@10: compiler directives in order to induce parallelism rather than
Chris@10: spawning its own threads directly, and installing an ‘fftw3_omp’ library
Chris@10: rather than an ‘fftw3_threads’ library (see Multi-threaded FFTW). You can use both --enable-openmp
and --enable-threads
Chris@10: since they compile/install libraries with different names. By default,
Chris@10: the OpenMP routines are not compiled.
Chris@10:
Chris@10: --with-combined-threads
: By default, if --enable-threads
Chris@10: is used, the threads support is compiled into a separate library that
Chris@10: must be linked in addition to the main FFTW library. This is so that
Chris@10: users of the serial library do not need to link the system threads
Chris@10: libraries. If --with-combined-threads
is specified, however,
Chris@10: then no separate threads library is created, and threads are included
Chris@10: in the main FFTW library. This is mainly useful under Windows, where
Chris@10: no system threads library is required and inter-library dependencies
Chris@10: are problematic.
Chris@10:
Chris@10: --enable-mpi
: Enables compilation and installation of the FFTW
Chris@10: MPI library (see Distributed-memory FFTW with MPI), which provides
Chris@10: parallel transforms for distributed-memory systems with MPI. (By
Chris@10: default, the MPI routines are not compiled.) See FFTW MPI Installation.
Chris@10:
Chris@10: --disable-fortran
: Disables inclusion of legacy-Fortran
Chris@10: wrapper routines (see Calling FFTW from Legacy Fortran) in the standard
Chris@10: FFTW libraries. These wrapper routines increase the library size by
Chris@10: only a negligible amount, so they are included by default as long as
Chris@10: the configure
script finds a Fortran compiler on your system.
Chris@10: (To specify a particular Fortran compiler foo, pass
Chris@10: F77=
foo to configure
.)
Chris@10:
Chris@10: --with-g77-wrappers
: By default, when Fortran wrappers are
Chris@10: included, the wrappers employ the linking conventions of the Fortran
Chris@10: compiler detected by the configure
script. If this compiler is
Chris@10: GNU g77
, however, then two versions of the wrappers are
Chris@10: included: one with g77
's idiosyncratic convention of appending
Chris@10: two underscores to identifiers, and one with the more common
Chris@10: convention of appending only a single underscore. This way, the same
Chris@10: FFTW library will work with both g77
and other Fortran
Chris@10: compilers, such as GNU gfortran
. However, the converse is not
Chris@10: true: if you configure with a different compiler, then the
Chris@10: g77
-compatible wrappers are not included. By specifying
Chris@10: --with-g77-wrappers
, the g77
-compatible wrappers are
Chris@10: included in addition to wrappers for whatever Fortran compiler
Chris@10: configure
finds.
Chris@10:
Chris@10: --with-slow-timer
: Disables the use of hardware cycle counters,
Chris@10: and falls back on gettimeofday
or clock
. This greatly
Chris@10: worsens performance, and should generally not be used (unless you don't
Chris@10: have a cycle counter but still really want an optimized plan regardless
Chris@10: of the time). See Cycle Counters.
Chris@10:
Chris@10: --enable-sse
, --enable-sse2
, --enable-avx
,
Chris@10: --enable-altivec
, --enable-neon
: Enable the compilation of
Chris@10: SIMD code for SSE (Pentium III+), SSE2 (Pentium IV+), AVX (Sandy Bridge,
Chris@10: Interlagos), AltiVec (PowerPC G4+), NEON (some ARM processors). SSE,
Chris@10: AltiVec, and NEON only work with --enable-float
(above). SSE2
Chris@10: works in both single and double precision (and is simply SSE in single
Chris@10: precision). The resulting code will still work on earlier CPUs
Chris@10: lacking the SIMD extensions (SIMD is automatically disabled, although
Chris@10: the FFTW library is still larger).
Chris@10: gcc
, you may have to use the
Chris@10: -mabi=altivec
option when compiling any code that links to FFTW,
Chris@10: in order to properly align the stack; otherwise, FFTW could crash when
Chris@10: it tries to use an AltiVec feature. (This is not necessary on MacOS X.)
Chris@10: gcc
, you should use a version of gcc that
Chris@10: properly aligns the stack when compiling any code that links to FFTW.
Chris@10: By default, gcc
2.95 and later versions align the stack as
Chris@10: needed, but you should not compile FFTW with the -Os
option or the
Chris@10: -mpreferred-stack-boundary
option with an argument less than 4.
Chris@10: gcc
flags for generating
Chris@10: NEON code. In general, you will have to provide them on the command line.
Chris@10: This command line is known to have worked at least once:
Chris@10: ./configure --with-slow-timer --host=arm-linux-gnueabi \ Chris@10: --enable-single --enable-neon \ Chris@10: "CC=arm-linux-gnueabi-gcc -march=armv7-a -mfloat-abi=softfp" Chris@10:Chris@10:
To force configure
to use a particular C compiler foo
Chris@10: (instead of the default, usually gcc
), pass CC=
foo to the
Chris@10: configure
script; you may also need to set the flags via the variable
Chris@10: CFLAGS
as described above.
Chris@10:
Chris@10:
Chris@10:
Chris@10:
Chris@10: