Contributing to PETSc#
As you gain experience in building, using, and debugging with PETSc, you will be able to contribute!
By submitting code, the contributor gives irretrievable consent to the redistribution and/or modification of the contributed source code as described in the PETSc open source license.
Some of the source code is documented to provide direct examples/templates for common contributions, adding new implementations for solver components:
Setting up Git#
We provide some information on common operations here; for more details, see
man git, or the Git book.
Install Git if it is not already installed on your machine, then obtain PETSc with the following:
Set up your Git environment to establish your identity.
To stay oriented when working with branches, we encourage configuring git-prompt.
To get tab-completion for Git commands, one can download and then source git-completion.bash.
Obtaining the development version of PETSc#
If you have write access to the PETSc GitLab repository, use
git clone firstname.lastname@example.org/petsc/petsc(or use a clone you already have).
Otherwise, Create a fork (your own copy of the PETSc repository).
You will be asked to “Select a namespace to fork the project”; click the green “Select” button.
If you already have a clone on your machine of the PETSc repository you would like to reuse
$ git remote set-url origin email@example.com:YOURGITLABUSERNAME/petsc.git
$ git clone firstname.lastname@example.org:YOURGITLABUSERNAME/petsc.git
PETSc can now be configured as specified on the Installation page
To update your copy of PETSc
$ git pull
Once updated, you will usually want to rebuild it completely
$ make reconfigure all
This is equivalent to
$ $PETSC_DIR/$PETSC_ARCH/lib/petsc/conf/reconfigure-$PETSC_ARCH.py && make all