Ok, there are a handful of systemic problems on your system. You’ve got inconsistent python versions (apparently you did that deliberately using update-alternatives). You’ve got a bizarre PETSc installation in /u/sw/toolchains/gcc-glibc/
I have no idea what that path means or where it comes from, except that it’s almost certainly going to interfere with getting dolfin running from ubuntu packages.
Your ubuntu is 22.04 jammy, which should itself be stable. It provides
python 3.10
dolfin 2019.2.0~git20210928.3eacdb4-3build1
petsc 3.15.5+dfsg1-1build2
The debian (and ubuntu) package system is a self-consistent system designed to ensure package dependencies are met so that programs can run successfully. If you start introducing external versions of packages, you can’t guarantee that interdependency is met, and programs will start to fail. Which is what has happened.
In particular python packages (such as dolfin) that provide python extensions written in C get built for a specific version of python and will fail on a python version that they were not built for. dolfin has other dependencies, PETSc among them, and will fail if the library versions it needs are not available.
Because of the strong dependency of the dolfin build on the python and petsc version, the dependency chain is managed by installing the dolfin python components in the tree of the PETSc installation, that is under the PETSC_DIR that dolfin is built for. dolfin.pth in the standard python installation path uses PETSC_DIR as a hint to find the dolfin module. So if you have PETSC_DIR pointing at some other random petsc installation (such as /u/sw/toolchains/gcc-glibc/
) for which dolfin was not built, python won’t know where the dolfin module is.
Your creation of /bin/python3 is a problem. Why did you do that? python3 is normally located at /usr/bin/python3
. You have two versions of python, 3.9 and 3.10. But Ubuntu 22.04 jammy provides python 3.10. Where does your python3.9 come from? (what does which python3
return?) Are you certain you completed the installation? (sudo apt update; sudo apt dist-upgrade
. Keep repeating as many times as needed until it says there are no packages to update)
Having PETSC_DIR=/u/sw/toolchains/gcc-glibc/11.2.0/pkgs/petsc/3.15.1
is a problem, as discussed above. The dolfin package for ubuntu is not built against such a PETSc installation.
Your package list says dolfin and ffc not installed but this is probably interference from your local directory. Use quote marks in the command, or run dpkg -l
in an empty directory. Check your python installation at the same time:
$ dpkg -l python3 python3-minimal python3-dev libpython3-dev "python3.*-minimal" "*dolfin*" "*ffc*" "*ufl*" "*dijitso*" "*petsc*" | cat