This document contains various information regarding installation of FFTW on DOS/Windows. (It was sent in by users, and has not been personally verified by us.) Please contact us if you have any additions or corrections. You should, of course, first read the Installation on non-Unix Systems of the FFTW 3 manual (or the corresponding section of the FFTW 2 manual).
Franz Franchetti has graciously offered to provide up-to-date FFTW binaries and project files using Visual Studio and the Intel C compiler at his web page.
Alessio Massaro contributed Windows binaries of fftw-3.0.1, compiled with the Intel C Compiler version 7.1. This package uses SSE/SSE2 instructions when appropriate.
This archive is called fftw-3.0.1-w32-pl1.zip
and
was created on Nov 13, 2003. If you downloaded the older archive
fftw-3.0.1-w32.zip
, please upgrade. Some library symbols
were incorrectly not exported in the older build.
Alessio has also sent us Windows binaries compiled with gcc under MinGW, which support for threads and have AMD K7 (3dNow!) in addition to SSE/SSE2. An updated version of this file was contributed by Boran Car, which incorporates a missing libgcc.a library file. This library can be called from Visual C++ and other Windows compilers.
Klaus Maisinger contributed .def and .lib
files for Borland C++ Builder 6 to to allow you to use the above
Intel-compiled binaries; you need to use Klaus' fftw3.lib
in addition to fix compatibility problems between Borland C++ and
Visual C++. See also his description of
what he did.
The above binaries were, unfortunately, compiled without the Fortran wrapper routines. Koos Huijssen sent us a library file for Compaq Visual Fortran that you can use, in addition to Alessio's DLL, to call FFTW from that Fortran compiler.
Stephane Ruel helped us to get FFTW 3 working under Visual C++, and
sent us a build
file to compile FFTW with that compiler. (Note that this package
provides modified versions of some FFTW files, which are no longer
necessary with FFTW version 3.0.1. Also, it refers to the files
rdft/vrank2-transpose.c
and
rdft/vrank3-transpose.c
, which are no longer included or
needed; references to them should be deleted from the build, or you
can create empty files with these names. Other compiler warnings can
be ignored.)
Mark Roden send us modified build files to use Visual C++ 6.0 with version 8.0 of the Intel compiler and FFTW 3.0.1, with threads and SSE enabled.
Visual C++ is buggy. Get a real compiler and do not complain to us.
Stephane Ruel was unable to get the SIMD (SSE) code to produce correct results with Visual C++ 6.0; we 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.
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.
George Beckett has contributed a Pascal interface file (fftw_interface.pas)
for calling FFTW from Borland Delphi (Pascal). This file is for the
single-precision FFTW, but double-precision could be used as well by
changing the appropriate types and renaming fftwf_
to
fftw_
in the file.
He also sent us his notes on calling FFTW from Delphi as well as on compiling FFTW on Windows with the Borland C++ compiler. Finally, he sent us the compiled library via Borland (see also the material from Klaus Maisinger, above). George recommends using the DLLs from Alessio Massaro instead, though, for better performance (note that Alessio's symbol names do not need to be prepended with an underscore, however).
Marek Januszewski has created an FFTW 2.x DevPak for use with Dev-C++ (a MinGW front-end).
FFTW includes special hacks to align double-precision variables on the stack for gcc on x86. One of our users, Jonathan Hardwick, has done a detailed study of how these hacks might be extended to Visual C++ and the Intel C++ compiler, and what their performance effects are.
FFTW can include Fortran-callable wrapper routines so that you can call the FFTW functions from a Fortran program. These routines are not available automatically on Windows, however.
The problem is that FFTW does not know how to mangle its subroutine
names for the Fortran linker (Fortran expects all identifiers to be in
a canonical case and format). On Unix systems, our
configure
script can 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
(Thanks to Dima Berkov for this note.)
FFTW includes a high-precision timer that will be automatically (see below) enabled under Win32, contributed by Andrew Sterian.
We have not tested this code ourselves, however, and it may cause
problems for some users. (In particular, problems have been reported
with its use of the header file windows.h
, which is not
recognized in some configurations.) To disable the use of this timing
code (and revert to the default clock()
function),
comment out the line:
#define HAVE_WIN32_TIMERin
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.)
#include
the file
watcom\h\nt\windows.h
in config.h
to get
things running (presumably because of the timer code).
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
$(AR) rv $(LIBFFT) *.odue to argument number constraints in make (there are likely other work-arounds).
$(RM) -f
to $(RM)
_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.)