Ubuntu16.04 源码安装 foam-extend 4.0


ubuntu 16.04
openfoam 4.0

源码安装 foam-extend 4.0
http://openfoamwiki.net/index.php/Installation/Linux/foam-extend-4.0/Ubuntu

【System preparations】

sudo apt-get update

sudo apt-get install git-core build-essential binutils-dev cmake flex \
zlib1g-dev qt4-dev-tools libqt4-dev libncurses5-dev libiberty-dev \
libxt-dev rpm mercurial graphviz python python-dev

【Get the source code】

cd ~
mkdir foam
cd foam
git clone git://git.code.sf.net/p/foam-extend/foam-extend-4.0 foam-extend-4.0

   // cd /opt
   // git clone git://git.code.sf.net/p/foam-extend/foam-extend-4.0 foam-extend-4.0

【compile】

cd ~/foam/foam-extend-4.0

echo export WM_THIRD_PARTY_USE_BISON_27=1  >> etc/prefs.sh  //这个命令不要忘了
source etc/bashrc

//当运行source etc/bashrc后,会显示好几条 bash:/opt/foam-extend-4.0/bin/...:没有那个文件或目录。
//开始检查:gedit etc/bashrc,看到 FOAM_INST_DIR=$HOME/$MM_PROJECT,运行 $HOME 后,显示路径为 /root,然而运行 $FOAM_INST_DIR 后,显示路径为 /opt;二者矛盾。此时,到shell手动运行 FOAM_INST_DIR=$HOME/$MM_PROJECT,再查看 $FOAM_INST_DIR,显示/root,执行source etc/bashrc 可顺利通过。
// 由于作者之前都将openfoam4和paraview安装到了/opt下面,为了统一,这里也将foam-extend4.0安装到/opt下。则

cp -r foam /opt
cd /opt/foam/foam-extend-4.0
gedit etc/bashrc

//修改为 FOAM_INST_DIR=/opt/$MM_PROJECT,此时执行source etc/bashrc还是有相同的问题,于是到shell单独执行FOAM_INST_DIR=/opt/$MM_PROJECT。在此后安装过程中,每遇到$HOME,都要换成/opt。

echo export WM_THIRD_PARTY_USE_BISON_27=1  >> etc/prefs.sh  //这个命令不要忘了
source etc/bashrc  //顺利通过了

echo "alias fe40='source \/opt/foam/foam-extend-4.0/etc/bashrc'" >> /opt/.bashrc

//Note: This line means that whenever you start a new terminal window or tab, you should run the alias command associated to the foam-extend 4.0 shell environment. In other words, whenever you start a new terminal, you should run: fe40

   【optionally】
    export QT_BIN_DIR=/path/to/qmake_directory
    echo "export QT_BIN_DIR=$QT_BIN_DIR" >> etc/prefs.sh

    export CUDA_ARCH=sm_30
    echo "export CUDA_ARCH=sm_30" >> etc/prefs.sh

./Allwmake.firstInstall  //漫长的编译过程,数个小时,要下载安装一些三方。

//安装过程中无fatal,有warning。
//大部分警告是 warning: use of old-style cast [-Wold-style-cast]
//ThirdParty Allmake stage 5 时,无法打开很多 .H for source file .C。
//以后应用中不知道会不会有问题,再更。
 

其他分享 https://blog.csdn.net/aleigus/article/details/72991105?utm_medium=distribute.pc_relevant.none-task-blog-OPENSEARCH-1.nonecase&depth_1-utm_source=distribute.pc_relevant.none-task-blog-OPENSEARCH-1.nonecase

 

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

ou_no

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值