Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

installing fftwpp on python #2

Closed
francispoulin opened this issue Nov 10, 2015 · 6 comments
Closed

installing fftwpp on python #2

francispoulin opened this issue Nov 10, 2015 · 6 comments

Comments

@francispoulin
Copy link

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

@johncbowman
Copy link
Member

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.

@malcolmroberts
Copy link
Member

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

@francispoulin
Copy link
Author

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

@malcolmroberts
Copy link
Member

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

@francispoulin
Copy link
Author

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.

@johncbowman
Copy link
Member

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants