1# unzip in the target directory, e.g., $HOME/opt/
2cd ~/opt/
3wget https://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-3.18.2.tar.gz
4tar -xvf petsc-3.18.2.tar.gz
5
6# 安装路径为当前路径
7cd petsc-3.18.2
8
9./configure --PETSC_ARCH=real-opt --with-mpi-dir=${MPI_HOME} \
10--with-scalar-type=real --with-debugging=0 \
11--download-metis=yes --download-parmetis=yes \
12--download-superlu_dist=yes --download-fblaslapack=yes \
13--with-shared-libraries=yes --with-fortran-bindings=1 --with-cxx-dialect=C++11
14
15make PETSC_DIR=$HOME/opt/petsc-3.18.2 PETSC_ARCH=real-opt all
16
17# Check if the libraries are working
18make PETSC_DIR=$HOME/opt/petsc-3.18.2 PETSC_ARCH=real-opt check