How to link Intel MKL FFT Library


Sometimes we want to use the FFT Library in MKL in order to improve performance. This blog introduces how to do it.


Counterintuitively, although FFT in integrate into MKL, it still needs to be compiled before use.

Compile FFT Library

Firstly, enter the FFT library interface folder. If you don’t have the full authority of this folder, a copy operation is needed.

cd $MKLROOT/interfaces

Then, for each directory with prefix fftw, enter that directory and execute the following compile command

make -j libintel64 \
	mpi=mpich2 \
	INSTALL_DIR=`pwd`/../lib64 \

For more parameters details, just type make

$ make
Usage: make libia32|libintel64|libmic

  compiler_name - {pgi|gnu|intel}
        Default value: intel
        Intel(R) C Compiler as default

Additional macros:
        Path to Intel(R) MKL root directory with header files and libraries.
        Default value: ../..

        Install the library to the specified location.
        Default value: $(MKLROOT)/lib/<arch>

        Specify the name of the library.
        Default value depends on PRECISION and compiler used:

It seems that, only static library is provided. Precision can be specified according to demand.

Finally, just link all the *.a files during link procedure.