diff -aur ode-0.1a4/ode/_lsode/_lsode.c ode-0.1a4_mod/ode/_lsode/_lsode.c --- ode-0.1a4/ode/_lsode/_lsode.c 2007-07-09 20:34:53.000000000 +0000 +++ ode-0.1a4_mod/ode/_lsode/_lsode.c 2009-07-08 17:46:18.000000000 +0000 @@ -202,12 +202,14 @@ PyObject* ydot_py = NULL; PyArrayObject* ydot_pyarray = NULL; double* ydot; + npy_intp neq; + neq = neqP[0]; //printf( "f neq %d, t %f, y %p [%f %f %f]\n", *neqP, *tP, y, y[0], y[1], y[2] ); /* pack y argument */ /* todo why is neqP the wrong pointer type??? */ - y_py = PyArray_SimpleNewFromData( 1, (void*) neqP, PyArray_DOUBLE, y ); + y_py = PyArray_SimpleNewFromData( 1, &neq, PyArray_DOUBLE, (void*) y ); if ( y_py == NULL ) { goto EXCEPTION; } /* call f(t,y) function */ @@ -264,12 +266,14 @@ PyArrayObject* jac_pyarray = NULL; double* jac; int i, j, jac_k, jac_out_k; + npy_intp neq; + neq = *neqP; //printf( "jac neq %d, t %f, y %p [%f %f %f]\n", *neqP, *tP, y, y[0], y[1], y[2] ); /* pack y argument */ /* todo why is neqP the wrong pointer type??? */ - y_py = PyArray_SimpleNewFromData( 1, (void*) neqP, PyArray_DOUBLE, y ); + y_py = PyArray_SimpleNewFromData( 1, &neq, PyArray_DOUBLE, (void*) y ); if ( y_py == NULL ) { goto EXCEPTION; } /* call jac(t,y) function */ @@ -332,12 +336,14 @@ PyObject* g_py = NULL; PyArrayObject* g_pyarray = NULL; double* g; + npy_intp neq; + neq = neqP[0]; //printf( "g neq %d, t %f, y %p [%f %f %f], ng %d\n", *neqP, *tP, y, y[0], y[1], y[2], *ngP ); /* pack y argument */ /* todo why is neqP the wrong pointer type??? */ - y_py = PyArray_SimpleNewFromData( 1, (void*) neqP, PyArray_DOUBLE, y ); + y_py = PyArray_SimpleNewFromData( 1, &neqP, PyArray_DOUBLE, (void*) y ); if ( y_py == NULL ) { goto EXCEPTION; } /* call g(t,y,ng) function */ diff -aur ode-0.1a4/ode/_rkc/_rkc.c ode-0.1a4_mod/ode/_rkc/_rkc.c --- ode-0.1a4/ode/_rkc/_rkc.c 2007-07-09 20:34:53.000000000 +0000 +++ ode-0.1a4_mod/ode/_rkc/_rkc.c 2009-07-08 17:48:19.000000000 +0000 @@ -160,10 +160,12 @@ PyObject* ydot_py = NULL; PyArrayObject* ydot_pyarray = NULL; double* ydot; + npy_intp neq; + neq = neqP[0]; /* pack y argument */ /* todo why is neqP the wrong pointer type??? */ - y_py = PyArray_SimpleNewFromData( 1, (void*) neqP, PyArray_DOUBLE, y ); + y_py = PyArray_SimpleNewFromData( 1, &neq, PyArray_DOUBLE, (void*) y ); if ( y_py == NULL ) { goto EXCEPTION; } /* call f(t,y) function */ @@ -214,10 +216,12 @@ PyObject* y_py = NULL; PyObject* rho_py = NULL; double rho; + npy_intp neq; + neq = neqP[0]; /* pack y argument */ /* todo why is neqP the wrong pointer type??? */ - y_py = PyArray_SimpleNewFromData( 1, (void*) neqP, PyArray_DOUBLE, y ); + y_py = PyArray_SimpleNewFromData( 1, &neq, PyArray_DOUBLE, (void*) y ); if ( y_py == NULL ) { goto EXCEPTION; } /* call spcrad(t,y) function */ diff -aur ode-0.1a4/setup.py ode-0.1a4_mod/setup.py --- ode-0.1a4/setup.py 2007-07-16 16:37:34.000000000 +0000 +++ ode-0.1a4_mod/setup.py 2009-07-08 17:50:07.000000000 +0000 @@ -19,7 +19,7 @@ #f77_libdirs = ['/usr/local/lib'] f77 = 'gfortran' -f77_flags = '-O2' +f77_flags = '-O2 -fPIC' f77_libs = ['gfortran'] f77_libdirs = ['/usr/local/lib']