Node:Generating your own code, Previous:Cycle Counters, Up:Installation and Customization

### 8.4 Generating your own code

The directory `genfft` contains the programs that were used to generate FFTW's "codelets," which are hard-coded transforms of small sizes. We do not expect casual users to employ the generator, which is a rather sophisticated program that generates directed acyclic graphs of FFT algorithms and performs algebraic simplifications on them. It was written in Objective Caml, a dialect of ML, which is available at http://pauillac.inria.fr/ocaml/.

If you have Objective Caml installed (along with recent versions of GNU `autoconf`, `automake`, and `libtool`), then you can change the set of codelets that are generated or play with the generation options. The set of generated codelets is specified by the `dft/codelets/*/Makefile.am`, `dft/simd/codelets/Makefile.am`, `dft/k7/codelets/Makefile.am`, and `rdft/codelets/*/Makefile.am` files. For example, you can add efficient REDFT codelets of small sizes by modifying `rdft/codelets/r2r/Makefile.am`. After you modify any `Makefile.am` files, you can type `sh bootstrap.sh` in the top-level directory followed by `make` to re-generate the files.

We do not provide more details about the code-generation process, since we do not expect that most users will need to generate their own code. However, feel free to contact us at fftw@fftw.org if you are interested in the subject.

You might find it interesting to learn Caml and/or some modern programming techniques that we used in the generator (including monadic programming), especially if you heard the rumor that Java and object-oriented programming are the latest advancement in the field. The internal operation of the codelet generator is described in the paper, "A Fast Fourier Transform Compiler," by M. Frigo, which is available from the FFTW home page and also appeared in the Proceedings of the 1999 ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI).