foam-extend 5.0 installation 安装

foam-extend 于 2022 年 9 月发布

现将 foam-extend-5.0 安装脚本共享给大家。

基本情况:

  • 安装环境:centos 7, gcc 4.8.5
  • 下列包安装在 5.0 ThirdParty 内
    • make 3.11.0
    • metis 5.1.0
    • ParMGridGen 1.0
    • Libccmio 2.6.1
    • Mesquite 2.3.0
    • Scotch 6.0.4
    • ParMetis 4.0.3
    • hwloc 2.0.1
    • OpenMPI 4.0.0
  • 下列包不安装在 5.0 版本内
    • ParaView
    • Qt

可以直接 copy 以下所有命令到终端执行

cd ~/foam # 安装在用户的 foam 目录内,如是其他目录,请把 foam 替换为你的目录
git clone https://git.code.sf.net/p/foam-extend/foam-extend-5.0 foam-extend-5.0
cd foam-extend-5.0
sed '195s/SYSTEM//' -i ./etc/bashrc
sed '113s/export/#export/' -i ./etc/bashrc
cd ./etc
cp prefs.sh-EXAMPLE prefs.sh
sed '226,227s/#export/export/' -i ./prefs.sh # OpenMPI 3.11 will be installed
sed '228,229s/export/#export/' -i ./prefs.sh
sed '249s/export/#export/' -i ./prefs.sh # PyFOAM will not be installed
sed '258,259s/export/#export/' -i ./prefs.sh # ParaView and QT will not be installed
sed '109s/export/#export/' -i ./bashrc
sed '111s/export/#export/' -i ./bashrc
sed '110s/#export/export/' -i ./bashrc
sed '112s/#export/export/' -i ./bashrc
sed '104s/export/#export/' -i ./bashrc
sed '105s/#export/export/' -i ./bashrc
cd ../
source etc/bashrc
cd ThirdParty/
sed '115s/http.*$/https\:\/\/github.com\/sandialabs\/mesquite\/raw\/main\/mesquite\/mesquite-2.3.0.tar.gz )/' -i ./AllMake.stage3
sed '157s/http.*$/https\:\/\/ftp.mcs.anl.gov\/pub\/pdetools\/spack-pkgs\/parmetis-4.0.3.tar.gz )/' -i ./AllMake.stage3
./AllMake.stage1
./AllMake.stage2
./AllMake.stage3
cd ../
source etc/bashrc
./Allwmake

安装完成后,可以更新环境设置文件

echo "alias fe50='source ~/foam/foam-extend-5.0/etc/bashrc'" >> ~/.bashrc
. ~/.bashrc # 使 fe50 = 生效
fe50        # 每次进入 foam-extend-5.0 环境时使用