Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

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

Merged
merged 1 commit into from

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
Owner

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
Owner

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
Owner

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 from
@rgommers
Owner

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
Commits on Jul 24, 2012
  1. @bfroehle

    BUG: Change __Pyx_zeros and __Pyx_minusones scope to static.

    bfroehle authored
    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.
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 4 deletions.
  1. +2 −2 scipy/io/matlab/mio5_utils.c
  2. +2 −2 scipy/stats/vonmises_cython.c
View
4 scipy/io/matlab/mio5_utils.c
@@ -1054,8 +1054,8 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view);
#define __Pyx_ReleaseBuffer PyBuffer_Release
#endif
-Py_ssize_t __Pyx_zeros[] = {0};
-Py_ssize_t __Pyx_minusones[] = {-1};
+static Py_ssize_t __Pyx_zeros[] = {0};
+static Py_ssize_t __Pyx_minusones[] = {-1};
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, long level); /*proto*/
View
4 scipy/stats/vonmises_cython.c
@@ -770,8 +770,8 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view);
#define __Pyx_ReleaseBuffer PyBuffer_Release
#endif
-Py_ssize_t __Pyx_zeros[] = {0};
-Py_ssize_t __Pyx_minusones[] = {-1};
+static Py_ssize_t __Pyx_zeros[] = {0};
+static Py_ssize_t __Pyx_minusones[] = {-1};
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, long level); /*proto*/
Something went wrong with that request. Please try again.