Dolfinx with debug build of PETSc

Hello,

I’m using dolfinx (installed with conda) from python and I’d like to have debug messages from PETSc (instead of the traditional SIGSEGV message when anything goes wrong).

I have a local build of petsc and petsc4py with a custom config (debug and no MPI). Is it safe to simply override the PYTHONPATH to point to the local build? I’m affraid by doing so that the local build would conflict with the version that dolfinx was linked against when compiled.
Or do I have to recompile dolfinx with the custom petsc?
Or maybe there is a debug docker image? (I haven’t been able to find one).

I’m asking because I tried my PYTHONPATH hack and I’m getting weird petsc logging errors (I can share those if needed if that solution is supposed to work).

Thanks

The images Docker
have petsc in debug mode.
You only need to build

  • Basix
  • ufl
  • ffcx
  • dolfinx
    in them.
1 Like

For information, there is a debug build of PETSc available in debian/ubuntu packages. You would have to rebuild dependent packages (pets4py, slepc, dolfinx etc), but you might find that relatively easy to do using the existing source for the standard builds (along the lines of apt-get source fenics-dolfinx, hacking the petsc references in the debian subdir to use petsc debug, then dpkg-buildpackage)

Thanks I am now using the test docker images and it’s working fine!