遇到上面错误,查询说是按照下面方式解决:
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时就可以了。