Hi numpy-discuss
.
I've distilled my problem down to a very simple program that segfaults.  I'm
sure I'm doing something silly, but hopefully someone can point me in the
right direction.  I create a program called numpy_test.cc:

---------------------
#include <Python.h>
#include "numpy/arrayobject.h"

int main(int argc, char **argv) {
  Py_Initialize();

  npy_intp length[1];
  length[0] = 10;
  PyObject* my_array = PyArray_SimpleNew(1, length, NPY_FLOAT);

  return 0;
}
---------------------

Standing in the directory above where I've done an in-place build of
numpy-1.3.0, I compile with:
g++ numpy_test.cc  -I/usr/include/python2.5
-I/tmp/numpy-1.3.0/numpy/core/include -lpython2.5*

*It compiles clean, but the resulting executable crashes in the
PyArray_SimpleNew line [verified via debugger].  I have yet to get a call to
PyArray_SimpleNew to not segfault.

Any thoughts or advice are appreciated.

Cheers,

rif
*
*
_______________________________________________
NumPy-Discussion mailing list
[email protected]
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to