lemire / fastrand

Fast random number generation in an interval in Python: Up to 10x faster than random.randint.
Apache License 2.0
88 stars 12 forks source link

Python3 installation #7

Closed GPaolo closed 5 years ago

GPaolo commented 5 years ago

When installing for Python3.5, at import time it gives an error:

undefined symbol: PyInt_AsUnsignedLongLongMask

to solve it, I had to modify the .c file from:

if PY_MAJOR_VERSION >= 3

define PyInt_AsLong(x) PyLong_AsLong(x)

endif

to

if PY_MAJOR_VERSION >= 3

define PyInt_AsLong(x) PyLong_AsLong(x)

define PyInt_AsUnsignedLongLongMask(x) PyLong_AsUnsignedLongLongMask(x)

endif

lemire commented 5 years ago

Do you want to issue this as a pull request?

One immediate benefit is that you get credit for your work.

GPaolo commented 5 years ago

Sure. Doing it.