fplll / fpylll

A Python interface for https://github.com/fplll/fplll
GNU General Public License v2.0
118 stars 60 forks source link

chore: PEP 517 Wheel build support #262

Closed alxiong closed 6 months ago

alxiong commented 7 months ago

I encounter build failure when trying to install fpylll in my virtual environment (managed using poetry shell)

according to the error message, it seems to be caused by the

is likely not a problem with poetry but with fpylll (0.6.1) not supporting PEP 517 builds.

Reproduce the issue

Create a new virtualenv with python=3.8.1, and run pip wheel --no-cache-dir --use-pep517 "fpylll (==0.6.1)", you should see:

      [ 1/13] Cythonizing src/fpylll/config.pyx
      [ 2/13] Cythonizing src/fpylll/fplll/bkz.pyx
      [ 3/13] Cythonizing src/fpylll/fplll/bkz_param.pyx
      [ 4/13] Cythonizing src/fpylll/fplll/enumeration.pyx
      [ 5/13] Cythonizing src/fpylll/fplll/gso.pyx
      [ 6/13] Cythonizing src/fpylll/fplll/integer_matrix.pyx
      [ 7/13] Cythonizing src/fpylll/fplll/lll.pyx
      [ 8/13] Cythonizing src/fpylll/fplll/pruner.pyx
      [ 9/13] Cythonizing src/fpylll/fplll/svpcvp.pyx
      [10/13] Cythonizing src/fpylll/fplll/wrapper.pyx
      [11/13] Cythonizing src/fpylll/gmp/pylong.pyx
      [12/13] Cythonizing src/fpylll/io.pyx
      [13/13] Cythonizing src/fpylll/util.pyx
      In file included from /usr/include/python3.8/pytime.h:6,
                       from /usr/include/python3.8/Python.h:85,
                       from build/src/fpylll/gmp/pylong.c:41:
      build/src/fpylll/gmp/pycore_long.h: In function __PyLong_SetSignAndDigitCount_:
      build/src/fpylll/gmp/pycore_long.h:92:13: error: _o_ undeclared (first use in this function); did you mean _op_?
         92 |     Py_SIZE(o) = size;
            |             ^
      /usr/include/python3.8/object.h:119:47: note: in definition of macro __PyVarObject_CAST_
        119 | #define _PyVarObject_CAST(op) ((PyVarObject*)(op))
            |                                               ^~
      build/src/fpylll/gmp/pycore_long.h:92:5: note: in expansion of macro _Py_SIZE_
         92 |     Py_SIZE(o) = size;
            |     ^~~~~~~
      build/src/fpylll/gmp/pycore_long.h:92:13: note: each undeclared identifier is reported only once for each function it appears in
         92 |     Py_SIZE(o) = size;
            |             ^
      /usr/include/python3.8/object.h:119:47: note: in definition of macro __PyVarObject_CAST_
        119 | #define _PyVarObject_CAST(op) ((PyVarObject*)(op))
            |                                               ^~
      build/src/fpylll/gmp/pycore_long.h:92:5: note: in expansion of macro _Py_SIZE_
         92 |     Py_SIZE(o) = size;
            |     ^~~~~~~
      warning: src/fpylll/fplll/decl.pxd:261:4: The 'IF' statement is deprecated and will be removed in a future Cython version. Consider using runtime conditions or C macros instead. See https://github.com/cython/cython/issues/4310
      .....
error: command '/usr/bin/x86_64-linux-gnu-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 fpylll
Failed to build fpylll
ERROR: Failed to build one or more wheels

Actions

Could you please try to reproduce the failure (if you can?) Is it possible to add build backend API support for PEP 517 standard?

🙏 Thanks!

alxiong commented 7 months ago

🤔 I was trying to install from source using "automatic install", but got the same error as above.

then it seems this is not a PEP compliant problem, but maybe system library setup problem.

$ uname -a
Linux alex 5.15.0-71-generic #78~20.04.1-Ubuntu SMP Wed Apr 19 11:26:48 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

I'm certain all the dependencies (such as gmp, mpfr, fplll, cython etc) are all installed on my system.

reading the error message again, seems to originate from build/src/fpylll/gmp/pycore_long.h, does this mean maybe I installed an incompatible version of the GMP library? any idea?