On 21 November 2010 08:49, cornail <[email protected]> wrote: > Hello, > > I tried to compile cython pyx file using distutils but gcc didn't like > the resulting C code (no error message from Cython). > It gave the following error message: > > running build_ext > building 'vector_slepian_ext_cython' extension > gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall - > Wstrict-prototypes -fPIC -I/usr/lib/python2.6/dist-packages/numpy/core/ > include -I/usr/local/include/ -I. -I/usr/include/python2.6 -c > vector_slepian_ext_cython.c -o build/temp.linux-x86_64-2.6/ > vector_slepian_ext_cython.o -ffast-math > vector_slepian_ext_cython.c:362: error: two or more data types in > declaration specifiers > error: command 'gcc' failed with exit status 1 > > The corresponding C code fragment is: > > #if CYTHON_CCOMPLEX > #ifdef __cplusplus > typedef ::std::complex< npy_float64 > __pyx_t_npy_float64_complex; > #else > typedef npy_float64 _Complex __pyx_t_npy_float64_complex; /* THIS > IS THE PROBLEMATIC LINE 362 */ > #endif > #else > typedef struct { npy_float64 real, imag; } > __pyx_t_npy_float64_complex; > #endif > > In my pyx file, I both import and cimport numpy, and use both "double > complex" type for calculations and the np.complex128_t type for > ndarrays. > > Version information: > Python 2.6.6 > Cython 0.13 > Numpy 1.3.0 > GCC (Ubuntu/Linaro 4.4.4-14ubuntu5) 4.4.5 > > Tell me please, if you need some more information. I would appreciate, > if someone could solve this for me or suggest a workaround. > > Thank you very much in advance! > > Kornel JAHN >
It seems that we are generating bad code. As a quick workaround, could you use "double" instead of "npy_float64" ? Robert, any idea of how could we fix this? It seems that we cannot support arbitrary typedefs for the real type... -- Lisandro Dalcin --------------- CIMEC (INTEC/CONICET-UNL) Predio CONICET-Santa Fe Colectora RN 168 Km 472, Paraje El Pozo Tel: +54-342-4511594 (ext 1011) Tel/Fax: +54-342-4511169 _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
