petsc4py fails to build with Python 3.10: Py_SIZE= needs to be replaced with Py_SET_SIZE
Hi all.
Please, can you prepare Petsc4py for Python-3.10?
src/petsc4py.PETSc.c:2604:23: error: lvalue required as left operand of assignment
2604 | Py_SIZE(list) = len+1;
| ^
src/petsc4py.PETSc.c: In function ‘__Pyx_ListComp_Append’:
src/petsc4py.PETSc.c:2921:23: error: lvalue required as left operand of assignment
2921 | Py_SIZE(list) = len+1;
| ^
In file included from src/PETSc.c:4:
src/petsc4py.PETSc.c: In function ‘__pyx_tp_dealloc_8petsc4py_5PETSc_Comm’:
src/petsc4py.PETSc.c:302802:5: error: lvalue required as increment operand
302802 | ++Py_REFCNT(o);
| ^~
src/petsc4py.PETSc.c:302804:5: error: lvalue required as decrement operand
302804 | --Py_REFCNT(o);
| ^~
src/petsc4py.PETSc.c: In function ‘__pyx_tp_dealloc_8petsc4py_5PETSc_Object’:
src/petsc4py.PETSc.c:303020:5: error: lvalue required as increment operand
303020 | ++Py_REFCNT(o);
| ^~
src/petsc4py.PETSc.c:303022:5: error: lvalue required as decrement operand
303022 | --Py_REFCNT(o);
| ^~
src/petsc4py.PETSc.c: In function ‘__pyx_tp_dealloc_8petsc4py_5PETSc_SF’:
src/petsc4py.PETSc.c:303908:5: error: lvalue required as increment operand
303908 | ++Py_REFCNT(o);
| ^~
src/petsc4py.PETSc.c:303910:5: error: lvalue required as decrement operand
303910 | --Py_REFCNT(o);
| ^~
src/petsc4py.PETSc.c: In function ‘__pyx_tp_dealloc_8petsc4py_5PETSc_Section’:
src/petsc4py.PETSc.c:304750:5: error: lvalue required as increment operand
304750 | ++Py_REFCNT(o);
| ^~
src/petsc4py.PETSc.c:304752:5: error: lvalue required as decrement operand
304752 | --Py_REFCNT(o);
| ^~
src/petsc4py.PETSc.c: In function ‘__pyx_tp_dealloc_8petsc4py_5PETSc__IS_buffer’:
src/petsc4py.PETSc.c:307767:5: error: lvalue required as increment operand
307767 | ++Py_REFCNT(o);
| ^~
src/petsc4py.PETSc.c:307769:5: error: lvalue required as decrement operand
307769 | --Py_REFCNT(o);
| ^~
src/petsc4py.PETSc.c: In function ‘__pyx_tp_dealloc_8petsc4py_5PETSc__Vec_buffer’:
src/petsc4py.PETSc.c:307904:5: error: lvalue required as increment operand
307904 | ++Py_REFCNT(o);
| ^~
src/petsc4py.PETSc.c:307906:5: error: lvalue required as decrement operand
307906 | --Py_REFCNT(o);
| ^~
src/petsc4py.PETSc.c: In function ‘__pyx_tp_dealloc_8petsc4py_5PETSc__DMComposite_access’:
src/petsc4py.PETSc.c:308561:5: error: lvalue required as increment operand
308561 | ++Py_REFCNT(o);
| ^~
src/petsc4py.PETSc.c:308563:5: error: lvalue required as decrement operand
308563 | --Py_REFCNT(o);
| ^~
src/petsc4py.PETSc.c: In function ‘__pyx_tp_dealloc_8petsc4py_5PETSc_Options’:
src/petsc4py.PETSc.c:308702:5: error: lvalue required as increment operand
308702 | ++Py_REFCNT(o);
| ^~
src/petsc4py.PETSc.c:308704:5: error: lvalue required as decrement operand
308704 | --Py_REFCNT(o);
| ^~
src/petsc4py.PETSc.c: In function ‘__pyx_tp_dealloc_array’:
src/petsc4py.PETSc.c:310700:5: error: lvalue required as increment operand
310700 | ++Py_REFCNT(o);
| ^~
src/petsc4py.PETSc.c:310702:5: error: lvalue required as decrement operand
310702 | --Py_REFCNT(o);
| ^~
src/petsc4py.PETSc.c: In function ‘__pyx_tp_dealloc_memoryview’:
src/petsc4py.PETSc.c:311011:5: error: lvalue required as increment operand
311011 | ++Py_REFCNT(o);
| ^~
src/petsc4py.PETSc.c:311013:5: error: lvalue required as decrement operand
311013 | --Py_REFCNT(o);
| ^~
src/petsc4py.PETSc.c: In function ‘__pyx_tp_dealloc__memoryviewslice’:
src/petsc4py.PETSc.c:311261:5: error: lvalue required as increment operand
311261 | ++Py_REFCNT(o);
| ^~
src/petsc4py.PETSc.c:311263:5: error: lvalue required as decrement operand
311263 | --Py_REFCNT(o);
| ^~
src/petsc4py.PETSc.c: In function ‘__Pyx_decode_c_bytes’:
src/petsc4py.PETSc.c:329649:9: warning: ‘PyUnicode_FromUnicode’ is deprecated [-Wdeprecated-declarations]
329649 | return PyUnicode_FromUnicode(NULL, 0);
| ^~~~~~
In file included from /usr/include/python3.10/unicodeobject.h:1046,
from /usr/include/python3.10/Python.h:97,
from src/petsc4py.PETSc.c:4,
from src/PETSc.c:4:
/usr/include/python3.10/cpython/unicodeobject.h:551:42: note: declared here
551 | Py_DEPRECATED(3.3) PyAPI_FUNC(PyObject*) PyUnicode_FromUnicode(
| ^~~~~~~~~~~~~~~~~~~~~
In file included from src/PETSc.c:4:
src/petsc4py.PETSc.c: In function ‘__Pyx__PyList_PopIndex’:
src/petsc4py.PETSc.c:330605:24: error: lvalue required as left operand of assignment
330605 | Py_SIZE(L) -= 1;
| ^~
src/petsc4py.PETSc.c: In function ‘__Pyx_ParseOptionalKeywords’:
src/petsc4py.PETSc.c:331043:21: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
331043 | (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:97,
from src/petsc4py.PETSc.c:4,
from src/PETSc.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) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from src/PETSc.c:4:
src/petsc4py.PETSc.c:331043:21: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations]
331043 | (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:97,
from src/petsc4py.PETSc.c:4,
from src/PETSc.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(
| ^~~~~~~~~~~~~~~~~~~
In file included from src/PETSc.c:4:
src/petsc4py.PETSc.c:331043:21: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
331043 | (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:97,
from src/petsc4py.PETSc.c:4,
from src/PETSc.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) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from src/PETSc.c:4:
src/petsc4py.PETSc.c:331043:21: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
331043 | (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:97,
from src/petsc4py.PETSc.c:4,
from src/PETSc.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) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from src/PETSc.c:4:
src/petsc4py.PETSc.c:331043:21: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations]
331043 | (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:97,
from src/petsc4py.PETSc.c:4,
from src/PETSc.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(
| ^~~~~~~~~~~~~~~~~~~
In file included from src/PETSc.c:4:
src/petsc4py.PETSc.c:331043:21: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
331043 | (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:97,
from src/petsc4py.PETSc.c:4,
from src/PETSc.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) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from src/PETSc.c:4:
src/petsc4py.PETSc.c:331059:25: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
331059 | (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:97,
from src/petsc4py.PETSc.c:4,
from src/PETSc.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) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from src/PETSc.c:4:
src/petsc4py.PETSc.c:331059:25: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations]
331059 | (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:97,
from src/petsc4py.PETSc.c:4,
from src/PETSc.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(
| ^~~~~~~~~~~~~~~~~~~
In file included from src/PETSc.c:4:
src/petsc4py.PETSc.c:331059:25: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
331059 | (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:97,
from src/petsc4py.PETSc.c:4,
from src/PETSc.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) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from src/PETSc.c:4:
src/petsc4py.PETSc.c:331059:25: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
331059 | (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:97,
from src/petsc4py.PETSc.c:4,
from src/PETSc.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) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from src/PETSc.c:4:
src/petsc4py.PETSc.c:331059:25: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations]
331059 | (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:97,
from src/petsc4py.PETSc.c:4,
from src/PETSc.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(
| ^~~~~~~~~~~~~~~~~~~
In file included from src/PETSc.c:4:
src/petsc4py.PETSc.c:331059:25: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
331059 | (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:97,
from src/petsc4py.PETSc.c:4,
from src/PETSc.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) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from src/PETSc.c:4:
src/petsc4py.PETSc.c: In function ‘__Pyx_PyList_Pop’:
src/petsc4py.PETSc.c:331906:20: error: lvalue required as left operand of assignment
331906 | Py_SIZE(L) -= 1;
| ^~
src/petsc4py.PETSc.c: In function ‘__Pyx_decode_c_string’:
src/petsc4py.PETSc.c:332131:9: warning: ‘PyUnicode_FromUnicode’ is deprecated [-Wdeprecated-declarations]
332131 | return PyUnicode_FromUnicode(NULL, 0);
| ^~~~~~
In file included from /usr/include/python3.10/unicodeobject.h:1046,
from /usr/include/python3.10/Python.h:97,
from src/petsc4py.PETSc.c:4,
from src/PETSc.c:4:
/usr/include/python3.10/cpython/unicodeobject.h:551:42: note: declared here
551 | Py_DEPRECATED(3.3) PyAPI_FUNC(PyObject*) PyUnicode_FromUnicode(
|