BUG: Change __Pyx_zeros and __Pyx_minusones scope to static. #274

Merged
merged 1 commit into from Jul 24, 2012

Projects

None yet

2 participants

@bfroehle

Manually apply the fix from cython/cython#87, rather than regenerate the
entire cython file.

Having multiple definitions of these symbols prevents liking SciPy into a
static Python binary.

@bfroehle bfroehle BUG: Change __Pyx_zeros and __Pyx_minusones scope to static.
Manually apply the fix from cython/cython#87, rather than regenerate the
entire cython file.

Having multiple definitions of these symbols prevents liking SciPy into
a static Python binary.
443b2fc
@rgommers
SciPy member

Regenerating with Cython 0.17-dev is OK. Since we decided to make using 0.17-dev required for now, that's probably better than manually patching again.

@bfroehle

I think it might be easier (and safer) to just commit this, especially since running 0.17-dev currently fails:

$ cython  -V
Cython version 0.17.beta1
$ cython mio5_utils.pyx 
warning: mio5_utils.pyx:302:16: Unreachable code
warning: mio5_utils.pyx:481:12: Unreachable code

Error compiling Cython file:
------------------------------------------------------------
...
            mod8 = byte_count % 8
            if mod8:
                self.cstream.seek(8 - mod8, 1)
        return 0

    cpdef inline cnp.ndarray read_numeric(self, int copy=True):
         ^
------------------------------------------------------------

mio5_utils.pyx:412:10: Only final types can have final Python (def/cpdef) methods
@rgommers
SciPy member

OK, if that fails than this is safer. This is getting very annoying though - neither the last released not the current dev version works right now....

@bfroehle

Well, the error is not with Cython but instead with the .pyx source. It isn't possible to have an inline'd def or cpdef method, as otherwise you'd get conflicting results depending on whether you called the method from C or Python if a subclass overrode the method.

@rgommers
SciPy member

Don't think that's an excuse for suddenly failing, without even generating a warning in the last released version, but well.....

I'll open a ticket for that issue.

@rgommers rgommers merged commit ddd617d into scipy:master Jul 24, 2012
@rgommers
SciPy member

Looks fine and works for me, so merging. Thanks @bfroehle.

@bfroehle

The fix for ticket 1707 should be simple, see bfroehle/scipy@recython, but I'll wait until after the 0.17 release to introduce a pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment