BrianGladman / gmpy2

GNU Lesser General Public License v3.0
10 stars 8 forks source link

Incompatibility with cpython main branch #9

Closed ghost closed 10 months ago

ghost commented 10 months ago

From the definition here it looks like this should be templong->long_value.ob_digit

➜  ~ pip install gmpy2
Defaulting to user installation because normal site-packages is not writeable
Collecting gmpy2
  Using cached gmpy2-2.1.5.tar.gz (261 kB)
  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
  ╰─> [90 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-312
      creating build/lib.linux-x86_64-cpython-312/gmpy2
      copying gmpy2/__init__.py -> build/lib.linux-x86_64-cpython-312/gmpy2
      running egg_info
      writing gmpy2.egg-info/PKG-INFO
      writing dependency_links to gmpy2.egg-info/dependency_links.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'
      copying gmpy2/__init__.pxd -> build/lib.linux-x86_64-cpython-312/gmpy2
      copying gmpy2/gmpy2.h -> build/lib.linux-x86_64-cpython-312/gmpy2
      copying gmpy2/gmpy2.pxd -> build/lib.linux-x86_64-cpython-312/gmpy2
      running build_ext
      building 'gmpy2.gmpy2' extension
      creating build/temp.linux-x86_64-cpython-312
      creating build/temp.linux-x86_64-cpython-312/src
      gcc -fno-strict-overflow -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -fcf-protection -fexceptions -fcf-protection -fexceptions -fcf-protection -fexceptions -fPIC -I./src -I/usr/include/python3.12 -c src/gmpy2.c -o build/temp.linux-x86_64-cpython-312/src/gmpy2.o -DSHARED=1
      In file included from src/gmpy2.c:605:
      src/gmpy2_convert_gmp.c: In function ‘GMPy_MPZ_From_PyIntOrLong’:
      src/gmpy2_convert_gmp.c:64:48: error: ‘PyLongObject’ {aka ‘struct _longobject’} has no member named ‘ob_digit’
         64 |         mpz_set_si(result->z, -(sdigit)templong->ob_digit[0]);
            |                                                ^~
      src/gmpy2_convert_gmp.c:70:39: error: ‘PyLongObject’ {aka ‘struct _longobject’} has no member named ‘ob_digit’
         70 |         mpz_set_si(result->z, templong->ob_digit[0]);
            |                                       ^~
      src/gmpy2_convert_gmp.c:83:55: error: ‘PyLongObject’ {aka ‘struct _longobject’} has no member named ‘ob_digit’
         83 |         mpz_import(result->z, len, -1, sizeof(templong->ob_digit[0]), 0,
            |                                                       ^~
      src/gmpy2_convert_gmp.c:84:35: error: ‘PyLongObject’ {aka ‘struct _longobject’} has no member named ‘ob_digit’
         84 |                    sizeof(templong->ob_digit[0])*8 - PyLong_SHIFT, templong->ob_digit);
            |                                   ^~
      src/gmpy2_convert_gmp.c:84:76: error: ‘PyLongObject’ {aka ‘struct _longobject’} has no member named ‘ob_digit’
         84 |                    sizeof(templong->ob_digit[0])*8 - PyLong_SHIFT, templong->ob_digit);
            |                                                                            ^~
      src/gmpy2_convert_gmp.c: In function ‘mpz_set_PyIntOrLong’:
      src/gmpy2_convert_gmp.c:110:40: error: ‘PyLongObject’ {aka ‘struct _longobject’} has no member named ‘ob_digit’
        110 |         mpz_set_si(z, -(sdigit)templong->ob_digit[0]);
            |                                        ^~
      src/gmpy2_convert_gmp.c:116:31: error: ‘PyLongObject’ {aka ‘struct _longobject’} has no member named ‘ob_digit’
        116 |         mpz_set_si(z, templong->ob_digit[0]);
            |                               ^~
      src/gmpy2_convert_gmp.c:129:47: error: ‘PyLongObject’ {aka ‘struct _longobject’} has no member named ‘ob_digit’
        129 |         mpz_import(z, len, -1, sizeof(templong->ob_digit[0]), 0,
            |                                               ^~
      src/gmpy2_convert_gmp.c:130:35: error: ‘PyLongObject’ {aka ‘struct _longobject’} has no member named ‘ob_digit’
        130 |                    sizeof(templong->ob_digit[0])*8 - PyLong_SHIFT, templong->ob_digit);
            |                                   ^~
      src/gmpy2_convert_gmp.c:130:76: error: ‘PyLongObject’ {aka ‘struct _longobject’} has no member named ‘ob_digit’
        130 |                    sizeof(templong->ob_digit[0])*8 - PyLong_SHIFT, templong->ob_digit);
            |                                                                            ^~
      src/gmpy2_convert_gmp.c: In function ‘GMPy_PyLong_From_MPZ’:
      src/gmpy2_convert_gmp.c:203:22: error: ‘PyLongObject’ {aka ‘struct _longobject’} has no member named ‘ob_digit’
        203 |     mpz_export(result->ob_digit, &count, -1, sizeof(result->ob_digit[0]), 0,
            |                      ^~
      src/gmpy2_convert_gmp.c:203:59: error: ‘PyLongObject’ {aka ‘struct _longobject’} has no member named ‘ob_digit’
        203 |     mpz_export(result->ob_digit, &count, -1, sizeof(result->ob_digit[0]), 0,
            |                                                           ^~
      src/gmpy2_convert_gmp.c:204:29: error: ‘PyLongObject’ {aka ‘struct _longobject’} has no member named ‘ob_digit’
        204 |                sizeof(result->ob_digit[0])*8 - PyLong_SHIFT, obj->z);
            |                             ^~
      src/gmpy2_convert_gmp.c:207:15: error: ‘PyLongObject’ {aka ‘struct _longobject’} has no member named ‘ob_digit’
        207 |         result->ob_digit[0] = 0;
            |               ^~
      src/gmpy2_convert_gmp.c:212:31: error: ‘PyLongObject’ {aka ‘struct _longobject’} has no member named ‘ob_digit’
        212 |     while ((size>0) && (result->ob_digit[size-1] == 0)) {
            |                               ^~
      src/gmpy2_convert_gmp.c: In function ‘GMPy_XMPZ_From_PyIntOrLong’:
      src/gmpy2_convert_gmp.c:481:48: error: ‘PyLongObject’ {aka ‘struct _longobject’} has no member named ‘ob_digit’
        481 |         mpz_set_si(result->z, -(sdigit)templong->ob_digit[0]);
            |                                                ^~
      src/gmpy2_convert_gmp.c:487:39: error: ‘PyLongObject’ {aka ‘struct _longobject’} has no member named ‘ob_digit’
        487 |         mpz_set_si(result->z, templong->ob_digit[0]);
            |                                       ^~
      src/gmpy2_convert_gmp.c:500:55: error: ‘PyLongObject’ {aka ‘struct _longobject’} has no member named ‘ob_digit’
        500 |         mpz_import(result->z, len, -1, sizeof(templong->ob_digit[0]), 0,
            |                                                       ^~
      src/gmpy2_convert_gmp.c:501:35: error: ‘PyLongObject’ {aka ‘struct _longobject’} has no member named ‘ob_digit’
        501 |                    sizeof(templong->ob_digit[0])*8 - PyLong_SHIFT, templong->ob_digit);
            |                                   ^~
      src/gmpy2_convert_gmp.c:501:76: error: ‘PyLongObject’ {aka ‘struct _longobject’} has no member named ‘ob_digit’
        501 |                    sizeof(templong->ob_digit[0])*8 - PyLong_SHIFT, templong->ob_digit);
            |                                                                            ^~
      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
ghost commented 10 months ago

This is defined upstream here: https://github.com/aleaxit/gmpy/blob/master/src/gmpy2_convert.h#L148

BrianGladman commented 10 months ago

Hi tazzaoui, You will need to report this at the primary repository for GMPY which is at https://github.com/aleaxit/gmpy This repository jut holds a clone of the master with minor changes for my own benefit.