THM2C编译运行方法
2023-03-28 本文已影响0人
HPCer
备注
- gfortran需要9.0以下版本,ubuntu需要20.04以下版本
开始
- 环境装备
sudo apt install gcc g++ gfortran make cmake
sudo apt-get install libhdf5-dev
sudo apt-get install libxml2-dev
- 获取代码
cd /home/zhengl/Codes
git clone git@e.coding.net:gassive/thm2c/thm2c.git
- 编译petsc
cd /home/zhengl/Codes/lib
wget https://www.mcs.anl.gov/petsc/mirror/release-snapshots/petsc-3.6.4.tar.gz
tar zxvf petsc-3.6.4.tar.gz
cd petsc-3.6.4
./configure --with-cc=gcc --with-cxx=g++ --with-fc=gfortran --download-mpich --download-fblaslapack --download-scalapack --download-mumps --download-superlu --download-metis --download-parmetis --download-suitesparse=yes PETSC_ARCH=linux-gnu-c
make PETSC_DIR=/home/zhengl/Codes/thm2c/lib/petsc-3.6.4 PETSC_ARCH=linux-gnu-c all
export PETSC_DIR=/home/zhengl/Codes/thm2c/lib/petsc-3.6.4 PETSC_ARCH=linux-gnu-c
- 编译thm2c
cd /home/zhengl/Codes/src
修改makefile文件,更改PETSC_DIR变量
PETSC_DIR=/home/zhengl/Codes/thm2c/lib/petsc-3.6.4
编译
make thm2c_nonuniform
安装
make install
- 运行thm2c
修改输入文件,更改inp_thm2d.xml文件中的结果存放位置
<data_dir>/home/zhengl/Codes/thm2c/res</data_dir>
运行程序
./run_nonuniform.sh