-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Building from git fails: Error compiling Cython file: Pythonic division not allowed without gil
#6719
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Error compiling Cython file: Pythonic division not allowed without gil
Error compiling Cython file: Pythonic division not allowed without gil
numpy/random/mtrand/mtrand.pyx contains a line where cython fails to compile, complaining “Pythonic division not allowed without gil”. By passing '--directive cdivision=true' to cython, it can compile again.
I added pull request #6720. I don't know if this is a workaround that fails to address the problem, or whether this is an actual fix, because I am not sure what the underlying problem is and why it hasn't been reported before — if I run into this problem, shouldn't many others too? |
Probably |
Note that two C floats are involved in the division, so the python version of |
Even if it's a bug in cython, wouldn'd numpy still want a workaround? I tried with both 0.23.2 and 0.23.4 so if it is a Cython bug, it's not a bug occurring in just a single revision. |
See pull request #6721 |
numpy/random/mtrand/mtrand.pyx contains a line where cython fails to compile, complaining “Pythonic division not allowed without gil”. By running this code segment under cdivision(True), this problem is avoided.
Closed by #6721. |
Please do file a bug with cython as well. |
I tried::
With the latest Cython head, with Python 2.7 and 3.4, with and without the -3 option, and was not able to reproduce this. Is there something non-standard in your setup? |
@njsmith I sent an e-mail to the cython-users mailing-list. I don't feel quite confident enough to formulate what exactly the cython bug is, as I've never used cython myself. @robertwb As far as I'm aware, I have not personally set anything non-standard. The machine configuration is different from a typical workstation, though — I'm building on a Red Hat Enterprise Linux Server release 6.7, cython and co installed in my home directory on a panfs filesystem, trying to build on a tmpfs filesystem. I don't think the filesystem type should matter but it's the only unusual aspect I'm aware of. Could you think of some other non-standard things I should look at specifically? |
numpy/random/mtrand/mtrand.pyx contains a line where cython fails to compile, complaining “Pythonic division not allowed without gil”. By running this code segment under cdivision(True), this problem is avoided.
* 'master' of git://github.com/numpy/numpy: (24 commits) BENCH: allow benchmark suite to run on Python 3 TST: test f2py, fallback on f2py2.7 etc., fixes numpy#6718 BUG: link cblas library if cblas is detected BUG/TST: Fix for numpy#6724, make numpy.ma.mvoid consistent with numpy.void BUG/TST: Fix numpy#6760 by correctly describing mask on nested subdtypes BUG: resizing empty array with complex dtype failed DOC: Add changelog for numpy#6734 and numpy#6748. Use integer division to avoid casting to int. Allow to change the maximum width with a class variable. Add some tests for mask creation with mask=True or False. Test that the mask dtype if MaskType before using np.zeros/ones BUG/TST: Fix for numpy#6729 ENH: Avoid memory peak and useless computations when printing a MaskedArray. ENH: Avoid memory peak when creating a MaskedArray with mask=True/False (numpy#6732). BUG: Readd fallback CBLAS detection on linux. TST: Fix travis-ci test for numpy wheels. MAINT: Localize variables only used with relaxed stride checking. BUG: Fix for numpy#6719 MAINT: enable Werror=vla in travis BUG: Include relevant files from numpy/linalg/lapack_lite in sdist. ...
numpy/random/mtrand/mtrand.pyx contains a line where cython fails to compile, complaining “Pythonic division not allowed without gil”. By running this code segment under cdivision(True), this problem is avoided.
Building numpy from git fails when Cythonizing
numpy/random/mtrand/mtrand.pyx
, due to an errorPythonic division not allowed without gil, consider using cython.cdivision(True)
. This is Python 3.5.0, Cython 0.23.4, withnumpy
git revisiond94043f0fb93985fd4302eae9fcdca2d79239908
on branchmaster
. The same problem occurs on branchmaintenance/1.10.x
with commit76db1ab4edef69e310426dccf95c15212b1ba4a6
, and on branchmaintenance/1.9.x
with commitedb902cdc6573553afcf11047ecdfb447e444322
. However, a regularpip install numpy
(which installs 1.10.1), works (because releases include compiled cython files, but version control does not). The failures occur as follows:What's going wrong?
The text was updated successfully, but these errors were encountered: