jsilva
2010-08-20 17:33:16 UTC
Hi,
I'm trying to use pyublas in a program that embeds the python
interpreter. I'm doing this because I couldn't find a simple and
effective way of calling C++ code from python that will allow the use of
OpenMP (using OpenMP from an extension wasn't stable for some reason).
I'm getting a segfault that I've reduced to the following:
/***************************************************/
#include <pyublas/numpy.hpp>
using namespace boost::python;
int main( int argc, char ** argv ) {
return 0;
}
/***************************************************/
I compile this with bjam to get an executable. Running it results in a
segfault:
#0 0x00000000 in ?? ()
#1 0xb7df9297 in PyEval_GetGlobals () at ../Python/ceval.c:3524
#2 0xb7e15af7 in PyImport_Import (module_name='numpy.core.multiarray')
at ../Python/import.c:2739
#3 0xb7e15d62 in PyImport_ImportModule (name=0x8048fe1
"numpy.core.multiarray")
at ../Python/import.c:2044
#4 0x08048974 in _import_array ()
at /usr/include/python2.6/numpy/__multiarray_api.h:1190
#5 0x08048b9b in _pyublas_array_importer (this=0x804a6e4)
at /usr/local/include/pyublas/numpy.hpp:47
#6 0x08048ce6 in __static_initialization_and_destruction_0
(__initialize_p=1,
__priority=65535) at /usr/local/include/pyublas/numpy.hpp:49
#7 0x08048d06 in global constructors keyed to python_ext.cpp ()
at python_ext.cpp:7
#8 0x08048fad in __do_global_ctors_aux ()
#9 0x080487d4 in _init ()
#10 0x08048f49 in __libc_csu_init ()
#11 0xb750dc14 in __libc_start_main () from /lib/i686/cmov/libc.so.6
#12 0x080488c1 in _start ()
Some searching sugests PyEval_GetGlobals only works when called from
within a python interpreter. Any tips on this? Does pyublas support
embedding (instead of extension modules)?
Regards,
Jo?o Silva
I'm trying to use pyublas in a program that embeds the python
interpreter. I'm doing this because I couldn't find a simple and
effective way of calling C++ code from python that will allow the use of
OpenMP (using OpenMP from an extension wasn't stable for some reason).
I'm getting a segfault that I've reduced to the following:
/***************************************************/
#include <pyublas/numpy.hpp>
using namespace boost::python;
int main( int argc, char ** argv ) {
return 0;
}
/***************************************************/
I compile this with bjam to get an executable. Running it results in a
segfault:
#0 0x00000000 in ?? ()
#1 0xb7df9297 in PyEval_GetGlobals () at ../Python/ceval.c:3524
#2 0xb7e15af7 in PyImport_Import (module_name='numpy.core.multiarray')
at ../Python/import.c:2739
#3 0xb7e15d62 in PyImport_ImportModule (name=0x8048fe1
"numpy.core.multiarray")
at ../Python/import.c:2044
#4 0x08048974 in _import_array ()
at /usr/include/python2.6/numpy/__multiarray_api.h:1190
#5 0x08048b9b in _pyublas_array_importer (this=0x804a6e4)
at /usr/local/include/pyublas/numpy.hpp:47
#6 0x08048ce6 in __static_initialization_and_destruction_0
(__initialize_p=1,
__priority=65535) at /usr/local/include/pyublas/numpy.hpp:49
#7 0x08048d06 in global constructors keyed to python_ext.cpp ()
at python_ext.cpp:7
#8 0x08048fad in __do_global_ctors_aux ()
#9 0x080487d4 in _init ()
#10 0x08048f49 in __libc_csu_init ()
#11 0xb750dc14 in __libc_start_main () from /lib/i686/cmov/libc.so.6
#12 0x080488c1 in _start ()
Some searching sugests PyEval_GetGlobals only works when called from
within a python interpreter. Any tips on this? Does pyublas support
embedding (instead of extension modules)?
Regards,
Jo?o Silva