From: Christian Meesters <meesters@gm...> - 2010-02-09 20:19:05
A while ago I already asked about integrating OpenMP-code in C/C++-code
to be wrapped for python. Unfortunately I was unable to provide a
minimal example then and did not find time to do so until now.
Please find the following files:
pi_test.h : http://paste.pocoo.org/show/174174/
and my setup.py: http://paste.pocoo.org/show/175890/
When I do
$ python setup.py swig # a routine to run SWIG from within the
$ python setup.py build
I get no compiler warnings or error - except for 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?
> 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.
depending on the version of gcc you are using, there might be a problem with using OpenMP in a shared library. I forgot where I found that problem and how I solved it for OpenCV, but I guess it was about supplying "-fopenmp" to the linker AS WELL and I think it worked for gcc 4.3 but not 4.2 .... Hm.
You could also try directly linking your shared library to libopenmp.
Institut für Nachrichtentechnik, RWTH Aachen University
Get latest updates about Open Source Projects, Conferences and News.