mcmtroffaes / pycddlib

A Python wrapper for Komei Fukuda's cddlib.
http://packages.python.org/pycddlib/
GNU General Public License v2.0
61 stars 9 forks source link

Installation fails using pip on Archlinux/Ubuntu 22.04 #53

Closed Edenharder closed 2 years ago

Edenharder commented 2 years ago

@mcmtroffaes I'm using Archlinux. There is a similar problem when I try to install pycddlib:

Defaulting to user installation because normal site-packages is not writeable
Collecting pycddlib
  Using cached pycddlib-2.1.4.tar.gz (265 kB)
Building wheels for collected packages: pycddlib
  Building wheel for pycddlib (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-5hcve4lr/pycddlib_d94d3abd5b514c3d9c0a4863b83b8526/setup.py'"'"'; __file__='"'"'/tmp/pip-install-5hcve4lr/pycddlib_d94d3abd5b514c3d9c0a4863b83b8526/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-o4i3d7h7
       cwd: /tmp/pip-install-5hcve4lr/pycddlib_d94d3abd5b514c3d9c0a4863b83b8526/
  Complete output (186 lines):
  /usr/lib/python3.10/site-packages/setuptools/installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
    warnings.warn(
  running bdist_wheel
  running build
  running build_ext
  skipping 'cdd.c' Cython extension (up-to-date)
  building 'cdd' extension
  creating build
  creating build/temp.linux-x86_64-3.10
  creating build/temp.linux-x86_64-3.10/cddlib
  creating build/temp.linux-x86_64-3.10/cddlib/lib-src
  gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -flto -ffat-lto-objects -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -flto -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -flto -fPIC -DGMPRATIONAL -Icddlib/lib-src -I/usr/include/python3.10 -c cdd.c -o build/temp.linux-x86_64-3.10/cdd.o
  cdd.c: In function ‘__pyx_f_3cdd_libc_stdio_tmpfile’:
  cdd.c:2425:3: warning: label ‘__pyx_L1_error’ defined but not used [-Wunused-label]
   2425 |   __pyx_L1_error:;
        |   ^~~~~~~~~~~~~~
  cdd.c:2307:7: warning: unused variable ‘__pyx_t_1’ [-Wunused-variable]
   2307 |   int __pyx_t_1;
        |       ^~~~~~~~~
  cdd.c:2304:9: warning: unused variable ‘__pyx_v_name’ [-Wunused-variable]
   2304 |   char *__pyx_v_name;
        |         ^~~~~~~~~~~~
  cdd.c: In function ‘__pyx_f_3cdd__get_set’:
  cdd.c:2768:69: warning: comparison of integer expressions of different signedness: ‘long int’ and ‘long unsigned int’ [-Wsign-compare]
   2768 |     for (__pyx_7genexpr__pyx_v_elem = 1; __pyx_7genexpr__pyx_v_elem <= __pyx_t_2; __pyx_7genexpr__pyx_v_elem++) {
        |                                                                     ^~
  cdd.c: In function ‘__pyx_f_3cdd__set_set’:
  cdd.c:2863:39: warning: comparison of integer expressions of different signedness: ‘long int’ and ‘long unsigned int’ [-Wsign-compare]
   2863 |   for (__pyx_v_elem = 1; __pyx_v_elem <= __pyx_t_1; __pyx_v_elem++) {
        |                                       ^~
  cdd.c: In function ‘__pyx_tp_dealloc_3cdd_Matrix’:
  cdd.c:20463:5: error: lvalue required as increment operand
  20463 |     ++Py_REFCNT(o);
        |     ^~
  cdd.c:20465:5: error: lvalue required as decrement operand
  20465 |     --Py_REFCNT(o);
        |     ^~
  cdd.c: In function ‘__pyx_tp_dealloc_3cdd_LinProg’:
  cdd.c:20668:5: error: lvalue required as increment operand
  20668 |     ++Py_REFCNT(o);
        |     ^~
  cdd.c:20670:5: error: lvalue required as decrement operand
  20670 |     --Py_REFCNT(o);
        |     ^~
  cdd.c: In function ‘__pyx_tp_dealloc_3cdd_Polyhedron’:
  cdd.c:20815:5: error: lvalue required as increment operand
  20815 |     ++Py_REFCNT(o);
        |     ^~
  cdd.c:20817:5: error: lvalue required as decrement operand
  20817 |     --Py_REFCNT(o);
        |     ^~
  cdd.c: In function ‘__Pyx_decode_c_bytes’:
  cdd.c:23923:9: warning: ‘PyUnicode_FromUnicode’ is deprecated [-Wdeprecated-declarations]
  23923 |         return PyUnicode_FromUnicode(NULL, 0);
        |         ^~~~~~
  In file included from /usr/include/python3.10/unicodeobject.h:1046,
                   from /usr/include/python3.10/Python.h:83,
                   from cdd.c:4:
  /usr/include/python3.10/cpython/unicodeobject.h:551:42: note: declared here
    551 | Py_DEPRECATED(3.3) PyAPI_FUNC(PyObject*) PyUnicode_FromUnicode(
        |                                          ^~~~~~~~~~~~~~~~~~~~~
  cdd.c: In function ‘__Pyx_ParseOptionalKeywords’:
  cdd.c:24309:21: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
  24309 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
        |                     ^
  In file included from /usr/include/python3.10/unicodeobject.h:1046,
                   from /usr/include/python3.10/Python.h:83,
                   from cdd.c:4:
  /usr/include/python3.10/cpython/unicodeobject.h:446:26: note: declared here
    446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
        |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
  cdd.c:24309:21: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations]
  24309 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
        |                     ^
  In file included from /usr/include/python3.10/unicodeobject.h:1046,
                   from /usr/include/python3.10/Python.h:83,
                   from cdd.c:4:
  /usr/include/python3.10/cpython/unicodeobject.h:580:45: note: declared here
    580 | Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
        |                                             ^~~~~~~~~~~~~~~~~~~
  cdd.c:24309:21: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
  24309 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
        |                     ^
  In file included from /usr/include/python3.10/unicodeobject.h:1046,
                   from /usr/include/python3.10/Python.h:83,
                   from cdd.c:4:
  /usr/include/python3.10/cpython/unicodeobject.h:446:26: note: declared here
    446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
        |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
  cdd.c:24309:21: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
  24309 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
        |                     ^
  In file included from /usr/include/python3.10/unicodeobject.h:1046,
                   from /usr/include/python3.10/Python.h:83,
                   from cdd.c:4:
  /usr/include/python3.10/cpython/unicodeobject.h:446:26: note: declared here
    446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
        |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
  cdd.c:24309:21: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations]
  24309 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
        |                     ^
  In file included from /usr/include/python3.10/unicodeobject.h:1046,
                   from /usr/include/python3.10/Python.h:83,
                   from cdd.c:4:
  /usr/include/python3.10/cpython/unicodeobject.h:580:45: note: declared here
    580 | Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
        |                                             ^~~~~~~~~~~~~~~~~~~
  cdd.c:24309:21: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
  24309 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
        |                     ^
  In file included from /usr/include/python3.10/unicodeobject.h:1046,
                   from /usr/include/python3.10/Python.h:83,
                   from cdd.c:4:
  /usr/include/python3.10/cpython/unicodeobject.h:446:26: note: declared here
    446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
        |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
  cdd.c:24325:25: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
  24325 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
        |                         ^
  In file included from /usr/include/python3.10/unicodeobject.h:1046,
                   from /usr/include/python3.10/Python.h:83,
                   from cdd.c:4:
  /usr/include/python3.10/cpython/unicodeobject.h:446:26: note: declared here
    446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
        |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
  cdd.c:24325:25: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations]
  24325 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
        |                         ^
  In file included from /usr/include/python3.10/unicodeobject.h:1046,
                   from /usr/include/python3.10/Python.h:83,
                   from cdd.c:4:
  /usr/include/python3.10/cpython/unicodeobject.h:580:45: note: declared here
    580 | Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
        |                                             ^~~~~~~~~~~~~~~~~~~
  cdd.c:24325:25: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
  24325 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
        |                         ^
  In file included from /usr/include/python3.10/unicodeobject.h:1046,
                   from /usr/include/python3.10/Python.h:83,
                   from cdd.c:4:
  /usr/include/python3.10/cpython/unicodeobject.h:446:26: note: declared here
    446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
        |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
  cdd.c:24325:25: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
  24325 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
        |                         ^
  In file included from /usr/include/python3.10/unicodeobject.h:1046,
                   from /usr/include/python3.10/Python.h:83,
                   from cdd.c:4:
  /usr/include/python3.10/cpython/unicodeobject.h:446:26: note: declared here
    446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
        |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
  cdd.c:24325:25: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations]
  24325 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
        |                         ^
  In file included from /usr/include/python3.10/unicodeobject.h:1046,
                   from /usr/include/python3.10/Python.h:83,
                   from cdd.c:4:
  /usr/include/python3.10/cpython/unicodeobject.h:580:45: note: declared here
    580 | Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
        |                                             ^~~~~~~~~~~~~~~~~~~
  cdd.c:24325:25: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
  24325 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
        |                         ^
  In file included from /usr/include/python3.10/unicodeobject.h:1046,
                   from /usr/include/python3.10/Python.h:83,
                   from cdd.c:4:
  /usr/include/python3.10/cpython/unicodeobject.h:446:26: note: declared here
    446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
        |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
  cdd.c: In function ‘__Pyx_Coroutine_Send’:
  cdd.c:27868:19: warning: implicit declaration of function ‘_PyGen_Send’; did you mean ‘_PyGen_yf’? [-Wimplicit-function-declaration]
  27868 |             ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
        |                   ^~~~~~~~~~~
        |                   _PyGen_yf
  cdd.c:27868:17: warning: assignment to ‘PyObject *’ {aka ‘struct _object *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
  27868 |             ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
        |                 ^
  cdd.c:27873:17: warning: assignment to ‘PyObject *’ {aka ‘struct _object *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
  27873 |             ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
        |                 ^
  cdd.c: In function ‘__Pyx_Generator_Next’:
  cdd.c:27957:17: warning: assignment to ‘PyObject *’ {aka ‘struct _object *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
  27957 |             ret = _PyGen_Send((PyGenObject*)yf, NULL);
        |                 ^
  error: command '/usr/bin/gcc' failed with exit code 1
  ----------------------------------------
  ERROR: Failed building wheel for pycddlib
  Running setup.py clean for pycddlib
Failed to build pycddlib
Installing collected packages: pycddlib
    Running setup.py install for pycddlib ... error
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-5hcve4lr/pycddlib_d94d3abd5b514c3d9c0a4863b83b8526/setup.py'"'"'; __file__='"'"'/tmp/pip-install-5hcve4lr/pycddlib_d94d3abd5b514c3d9c0a4863b83b8526/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-7svbb54d/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/x/.local/include/python3.10/pycddlib
         cwd: /tmp/pip-install-5hcve4lr/pycddlib_d94d3abd5b514c3d9c0a4863b83b8526/
    Complete output (188 lines):
    /usr/lib/python3.10/site-packages/setuptools/installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
      warnings.warn(
    running install
    /usr/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
      warnings.warn(
    running build
    running build_ext
    skipping 'cdd.c' Cython extension (up-to-date)
    building 'cdd' extension
    creating build
    creating build/temp.linux-x86_64-3.10
    creating build/temp.linux-x86_64-3.10/cddlib
    creating build/temp.linux-x86_64-3.10/cddlib/lib-src
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -flto -ffat-lto-objects -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -flto -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -flto -fPIC -DGMPRATIONAL -Icddlib/lib-src -I/usr/include/python3.10 -c cdd.c -o build/temp.linux-x86_64-3.10/cdd.o
    cdd.c: In function ‘__pyx_f_3cdd_libc_stdio_tmpfile’:
    cdd.c:2425:3: warning: label ‘__pyx_L1_error’ defined but not used [-Wunused-label]
     2425 |   __pyx_L1_error:;
          |   ^~~~~~~~~~~~~~
    cdd.c:2307:7: warning: unused variable ‘__pyx_t_1’ [-Wunused-variable]
     2307 |   int __pyx_t_1;
          |       ^~~~~~~~~
    cdd.c:2304:9: warning: unused variable ‘__pyx_v_name’ [-Wunused-variable]
     2304 |   char *__pyx_v_name;
          |         ^~~~~~~~~~~~
    cdd.c: In function ‘__pyx_f_3cdd__get_set’:
    cdd.c:2768:69: warning: comparison of integer expressions of different signedness: ‘long int’ and ‘long unsigned int’ [-Wsign-compare]
     2768 |     for (__pyx_7genexpr__pyx_v_elem = 1; __pyx_7genexpr__pyx_v_elem <= __pyx_t_2; __pyx_7genexpr__pyx_v_elem++) {
          |                                                                     ^~
    cdd.c: In function ‘__pyx_f_3cdd__set_set’:
    cdd.c:2863:39: warning: comparison of integer expressions of different signedness: ‘long int’ and ‘long unsigned int’ [-Wsign-compare]
     2863 |   for (__pyx_v_elem = 1; __pyx_v_elem <= __pyx_t_1; __pyx_v_elem++) {
          |                                       ^~
    cdd.c: In function ‘__pyx_tp_dealloc_3cdd_Matrix’:
    cdd.c:20463:5: error: lvalue required as increment operand
    20463 |     ++Py_REFCNT(o);
          |     ^~
    cdd.c:20465:5: error: lvalue required as decrement operand
    20465 |     --Py_REFCNT(o);
          |     ^~
    cdd.c: In function ‘__pyx_tp_dealloc_3cdd_LinProg’:
    cdd.c:20668:5: error: lvalue required as increment operand
    20668 |     ++Py_REFCNT(o);
          |     ^~
    cdd.c:20670:5: error: lvalue required as decrement operand
    20670 |     --Py_REFCNT(o);
          |     ^~
    cdd.c: In function ‘__pyx_tp_dealloc_3cdd_Polyhedron’:
    cdd.c:20815:5: error: lvalue required as increment operand
    20815 |     ++Py_REFCNT(o);
          |     ^~
    cdd.c:20817:5: error: lvalue required as decrement operand
    20817 |     --Py_REFCNT(o);
          |     ^~
    cdd.c: In function ‘__Pyx_decode_c_bytes’:
    cdd.c:23923:9: warning: ‘PyUnicode_FromUnicode’ is deprecated [-Wdeprecated-declarations]
    23923 |         return PyUnicode_FromUnicode(NULL, 0);
          |         ^~~~~~
    In file included from /usr/include/python3.10/unicodeobject.h:1046,
                     from /usr/include/python3.10/Python.h:83,
                     from cdd.c:4:
    /usr/include/python3.10/cpython/unicodeobject.h:551:42: note: declared here
      551 | Py_DEPRECATED(3.3) PyAPI_FUNC(PyObject*) PyUnicode_FromUnicode(
          |                                          ^~~~~~~~~~~~~~~~~~~~~
    cdd.c: In function ‘__Pyx_ParseOptionalKeywords’:
    cdd.c:24309:21: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
    24309 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
          |                     ^
    In file included from /usr/include/python3.10/unicodeobject.h:1046,
                     from /usr/include/python3.10/Python.h:83,
                     from cdd.c:4:
    /usr/include/python3.10/cpython/unicodeobject.h:446:26: note: declared here
      446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
          |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
    cdd.c:24309:21: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations]
    24309 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
          |                     ^
    In file included from /usr/include/python3.10/unicodeobject.h:1046,
                     from /usr/include/python3.10/Python.h:83,
                     from cdd.c:4:
    /usr/include/python3.10/cpython/unicodeobject.h:580:45: note: declared here
      580 | Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
          |                                             ^~~~~~~~~~~~~~~~~~~
    cdd.c:24309:21: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
    24309 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
          |                     ^
    In file included from /usr/include/python3.10/unicodeobject.h:1046,
                     from /usr/include/python3.10/Python.h:83,
                     from cdd.c:4:
    /usr/include/python3.10/cpython/unicodeobject.h:446:26: note: declared here
      446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
          |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
    cdd.c:24309:21: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
    24309 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
          |                     ^
    In file included from /usr/include/python3.10/unicodeobject.h:1046,
                     from /usr/include/python3.10/Python.h:83,
                     from cdd.c:4:
    /usr/include/python3.10/cpython/unicodeobject.h:446:26: note: declared here
      446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
          |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
    cdd.c:24309:21: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations]
    24309 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
          |                     ^
    In file included from /usr/include/python3.10/unicodeobject.h:1046,
                     from /usr/include/python3.10/Python.h:83,
                     from cdd.c:4:
    /usr/include/python3.10/cpython/unicodeobject.h:580:45: note: declared here
      580 | Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
          |                                             ^~~~~~~~~~~~~~~~~~~
    cdd.c:24309:21: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
    24309 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
          |                     ^
    In file included from /usr/include/python3.10/unicodeobject.h:1046,
                     from /usr/include/python3.10/Python.h:83,
                     from cdd.c:4:
    /usr/include/python3.10/cpython/unicodeobject.h:446:26: note: declared here
      446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
          |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
    cdd.c:24325:25: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
    24325 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
          |                         ^
    In file included from /usr/include/python3.10/unicodeobject.h:1046,
                     from /usr/include/python3.10/Python.h:83,
                     from cdd.c:4:
    /usr/include/python3.10/cpython/unicodeobject.h:446:26: note: declared here
      446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
          |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
    cdd.c:24325:25: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations]
    24325 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
          |                         ^
    In file included from /usr/include/python3.10/unicodeobject.h:1046,
                     from /usr/include/python3.10/Python.h:83,
                     from cdd.c:4:
    /usr/include/python3.10/cpython/unicodeobject.h:580:45: note: declared here
      580 | Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
          |                                             ^~~~~~~~~~~~~~~~~~~
    cdd.c:24325:25: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
    24325 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
          |                         ^
    In file included from /usr/include/python3.10/unicodeobject.h:1046,
                     from /usr/include/python3.10/Python.h:83,
                     from cdd.c:4:
    /usr/include/python3.10/cpython/unicodeobject.h:446:26: note: declared here
      446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
          |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
    cdd.c:24325:25: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
    24325 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
          |                         ^
    In file included from /usr/include/python3.10/unicodeobject.h:1046,
                     from /usr/include/python3.10/Python.h:83,
                     from cdd.c:4:
    /usr/include/python3.10/cpython/unicodeobject.h:446:26: note: declared here
      446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
          |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
    cdd.c:24325:25: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations]
    24325 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
          |                         ^
    In file included from /usr/include/python3.10/unicodeobject.h:1046,
                     from /usr/include/python3.10/Python.h:83,
                     from cdd.c:4:
    /usr/include/python3.10/cpython/unicodeobject.h:580:45: note: declared here
      580 | Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
          |                                             ^~~~~~~~~~~~~~~~~~~
    cdd.c:24325:25: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
    24325 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
          |                         ^
    In file included from /usr/include/python3.10/unicodeobject.h:1046,
                     from /usr/include/python3.10/Python.h:83,
                     from cdd.c:4:
    /usr/include/python3.10/cpython/unicodeobject.h:446:26: note: declared here
      446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
          |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
    cdd.c: In function ‘__Pyx_Coroutine_Send’:
    cdd.c:27868:19: warning: implicit declaration of function ‘_PyGen_Send’; did you mean ‘_PyGen_yf’? [-Wimplicit-function-declaration]
    27868 |             ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
          |                   ^~~~~~~~~~~
          |                   _PyGen_yf
    cdd.c:27868:17: warning: assignment to ‘PyObject *’ {aka ‘struct _object *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
    27868 |             ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
          |                 ^
    cdd.c:27873:17: warning: assignment to ‘PyObject *’ {aka ‘struct _object *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
    27873 |             ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
          |                 ^
    cdd.c: In function ‘__Pyx_Generator_Next’:
    cdd.c:27957:17: warning: assignment to ‘PyObject *’ {aka ‘struct _object *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
    27957 |             ret = _PyGen_Send((PyGenObject*)yf, NULL);
          |                 ^
    error: command '/usr/bin/gcc' failed with exit code 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-5hcve4lr/pycddlib_d94d3abd5b514c3d9c0a4863b83b8526/setup.py'"'"'; __file__='"'"'/tmp/pip-install-5hcve4lr/pycddlib_d94d3abd5b514c3d9c0a4863b83b8526/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-7svbb54d/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/x/.local/include/python3.10/pycddlib Check the logs for full command output.

BTW, there is no problem to install pycddlib 2.1.2. I have indeed installed gmp in Archlinux. Even after I have installed gmpy2 with pip for Python, there is still such errors.

mcmtroffaes commented 2 years ago

Thanks for reporting and for the detailed log. This definitely looks like an issue with Cython. Can you try to install by generating the cdd.c file yourself? Removing cdd.c from the source tarball should trigger this, or alternatively building from the git source (this is slightly more tricky).

If removing cdd.c fixes it, I think I might release the source tarball without cdd.c in the future to ensure no incompatibilities occur.

Edenharder commented 2 years ago

Thank you for the suggestion. In fact, I do not know where to download the source tarball. Then I used pip to install from github. There is still the error.

pip install git+https://github.com/mcmtroffaes/pycddlib@develop
Defaulting to user installation because normal site-packages is not writeable
Collecting git+https://github.com/mcmtroffaes/pycddlib@develop
  Cloning https://github.com/mcmtroffaes/pycddlib (to revision develop) to /tmp/pip-req-build-udxawz4a
  Running command git clone -q https://github.com/mcmtroffaes/pycddlib /tmp/pip-req-build-udxawz4a
  Running command git submodule update --init --recursive -q
Building wheels for collected packages: pycddlib
  Building wheel for pycddlib (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-udxawz4a/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-udxawz4a/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-b_tx9tmv
       cwd: /tmp/pip-req-build-udxawz4a/
  Complete output (18 lines):
  /usr/lib/python3.10/site-packages/setuptools/installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
    warnings.warn(
  running bdist_wheel
  running build
  running build_ext
  cythoning cdd.pyx to cdd.c
  building 'cdd' extension
  creating build
  creating build/temp.linux-x86_64-3.10
  creating build/temp.linux-x86_64-3.10/cddlib
  creating build/temp.linux-x86_64-3.10/cddlib/lib-src
  gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -flto -ffat-lto-objects -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -flto -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -flto -fPIC -DGMPRATIONAL -Icddlib/lib-src -I/usr/include/python3.10 -c cdd.c -o build/temp.linux-x86_64-3.10/cdd.o
  In file included from cdd.c:684:
  cddlib/lib-src/cdd.h:26:10: fatal error: cdd_f.h: No such file or directory
     26 | #include "cdd_f.h"
        |          ^~~~~~~~~
  compilation terminated.
  error: command '/usr/bin/gcc' failed with exit code 1
  ----------------------------------------
  ERROR: Failed building wheel for pycddlib
  Running setup.py clean for pycddlib
Failed to build pycddlib
Installing collected packages: pycddlib
    Running setup.py install for pycddlib ... error
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-udxawz4a/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-udxawz4a/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-t8aa5nsp/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/x/.local/include/python3.10/pycddlib
         cwd: /tmp/pip-req-build-udxawz4a/
    Complete output (20 lines):
    /usr/lib/python3.10/site-packages/setuptools/installer.py:27: Seirements should be satisfied by a PEP 517 installer.
      warnings.warn(
    running install
    /usr/lib/python3.10/site-packages/setuptools/command/install.py:e build and pip and other standards-based tools.
      warnings.warn(
    running build
    running build_ext
    cythoning cdd.pyx to cdd.c
    building 'cdd' extension
    creating build
    creating build/temp.linux-x86_64-3.10
    creating build/temp.linux-x86_64-3.10/cddlib
    creating build/temp.linux-x86_64-3.10/cddlib/lib-src
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrations -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fsta86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_fcf-protection -flto -march=x86-64 -mtune=generic -O3 -pipe -fno-pltty -fstack-clash-protection -fcf-protection -flto -fPIC -DGMPRATIONAlinux-x86_64-3.10/cdd.o
    In file included from cdd.c:684:
    cddlib/lib-src/cdd.h:26:10: fatal error: cdd_f.h: No such file o
       26 | #include "cdd_f.h"
          |          ^~~~~~~~~
    compilation terminated.
    error: command '/usr/bin/gcc' failed with exit code 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python -u -cbuild-udxawz4a/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-udxaw);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec-record-t8aa5nsp/install-record.txt --single-version-externally-manaude/python3.10/pycddlib Check the logs for full command output.
mcmtroffaes commented 2 years ago

Yeah, it is a bit tricky... you can't install directly from the github link, you have to clone the project and then run a script to generate the missing files: https://github.com/mcmtroffaes/pycddlib/blob/develop/cddlib-makefile-gmp.sh I apologize for making you go through this complicated steps, but that's just how cddlib is set up. Alternatively, the tarball can be found here:

https://pypi.org/project/pycddlib/2.1.4/#files

This will include missing the generated headers. If you remove the cdd.c file, Cython will do the generation for you and I guess this will fix the problem. If not, we'll have to dig deeper...

(BTW it seems I forgot to make a source release for 2.1.5 🤦‍♂️ - I'll correct that.)

Edenharder commented 2 years ago

Removing cdd.c from the source tarball should trigger this

Thank you! It works. I can install it successfully in this way.

mcmtroffaes commented 2 years ago

Awesome! In the next week, I'll try to put together a fresh release with source tarball that doesn't include this file, so cython can do its thing.

mcmtroffaes commented 2 years ago

@anagorko @Edenharder I got this running now on github actions, which means that the current package is now much better tested against linux. Could you download the .tar.gz from the "dist" artifact from the build below, and let me know if you can install it locally straight from this tarball?

https://github.com/mcmtroffaes/pycddlib/actions/runs/2287368270 (zip can be downloaded by clicking on "dist" at the bottom of the page, you have to unzip it first to get to the tarball itself)

mcmtroffaes commented 2 years ago

I've done further testing and I'm pretty confident that this should be fixed now with the latest 2.1.6 release. Thanks again for reporting! Please do reopen if the same issue were to sustain somehow.

rhjiang commented 1 year ago

I'm getting this error or similar now, when trying to pip install pycddlib or pip install pycddlib==2.1.6


Collecting pycddlib==2.1.6
Using cached pycddlib-2.1.6.tar.gz (159 kB)
Preparing metadata (setup.py) ... done
Building wheels for collected packages: pycddlib
Building wheel for pycddlib (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [23 lines of output]
/usr/lib/python3/dist-packages/pkg_resources/init.py:116: PkgResourcesDeprecationWarning: 1.1build1 is an invalid version and will not be supported in a future release
warnings.warn(
/usr/lib/python3/dist-packages/pkg_resources/init.py:116: PkgResourcesDeprecationWarning: 0.1.43ubuntu1 is an invalid version and will not be supported in a future release
warnings.warn(
/usr/lib/python3/dist-packages/setuptools/installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
warnings.warn(
running bdist_wheel
running build
running build_ext
cythoning cdd.pyx to cdd.c
building 'cdd' extension
creating build
creating build/temp.linux-x86_64-3.10
creating build/temp.linux-x86_64-3.10/cddlib
creating build/temp.linux-x86_64-3.10/cddlib/lib-src
x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DGMPRATIONAL -Icddlib/lib-src -I/usr/include/python3.10 -c cdd.c -o build/temp.linux-x86_64-3.10/cdd.o
In file included from cddlib/lib-src/cdd.h:17,
from cdd.c:749:
cddlib/lib-src/cddmp.h:30:11: fatal error: gmp.h: No such file or directory
30 | #include "gmp.h"
| ^~~~~~~
compilation terminated.
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 pycddlib
Running setup.py clean for pycddlib
Failed to build pycddlib
Installing collected packages: pycddlib
Running setup.py install for pycddlib ... error
error: subprocess-exited-with-error

× Running setup.py install for pycddlib did not run successfully.
│ exit code: 1
╰─> [25 lines of output]
/usr/lib/python3/dist-packages/pkg_resources/init.py:116: PkgResourcesDeprecationWarning: 1.1build1 is an invalid version and will not be supported in a future release
warnings.warn(
/usr/lib/python3/dist-packages/pkg_resources/init.py:116: PkgResourcesDeprecationWarning: 0.1.43ubuntu1 is an invalid version and will not be supported in a future release
warnings.warn(
/usr/lib/python3/dist-packages/setuptools/installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
warnings.warn(
running install
/usr/lib/python3/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build
running build_ext
skipping 'cdd.c' Cython extension (up-to-date)
building 'cdd' extension
creating build
creating build/temp.linux-x86_64-3.10
creating build/temp.linux-x86_64-3.10/cddlib
creating build/temp.linux-x86_64-3.10/cddlib/lib-src
x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DGMPRATIONAL -Icddlib/lib-src -I/usr/include/python3.10 -c cdd.c -o build/temp.linux-x86_64-3.10/cdd.o
In file included from cddlib/lib-src/cdd.h:17,
from cdd.c:749:
cddlib/lib-src/cddmp.h:30:11: fatal error: gmp.h: No such file or directory
30 | #include "gmp.h"
| ^~~~~~~
compilation terminated.
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: legacy-install-failure

× Encountered error while trying to install package.
╰─> pycddlib

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.```

I'm also on Ubuntu 22.04.
mcmtroffaes commented 1 year ago

This problem is very different from the one originally posted. It seems you don't have the gmp headers installed; did you follow the instructions for ubuntu? See https://pycddlib.readthedocs.io/en/latest/quickstart.html#installation If you did that and the issue remains, please submit a fresh ticket.

rhjiang commented 1 year ago

Thanks, I did miss the GMP instructions, and apologies for the misplaced comment, I associated the issues because of the "failed building wheel" and did not know what the rest of the error meant.

mcmtroffaes commented 1 year ago

I know, it's ok. Glad it worked!