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