dealias/fftwpp

installing fftwpp on python

Closed this issue · 6 comments

Hello John and/or Malcolm,

It's been a while. I have heard very good things about fftwpp recently and am very curious to try it out. I thought there was a wrapper for python. If yes do you have any advice on how one might set this up? If no maybe it's too much work.

Thanks for putting this together, it looks really great!

Francis

Hi Francis
Good to hear from you!
Yes there's a wrapper in the wrappers dir called pexample. Malcolm knows
more about it.
On Nov 9, 2015 6:24 PM, "francispoulin" notifications@github.com wrote:

Hello John and/or Malcolm,

It's been a while. I have heard very good things about fftwpp recently and
am very curious to try it out. I thought there was a wrapper for python. If
yes do you have any advice on how one might set this up? If no maybe it's
too much work.

Thanks for putting this together, it looks really great!

Francis


Reply to this email directly or view it on GitHub
#2.

Hello.

Yes, there are python wrappers for the shared-memory routines. The wrappers are in the wrappers directory. pexample.py has examples of how to call FFTW++ from python.

Best,

~Malcolm

Hello John and Malcolm,

Thanks for pointing me in the right folder. Unfortunately, I need to make stuff before I can run the python example. I haven't been able to find any instructions on the github repo. Could you maybe help me to get started?

Francis

Hi, Francis.

Sorry about the lack of documentation; it's on the to-do list!

For compiling, the first thing that you need to do is have FFTW compiled with --with-pic. Then, compile _fftwpp.so in the wrappers directory of fftw++; normally this is just "make _fftwpp.so". If you install FFTW in a non-standard location, specify this with FFTW_INCLUDE_PATH and FFTW_LIB_PATH, which are referenced in wrappers/Makefile.

You can then use the python wrappers by adding the wrappers directory to your PYTHONPATH.

I've tested the wrappers on Linux with gcc and the Intel compilers, but I can't vouch for Windows or MacOS yet.

~Malcolm

Thanks for the quick reply.

I tried it on my ubuntu machine and it compiled easily and ran fast. Ah, if only more of my life was linux based. Unfortunately, my Mac was not so cooperative. A questions.

  1. If I wanted to test the parallelization/threading in linux, can I just crank up some numbers and test the efficiency? I presume you've done scaling tests before but I'd like to learn about this myself.

  2. For my mac, it seems to be using the clang compiles (mac based) which I want to avoid. I changed the compilers under the # GNU Compiler comment to my other ones but it doesn't seem to use them. But it does compile and create the .so file. So maybe it's ok?

  3. Probably not since when I try running it I get the following problem. My fftw is in usr/local/lib so should be easy to find.

python pexample.py
Traceback (most recent call last):
File "pexample.py", line 5, in
import fftwpp
File "/Users/fpoulin/software/fftwpp/wrappers/fftwpp.py", line 24, in
clib = CDLL(os.path.join(base, '_fftwpp.so'))
File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/init.py", line 365, in init
self._handle = _dlopen(self._name, mode)
OSError: dlopen(/Users/fpoulin/software/fftwpp/wrappers/_fftwpp.so, 6): Symbol not found: _GOMP_parallel
Referenced from: /usr/local/opt/fftw/lib/libfftw3_omp.3.dylib
Expected in: flat namespace
in /usr/local/opt/fftw/lib/libfftw3_omp.3.dylib

Sorry for the bother but thanks for the help.

Try linking with -lgomp

On Wed, Nov 18, 2015 at 7:51 PM, francispoulin notifications@github.com
wrote:

Thanks for the quick reply.

I tried it on my ubuntu machine and it compiled easily and ran fast. Ah,
if only more of my life was linux based. Unfortunately, my Mac was not so
cooperative. A questions.

  1. If I wanted to test the parallelization/threading in linux, can I just
    crank up some numbers and test the efficiency? I presume you've done
    scaling tests before but I'd like to learn about this myself.

  2. For my mac, it seems to be using the clang compiles (mac based) which I
    want to avoid. I changed the compilers under the # GNU Compiler comment to
    my other ones but it doesn't seem to use them. But it does compile and
    create the .so file. So maybe it's ok?

  3. Probably not since when I try running it I get the following problem.
    My fftw is in usr/local/lib so should be easy to find.

python pexample.py
Traceback (most recent call last):
File "pexample.py", line 5, in
import fftwpp
File "/Users/fpoulin/software/fftwpp/wrappers/fftwpp.py", line 24, in
clib = CDLL(os.path.join(base, '
_fftwpp.so')) File
"/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/init.py",
line 365, in init
self._handle = _dlopen(self._name, mode)
OSError: dlopen(/Users/fpoulin/software/fftwpp/wrappers/_fftwpp.so, 6):
Symbol not found: _GOMP_parallel
Referenced from: /usr/local/opt/fftw/lib/libfftw3_omp.3.dylib
Expected in: flat namespace
in /usr/local/opt/fftw/lib/libfftw3_omp.3.dylib

Sorry for the bother but thanks for the help.


Reply to this email directly or view it on GitHub
#2 (comment).