Potential of a PyPi package

Is there a reason to not support pip? I understand Python packaging has been a complete disaster for many years, but recently things seem to be getting better, complex scientific libs have working pypi packages, uv is very popular, and I am seeing conda and similar tools recommended less and less.

I am currently using Fenics as part of a complex python pipeline that uses a lot of other packages, and it would be very convenient to be able to install it all the same way I install everything else. It would also make things a lot easier for new users.

To be fully pip installable, we would have to ship our own MPI binaries. Currently @jackhale has tested building wheels (without PETSC) at: Build wheels · FEniCS/dolfinx@3fd0bb7 · GitHub
which is a step in the right direction. Following this, he and @Chris_Richardson just made
a superlu_dist interface that would be a parallel solver bundled with this. See: SuperLU_DIST solver interface by jhale · Pull Request #4054 · FEniCS/dolfinx · GitHub

I was starting to look into this as well since conda forge is a bit inconvenient for my use case. Relatively naive question, but could you not use the openmpi or mpich wheels published in PyPi?

We already have a prototype of Linux binary wheels leveraging the MPICH 4 ABI which can link at runtime against either the impi-rt mpich wheels.

On release of DOLFINx 0.11 we will try for a beta binary wheel on Linux, uploaded to a custom FEniCS pypi repository, rather than the main pypi.org.

We will then attempt wheels for both Linux and macOS using MPI ABI 5 for DOLFINx 0.12, potentially uploaded to the main pypi.org.

PETSc and petsc4py support remain an open issue, because we cannot package wheels for those ourselves - at the moment we are building without them.

If you fork DOLFINx you are welcome to try executing the action which produces the wheels as a build artifact. I’m not willing to distribute them at the moment, early days.

Awesome, thanks @jackhale I’ll give it a go when I get some free time. As for the PETSc, I haven’t looked how they ship their PyPi wheels, but is there a reason why the registry-uploaded ones are not suitable?

I have similiar problems:D what is working well for me is using spack to install fenicsx and pip in the same env. After the “hard“ installations, i can use the pip inside the env to install addtional pip packages:D

spack add py-pip

spack add py-fenics-dolfinx+petsc4py+slepc4py cflags="-O3" fflags="-O3"

spack concretize -f

spack install

#With active env
pip list
pip install