petsc 2.3.3 & 3.12.3 安装

安装依赖库 hypre-2.4

只有 petsc-2.3.3 需要

    #下载安装hypre-2.4.0b.tar.gz
    $ tar zxvf hypre-2.4.0b.tar.gz 
    $ cd hypre-2.4.0b/src
    $ export CC=mpiicc
    $ export CXX=mpiicxx
    $ export F77=mpiifort
    $ ./configure
    $ make install

安装 petsc-2.3.3

    # 参考网址 https://www.mcs.anl.gov/petsc/petsc-2.3.3/docs/installation.html
    # 下载安装 petsc-2.3.3.tar.gz
    $ tar zxvf petsc-2.3.3.tar.gz
    $ cd petsc-2.3.3-p16
    $ export PETSC_DIR=$PWD
    $ ./config/configure.py PETSC_ARCH=linux-gnu-intel --prefix=你想安装的文件夹 --with-cc=mpiicc --with-cxx=mpiicxx --with-fc=mpiifort --with-blas-lapack-lib="-L/usr/sw-cluster/intel/composer_xe_2013_sp1.4.211/mkl/lib/intel64 -lmkl_blas95_lp64 -lmkl_lapack95_lp64 -L/usr/sw-cluster/intel/composer_xe_2013_sp1.4.211/mkl/lib/intel64 -lmkl_intel_lp64 -lmkl_core -lmkl_sequential -lpthread -lm " --with-shared=0 --with-hypre=1 --with-hypre-dir=刚才hypre的安装路径
    $ make
    $ make install 

安装 petsc-3.12.3

    $ cd petsc-3.12.3 
	# 可以选择使用 intelmpi + mkl ,也可以使用 mpich + lapack、blas 
    $ ./configure --prefix=/path/you/want --with-mpi-dir=/path/to/mpi -with-blaslapack-dir=/path/to/libblas.a&liblapack.a/or/$MKLROOT
    $ make all
    $ make install 

运行 2.3.3 测试



    $ cd src/snes/examples/tutorials/
    # 修改makefile
    # 替换所有的 ${MPIEXEC} 为 bsub -I -q q_x86_expr
    # 替换所有的 refine_always > 为 refine_always
    # 回到petsc-2.3.3-p16目录下
    $ export PETSC_DIR=你刚才的安装目录
    $ make testexamples
    $ make testfortran
    $ make testexamples_uni
    $ make testfortran_uni
    

猜你喜欢

转载自blog.csdn.net/qq_32115939/article/details/108119333
今日推荐