Node:Installation on non-Unix systems, Next:Cycle Counters, Previous:Installation on Unix, Up:Installation and Customization
It should be relatively straightforward to compile FFTW even on non-Unix
systems lacking the niceties of a configure
script. Basically,
you need to edit the config.h
header (copy it from
config.h.in
) to #define
the various options and compiler
characteristics, and then compile all the .c
files in the
relevant directories.
The config.h
header contains about 100 options to set, each one
initially an #undef
, all documented with a comment, and most of
them fairly obvious. For most of the options, you should simply
#define
them to 1
if they are applicable, although a few
options require a particular value (e.g. SIZEOF_LONG_LONG
should
be defined to the size of the long long
type, in bytes, or zero
if it is not supported). We will likely post some sample
config.h
files for various operating systems and compilers for
you to use (at least as a starting point). Please let us know if you
have to hand-create a configuration file (and/or a pre-compiled binary)
that you want to share.
To create the FFTW library, you will then need to compile all of the
.c
files in the kernel
, dft
, dft/codelets
,
dft/codelets/standard
, dft/codelets/inplace
, rdft
,
rdft/codelets
, rdft/codelets/r2hc
,
rdft/codelets/hc2r
, rdft/codelets/r2r
, reodft
, and
api
directories. If you are compiling with SIMD support
(e.g. you defined HAVE_SSE2
in config.h
), then you also
need to compile the .c
files in the simd
, dft/simd
,
and dft/simd/codelets
directories. If you are compiling with AMD
K7 optimizations (i.e. you defined HAVE_K7
), then you also need
to include the dft/k7
and dft/k7/codelets
directories.
(See the previous section for more information on configuration options
like SIMD and K7 optimization; each Unix configuration option has a
corresponding #define
in config.h
.)
Once these files are all compiled, link them into a library, or a shared library, or directly into your program.
To compile the FFTW test program, additionally compile the code in the
libbench2/
directory, and link it into a library. Then compile
the code in the tests/
directory and link it to the
libbench2
and FFTW libraries. To compile the fftw-wisdom
(command-line) tool (see Wisdom Utilities), compile
tools/fftw-wisdom.c
and link it to the libbench2
and FFTW
libraries