Stewori / JyNI

Enables Jython to load native CPython extensions.
https://jyni.12hp.de
Other
150 stars 17 forks source link

Patch: NumPy 13.2 broken for JyNI 2.7-alpha.5 #20

Closed Stewori closed 6 years ago

Stewori commented 6 years ago

This is an issue with mtrand.c, which is a Cython-generated file. In the mtrand folder, NumPy bundles a script called generate_mtrand_c.py. This is used to generate mtrand.c, in NumPy 13.2 prebuilt with Cython 0.27. If you build it using Cython 0.25 everything works fine (0.26 not tested). For convenience I prepared a Cython-0.25-built version of mtrand.c.

You can either replace mtrand.c if you build NumPy by yourself or use the binary mtrand.so (Linux 64 only as of this writing; I will add more binaries soon). You can put the binary on sys.path such that it preceeds NumPy. Then it should override the original mtrand.so.

Sure, this needs to be fixed in JyNI, but I cannot tell when I'll find time. So, until then use this workaround for NumPy 13.2.

Stewori commented 6 years ago

So, it seems this was actually a Cython issue. It is obsolete as of NumPy 13.3 release. Also see https://github.com/numpy/numpy/issues/9786