Professional Documents
Culture Documents
http://www.fftw.org/install/windows.html#fftw2
For Borland C++, you instead need to use Borland's implib program, via (thanks to M. Lenarczyk):
implib -a fftw3-3.lib libfftw3-3.dll implib -a fftw3f-3.lib libfftw3f-3.dll implib -a fftw3l-3.lib libfftw3l-3.dll
See DLLs and wisdom, below, for important information on using wisdom import/export from a DLL. Contact us if you have suggestions, but realize that we don't use Windows ourselves. We created these .zip files with the scripts BUILD-MINGW32.sh and BUILD-MINGW64.sh; see also the MinGW instructions below. Thanks to John Pavel for his extensive feedback.
1 de 6
http://www.fftw.org/install/windows.html#fftw2
the gcc-compiled version that we provide above. In particular, you can use the bench.exe program to benchmark a few typical sizes to get an idea of how they compare:
bench.exe -opatient 64 128 256 512 1024 2048 4096
The resulting DLL files are installed in /usr/local/bin. Important: If you want to call the resulting DLL from another compiler (i.e. not from MinGW), you need to add a line #define FFTW_DLL to fftw3.h (installed in /usr/local/include). This adds some __declspec decorations to the function declarations.
2 de 6
http://www.fftw.org/install/windows.html#fftw2
FFTW implements a mechanism called "wisdom" for saving plans to disk (see the manual). However, users have reported that passing FILE pointers to a DLL fails (i/o in the DLL crashes). This has been reported for FFTW compiled with both gcc/MinGW and the Intel compilers, and it's been suggested to us that this has to do with there being multiple C runtime libraries in Windows (see here). Because of this, you currently cannot call FFTW's fftw_export_wisdom_to_file and fftw_import_wisdom_from_file functions when FFTW is compiled as a DLL. There are workarounds, however. In particular, FFTW provides generic import/export functions that allow you to specify a routine for reading/writing characters. That way, you can supply a routine to access the file yourself and the DLL never has to see it. In particular, you can provide a drop-in replacement for FFTW's fftw_export_wisdom_to_file and fftw_import_wisdom_from_file functions simply by including the following lines after you #include <fftw3.h>:
static void my_fftw_write_char(char c, void *f) { fputc(c, (FILE *) f); } #define fftw_export_wisdom_to_file(f) fftw_export_wisdom(my_fftw_write_char, (void*) (f)) #define fftwf_export_wisdom_to_file(f) fftwf_export_wisdom(my_fftw_write_char, (void*) (f)) #define fftwl_export_wisdom_to_file(f) fftwl_export_wisdom(my_fftw_write_char, (void*) (f)) static int my_fftw_read_char(void *f) { return fgetc((FILE *) f); } #define fftw_import_wisdom_from_file(f) fftw_import_wisdom(my_fftw_read_char, (void*) (f)) #define fftwf_import_wisdom_from_file(f) fftwf_import_wisdom(my_fftw_read_char, (void*) (f)) #define fftwl_import_wisdom_from_file(f) fftwl_import_wisdom(my_fftw_read_char, (void*) (f))
Older stuff
Below are older instructions and packages that were sent to us, but which are now probably out of date.
3 de 6
http://www.fftw.org/install/windows.html#fftw2
suspect a compiler bug (the same code works fine with gcc and Intel icc). We have an unconfirmed report of similar problems with version 7.0. If you have a more recent version of VC++, please let us know whether it works. Stephane recently reported that he was able to compile the SIMD code in FFTW 3.0.1 using the Intel compiler version 7.1 (with flags -O3 -G7 -QxW) with Visual C++. (Modify config.h to #define either HAVE_SSE or HAVE_SSE2, depending upon the precision.) Visual C++ 4.0 and 5.0 had some problems compiling previous FFTW versions correctly, but these were fixed in later releases of those compilers, which however introduced new bugs for new FFTW versions. VC++ 6.0 also reportedly produces incorrect code for the file reodft11e-r2hc-odd.c (odd-size type-IV DCTs and DSTs) unless optimizations are disabled for that file.
Visual C++ Project Files and Win32 Binaries for FFTW 2.x
Andrew Sterian has put together project workspace files for Microsoft Visual C++ 5.0 that can be used to build FFTW 2.1.3 smoothly from within the IDE. His workspace also allows building the FFTW library as a DLL. Please read through the README.TXT file for important information about using FFTW as a DLL. You should note that the FFTW package can be compiled as-is on Windows--you simply need to compile all of the .c files in the fftw and rfftw directories. Andrew's files may provide extra convenience, however, especially when building DLLs. Andrew's package also includes some code to allow the test program to accept command-line parameters in the DOS shell (otherwise, the test program will run in interactive mode on Windows). You can also find the latest versions of Andrew's packages, as well as prebuilt binaries for Win32 (x86) on his web site.
4 de 6
http://www.fftw.org/install/windows.html#fftw2
automatically detect the name-mangling scheme, but this is not possible on Windows. So, you have to specify it manually in order to use the Fortran wrappers. To do this, go to the end of the fftw/config.h file and #define the appropriate symbol according to the comments. There are eight possibilities: all upper or lower case, and zero, one, or two appended underscores. For example, Digital Visual Fortran (reportedly) uses all lower case with no appended underscore, so you should #define FFTW_FORTRANIZE_LOWERCASE. (If you don't know, you can experiment with a small Fortran and C program until you find something that works. Your Fortran manual may also document how to link with C.) Let us know how it works with your Fortran compiler. There is another issue to be aware of with Digital Fortran: for every routine that you want to call (e.g. fftw_f77), you must include an instruction like the following at the beginning of your Fortran program:
!DEC$ ATTRIBUTES C, REFERENCE :: fftw_f77
in config.h. If you want to make sure that the timer is automatically enabled in your compiler, delete the #if directive surrounding the above line. (This directive is used to automatically enable the timer, but it won't work if your compiler doesn't define __WIN32__, WIN32, or _WINDOWS. Visual C++ and Borland C/C++ should be fine.)
FFTW 1.2
Here are some changes to the Makefile sent in by Robert Jansen to get FFTW 1.2 running under the DOS shell with gcc:
RM = del CP = copy AR = ar
due to argument number constraints in make (there are likely other work-arounds). Change $(RM) -f to $(RM) Remove all _64 modules in config.c and the Makefile due to a stack limit problem. (This might be solved by simply increasing the stack size in config.sys; he didn't check.) (Many of these changes may not be necessary with other compilers or if you install a DOS-UNIX package like like uxut123 from the Oakland software repository.)
5 de 6
http://www.fftw.org/install/windows.html#fftw2
Be sure to let us know if you have to make any other changes to get things working under Windows. Go back to the FFTW download page.
6 de 6