OpenKinect/libfreenect

macOS Big Sur + Python 3.9.7 - Failing to build wrappers

Obrepal opened this issue · 2 comments

running install
running build
running build_ext
building 'freenect' extension
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -I/opt/homebrew/include -I/opt/homebrew/opt/openssl@1.1/include -I/opt/homebrew/opt/sqlite/include -I/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c freenect.c -o build/temp.macosx-11-arm64-3.9/freenect.o -fPIC -I ../../include/ -I /usr/include/libusb-1.0/ -I /usr/local/include/libusb-1.0 -I /usr/local/include -I ../c_sync/ -I /opt/homebrew/lib/python3.9/site-packages/numpy/core/include
In file included from freenect.c:353:
In file included from /opt/homebrew/lib/python3.9/site-packages/numpy/core/include/numpy/arrayobject.h:4:
In file included from /opt/homebrew/lib/python3.9/site-packages/numpy/core/include/numpy/ndarrayobject.h:12:
In file included from /opt/homebrew/lib/python3.9/site-packages/numpy/core/include/numpy/ndarraytypes.h:1969:
/opt/homebrew/lib/python3.9/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: "Using deprecated NumPy
API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings]
#warning "Using deprecated NumPy API, disable it with "
^
freenect.c:8444:134: warning: code will never be executed [-Wunreachable-code]
...__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx...
^~~~~~~
freenect.c:10210:31: error: no member named 'tp_print' in 'struct _typeobject'
__pyx_type_8freenect_CtxPtr.tp_print = 0;

