I am having trouble using fftw. I have been given some C code and I am trying to get it working on my machine. I am using MinGW 6.3.0, Visual Studio Code 2022 and my os is windows 10. The code uses the fftw3 library by calling #include <fftw3.h>
I followed these instructions: http://www.fftw.org/install/windows.html I unzipped the 64 bit version into a folder and ran the following in the Developer Command Prompt for VS 2022:
implib -a fftw3-3.lib libfftw3-3.dll
implib -a fftw3f-3.lib libfftw3f-3.dll
implib -a fftw3l-3.lib libfftw3l-3.dll
But now I'm not sure what to do. When I try to compile the code in windows command prompt it gives an error as it can't find fftw3.h, but I don't know how to fix it. I have tried looking at guides online but I am just getting confused. I want to be able to use fftw3.h without copy-pasting it into the working directory.
Any tips would be greatly appreciated, as I don't really know what I'm doing :/
The compiler has to be able to find the include file fftw3.h to process your source code correctly. Your options are basically to put it in the working directory for this project or into one of the paths that the compiler uses to look for .h header files. Unless you intend to use FFTW a lot it is probably easier to add it to your working directory for this particular project. You could also do it by using the menu bar :
MinGW on Windows may not be the best choice if you want things to run quickly. I have recently had trouble with it using 80bit x87 code behind the scenes for sin, cos & exp. If performance is an issue I suggest trying MS VC 2022 in the Windows environment which looks very much like VS code. I haven't tried FFTW under MS C 2022 so I don't know if the caveats given on the FFTW page you referenced about MS C still apply. My instinct is that they probably don't but it is worth double checking that the code is really doing a correct FFT!
If you really want the fastest compiler for this sort of numeric work download the Intel compiler which will also install and run under the MSVC environment. But get it all compiled and working first and then worry about speed.