PETSc

 

Developers Site


 

 These pages are for people interested in using the development copy of PETSc (called petsc-dev) or contributing to the PETSc libraries. It 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-dev mailing-list.

How to:


Browsing Source:

One can browse the development repositories at the following location

Obtaining the development version of PETSc:

You have three options
  1.  download and install mercurial (recommended)
  2.  access tarballs directly from our mercurial server.
  3.  access the nightly tarball snapshot at http://ftp.mcs.anl.gov/pub/petsc/petsc-dev.tar.gz
1) To use mercurial - first install the software
  • Linux 
    • Debian and Ubuntu
        apt-get install mercurial
    • Fedora
        yum install mercurial
    • Gentoo
        emerge mercurial
    • SuSE
      <unknown>
  • MacOS: Prebuilt binaries are available. For eg: Mercurial 0.9.5 for OS X 10.5
  • Windows: Prebuilt binaries are available. For ex: mercurial-0.9.5.exe
  • From source - on Linux this requires that python be built with zlib and include the python C include files. You may need to ask your sysadmin to install python-devel, zlib-devel [or equivalnet] packages before building Mercurial.
  Once Mercurial is installed obtain petsc-dev with the following:
  • hg clone http://petsc.cs.iit.edu/petsc/petsc-dev
  • cd petsc-dev/config
  • hg clone http://petsc.cs.iit.edu/petsc/BuildSystem BuildSystem
To update your copy of petsc-dev
  • cd petsc-dev
  • hg pull -u
  • cd config/BuildSystem
  • hg pull -u
Once updated, you will usually want to rebuild completely
  • cd petsc-dev
  • ./$PETSC_ARCH/conf/reconfigure-$PETSC_ARCH.py
  • make allfortranstubs
  • make
The Mercurial download always has the latest version of petsc-dev.

For additional help use
  • hg help  [or]
  • man hg

2) One can obtain the current petsc-dev and BuildSystem repositories as tarballs from the mercurial server using the following URLs.
http://petsc.cs.iit.edu/petsc/petsc-dev/archive/tip.tar.gz
http://petsc.cs.iit.edu/petsc/BuildSystem/archive/tip.tar.gz

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

Note2: If using firefox  to download - the tarballs will get the names petsc-dev-changesetid.tar.gz and BuildSystem-changesetid.tar.gz. However, if wget is used - both tarballs will get the name 'tip.tar.gz'. In this case rename the tarballs [to avoid the name conflict].

After both the tarballs are obtained - do the following:
  • gunzip -c petsc-dev-changestid.tar.gz | tar xf  -
  • mv petsc-dev-changesetid petsc-dev
  • cd petsc-dev/config
  • gunzip -c BuildSystem-changesetid.tar.gz | tar xf -
  • mv BuildSystem-changesetid BuildSystem
To update this copy of petsc-dev, re-download the above two tarballs . Each time the repository gets new changesets, the above url will give the tarballs  including the new changes.

3) The nightly tarball will be equivalent to the release tarball - with all the doumentation built. To use the nightly tarball snapshot, simply download http://ftp.mcs.anl.gov/pub/petsc/petsc-dev.tar.gz and extract it.
  • gunzip -c petsc-dev.tar.gz | tar xf  -
To update your copy of petsc-dev 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 petsc-dev

Compiling and using the development copy (petsc-dev):

Use config/configure.py to install PETSc, (trouble, please contact us petsc-maint@mcs.anl.gov). And subscribe to petsc mailing lists.


Building documentation:

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

  • Sowing:  A text processing tools developed by Bill Gropp

  • C2html: A text processing package required to generate the PETSc documentation.

  • A version of pdflatex (for example in teTeX):This package might already be installed on most systems. It is required to generate the users manual (part of the PETSc documentation)

   Once pdflatex (from teTeX) is in your PATH you can build the documentation with:

  • make alldoc LOC=${PETSC_DIR}

Sending patches to update the master copy of petsc-dev:

One can send us changes to PETSc [perhaps bug fixes or new feature additions] via e-mail. One easy way to do this [if no new files get created] is:

  • [get the latest version of petsc-dev using mercurial as descrbed above]
  • [make edits]
  • hg diff > patchfile
  • [email patchfile to petsc-maint@mcs.anl.gov]
To undo the changes, one can do 'hg revert' so that subsequent 'hg pull' or 'make pull' will continue to work.

Alternatively - one can send us patches using 'hg bundle' as described at http://www.selenic.com/mercurial/wiki/index.cgi/CommunicatingChanges

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

Nightly builds:

The logs for the nightly builds at
http://ftp.mcs.anl.gov/pub/petsc/nightlylogs

PETSc developers can automatically log into any PETSc test directory with ${PETSC_DIR}/bin/maint/petscgoto  arch-of-test-system

The coverage (what lines of source code are tested in the nightly builds) can be found at http:/www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-dev/index_gcov1.html