The latest version of FFTW may be found on the Web at the FFTW home
page:
http://theory.lcs.mit.edu/~fftw
As distributed, FFTW makes very few assumptions about your system. All
you need is an ANSI C compiler (gcc
is fine, although
vendor-provided compilers often produce faster code). If you have a
Unix system (Linux is fine), you can simply type make install
in
the src
directory. This command will create a library called
libfftw.a
and install it in /usr/local/lib
. Also, the
header file fftw.h
is installed in /usr/local/include
.
(You can change these locations by editing the prefix
variable in
the Makefile
.) The default compiler used is gcc
, and there
are some default CFLAGS
specified in the Makefile
.
If you have a non-Unix system that does not provide make
, it is
still possible to compile the source code. However, the Makefile
we provide will probably not work, and you will have to build the
library yourself; you must also install the library and the header file
fftw.h
. (You just have to compile all the .c
files in the
src
directory and link them into a library.)
There are two things that you might want to consider doing in order to
get a better installation of FFTW. First, if your system
supports a high-resolution clock, it is advisable to use it. This will
reduce the time spent creating plans. Second, if you know that you will
only use transforms of a certain size (say, powers of ), you may
reconfigure FFTW to support only those sizes you are interested in. You
may even generate code to support transforms of a size not supported by
the default distribution. The default distribution supports transforms
of any size, but not all sizes are equally fast. The default
installation of FFTW is best at handling sizes of the form
where the exponents of and are either or
, and the other exponents are arbitrary. Other sizes are
computed by means of a slow, general-purpose routine. However, if you
have an application that requires fast transforms of size, say,
17
, there is a way to generate specialized code to handle that.
FFTW needs a reasonably precise clock in order to find the optimal way
to compute a transform. By default, FFTW uses the Unix clock()
function for timings. This is very portable, but it also means that
FFTW must run for a long time in order to get reliable measurements.
If your machine supports a high-resolution clock, it is therefore
advisable to use it. You must edit the last part of
src/fftw.h
. There are a few macros you must redefine:
look at how we handled Solaris and the MacOS for examples.
Even if you don't install high-resolution timing code, we still
recommend that you look at the FFTW_TIME_MIN
constant in
src/fftw.h
. This constant holds the minimum time interval (in
seconds) required to get accurate timing measurements, and should be (at
least) several hundred times the resolution of your clock. The default
constants are on the conservative side, and may cause FFTW to take
longer than necessary when you create a plan. Set FFTW_TIME_MIN
to whatever is appropriate on your system (be sure to set the
right FFTW_TIME_MIN
...there are several definitions in
fftw.h
, corresponding to different platforms and timers).
As an aid in checking the resolution of your clock, you can use the
tests/fftw_test
program with the -t
option
(c.f. tests/README
). Remember, the mere fact that your clock
reports times in, say, picoseconds, does not mean that it is actually
accurate to that resolution.
The program src/genfft.ml
was used to generate the code that FFTW
uses to compute the transforms. We do not expect casual users to use
it. genfft
is a rather sophisticated program that generates
abstract syntax trees and performs algebraic simplifications on them.
genfft
is written in Caml Light, a dialect of ML. Caml Light is
available from ftp.inria.fr
in the directory
lang/caml-light
.
If you have Caml Light installed, you can type make sources
to re-generate the sources. At this point, you can generate
any source you want, of course: just change the Makefile
and src/config.c
to make FFTW aware of the new functions you
want to use.
We do not provide more details about the code-generation process, since
we do not expect that users will need to generate their own code.
However, feel free to contact us at fftw@theory.lcs.mit.edu
if
you are interested in the subject.