[petsc-dev] PETSc-3.16.3 and Python-3.11

Lisandro Dalcin dalcinl at gmail.com
Sun Jan 16 09:30:14 CST 2022


Dear Antonio,

It is hard for us to do that, sorry. The problem is not petsc4py itself,
but Cython-generated code.

The first thing you need is to install in-development Cython (as long as it
already supports Py 3.11, I have not checked).
Then you can use petsc4py from a git checkout, although that may be a bit
inconvenient to implement in your build script.
Alternatively, you can keep using the latest release tarball, but then in
your build script run `rm src/petsc4py.PETSc.c`, that will force Cython to
run again.
Another way to force C sources regeneration could be `python setup.py
build_src --force`.

I hope that helps,

On Sat, 15 Jan 2022 at 12:03, Antonio T. sagitter <
sagitter at fedoraproject.org> wrote:

> Hi all.
>
> Please, can you adapt petsc4py-3.16.3 to Python-3.11?
> We have a special development branch where we move up the use of
> Python-3.11 (Python-3.11 is expected for Fedora 37).
>
> In file included from src/PETSc.c:4:
> src/petsc4py.PETSc.c:318:11: error: too few arguments to function
> ‘PyCode_New’
>    318 |           PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell,
> fn, name, fline, lnos)
>        |           ^~~~~~~~~~
> src/petsc4py.PETSc.c:341687:34: note: in expansion of macro
> ‘__Pyx_PyCode_New’
> 341687 |   __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(0, 0, 3, 0,
> CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes,
> __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22,
> __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_PETSc_Log_pyx,
> __pyx_n_s_wrapped_func, 110, __pyx_empty_bytes); if
> (unlikely(!__pyx_codeobj__23)) __PYX_ERR(28, 110, __pyx_L1_error)
>         |                                  ^~~~~~~~~~~~~~~~
>
> Red Hat Bugzilla's bug:
> https://bugzilla.redhat.com/show_bug.cgi?id=2039365#c3
>
> --
> ---
> Antonio Trande
> Fedora Project
> mailto: sagitter at fedoraproject.org
> GPG key: 0xCC1CFEF30920C8AE
> GPG key server: https://keyserver1.pgp.com/
>


-- 
Lisandro Dalcin
============
Senior Research Scientist
Extreme Computing Research Center (ECRC)
King Abdullah University of Science and Technology (KAUST)
http://ecrc.kaust.edu.sa/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20220116/06d3e6ad/attachment.html>


More information about the petsc-dev mailing list