Sunday 8 December 2019

python - Does PyPy support gmpy2?



It seems from the discussions issue #60 and issue #40 that PyPy couldn't build gmpy before. All I intend to use currently is the probable prime is_prime code which is conveniently in gmpy2. I get the impression that the more calls to gmpy2 means less efficiency for PyPy. Is using gmpy2 possible currently, or do I have to use something like GMPY_CFFI?



The error I get when using pip in PyPy is cannot open include file 'mpir.h'


Answer




You should use GMPY_CFFI. gmpy and gmpy2 rely on too many internal details of CPython to be ported to PyPy.



Note: I maintain gmpy2.


No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...