Actually this was the problem I was trying to resolve, but I couldn't
replicate it for a while due to another issue, likely due to the
0.11.2 cython install as you indicated.
The failure to compile issue occurs for both MS visual studio 2008 and
the free version of that compiler.
The way to coerce MS Visual Studio to show the includes is apparently
with the /P option, which puts them in the source file. (So save a
copy of the source if you need it).
Anyway here is how the macro is defined and embedded into test.c, for
the prior test.pyx example I provided:
> #ifndef CYTHON_PROFILE
> #define CYTHON_PROFILE 1
> #endif
This part is in the #if CYTHON_PROFILE section.
> #define __Pyx_TraceCall(funcname, srcfile,
> firstlineno) \
> static PyCodeObject *__pyx_frame_code =
> NULL; \
> CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame =
> NULL; \
> int __Pyx_use_tracing =
> 0; \
> if (unlikely(PyThreadState_GET()->use_tracing &&
> PyThreadState_GET()->c_profilefunc)) { \
> __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code,
> &__pyx_frame, funcname, srcfile, firstlineno); \
> }
Oh and then there are some other special cases it seems:
#if CYTHON_PROFILE
#include "compile.h"
#include "frameobject.h"
#include "traceback.h"
...
...
#else
#define __Pyx_TraceCall(funcname, srcfile, firstlineno)
#define __Pyx_TraceException()
#define __Pyx_TraceReturn(result)
#endif /* CYTHON_PROFILE */
So the change could well be related to how CYTHON_PROFILE is being handled.
-Matt
On 2:59 PM, Stefan Behnel wrote:
> Hi,
>
> Matthew Bromberg, 27.12.2009 08:03:
>> 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.
> > [...]
>> 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'
>> [...]
>> 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.
>
> Note that this is a totally different problem than what you originally
> reported. Cython seems to have run as expected now.
>
> It might be possible that the macro definition of __Pyx_TraceCall()
> doesn't work smoothly with your compiler. Does the MS compiler have a
> way to output what the preprocessor made of the source? Like "gcc -E"
> does?
>
> Stefan
>
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev