Linux Installation Instructions

Required software packages:

Installation Instructions

  1. Install Git. Git is usually installed by default on most modern operating systems. It is usually available through your package manager.

  2. Install a Fortran compiler (see bullets above), MPI, BLAS/LAPACK and HDF5 libraries (Note that petsc can be configured to download and install these libraries automatically. E.g. –download-mpich=yes or –download-openmpi=yes, –download-hdf5=yes, –download-f-blas-lapack=yes)

  3. Install PETSc

    3.1. Clone petsc and check out the supported version:

    git clone petsc
    cd petsc
    git checkout xsdk-0.2.0

    NOTE:PFLOTRAN currently uses a snapshot of PETSc ‘maint’ (release) branch. The only supported snapshot/version is specified by the changeset-id above. The supported version will change periodically as we need bug fixes or new features and changes will be announced on the mailing lists. The supported version of petsc is used on the buildbot automated testing system.

    3.2. Configure PETSc (see PETSc installation instructions).

    ./configure --with-mpi-dir=<dir> --with-hdf5-dir=<dir> --with-blas-lapack-dir=<dir>


    ./configure --download-mpich=yes --download-hdf5=yes --download-fblaslapack=yes

    or (to add unstructured grid capability)

    ./configure --download-mpich=yes --download-hdf5=yes --download-fblaslapack=yes --download-metis=yes --download-parmetis=yes

    or (for most users, compile an optimized executable with full capability)

    ./configure --CFLAGS='-O3' --CXXFLAGS='-O3' --FFLAGS='-O3' --with-debugging=no --download-mpich=yes --download-hdf5=yes --download-fblaslapack=yes --download-metis=yes --download-parmetis=yes
    3.3. Set the PETSC_DIR and PETSC_ARCH environment variables based on the PETSc installation location (PETSC_DIR) and architecture (PETSC_ARCH: hardware, compilers, etc.). See PETSc environment variables.

    The environmental variables can be set in your ~/.bashrc file by adding the following two lines somewhere in the file:

    export PETSC_DIR=/home/username/path_to_top_level_petsc
    export PETSC_ARCH=gnu-c-debug

    Note: You can check what your PETSC_ARCH actually is (the above is just an example) by opening up the directory where PETSc is installed and looking in the configure.log file for --PETSC_ARCH=. After you update your .bashrc file, either close the terminal and open a new one, or type source ./.bashrc for the changes to take effect.

    3.4. Compile PETSc

    cd $PETSC_DIR
    make all

    or even better follow the ‘make’ instructions printed at the end of configuration. E.g.

      Configure stage complete. Now build PETSc libraries with:
      make PETSC_DIR=/proj/geo002/petsc PETSC_ARCH=cray-xt4-pgi all
  4. Download (clone) PFLOTRAN off Bitbucket.

git clone
  1. Compile PFLOTRAN (ensure that PETSC_DIR and PETSC_ARCH environment variables are properly defined, or PFLOTRAN will not compile)
cd pflotran/src/pflotran
make pflotran