PETSc: Developers Site

# PETSc

# Developers Site

These pages are for people interested in using the development copy of PETSc or contributing to the PETSc libraries. This information is intended only for people who are experienced with building, using, and debugging PETSc. If you cannot use makefiles, a debugger, and EMACS etags, then please don't access these pages.

Consider joining petsc developers mailing-list.

How to:

- browse sources in the repository
- obtain the development version of PETSc
- compile the developement version
- build documentation for the development version
- submitting code for inclusion in PETSc
- check nightlybuild logs
- add a new PC type
- add a new KSP type
- add a new subclass of a matrix type (implementation inheritence)

## Browsing source:

One can browse the development repositories at the following location

- https://bitbucket.org/petsc/petsc

## 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://bitbucket.org/petsc/petsc`
- `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

- `./$PETSC_ARCH/lib/petsc/conf/reconfigure-$PETSC_ARCH.py`
- `make`

For additional help use

- git help [or]
- man git
- [developer instructions at our wiki]
- [Pro Git book]

If you absolutely cannot use git then you can access tarballs directly from 'master' branch. or access the nightly tarball snapshot

## Compiling and using the development copy of PETSc:

Use ./configure to install PETSc. If you have problems, please use the petsc developers mailing list.

## Building documentation:

The documentation tools listed below (except for pdflatex) are automatically downloaded and installed by ./configure.

- Sowing: a text processing tool developed by Bill Gropp. This produces the PETSc manual pages see sowing documentation
- C2html: A text processing package. This generates the HTML versions of all the source code.
- A version of pdflatex (for example in TeX Live): This package might already be installed on most systems. It is required to generate the users manual (part of the PETSc documentation).

Note: sowing and c2html have additional dependencies like gcc, g++, and flex and do not use compilers specified to PETSc configure. [Windows users please install the corresponding cygwin packages]

Once pdflatex (e.g., from TeX Live) is in your PATH, you can build the documentation with:

- `make alldoc LOC=${PETSC_DIR}`

## Submitting code for inclusion in PETSc:

See https://bitbucket.org/petsc/petsc/wiki/Home for how to contribute code to PETSc.

Please read the code standards chapter of the developer guide before submitting code.

Please refer to the PETSc developer wiki for detailed instructions on submitting code.

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.

## Developer guide:

The developer guide gives an overview of the design and detailed style specifications.

## Nightly builds:

The logs for the nightly builds at

- http://ftp.mcs.anl.gov/pub/petsc/nightlylogs/index.html

The coverage(what lines of source code are tested in the nightly builds) can be found at

- http:/www.mcs.anl.gov/petsc/petsc-master/index_gcov1.html

### Getting a Tarball of the git master branch of PETSc

Use the following URL:

- https://bitbucket.org/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 [arround midnight CST] with the latest changes to the development version of PETSc.