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