Heya Cython folks,
I face a compiler crash (full log at the bottom of the mail) with Cython 
0.17.1-392-g81d3d10 (today's git). This only happens if Cython directive 
binding is left to True, if set to False, the project builds and runs fine.

Steps to reproduce:
# git clone git://github.com/strohel/PyBayes.git
# cd PyBayes
# git submodule update --init
Open support/dist_cmd_build_prepare.py, set binding to True on line 35
# ./setup.py build

Note that this bug is not at all a recent regression - it exists at least 
since binding=True has been made default (commit 621dbe6403) - sorry for being 
that late reporting it.

On a related note, what does the binding directive mean? I was unable to find 
any info at [1] or [2]. What are the consequences of disabling it to work-
around this crash?

[1] http://wiki.cython.org/enhancements/compilerdirectives
[2] http://docs.cython.org/src/reference/compilation.html

Regards,
                Matěj Laitl


=============== Full Crash Log ===============
running build_ext
cythoning pybayes/filters.py to build/temp.linux-
x86_64-2.7/pyrex/pybayes/filters.c

Error compiling Cython file:
------------------------------------------------------------
...
    cpdef Pdf posterior(self)
    cpdef double evidence_log(self, np.ndarray yt) except? -1


cdef class KalmanFilter(Filter):
    cdef readonly np.ndarray A, B, C, D, Q, R
                            ^
------------------------------------------------------------

pybayes/filters.pxd:22:29: Compiler crash in AnalyseDeclarationsTransform

ModuleNode.body = StatListNode(filters.py:13:0)
StatListNode.stats[6] = StatListNode(filters.py:62:0)
StatListNode.stats[0] = CClassDefNode(filters.py:62:0,
    base_class_name = u'Filter',
    class_name = u'KalmanFilter',
    doc = u'Implementation of standard Kalman filter. **cond** in :meth:`bayes` 
is interpreted as\n    control (intervention) input :math:`u_t` to the system.
\n\n    Kalman filter forms *optimal Bayesian solution* for the following 
system:\n\n    .. math::\n\n        x_t &= A_t x_{t-1} + B_t u_t + v_{t-1} 
\\quad \\quad\n            A_t \\in \\mathbb{R}^{n,n} \\;\\;\n            B_t 
\\in \\mathbb{R}^{n,k} \\;\\;\n            \\;\\; n \\in \\mathbb{N}\n          
  
\\;\\; k \\in \\mathbb{N}_0 \\text{ (may be zero)}\n            \\\\\n        
y_t &= C_t x_t + D_t u_t + w_t \\quad \\quad \\quad \\;\\;\n            C_t 
\\in \\mathbb{R}^{j,n} \\;\\;\n            D_t \\in \\mathbb{R}^{j,k} \\;\\;\n  
          
j \\in \\mathbb{N} \\;\\; j \\leq n\n\n    where :math:`x_t \\in 
\\mathbb{R}^n` is hidden state vector, :math:`y_t \\in \\mathbb{R}^j` is\n    
observation vector and :math:`u_t \\in \\mathbb{R}^k` is control vector. 
:math:`v_t` is normally\n    distributed zero-mean process noise with 
covariance matrix :math:`Q_t`, :math:`w_t` is normally\n    distributed zero-
mean observation noise with covariance matrix :math:`R_t`. Additionally, 
intial\n    pdf (**state_pdf**) has to be Gaussian.\n    ',
    visibility = 'private')

Compiler crash traceback from this point on:
  File "Visitor.py", line 168, in Cython.Compiler.Visitor.TreeVisitor._visit 
(/var/tmp/portage/dev-python/cython-9999/work/Cython/Compiler/Visitor.c:3840)
  File "Visitor.py", line 284, in 
Cython.Compiler.Visitor.CythonTransform.visit_Node (/var/tmp/portage/dev-
python/cython-9999/work/Cython/Compiler/Visitor.c:5756)
  File "Visitor.py", line 236, in 
Cython.Compiler.Visitor.VisitorTransform.visitchildren (/var/tmp/portage/dev-
python/cython-9999/work/Cython/Compiler/Visitor.c:4813)
  File "Visitor.py", line 210, in 
Cython.Compiler.Visitor.TreeVisitor._visitchildren (/var/tmp/portage/dev-
python/cython-9999/work/Cython/Compiler/Visitor.c:4591)
AssertionError: Cannot insert list here: body in 
<Cython.Compiler.Nodes.PropertyNode object at 0x3136550>
_______________________________________________
cython-devel mailing list
cython-devel@python.org
http://mail.python.org/mailman/listinfo/cython-devel

Reply via email to