Subversion Repositories shark

Rev

Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 pj 1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
2
<html>
3
<head><title>
4
FFTW FAQ - Section 2
5
</title>
6
<link rev="made" href="mailto:fftw@theory.lcs.mit.edu">
7
<link rel="Contents" href="index.html">
8
<link rel="Start" href="index.html">
9
<link rel="Next" href="section3.html"><link rel="Previous" href="section1.html"><link rel="Bookmark" title="FFTW FAQ" href="index.html">
10
</head><body text="#000000" bgcolor="#FFFFFF"><h1>
11
FFTW FAQ - Section 2 <br>
12
Installing FFTW
13
</h1>
14
 
15
<ul>
16
<li><a href="#systems" rel=subdocument>Q2.1. Which systems does FFTW run on?</a>
17
<li><a href="#runOnDOS" rel=subdocument>Q2.2. Does FFTW run on DOS/Windows?</a>
18
<li><a href="#compilerCrashes" rel=subdocument>Q2.3. My compiler crashes when compiling FFTW.</a>
19
<li><a href="#solarisSucks" rel=subdocument>Q2.4. FFTW does not compile on Solaris, complaining about
20
<code>const</code>.</a>
21
<li><a href="#languages" rel=subdocument>Q2.5. Which language is FFTW written in?</a>
22
<li><a href="#fortran" rel=subdocument>Q2.6. Can I call FFTW from FORTRAN?</a>
23
<li><a href="#cplusplus" rel=subdocument>Q2.7. Can I call FFTW from C++?</a>
24
<li><a href="#whynotfortran" rel=subdocument>Q2.8. Why isn't FFTW written in FORTRAN/C++?</a>
25
<li><a href="#singleprec" rel=subdocument>Q2.9. How do I compile FFTW to run in single precision?</a>
26
</ul><hr>
27
 
28
<h2><A name="systems">
29
Question 2.1.  Which systems does FFTW run
30
on?
31
</A></h2>
32
 
