Alas no it's not just my installation, I have replicated the problem on a clean 
install of windows 7 64 bit
 on a new harddrive.  To install cython I used the technique of pointing 
PYTHONPATH and path
 to the cython0.12 directory.  I am running 32 bit version of python2.6.4 and 
numpy.

I can now provide a complete test case (with one caveat) and show the output 
error.
I have two source files,  test.pyx and test.pxd.   The vsip.h include file can 
not be redistributed,
however it can be downloaded from:
http://gpu-vsipl.gtri.gatech.edu/builds/gpuvsipl_2009Aug11.zip


To link everything you would need to have an NVIDIA cuda enabled graphics card, 
drivers and SDK,  but the
error occurs prior to linking, and during the compilation of the 'successfully' 
generated source. The code
snippet doesn't do anything so I don't care about linking so far.  (Until I hit 
the next problem.)

I am including the sources below
---------- test.pyx -----------------------

# cython: profile=True
from __future__ import division
import numpy as np
cimport numpy as np

DTYPE = np.float32
pnorm = 2 * np.pi * 1j
# initialize the vsipl engine
vsip_init(<void *>0)
# create a global random seed state
cdef vsip_randstate *_vrs
# _vrs = vsip_randcreate(0, 4, 0, VSIP_NPRNG)


cpdef DTYPE_t pi = 3.1415926535897932384626433832795

cdef class rmat :

    def __cinit__(self, int r, int c):
        """ Generate a real matrix of r rows and c cols unitialized. """
        cdef vsip_block_f *myb
        cdef int istrue
        cdef np.ndarray[DTYPE_t, ndim=2] carr




------------ test.pxd ----------------

cimport numpy as np
ctypedef np.float32_t DTYPE_t
cdef struct cfloat:
     DTYPE_t r
     DTYPE_t i

cdef struct cdouble:
    double real
    double imag

cdef extern from "vsip.h" :
    int vsip_init(void *)
    ctypedef struct vsip_randstate

    ctypedef unsigned int vsip_length
    ctypedef unsigned int vsip_index

    ctypedef enum vsip_major:
        VSIP_ROW
        VSIP_COL

    ctypedef enum vsip_rng:
        VSIP_PRNG
        VSIP_NPRNG

    struct vsip_block_f
    vsip_randstate *vsip_randcreate ( vsip_index seed, vsip_index numprocs, 
vsip_index id, vsip_rng portable)



To compile this in cython  I did:
compile('test.pyx')

in a python shell,  and on the windows command line I did this ugly command, 
which sets the visual studio
2008 command line environment prior to calling cl.exe.  ( I also show the 
reported error codes
when the compile fails)
cmd.exe /c "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" 
x86&&  cl.exe /O2 /LD /EHsc /I. /IC:\python2
sip\windows32\gpu_vsip.lib E:\Apps\CUDA\lib\cudart.lib 
E:\Apps\CUDA\lib\cufft.lib&&  copy test.dll test.pyd
Setting environment for using Microsoft Visual Studio 2008 x86 tools.
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.21022.08 for 80x86
Copyright (C) Microsoft Corporation.  All rights reserved.

test.c
test.c(812) : error C2143: syntax error : missing ';' before 'type'
test.c(812) : error C2275: 'PyFrameObject' : illegal use of this type as an 
expression
        C:\python26\include\frameobject.h(47) : see declaration of 