freenect.c:10214:31: error: no member named 'tp_print' in 'struct _typeobject'
__pyx_type_8freenect_DevPtr.tp_print = 0;
~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
freenect.c:10218:33: error: no member named 'tp_print' in 'struct _typeobject'
__pyx_type_8freenect_StatePtr.tp_print = 0;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
freenect.c:11450:22: warning: '_PyUnicode_get_wstr_length' is deprecated [-Wdeprecated-declarations]
                  (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
                   ^
/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9/cpython/unicodeobject.h:261:7: note: expanded
    from macro 'PyUnicode_GET_SIZE'
    PyUnicode_WSTR_LENGTH(op) :                    \
    ^
/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9/cpython/unicodeobject.h:451:35: note: 
    expanded from macro 'PyUnicode_WSTR_LENGTH'
#define PyUnicode_WSTR_LENGTH(op) _PyUnicode_get_wstr_length((PyObject*)op)
                                ^
/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9/cpython/unicodeobject.h:445:1: note: 
    '_PyUnicode_get_wstr_length' has been explicitly marked deprecated here
Py_DEPRECATED(3.3)
^
/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9/pyport.h:508:54: note: expanded from macro
    'Py_DEPRECATED'
#define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                   ^
freenect.c:11450:22: warning: 'PyUnicode_AsUnicode' is deprecated [-Wdeprecated-declarations]
                  (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
                   ^
/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9/cpython/unicodeobject.h:262:14: note: 
    expanded from macro 'PyUnicode_GET_SIZE'
    ((void)PyUnicode_AsUnicode(_PyObject_CAST(op)),\
           ^
/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9/cpython/unicodeobject.h:580:1: note: 
    'PyUnicode_AsUnicode' has been explicitly marked deprecated here
Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
^
/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9/pyport.h:508:54: note: expanded from macro
    'Py_DEPRECATED'
#define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                   ^
freenect.c:11450:22: warning: '_PyUnicode_get_wstr_length' is deprecated [-Wdeprecated-declarations]
                  (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
                   ^
/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9/cpython/unicodeobject.h:264:8: note: expanded
    from macro 'PyUnicode_GET_SIZE'
     PyUnicode_WSTR_LENGTH(op)))
     ^
/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9/cpython/unicodeobject.h:451:35: note: 
    expanded from macro 'PyUnicode_WSTR_LENGTH'
#define PyUnicode_WSTR_LENGTH(op) _PyUnicode_get_wstr_length((PyObject*)op)
                                ^
/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9/cpython/unicodeobject.h:445:1: note: 
    '_PyUnicode_get_wstr_length' has been explicitly marked deprecated here
Py_DEPRECATED(3.3)
^
/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9/pyport.h:508:54: note: expanded from macro
    'Py_DEPRECATED'
#define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                   ^
freenect.c:11450:52: warning: '_PyUnicode_get_wstr_length' is deprecated [-Wdeprecated-declarations]
                  (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
                                                 ^
/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9/cpython/unicodeobject.h:261:7: note: expanded
    from macro 'PyUnicode_GET_SIZE'
    PyUnicode_WSTR_LENGTH(op) :                    \
    ^
/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9/cpython/unicodeobject.h:451:35: note: 
    expanded from macro 'PyUnicode_WSTR_LENGTH'
#define PyUnicode_WSTR_LENGTH(op) _PyUnicode_get_wstr_length((PyObject*)op)
                                ^
/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9/cpython/unicodeobject.h:445:1: note: 
    '_PyUnicode_get_wstr_length' has been explicitly marked deprecated here
Py_DEPRECATED(3.3)
^
/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9/pyport.h:508:54: note: expanded from macro
    'Py_DEPRECATED'
#define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                   ^
freenect.c:11450:52: warning: 'PyUnicode_AsUnicode' is deprecated [-Wdeprecated-declarations]
                  (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
                                                 ^
/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9/cpython/unicodeobject.h:262:14: note: 
    expanded from macro 'PyUnicode_GET_SIZE'
    ((void)PyUnicode_AsUnicode(_PyObject_CAST(op)),\
           ^
/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9/cpython/unicodeobject.h:580:1: note: 
    'PyUnicode_AsUnicode' has been explicitly marked deprecated here
Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
^
/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9/pyport.h:508:54: note: expanded from macro
    'Py_DEPRECATED'
#define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                   ^
freenect.c:11450:52: warning: '_PyUnicode_get_wstr_length' is deprecated [-Wdeprecated-declarations]
                  (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
                                                 ^
/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9/cpython/unicodeobject.h:264:8: note: expanded
    from macro 'PyUnicode_GET_SIZE'
     PyUnicode_WSTR_LENGTH(op)))
     ^
/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9/cpython/unicodeobject.h:451:35: note: 
    expanded from macro 'PyUnicode_WSTR_LENGTH'
#define PyUnicode_WSTR_LENGTH(op) _PyUnicode_get_wstr_length((PyObject*)op)
                                ^
/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9/cpython/unicodeobject.h:445:1: note: 
    '_PyUnicode_get_wstr_length' has been explicitly marked deprecated here
Py_DEPRECATED(3.3)
^
/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9/pyport.h:508:54: note: expanded from macro
    'Py_DEPRECATED'
#define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                   ^
freenect.c:11466:26: warning: '_PyUnicode_get_wstr_length' is deprecated [-Wdeprecated-declarations]
                      (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                       ^
/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9/cpython/unicodeobject.h:261:7: note: expanded
    from macro 'PyUnicode_GET_SIZE'
    PyUnicode_WSTR_LENGTH(op) :                    \
    ^
/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9/cpython/unicodeobject.h:451:35: note: 
    expanded from macro 'PyUnicode_WSTR_LENGTH'
#define PyUnicode_WSTR_LENGTH(op) _PyUnicode_get_wstr_length((PyObject*)op)
                                ^
/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9/cpython/unicodeobject.h:445:1: note: 
    '_PyUnicode_get_wstr_length' has been explicitly marked deprecated here
Py_DEPRECATED(3.3)
^
/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9/pyport.h:508:54: note: expanded from macro
    'Py_DEPRECATED'
#define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                   ^
freenect.c:11466:26: warning: 'PyUnicode_AsUnicode' is deprecated [-Wdeprecated-declarations]
                      (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                       ^
/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9/cpython/unicodeobject.h:262:14: note: 
    expanded from macro 'PyUnicode_GET_SIZE'
    ((void)PyUnicode_AsUnicode(_PyObject_CAST(op)),\
           ^
/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9/cpython/unicodeobject.h:580:1: note: 
    'PyUnicode_AsUnicode' has been explicitly marked deprecated here
Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
^
/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9/pyport.h:508:54: note: expanded from macro
    'Py_DEPRECATED'
#define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                   ^
freenect.c:11466:26: warning: '_PyUnicode_get_wstr_length' is deprecated [-Wdeprecated-declarations]
                      (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                       ^
/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9/cpython/unicodeobject.h:264:8: note: expanded
    from macro 'PyUnicode_GET_SIZE'
     PyUnicode_WSTR_LENGTH(op)))
     ^
/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9/cpython/unicodeobject.h:451:35: note: 
    expanded from macro 'PyUnicode_WSTR_LENGTH'
#define PyUnicode_WSTR_LENGTH(op) _PyUnicode_get_wstr_length((PyObject*)op)
                                ^
/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9/cpython/unicodeobject.h:445:1: note: 
    '_PyUnicode_get_wstr_length' has been explicitly marked deprecated here
Py_DEPRECATED(3.3)
^
/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9/pyport.h:508:54: note: expanded from macro
    'Py_DEPRECATED'
#define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                   ^
freenect.c:11466:59: warning: '_PyUnicode_get_wstr_length' is deprecated [-Wdeprecated-declarations]
                      (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                                                        ^
/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9/cpython/unicodeobject.h:261:7: note: expanded
    from macro 'PyUnicode_GET_SIZE'
    PyUnicode_WSTR_LENGTH(op) :                    \
    ^
/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9/cpython/unicodeobject.h:451:35: note: 
    expanded from macro 'PyUnicode_WSTR_LENGTH'
#define PyUnicode_WSTR_LENGTH(op) _PyUnicode_get_wstr_length((PyObject*)op)
                                ^
/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9/cpython/unicodeobject.h:445:1: note: 
    '_PyUnicode_get_wstr_length' has been explicitly marked deprecated here
Py_DEPRECATED(3.3)
^
/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9/pyport.h:508:54: note: expanded from macro
    'Py_DEPRECATED'
#define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                   ^
freenect.c:11466:59: warning: 'PyUnicode_AsUnicode' is deprecated [-Wdeprecated-declarations]
                      (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                                                        ^
/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9/cpython/unicodeobject.h:262:14: note: 
    expanded from macro 'PyUnicode_GET_SIZE'
    ((void)PyUnicode_AsUnicode(_PyObject_CAST(op)),\
           ^
/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9/cpython/unicodeobject.h:580:1: note: 
    'PyUnicode_AsUnicode' has been explicitly marked deprecated here
Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
^
/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9/pyport.h:508:54: note: expanded from macro
    'Py_DEPRECATED'
#define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                   ^
freenect.c:11466:59: warning: '_PyUnicode_get_wstr_length' is deprecated [-Wdeprecated-declarations]
                      (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                                                        ^
/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9/cpython/unicodeobject.h:264:8: note: expanded
    from macro 'PyUnicode_GET_SIZE'
     PyUnicode_WSTR_LENGTH(op)))
     ^
/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9/cpython/unicodeobject.h:451:35: note: 
    expanded from macro 'PyUnicode_WSTR_LENGTH'
#define PyUnicode_WSTR_LENGTH(op) _PyUnicode_get_wstr_length((PyObject*)op)
                                ^
/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9/cpython/unicodeobject.h:445:1: note: 
    '_PyUnicode_get_wstr_length' has been explicitly marked deprecated here
Py_DEPRECATED(3.3)
^
/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9/pyport.h:508:54: note: expanded from macro
    'Py_DEPRECATED'
#define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                   ^
14 warnings and 3 errors generated.
error: command '/usr/bin/clang' failed with exit code 1

You need to downgrade your Python version so that the error: no member named 'tp_print' in 'struct _typeobject' becomes a warning instead. Did you ever get this to work? Struggling with the home-brew installation of libfreenect and the Python wrapper myself right now.

The existing freenect.c is outdated so it's better to generate it locally using one of these methods.

  • run python setup.py build_ext -f
  • delete wrappers/python/freenect.c (as done in 8f5ba39) and try again
  • use cmake -DBUILD_PYTHON3=ON rather than running setup.py