[openfoam]OpenFOAM安装时:gcc: error: unrecognized command line option ‘--showme:link’

遇到上面错误,查询说是按照下面方式解决:

The user can check whether MPICH is installed by typing the following:

sudo update-alternatives --list mpi

which returns /usr/mpich/include if MPICH is installed. This error is caused when the default mpicc is MPICH, rather than OpenMPI. The simplest way to fix the problem is to set mpicc to OpenMPI is by running the following command in a terminal prompt:

sudo update-alternatives --set mpi /usr/lib/openmpi/include

其中/usr/lib/openmpi/include路径可以用find命令找到

但是很遗憾,没有效果,正确方式是在openfoam文件夹下面etc有个bashrc文件,用vim打开

export WM_MPLIB=SYSTEMOPENMPI

将其修改成:

export WM_MPLIB=OPENMPI

在source时就可以了。

猜你喜欢

转载自blog.csdn.net/FL1623863129/article/details/132719588
今日推荐