[SciPy-User] swig and OpenMP

Christian Meesters meesters at gmx.de
Fri Feb 12 04:41:35 EST 2010


Hi,

Sorry for being a bit off-topic, but I thought somebody here might have
the relevant info for me.

A while ago I already asked about integrating OpenMP-code in C/C++-code
to be wrapped for python on the swig mailing list. Unfortunately nobody
there knew an answer to my problem.

Please find a minimal example in this pastebin:
pi_test.h : http://paste.pocoo.org/show/174174/ 
pi_test.c: http://paste.pocoo.org/show/174175/ 
pi_test.i: http://paste.pocoo.org/show/174177/ 
and my setup.py: http://paste.pocoo.org/show/175890/

When I do
$ python setup.py build

I get no compiler warnings or error - except for the unused variables.

But when importing the module I get this as a Traceback:

ImportError: ./pi_test.so: undefined symbol: GOMP_parallel_end

So, apparently OpenMP did not make it correctly into the wrapped code.

Any pointers for me? What's going wrong here?
Does anyone know a working example for OpenMP-code with SWIG (or
Cython)?

For the record: I'm using python 2.6.4, swig 1.3.36, and gcc 4.4.1.

TIA
Christian





More information about the SciPy-User mailing list