CraFT installation

version 1.0.12g
Tuesday October 04 2011

CraFT is written mostly in C (C99) and some features are written in Fortran 90 (in an almost Fortran 77 manner). Its installation has been tested on Linux Debian Squeeze but it should be able to be compiled on any Unix system.

The following text gives some details on how to install it.


To compile craft, you need:
  • FFTW3
    You can download it from or as a package of your gnu/linux distibution (if it is your os and if such a package exists).
    [ Remark: CraFT uses fast Fourier transforms. It could be implemented with different FFT packages (previous versions of the algorithm used many other FFT packages) but this version has been implemented with FFTW3 package. If you prefer to use another FFT package, I’m afraid you will have to modify craft_fft_image.c file. ]
  • Gnu make
  • a C compiler with C99 features + a Fortran 90 compiler


    • either gnu compilers: gcc + gfortran
    • or Intel compilers : icc + ifort

Downloading CraFT:

You can download CraFT distribution from here:

Put craft-1.0.12g.tgz where you want on your disk and extract the distribution by the following command:

    tar xvfz craft-1.0.12g.tgz

Compiling CraFT:

  • get into craft root directory:
  • cd ./craft-1.0.12g

  • If necessary edit and modify what you need in file present in the craft root directory.
  • In this file, you should just have:

    1. to choose the compilers you want to use, set COMPILERS variable:
      • COMPILERS=intel if you want to use icc and ifort
      • COMPILERS=gnu if you want to use gcc and gfortran
    2. to choose to use OpenMP parallelization option or not by setting OPENMP variable to yes or no
    3. to choose to get a static or a dynamic executable by setting STATIC_LIBRARIES to yes or no
    4. to set the directories where fftw3 libraries and include files have been installed.

    Of course, you can change other things in (typically CFLAGS, FFLAGS variables) but it is not necessary. has been initially set to compile with gcc anf gfortran compiler without OpenMP options, and to build an executable using dynamic libraries.

  • Type make in the current directory (the one containing this INSTALL file)
  • This should build the executables:

    • bin/craft (CraFT program)

    and some tools:

    • bin/i3dtovtk : converts an image file in "i3d" CraFT image format into simple legacy VTK file format
    • bin/vtktoi3d : converts an image file in simple legacy VTK file format into "i3d" CraFT image file format
    • bin/i3stat : displays some infos about images in "i3d" or VTK format
    • bin/general_i3d : creates a descriptor file for use of a i3d file in 3D scientific visualization program OpenDX
    • bin/teq : creates an image of equivalent stress or strain + an image of the hydrostatic component from the image files of the 6 components of a stress or strain tensor field