33
FFTW is written in ANSI C, and should work on any system with
34
a decent C compiler.  (See also <A href="#runOnDOS">Q2.2 `Does FFTW run on DOS/Windows?'</A> and  <A href="#compilerCrashes">Q2.3 `My compiler crashes when compiling FFTW.'</A>.)
35
<h2><A name="runOnDOS">
36
Question 2.2.  Does FFTW run on DOS/Windows?
37
</A></h2>
38
 
39
It should.  FFTW was not developed on DOS or Windows, but the source
40
code is straight ANSI C.  Some users have reported using FFTW on
41
DOS/Windows using various compilers.  See also the
42
<A href="http://theory.lcs.mit.edu/~fftw/install/install-Windows.html">FFTW Windows installation notes</A> and <A href="#compilerCrashes">Q2.3 `My compiler crashes when compiling FFTW.'</A>
43
<h2><A name="compilerCrashes">
44
Question 2.3.  My compiler crashes when compiling
45
FFTW.
46
</A></h2>
47
 
48
Complain fiercely to the vendor of the compiler.
49
 
50
<p>
51
FFTW is a heavily-optimized piece of software that is likely to push
52
compilers to their limits.  We had no problems with, for example,
53
<code>gcc 2.7.2</code>, Sun's <code>SC4.0</code>, IBM's <code>XLC</code>, Metrowerks' compilers for the Macintosh, and SGI's compilers for IRIX
54
6.2.  Users have also reported successful compilations of FFTW using
55
Borland's C/C++ compilers on Windows.  
56
<p>
57
Visual C++ 4.0 crashes when compiling FFTW 1.2 with all optimizations
58
turned on.  Visual C++ 5.0 reportedly produces incorrect code for the
59
real transforms in FFTW 2.x when the option &quot;Maximize speed&quot;
60
is set.  We are told that Service Pack 3 fixes the bug.
61
 
62
<p>
63
Various problems have also been observed with SGI's MIPSpro compilers,
64
versions 7.2.0 and 7.2.1 (you may have to lower the optimization level
65
for some files to get them to compile).  The test program in earlier
66
versions of FFTW had problems with the <code>-xO5</code> option in Sun's <code>SC4.0</code> C compiler.  
67
<h2><A name="solarisSucks">
68
Question 2.4.  FFTW does not compile on Solaris, complaining about
69
<code>const</code>.
70
</A></h2>
71
 
72
We know that at least on Solaris 2.5.x with Sun's compilers 4.2 you
73
might get error messages from <code>make</code> such as
74
<p>
75
<code>&quot;./fftw.h&quot;, line 88: warning: const is a keyword in ANSI
76
C</code>
77
<p>
78
This is the case when the <code>configure</code> script reports that <code>const</code> does not work:
79
<p>
80
<code>checking for working const... (cached) no</code>
81
<p>
82
You should be aware that Solaris comes with two compilers, namely,
83
<code>/opt/SUNWspro/SC4.2/bin/cc</code> and <code>/usr/ucb/cc</code>.  The latter compiler is non-ANSI.  Indeed, it is a perverse shell script
84
that calls the real compiler in non-ANSI mode.  In order
85
to compile FFTW, change your path so that the right
86
<code>cc</code> is used.  
87
<p>
88
To know whether your compiler is the right one,  type
89
<code>cc -V</code>.  If the compiler prints ``<code>ucbcc</code>'', as in  
90
<p>
91
<code>ucbcc: WorkShop Compilers 4.2 30 Oct 1996 C
92
4.2</code>
93
<p>
94
then the compiler is wrong.  The right message is something like
95
 
96
<p>
97
<code>cc: WorkShop Compilers 4.2 30 Oct 1996 C
98
4.2</code>
99
<h2><A name="languages">
100
Question 2.5.  Which language is FFTW written
101
in?
102
</A></h2>
103
 
104
FFTW is written in ANSI C.  Most of the code, however, was
105
automatically generated by a program called
106
<code>genfft</code>, written in the Objective Caml dialect of ML.  You do not need to know ML or to
107
have an Objective Caml compiler in order to use FFTW.
108
 
109
<p>
110
<code>genfft</code> is provided with the FFTW sources, which means that
111
you can play with the code generator if you want.  In this case, you
112
need a working Objective Caml system.  Objective Caml is available
113
from <code>ftp.inria.fr</code> in the directory <A href="ftp://ftp.inria.fr/lang/caml-light"><code>/lang/caml-light</code></A>.  
114
<h2><A name="fortran">
115
Question 2.6.  Can I call FFTW from FORTRAN?
116
</A></h2>
117
 
118
Yes, but not directly.  The main problem is that Fortran cannot pass
119
parameters by value.  However, FFTW can be called indirectly from
120
Fortran through the use of special C &quot;wrapper&quot; routines.
121
Appropriate wrapper code, documented in the FFTW manual, is included with FFTW
122
(versions 1.3 and higher).  
123
<h2><A name="cplusplus">
124
Question 2.7.  Can I call FFTW from C++?
125
</A></h2>
126
 
127
Most definitely.  FFTW should compile and run under any C++ compiler.
128
 
129
<h2><A name="whynotfortran">
130
Question 2.8.  Why isn't FFTW written in
131
FORTRAN/C++?
132
</A></h2>
133
 
134
Because we don't like those languages, and neither approaches the
135
portability of C.  
136
<h2><A name="singleprec">
137
Question 2.9.  How do I compile FFTW to run in single
138
precision?
139
</A></h2>
140
 
141
On a Unix system: <code>configure --enable-float</code>.  On a non-Unix system: edit <code>fftw/fftw.h</code> to <code>#define</code> the symbol <code>FFTW_ENABLE_FLOAT</code>.  In both cases, you must then recompile
142
FFTW.  <hr>
143
Next: <a href="section3.html" rel=precedes>Using FFTW</a>.<br>
144
Back: <a href="section1.html" rev=precedes>Introduction and General Information</a>.<br>
145
<a href="index.html" rev=subdocument>Return to contents</a>.<p>
146
<address>
147
<A href="http://theory.lcs.mit.edu/~fftw/">Matteo Frigo and Steven G. Johnson</A> / <A href="mailto:fftw@theory.lcs.mit.edu">fftw@theory.lcs.mit.edu</A>
148
- 18 May 1999
149
</address><br>
150
Extracted from FFTW Frequently Asked Questions with Answers,
151
Copyright &copy; 1999 Massachusetts Institute of Technology.
152
</body></html>