[Numpy-discussion] need help building a numpy extension that uses fftpack on windows
Robert Kern
robert.kern at gmail.com
Thu Jun 2 15:33:47 EDT 2011
On Thu, Jun 2, 2011 at 14:07, Ralf Gommers <ralf.gommers at googlemail.com> wrote:
>
> On Wed, Jun 1, 2011 at 5:45 PM, martin smith <gmane at blindgoat.org> wrote:
>>
>> I have a bit of code that performs multi-taper power spectra using numpy
>> and a C extension module. The C portion consists of an interface file
>> and a python-unaware computational file. The latter invokes fftpack.
>>
>> The straightforward setup.py appended below works fine on Linux. On
>> Windows using MinGW it's not so good. I first created a libpython27.a
>> file following instructions on the web. The C code now compiles but
>> fails to link since there is no fftpack_lite.so on Windows. I can't
>> find an fftpack_lite.dll (or even the source for fftpack_lite) and don't
>> know where to turn.
>
> Python dll's on Windows have a .pyd extension, there should be a
> fftpack_lite.pyd file. But you should be able to just leave off the
> extension, so it does the right thing on any platform.
>
> Also, the way you specified library_dirs doesn't work if numpy is not in
> site-packages, better to use something like:
> library_dirs = [os.path.join(numpy.__path__[0], 'fft')]
That said, there is no good cross-platform way to link against other
Python extension modules. Please do not try. You will have to include
a copy of the FFTPACK code in your own extension module.
--
Robert Kern
"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
-- Umberto Eco
More information about the NumPy-Discussion
mailing list