[SciPy-dev] more 64 Bit testing (was linspace)

Arnd Baecker arnd.baecker at web.de
Thu Dec 8 02:48:06 EST 2005


Hi,

now I managed to have another closer look at the compile problem
with dfitpackmodule.c.

Some facts ahead
- this is with intel icc
- dfitpackmodule.c is generated via f2py
  (it is explicitely written at the start of that file -
   sorry for not making this clear in the very begining -
   I jumped straight to the error ...)
- The error is
  build/src/Lib/interpolate/dfitpackmodule.c(2528): error: expected a ";"
         int calc_lwrk1(void) {
- the code looks alright to me
  (but after too long exposure to python I would not
   be able to spot a missing ";" anyway )
- the same file compiles fine with gcc!

So does this mean the code uses something which is specific to gcc?
Maybe some (ic)C expert can spot the problem??
(Somehow I am tempted to say that this is a bug in icc ...)

Any ideas are appreciated. I attach the corresponding section of
the code below (line 2528 is marked by <=====).

Best, Arnd

--------------------------------
dfitpackmodule.c: Lines - 2401-2554
/******************************** surfit_smth
********************************/
static char doc_f2py_rout_dfitpack_surfit_smth[] = "\
Function signature:\n\
  nx,tx,ny,ty,c,fp,wrk1,ier =
surfit_smth(x,y,z,[w,xb,xe,yb,ye,kx,ky,s,nxest,nyest,eps,lwrk2])\n\
Required arguments:\n"
"  x : input rank-1 array('d') with bounds (m)\n"
"  y : input rank-1 array('d') with bounds (m)\n"
"  z : input rank-1 array('d') with bounds (m)\n"
"Optional arguments:\n"
"  w := 1.0 input rank-1 array('d') with bounds (m)\n"
"  xb := dmin(x,m) input float\n"
"  xe := dmax(x,m) input float\n"
"  yb := dmin(y,m) input float\n"
"  ye := dmax(y,m) input float\n"
"  kx := 3 input int\n"
"  ky := 3 input int\n"
"  s := m input float\n"
"  nxest := imax(kx+1+sqrt(m/2),2*(kx+1)) input int\n"
"  nyest := imax(ky+1+sqrt(m/2),2*(ky+1)) input int\n"
"  eps := 1e-16 input float\n"
"  lwrk2 := calc_lwrk2() input int\n"
"Return objects:\n"
"  nx : int\n"
"  tx : rank-1 array('d') with bounds (nmax)\n"
"  ny : int\n"
"  ty : rank-1 array('d') with bounds (nmax)\n"
"  c : rank-1 array('d') with bounds ((nxest-kx-1)*(nyest-ky-1))\n"
"  fp : float\n"
"  wrk1 : rank-1 array('d') with bounds (lwrk1)\n"
"  ier : int";
/* extern void
F_FUNC(surfit,SURFIT)(int*,int*,double*,double*,double*,double*,double*,double*,double*,double*,int*,int*,double*,int*,int*,int*,double*,int*,double*,int*,double*,double*,double*,double*,int*,double*,int*,int*,int*,int*);
*/
static PyObject *f2py_rout_dfitpack_surfit_smth(const PyObject *capi_self,
                           PyObject *capi_args,
                           PyObject *capi_keywds,
                           void
(*f2py_func)(int*,int*,double*,double*,double*,double*,double*,double*,double*,double*,int*,int*,double*,int*,int*,int*,double*,int*,double*,int*,double*,double*,double*,double*,int*,double*,int*,int*,int*,int*))
{
  PyObject * volatile capi_buildvalue = NULL;
  volatile int f2py_success = 1;
/*decl*/

  int iopt = 0;
  int m = 0;
  double *x = NULL;
  intp x_Dims[1] = {-1};
  const int x_Rank = 1;
  PyArrayObject *capi_x_tmp = NULL;
  int capi_x_intent = 0;
  PyObject *x_capi = Py_None;
  double *y = NULL;
  intp y_Dims[1] = {-1};
  const int y_Rank = 1;
  PyArrayObject *capi_y_tmp = NULL;
  int capi_y_intent = 0;
  PyObject *y_capi = Py_None;
  double *z = NULL;
  intp z_Dims[1] = {-1};
  const int z_Rank = 1;
  PyArrayObject *capi_z_tmp = NULL;
  int capi_z_intent = 0;
  PyObject *z_capi = Py_None;
  double *w = NULL;
  intp w_Dims[1] = {-1};
  const int w_Rank = 1;
  PyArrayObject *capi_w_tmp = NULL;
  int capi_w_intent = 0;
  PyObject *w_capi = Py_None;
  double xb = 0;
  PyObject *xb_capi = Py_None;
  double xe = 0;
  PyObject *xe_capi = Py_None;
  double yb = 0;
  PyObject *yb_capi = Py_None;
  double ye = 0;
  PyObject *ye_capi = Py_None;
  int kx = 0;
  PyObject *kx_capi = Py_None;
  int ky = 0;
  PyObject *ky_capi = Py_None;
  double s = 0;
  PyObject *s_capi = Py_None;
  int nxest = 0;
  PyObject *nxest_capi = Py_None;
  int nyest = 0;
  PyObject *nyest_capi = Py_None;
  int nmax = 0;
  double eps = 0;
  PyObject *eps_capi = Py_None;
  int nx = 0;
  double *tx = NULL;
  intp tx_Dims[1] = {-1};
  const int tx_Rank = 1;
  PyArrayObject *capi_tx_tmp = NULL;
  int capi_tx_intent = 0;
  int ny = 0;
  double *ty = NULL;
  intp ty_Dims[1] = {-1};
  const int ty_Rank = 1;
  PyArrayObject *capi_ty_tmp = NULL;
  int capi_ty_intent = 0;
  double *c = NULL;
  intp c_Dims[1] = {-1};
  const int c_Rank = 1;
  PyArrayObject *capi_c_tmp = NULL;
  int capi_c_intent = 0;
  double fp = 0;
  double *wrk1 = NULL;
  intp wrk1_Dims[1] = {-1};
  const int wrk1_Rank = 1;
  PyArrayObject *capi_wrk1_tmp = NULL;
  int capi_wrk1_intent = 0;
  int lwrk1 = 0;
  double *wrk2 = NULL;
  intp wrk2_Dims[1] = {-1};
  const int wrk2_Rank = 1;
  PyArrayObject *capi_wrk2_tmp = NULL;
  int capi_wrk2_intent = 0;
  int lwrk2 = 0;
  PyObject *lwrk2_capi = Py_None;
  int *iwrk = NULL;
  intp iwrk_Dims[1] = {-1};
  const int iwrk_Rank = 1;
  PyArrayObject *capi_iwrk_tmp = NULL;
  int capi_iwrk_intent = 0;
  int kwrk = 0;
  int ier = 0;
  static char *capi_kwlist[] =
{"x","y","z","w","xb","xe","yb","ye","kx","ky","s","nxest","nyest","eps","lwrk2",NULL};
  /* start usercode multiline (0) */

       int calc_lwrk1(void) {             <======================= 2528!
         int u = nxest-kx-1;
         int v = nyest-ky-1;
         int km = MAX(kx,ky)+1;
         int ne = MAX(nxest,nyest);
         int bx = kx*v+ky+1;
         int by = ky*u+kx+1;
         int b1,b2;
         if (bx<=by) {b1=bx;b2=bx+v-ky;}
         else {b1=by;b2=by+u-kx;}
         return u*v*(2+b1+b2)+2*(u+v+km*(m+ne)+ne-kx-ky)+b2+1;
       }
       int calc_lwrk2(void) {
         int u = nxest-kx-1;
         int v = nyest-ky-1;
         int bx = kx*v+ky+1;
         int by = ky*u+kx+1;
         int b2 = (bx<=by?bx+v-ky:by+u-kx);
         return u*v*(b2+1)+b2;
       }

  /* end multiline (0)*/
/*routdebugenter*/
#ifdef F2PY_REPORT_ATEXIT
f2py_start_clock();
#endif





More information about the SciPy-Dev mailing list