Skip to content
This repository

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

Merged
merged 1 commit into from over 1 year ago

2 participants

Bradley M. Froehle Ralf Gommers
Bradley M. Froehle

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.

Bradley M. Froehle 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
Ralf Gommers
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.

Bradley M. Froehle

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
Ralf Gommers
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....

Bradley M. Froehle

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.

Ralf Gommers
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.

Ralf Gommers rgommers merged commit ddd617d into from July 24, 2012
Ralf Gommers rgommers closed this July 24, 2012
Ralf Gommers
Owner

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

Bradley M. Froehle

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

Showing 1 unique commit by 1 author.

Jul 23, 2012
Bradley M. Froehle 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
This page is out of date. Refresh to see the latest.
4  scipy/io/matlab/mio5_utils.c
@@ -1054,8 +1054,8 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view);
1054 1054
 #define __Pyx_ReleaseBuffer PyBuffer_Release
1055 1055
 #endif
1056 1056
 
1057  
-Py_ssize_t __Pyx_zeros[] = {0};
1058  
-Py_ssize_t __Pyx_minusones[] = {-1};
  1057
+static Py_ssize_t __Pyx_zeros[] = {0};
  1058
+static Py_ssize_t __Pyx_minusones[] = {-1};
1059 1059
 
1060 1060
 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, long level); /*proto*/
1061 1061
 
4  scipy/stats/vonmises_cython.c
@@ -770,8 +770,8 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view);
770 770
 #define __Pyx_ReleaseBuffer PyBuffer_Release
771 771
 #endif
772 772
 
773  
-Py_ssize_t __Pyx_zeros[] = {0};
774  
-Py_ssize_t __Pyx_minusones[] = {-1};
  773
+static Py_ssize_t __Pyx_zeros[] = {0};
  774
+static Py_ssize_t __Pyx_minusones[] = {-1};
775 775
 
776 776
 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, long level); /*proto*/
777 777
 
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.