Docs:   Installation: Package Installation

If using configure to build PETSc, check 'configure --help' for options to specify external packages. If using the default mode of building PETSc libraries then use the following instructions:

Installing Optional Package after PETSc

We recommend installing all optional packages before installing PETSc but if PETSc is already installed you can still add optional packages.