aleaxit / gmpy

General Multi-Precision arithmetic for Python 2.6+/3+ (GMP, MPIR, MPFR, MPC)
https://gmpy2.readthedocs.io/en/latest/
GNU Lesser General Public License v3.0
510 stars 86 forks source link

Build failure on CPython 3.13 (dev) #417

Closed skirpichev closed 10 months ago

skirpichev commented 1 year ago

src/gmpy2_hash.c:219:27: error: ‘_PyHASH_IMAG’ undeclared:

$ pip install .
Processing /home/sk/src/gmpy
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: gmpy2
  Building wheel for gmpy2 (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for gmpy2 (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [43 lines of output]
      running bdist_wheel
      running build
      running build_py
      running egg_info
      writing gmpy2.egg-info/PKG-INFO
      writing dependency_links to gmpy2.egg-info/dependency_links.txt
      writing requirements to gmpy2.egg-info/requires.txt
      writing top-level names to gmpy2.egg-info/top_level.txt
      reading manifest file 'gmpy2.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      adding license file 'COPYING'
      adding license file 'COPYING.LESSER'
      writing manifest file 'gmpy2.egg-info/SOURCES.txt'
      running build_ext
      building 'gmpy2.gmpy2' extension
      gcc -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O3 -Wall -fPIC -I./src -I/home/sk/src/cpython/for-gmpy/include -I/home/sk/src/cpython/Include -I/home/sk/src/cpython -c src/gmpy2.c -o build/temp.linux-x86_64-cpython-313/src/gmpy2.o -DSHARED=1
      In file included from src/gmpy2.c:621:
      src/gmpy2_convert_gmp.c: In function ‘GMPy_PyLong_From_MPZ’:
      src/gmpy2_convert_gmp.c:160:20: warning: implicit declaration of function ‘_PyLong_New’ [-Wimplicit-function-declaration]
        160 |     if (!(result = _PyLong_New(size))) {
            |                    ^~~~~~~~~~~
      src/gmpy2_convert_gmp.c:160:18: warning: assignment to ‘PyLongObject *’ {aka ‘struct _longobject *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
        160 |     if (!(result = _PyLong_New(size))) {
            |                  ^
      In file included from src/gmpy2.c:623:
      src/gmpy2_convert_mpc.c: In function ‘GMPy_MPC_From_PyStr’:
      src/gmpy2_convert_mpc.c:281:13: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
        281 |         cp  = PyUnicode_AsUTF8AndSize(s, &len);
            |             ^
      In file included from src/gmpy2.c:664:
      src/gmpy2_hash.c: In function ‘_mpfr_hash’:
      src/gmpy2_hash.c:187:5: warning: returning ‘void *’ from a function with return type ‘Py_hash_t’ {aka ‘long int’} makes integer from pointer without a cast [-Wint-conversion]
        187 |     CHECK_CONTEXT(context);
            |     ^~~~~~~~~~~~~ 
      src/gmpy2_hash.c:189:12: warning: implicit declaration of function ‘_Py_HashDouble’ [-Wimplicit-function-declaration]
        189 |     return _Py_HashDouble(temp);
            |            ^~~~~~~~~~~~~~
      src/gmpy2_hash.c: In function ‘GMPy_MPC_Hash_Slot’:
      src/gmpy2_hash.c:219:27: error: ‘_PyHASH_IMAG’ undeclared (first use in this function)
        219 |     combined = hashreal + _PyHASH_IMAG * hashimag;
            |                           ^~~~~~~~~~~~
      src/gmpy2_hash.c:219:27: note: each undeclared identifier is reported only once for each function it appears in
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for gmpy2
Failed to build gmpy2
ERROR: Could not build wheels for gmpy2, which is required to install pyproject.toml-based projects