FEniCS / dolfinx

Next generation FEniCS problem solving environment
https://fenicsproject.org
GNU Lesser General Public License v3.0
779 stars 181 forks source link

Cython generated headers broken for petsc4py #2619

Closed jhale closed 1 year ago

jhale commented 1 year ago

How to reproduce the bug

See https://gitlab.com/petsc/petsc/-/issues/1359

Minimal Example (Python)

Build DOLFINx Python interface with petsc4py built using Cython 0.29.34

Output (Python)

No response

Version

main branch

DOLFINx git commit

No response

Installation

Possible to reproduce on MacOS and Ubuntu.

Additional information

No response

jhale commented 1 year ago

PETSc and petsc4py can be built on commit ffdfd6a (~3.18.5) as a temporary workaround.

jhale commented 1 year ago

The previous comment is incorrect.

Building petsc4py with Cython 0.36.34 (latest) produces headers that are incompatible with the mpi4py headers that are pre-built on pypa with Cython 0.36.33 or 0.36.34.

In short, users must build petsc4py using Cython 0.36.32 or 0.36.33 if they are using mpi4py from pypi.org which contains pre-generated headers with Cython 0.36.33.

An alternative is to build mpi4py and petsc4py from source using a consistent Cython version.

jhale commented 1 year ago

As pointed out by @garth-wells still having issues with this downgrade fix on Mac: https://github.com/FEniCS/dolfinx/actions/runs/4891338240/jobs/8731728473

garth-wells commented 1 year ago

'Fixed' now for macOS CI. Complicated interaction between distutils, petsc4py build system, and Github macOS image led to strange behaviour.

Closing issue because there is nothing to do from our side.