[SciPy-dev] more 64 Bit testing
David M. Cooke
cookedm at physics.mcmaster.ca
Thu Dec 8 01:54:01 CST 2005
Arnd Baecker <arnd.baecker at web.de> writes:
> 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 ...)
I've pruned it down below. It looks to me like icc may not like nested
functions. IIRC, nested functions have been supported by gcc for a
while, they're in the C99 standard, but not in C89. It's complaining
about a missing ";" because adding one before the "{" on that line
would make it a valid function declaration.
Is there a flag to make icc use the C99 standard? That may help.
> Any ideas are appreciated. I attach the corresponding section of
> the code below (line 2528 is marked by <=====).
>
> Best, Arnd
>
> --------------------------------
> dfitpackmodule.c:
[snip]
> /* 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*/
[snip]
> 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
--
|>|\/|<
/--------------------------------------------------------------------------\
|David M. Cooke http://arbutus.physics.mcmaster.ca/dmc/
|cookedm at physics.mcmaster.ca
More information about the Scipy-dev
mailing list