Contributing to PETSc

As you gain experience in building, using, and debugging with PETSc, you may become able to contribute!

Before contributing code to PETSc, please read the PETSc Style and Usage Guide. You may also be interested to read about The Design of PETSc.

See PETSc Integration Workflows for information on how to submit patches and pull requests to PETSc.

Once you have gained experience with developing PETSc source code, you can become an active member of our development and push changes directly to the petsc repository. Send mail to petsc-maint@mcs.anl.gov to arrange it.

How-tos

Some of the source code is documented to provide direct examples/templates for common contributions, adding new implementations for solver components:

Browsing Source

One can browse the development repositories at the following location

Obtaining the development version of PETSc

Install Git if it is not already installed on your machine, then obtain PETSc with the following:

git clone https://gitlab.com/petsc/petsc.git
cd petsc

PETSc can now be configured in the usual way, specified on the Installation page

To update your copy of PETSc

git pull

Once updated, you will usually want to rebuild completely

make reconfigure all

This is a shorthand version of

./$PETSC_ARCH/lib/petsc/conf/reconfigure-$PETSC_ARCH.py && make all

For additional help use

If you absolutely cannot use git then you can access tarballs directly, as in Other ways to obtain PETSc.

Other ways to obtain PETSc

Getting a Tarball of the git master branch of PETSc

Use the following URL: https://gitlab.com/petsc/petsc/get/master.tar.gz

This mode is useful if you are on a machine where you cannot install Git or if it has a firewall blocking http downloads.

After the tarballs is obtained - do the following:

tar zxf petsc-petsc-CHANGESET.tar.gz
mv petsc-petsc-CHANGESET petsc

To update this copy of petsc, re-download the above tarball. The URL above gets the latest changes immediately when they are pushed to the repository.

Getting the Nightly tarball of the git master branch of PETSc

The nightly tarball will be equivalent to the release tarball - with all the documentation built. Use the following URL:

http://ftp.mcs.anl.gov/pub/petsc/petsc-master.tar.gz

To update your copy of petsc simply get a new copy of the tar file. The tar file at the ftp site is updated once each night [around midnight Chicago time] with the latest changes to the development version of PETSc.