[SciPy-dev] Fix to FFTW Compilation Error in latest CVS
w.f.alexander at ieee.org
Tue Feb 4 02:32:20 CST 2003
I believe I have fixed a compile-time error under Unix/Linux in the
fftpack module of scipy. I found this problem in some of the older
tgz's (source and binary forms), as well as the last three days' CVS
versions. I found no published reference to this error or solution, so
I hope this isn't just additional noise on the list.
>>> import scipy
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/lib/python2.2/site-packages/scipy/__init__.py", line 49, in
import special, io, linalg, stats, fftpack
line 55, in ?
from pseudo_diffs import *
line 12, in ?
undefined symbol: fftw_lookup
Analysis reveals that the FFTW libraries are being linked in the wrong
order, causing the fftw_lookup object to be obscured and lost. Looking
into the scipy/scipy_distutils/system_info.py script reveals that in
every position except one, the *rfftw libraries properly precede the
*fftw library (all the precisions are in there, with rfftw and fftw
being the default case). This default case is in the wrong order, with
fftw in front of rfftw. Doesn't it just suck that we still have these
kinds of problems? You'd think our compilers could figure it out by
The fix is trivial - just reorder the libraries in the list (it looks
like this is already OK for all the other precisions in the script, just
not this particular one):
Roughly line #324 of scipy/scipy_distutils/system_info.py:
you want to use
libs = ['rfftw','fftw']
libs = ['fftw','rfftw']
A diff patch is included below. This is against the 03 February 2003
CVS (not that the date really matters - it looks like the same file as
the Oct 2002 Sun build that's in the download area).
Now that I've got it running, I can't wait to throw my Matlab support
agreement into a ditch. OK, maybe that's cruel and a bit optimistic,
but I sure hope so anyway.
Also, this was built on a mostly stock Red Hat 8.0 system, in case that
matters to anyone.
- Bill Alexander
diff -u scipy/scipy_distutils/system_info.py
--- scipy/scipy_distutils/system_info.py 2002-10-14
+++ scipy_fixed/scipy_distutils/system_info.py 2003-02-03
@@ -321,7 +321,7 @@
section = 'fftw'
dir_env_var = 'FFTW'
- libs = ['fftw','rfftw']
+ libs = ['rfftw','fftw']
includes = ['fftw.h','rfftw.h']
macros = [('SCIPY_FFTW_H',None)]
More information about the Scipy-dev