天河 2 号超算安装 OpenFOAM 7 (不含CGAL)
-
创建安装目录:
cd ~ mkdir OpenFOAM cd OpenFOAM
解压软件包,重命名文件夹:
tar -xvf OpenFOAM-7-version-7.tar.gz tar -xvf ThirdParty-7-version-7.tar.gz mv OpenFOAM-7-version-7 OpenFOAM-7 mv ThirdParty-7-version-7 ThirdParty-7
修改配置文件使用 Intel 编译器和 Intel MPI 进行编译:
cd OpenFOAM-7/etc sed -i 's/export\ WM_COMPILER=Gcc/export WM_COMPILER=Icc/' bashrc sed -i 's/export\ WM_MPLIB=SYSTEMOPENMPI/export\ WM_MPLIB=INTELMPI\nMPI_ROOT=\$I_MPI_ROOT/' bashrc
加载编译器和 MPI:
module load cmake/3.8.1 MPI/Intel/MPICH/3.2-icc2018-dyn gcc/4.9.2
加载环境变量:
source bashrc
编译第三方程序:
cd ../../ThirdParty-7 ./Allwmake
编译 OpenFOAM:
cd ../OpenFOAM-7 ./Allwmake
将 OpenFOAM 环境变量添加到用户配置:
echo 'source ~/OpenFOAM/OpenFOAM-7/etc/bashrc' >> ~/.bashrc source ~/.bashrc
注: 本安装流程未编译 CGAL 库,依赖 CGAL 的 foamyHexMesh 也未编译。
-
这个要mark一下,后面估计会用到。