?? fftw-faq.ascii
字號:
FFTW FREQUENTLY ASKED QUESTIONS WITH ANSWERS 24 Mar 2003 Matteo Frigo Steven G. Johnson <fftw@fftw.org>This is the list of Frequently Asked Questions about FFTW, a collection offast C routines for computing the Discrete Fourier Transform in one ormore dimensions.===============================================================================Index Section 1. Introduction and General Information Q1.1 What is FFTW? Q1.2 How do I obtain FFTW? Q1.3 Is FFTW free software? Q1.4 What is this about non-free licenses? Section 2. Installing FFTW Q2.1 Which systems does FFTW run on? Q2.2 Does FFTW run on DOS/Windows? Q2.3 My compiler has trouble with FFTW. Q2.4 FFTW does not compile on Solaris, complaining about const. Q2.5 Which language is FFTW written in? Q2.6 Can I call FFTW from FORTRAN? Q2.7 Can I call FFTW from C++? Q2.8 Why isn't FFTW written in FORTRAN/C++? Q2.9 How do I compile FFTW to run in single precision? Section 3. Using FFTW Q3.1 FFTW seems really slow. Q3.2 FFTW slows down after repeated calls. Q3.3 An FFTW routine is crashing when I call it. Q3.4 My Fortran program crashes when calling FFTW. Q3.5 FFTW gives results different from my old FFT. Q3.6 Your in-place transform gives incorrect results. Q3.7 Can I save FFTW's plans? Q3.8 Why does your inverse transform return a scaled result? Q3.9 How can I make FFTW put the origin (zero frequency) at the center Q3.10 How do I FFT an image/audio file in *foobar* format? Q3.11 My program does not link (on Unix). Q3.12 My program crashes, complaining about stack space. Section 4. Internals of FFTW Q4.1 How does FFTW work? Q4.2 Why is FFTW so fast? Q4.3 What is this wisdom thing? Q4.4 Why do you use wisdom? I just wanted to save a plan. Section 5. Known bugs Q5.1 FFTW 1.1 crashes in rfftwnd on Linux. Q5.2 The MPI transforms in FFTW 1.2 give incorrect results/leak memory. Q5.3 The test programs in FFTW 1.2.1 fail when I change FFTW to use sin Q5.4 The test program in FFTW 1.2.1 fails for n > 46340. Q5.5 The threaded code fails on Linux Redhat 5.0 Q5.6 FFTW 2.0's rfftwnd fails for rank > 1 transforms with a final dime Q5.7 FFTW 2.0's complex transforms give the wrong results with prime fa Q5.8 FFTW 2.1.1's MPI test programs crash with MPICH. Q5.9 FFTW 2.1.2's multi-threaded transforms don't work on AIX. Q5.10 FFTW 2.1.2's complex transforms give incorrect results for large p Q5.11 FFTW 2.1.3 crashes on AIX===============================================================================Section 1. Introduction and General Information Q1.1 What is FFTW? Q1.2 How do I obtain FFTW? Q1.3 Is FFTW free software? Q1.4 What is this about non-free licenses?-------------------------------------------------------------------------------Question 1.1. What is FFTW?FFTW is a free collection of fast C routines for computing the DiscreteFourier Transform in one or more dimensions. It includes complex, real,and parallel transforms, and can handle arbitrary array sizes efficiently.FFTW is typically faster than other publically-available FFTimplementations, and is even competitive with vendor-tuned libraries.(See our web page for extensive benchmarks.) To achieve this performance,FFTW uses novel code-generation and runtime self-optimization techniques(along with many other tricks).-------------------------------------------------------------------------------Question 1.2. How do I obtain FFTW?FFTW can be found at the FFTW web page. You can also retrieve it fromftp.fftw.org in /pub/fftw.-------------------------------------------------------------------------------Question 1.3. Is FFTW free software?Starting with version 1.3, FFTW is Free Software in the technical sensedefined by the Free Software Foundation (see Categories of Free andNon-Free Software), and is distributed under the terms of the GNU GeneralPublic License. Previous versions of FFTW were distributed without feefor noncommercial use, but were not technically ``free.''Non-free licenses for FFTW are also available that permit different termsof use than the GPL.-------------------------------------------------------------------------------Question 1.4. What is this about non-free licenses?The non-free licenses are for companies that wish to use FFTW in theirproducts but are unwilling to release their software under the GPL (whichwould require them to release source code and allow free redistribution).Such users can purchase an unlimited-use license from MIT. Contact us formore details.We could instead have released FFTW under the LGPL, or even disallowednon-Free usage. Suffice it to say, however, that MIT owns the copyrightto FFTW and they only let us GPL it because we convinced them that itwould neither affect their licensing revenue nor irritate existinglicensees.===============================================================================Section 2. Installing FFTW Q2.1 Which systems does FFTW run on? Q2.2 Does FFTW run on DOS/Windows? Q2.3 My compiler has trouble with FFTW. Q2.4 FFTW does not compile on Solaris, complaining about const. Q2.5 Which language is FFTW written in? Q2.6 Can I call FFTW from FORTRAN? Q2.7 Can I call FFTW from C++? Q2.8 Why isn't FFTW written in FORTRAN/C++? Q2.9 How do I compile FFTW to run in single precision?-------------------------------------------------------------------------------Question 2.1. Which systems does FFTW run on?FFTW is written in ANSI C, and should work on any system with a decent Ccompiler. (See also Q2.2 `Does FFTW run on DOS/Windows?' and Q2.3 `Mycompiler has trouble with FFTW.'.)-------------------------------------------------------------------------------Question 2.2. Does FFTW run on DOS/Windows?It should. FFTW was not developed on DOS or Windows, but the source codeis straight ANSI C. Some users have reported using FFTW on DOS/Windowsusing various compilers. See also the FFTW Windows installation notes andQ2.3 `My compiler has trouble with FFTW.'-------------------------------------------------------------------------------Question 2.3. My compiler has trouble with FFTW.Complain fiercely to the vendor of the compiler.FFTW is a heavily-optimized piece of software that is likely to pushcompilers to their limits. We had no problems with, for example, gcc2.7.2, egcs 1.1.x, Sun's SC4.0, and IBM's XLC. Users have also reportedsuccessful compilations of FFTW using Borland's C/C++ compilers onWindows.The Portland Group PGCC compiler, version 4.0 for Linux/x86, reportedlyproduces incorrect code for FFTW 2.1.3.Visual C++ 4.0 crashes when compiling FFTW 1.2 with all optimizationsturned on. Visual C++ 5.0 reportedly produces incorrect code for the realtransforms in FFTW 2.x when the option "Maximize speed" is set. We aretold that Service Pack 3 fixes the bug.Metrowerks CodeWarrior Pro 4 reportedly generates incorrect code for thePowerPC when compiling FFTW at optimization level 4. Supposedly, this bugis fixed in CW Pro 5 with all the latest updates applied. (No problemswere reported for previous versions.)Various problems have also been observed with SGI's MIPSpro compilers,versions 7.2.0 and 7.2.1 (you may have to lower the optimization level forsome files to get them to compile); the bug seems to be fixed in version7.3. The test program in earlier versions of FFTW had problems with the-xO5 option in Sun's SC4.0 C compiler. egcs 1.0.2 produced incorrect codefor FFTW on the PowerPC (corrected in egcs 1.1).The DEC C compiler, V5.8-009 on Digital UNIX V4.0 (Rev. 1091) is known tohave bugs with its EV6 tuning. Specifically, compiling FFTW with -archhost (the default) or -arch ev6 on an Alpha EV6 can cause FFTW (e.g.fftw_test -s 256) to crash.-------------------------------------------------------------------------------Question 2.4. FFTW does not compile on Solaris, complaining about const.We know that at least on Solaris 2.5.x with Sun's compilers 4.2 you mightget error messages from make such as"./fftw.h", line 88: warning: const is a keyword in ANSI CThis is the case when the configure script reports that const does notwork:checking for working const... (cached) noYou should be aware that Solaris comes with two compilers, namely,/opt/SUNWspro/SC4.2/bin/cc and /usr/ucb/cc. The latter compiler isnon-ANSI. Indeed, it is a perverse shell script that calls the realcompiler in non-ANSI mode. In order to compile FFTW, change your path sothat the right cc is used.To know whether your compiler is the right one, type cc -V. If thecompiler prints ``ucbcc'', as inucbcc: WorkShop Compilers 4.2 30 Oct 1996 C 4.2then the compiler is wrong. The right message is something likecc: WorkShop Compilers 4.2 30 Oct 1996 C 4.2-------------------------------------------------------------------------------Question 2.5. Which language is FFTW written in?FFTW is written in ANSI C. Most of the code, however, was automaticallygenerated by a program called genfft, written in the Objective Camldialect of ML. You do not need to know ML or to have an Objective Camlcompiler in order to use FFTW.genfft is provided with the FFTW sources, which means that you can playwith the code generator if you want. In this case, you need a workingObjective Caml system. Objective Caml is available from ftp.inria.fr inthe directory /lang/caml-light.-------------------------------------------------------------------------------Question 2.6. Can I call FFTW from FORTRAN?Yes, but not directly. The main problem is that Fortran cannot passparameters by value. However, FFTW can be called indirectly from Fortranthrough the use of special C "wrapper" routines. Appropriate wrappercode, documented in the FFTW manual, is included with FFTW (versions 1.3and higher).By default, FFTW configures its wrapper routines to work with the firstcompiler it finds, e.g. g77. To configure for a different, incompatibleFortran compiler foobar, use ./configure F77=foobar when installing FFTW.-------------------------------------------------------------------------------Question 2.7. Can I call FFTW from C++?Most definitely. FFTW should compile and run under any C++ compiler.-------------------------------------------------------------------------------Question 2.8. Why isn't FFTW written in FORTRAN/C++?Because we don't like those languages, and neither approaches theportability of C.-------------------------------------------------------------------------------Question 2.9. How do I compile FFTW to run in single precision?On a Unix system: configure --enable-float. On a non-Unix system: editfftw/fftw.h to #define the symbol FFTW_ENABLE_FLOAT. In both cases, youmust then recompile FFTW.===============================================================================Section 3. Using FFTW Q3.1 FFTW seems really slow. Q3.2 FFTW slows down after repeated calls. Q3.3 An FFTW routine is crashing when I call it. Q3.4 My Fortran program crashes when calling FFTW. Q3.5 FFTW gives results different from my old FFT. Q3.6 Your in-place transform gives incorrect results. Q3.7 Can I save FFTW's plans? Q3.8 Why does your inverse transform return a scaled result? Q3.9 How can I make FFTW put the origin (zero frequency) at the center Q3.10 How do I FFT an image/audio file in *foobar* format? Q3.11 My program does not link (on Unix). Q3.12 My program crashes, complaining about stack space.-------------------------------------------------------------------------------Question 3.1. FFTW seems really slow.You are probably recreating the plan before every transform, rather thancreating it once and reusing it for all transforms of the same size. FFTWis designed to be used in the following way:* First, you create a plan. This will take several seconds.* Then, you reuse the plan many times to perform FFTs. These are fast.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -