Using FFTW (the fastest FFT) under Visual Studio 2013

Keywords:
FFTW (3.3.4Version), FFT, DFT, C/C++, Visual Studio 2013, Win7/Win8



Step 1.  First visit ffte.org and download the version (32 or 64-bit) of your interest, for precompiled FFTW 3.3.4 windows dlls. 

Here I would like to choose the 32bit version.See Fig 1. Then, extract the files in a target directory, say D:\FFTW32.


Fig 1. Precompiled FFTW 3.3.4 Windows DLLs


Step 2. You should be able to call those DLLs from your compiler. In order to link to them from Visual C++, you will need to create .lib"import libraries" using the Command Prompt program included with VC++. 

You can achieve this objective through the following steps.

1) Open Visual Studio Command Prompt. See Fig 2.
For Visual Studio 2013 in Windows8 or Windows 8.1
On the Start screen, type Visual Studio, and then choose Visual Studio Tools. (To access the Start screen, press the Windows logo key on your keyboard.)
In File Explorer, choose Developer Command Prompt for VS2013.
For Visual Studio (any version) in Windows 7
Choose Start, and then choose All Programs, Microsoft Visual Studio, Visual Studio Tools, Visual Studio Command Prompt.


Fig 2 Visual Studio 2013 Command Prompt in Windows 7

2)Within VS2013 x86 Native Tools Command Prompt, Change the current directory to the target one “D:\FFTW32\fftw-3.3.4-dll32”, which include those .dll files. Please Run: cd /dD:\FFTW32\fftw-3.3.4-dll32. See Fig 3 for results.


Fig 3 Change Current Directory to D:\FFTW32\fftw-3.3.4-dll32


3)Within VS2013 x86 Native Tools Command Prompt, Run the following commands. SeeFig 4 for results.
a) On Visual Studio 2008 in 32-bit mode, Run:

  • lib/machine:ix86 /def:libfftw3-3.def
  • lib/machine:ix86 /def:libfftw3f-3.def
  • lib/machine:ix86 /def:libfftw3l-3.def
b) On Visual Studio 2008 in 64-bit mode, Run:
  • lib/machine:x64 /def:libfftw3-3.def
  • lib/machine:x64 /def:libfftw3f-3.def
  • lib /machine:x64/def:libfftw3l-3.def
So, under the directory of D:\FFTW32\fftw-3.3.4-dll32, you can find the newly generated files (libfftw3-3.exp, libfftw3-3.lib, libfftw3f-3.exp, libfftw3f-3.lib, libfftw3l-3.exp, libfftw3l-3.lib), as well as one originally existing important header file (i.e., fftw3.h). See Fig 5.



Fig 4 Results of Run VS2013 x86 Native Tools Command Prompt


Fig 5 Generated Files


Step 3. Thelast four steps, in Visual C++, are the following. 

Now, open Visual Studio and:
  • Go to: Project -> Properties -> Configuration Properties ->VC++ Directories -> Include Directories, and then add the D:\FFTW32\fftw-3.3.4-dll32to the Include Directories;

  • Go to: Project ->Properties -> Configuration Properties -> VC++ Directories -> LibraryDirectories, and then add the D:\FFTW32\fftw-3.3.4-dll32, to the Library Directories;
  • Go to: Project ->Properties -> Configuration Properties -> VC++ Directories -> Linker-> Input, and then add the libfftw3-3.lib and/or libfftw3f-3.liband/or libfftw3l-3.libto the Additional Dependencies.
  • Copy the three .dll FFTW files (Note: .dll files, NOT .lib files) into the folder of your project where.vcxproj and .vcxproj.filters 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.libis for double precision and libfftw3l-3.lib is for long double.

That's all. This procedure works fine for me.
Enjoy the Fastest Fourier Transform in the West (FFTW) in your IDE!


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值