Rate This Document
Findability
Accuracy
Completeness
Readability

Installing PETSc

Procedure

  1. Use PuTTY to log in to the server as the root user.
  2. Upload the METIS, ParMETIS, f2cblaslapack, and SUNDIALS installation packages to the /path/to/PETSC directory.
  3. Decompress the PETSc installation package.
    cd /path/to/PETSC
    tar -xvf petsc-lite-3.6.2.tar.gz
  4. Go to the directory generated after the decompression.
    cd petsc-3.6.2
  5. Load environment variables.
    export CC=`which gcc`
    export CXX=`which g++`
    export FC=`which gfortran`
  6. Perform the configuration.
    ./configure --with-make-np=4 --with-fc=0 --with-x=false --with-ssl=false --download-f2cblaslapack=/path/to/PETSC/f2cblaslapack-3.4.2.q1.tar.gz --download-parmetis=/path/to/PETSC/parmetis-4.0.3-p2.tar.gz --download-sundials=/path/to/PETSC/sundials-2.5.0p1.tar.gz --with-shared-libraries --with-mpi-dir=$MPI_DIR --download-metis=/path/to/PETSC/metis-5.1.0-p1.tar.gz --download-hdf5=/path/to/PETSC/hdf5-1.8.16.tar.bz2
    • In the previous command, the --download parameter indicates that all the other software will be also installed.
    • The --download parameter can be in a format similar to --download-hdf5=1 or a format with a specified path. In the former format, the software will be downloaded and installed from the Internet; in the latter format, the software will be installed from the specified path.
    • If the problem described in Troubleshooting is reported when you perform step 6, refer to the solution described in Problem 1: An Error Is Reported During PETSc Configuration. After the fault is rectified, perform step 6 again.
  7. Perform the installation.
    make
  8. Set the environment variables.
    export PETSC_DIR=/path/to/PETSC/petsc-3.6.2
    export PETSC_ARCH=linux-gnu
    export SUNDIALS_ROOT=$PETSC_DIR/$PETSC_ARCH
    export HDF5_ROOT=$PETSC_DIR/$PETSC_ARCH