'PyFrameObject'
test.c(812) : error C2065: '__pyx_frame' : undeclared identifier
test.c(812) : error C2143: syntax error : missing ';' before 'type'
test.c(812) : error C2065: '__Pyx_use_tracing' : undeclared identifier
test.c(812) : error C2065: '__pyx_frame_code' : undeclared identifier
test.c(812) : warning C4047: 'function' : 'PyCodeObject **' differs in levels 
of indirection from 'int *'
test.c(812) : warning C4024: '__Pyx_TraceSetupAndCall' : different types for 
formal and actual parameter 1
test.c(812) : error C2065: '__pyx_frame' : undeclared identifier
test.c(812) : warning C4047: 'function' : 'PyFrameObject **' differs in levels 
of indirection from 'int *'
test.c(812) : warning C4024: '__Pyx_TraceSetupAndCall' : different types for 
formal and actual parameter 2
test.c(854) : error C2065: '__Pyx_use_tracing' : undeclared identifier
test.c(854) : error C2065: '__pyx_frame' : undeclared identifier
test.c(854) : warning C4047: 'function' : '_frame *' differs in levels of 
indirection from 'int'
test.c(854) : warning C4024: 'function through pointer' : different types for 
formal and actual parameter 2
test.c(854) : error C2065: '__pyx_frame' : undeclared identifier
test.c(854) : error C2065: '__pyx_frame' : undeclared identifier
test.c(854) : error C2065: '__pyx_frame' : undeclared identifier
test.c(890) : error C2143: syntax error : missing ';' before 'type'
test.c(890) : error C2275: 'PyFrameObject' : illegal use of this type as an 
expression
        C:\python26\include\frameobject.h(47) : see declaration of 
'PyFrameObject'
test.c(890) : error C2065: '__pyx_frame' : undeclared identifier
test.c(890) : error C2143: syntax error : missing ';' before 'type'
test.c(890) : error C2065: '__Pyx_use_tracing' : undeclared identifier
test.c(890) : error C2065: '__pyx_frame_code' : undeclared identifier
test.c(890) : warning C4047: 'function' : 'PyCodeObject **' differs in levels 
of indirection from 'int *'
test.c(890) : warning C4024: '__Pyx_TraceSetupAndCall' : different types for 
formal and actual parameter 1
test.c(890) : error C2065: '__pyx_frame' : undeclared identifier
test.c(890) : warning C4047: 'function' : 'PyFrameObject **' differs in levels 
of indirection from 'int *'
test.c(890) : warning C4024: '__Pyx_TraceSetupAndCall' : different types for 
formal and actual parameter 2
test.c(1661) : error C2065: '__Pyx_use_tracing' : undeclared identifier
test.c(1661) : error C2065: '__pyx_frame' : undeclared identifier
test.c(1661) : warning C4047: 'function' : '_frame *' differs in levels of 
indirection from 'int'
test.c(1661) : warning C4024: 'function through pointer' : different types for 
formal and actual parameter 2



Finally I show the relevant section of test.c

--------------- test.c -----------------------------

/* "E:\Projects\MUD\test.pyx":19
 * cdef class rmat :
 *
 *     def __cinit__(self, int r, int c):             #<<<<<<<<<<<<<<
 *         """ Generate a real matrix of r rows and c cols unitialized. """
 *         cdef vsip_block_f *myb
 */

static int __pyx_pf_4test_4rmat___cinit__(PyObject *__pyx_v_self, PyObject 
*__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4test_4rmat___cinit__[] = " Generate a real matrix of r rows 
and c cols unitialized. ";
static int __pyx_pf_4test_4rmat___cinit__(PyObject *__pyx_v_self, PyObject 
*__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_r;
  int __pyx_v_c;
  int __pyx_r;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__r,&__pyx_n_s__c,0};
  __Pyx_RefNannySetupContext("__cinit__");
  __Pyx_TraceCall("__cinit__", __pyx_f[0], 19); /* This is line 812 */
  if (unlikely(__pyx_kwds)) {


It looks like a bug to me.


-Matt
--------------------------Prior 
Mail---------------------------------------------

   There's something wrong with your installation, the two versions seem to be
   mixed. Try removing Cython and installing it again.


   >  I'm using python 2.6.4.  I just wanted to run this by someone prior to
   >  filing a bug report,  in case there is something wrong on my end.

   It likely is.

   Stefan
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to