Tricks and Tips: Using FFTW (the fastest FFT in the west) under Visual Studio 2010

First visit Fftw.org and download the version (32 or 64bit) of your interest.

Then, extract the files in a target directory, say C:UsersPublicDocumentsFFTW32 or C:UsersPublicDocumentsFFTW64, depending on your relevant architecture.

Copy now the lib.exe file located in C:Program Files (x86)Microsoft Visual Studio 10.0VCbin to the target directory. Also copy the files:

msobj100.dll
mspdb100.dll
mspdbcore.dll
mspdbsrv.exe

located in the C:Program Files (x86)Microsoft Visual Studio 10.0Common7IDE directory.

Open a command window (Start and type cmd in the dialog box). Change directory to the target directory and then type

lib /def:libfftw3f-3.def
lib /def:libfftw3-3.def
lib /def:libfftw3l-3.def

This step generates the files

libfftw3-3.exp
libfftw3-3.lib
libfftw3f-3.exp
libfftw3f-3.lib
libfftw3l-3.exp
libfftw3l-3.lib

The above lib command will generate the files for a 32 bit architecture. To specify a 64 bit architecture, use for example:

lib /machine:x64 /def:libfftw3-3.def
(/machine: x86 specifies on the contrary a 32 bit machine).

The last four steps, in Visual C++, are the following.

1. Go to: Project -> Properties -> Configuration Properties -> VC++ Directories  and then add the C:UsersPublicDocumentsFFTW32 or C:UsersPublicDocumentsFFTW64 directories, depending on the relevant architecture, to the Include Directories;

2. Go to: Project -> Properties -> Configuration Properties -> VC++ Directories  and then add the C:UsersPublicDocumentsFFTW32 or C:UsersPublicDocumentsFFTW64 directories, depending on the relevant architecture, to the Library Directories;

3. Go to: Project -> Properties -> Configuration Properties -> C/C++ -> Linker -> Input and then add the libfftw3-3.lib and/or libfftw3f-3.lib and/or libfftw3l-3.libto the Additional Dependencies.

4. Copy the three .dll FFTW files into the folder of your project where the .pdb files are located.

Remember that FFTW can deal with floating point, double precision and long double numbers.
The libfftw3f-3.lib library is for floating points, the libfftw3-3.lib is for double precision and libfftw3l-3.lib is for long double.

One thought on “Tricks and Tips: Using FFTW (the fastest FFT in the west) under Visual Studio 2010

  1. Vaclav Divis says:

    One additional hint. For VS12 copy also the “link.exe”.

Leave a Reply

Your email address will not be published. Required fields are marked *