openfoam openmpi 错误:找不到 libmpi.so.0

Posted

技术标签:

【中文标题】openfoam openmpi 错误:找不到 libmpi.so.0【英文标题】:openfoam openmpi error: libmpi.so.0 not found 【发布时间】:2015-07-03 07:18:11 【问题描述】:

每当我尝试在 openfoam 中编译求解器时,都会收到错误消息:

/usr/bin/ld: warning: libmpi.so.0, needed by /opt/openfoam211/platforms/linux64GccDPOpt/lib/openmpi-system/libPstream.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libopen-rte.so.0, needed by /opt/openfoam211/platforms/linux64GccDPOpt/lib/openmpi-system/libPstream.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libopen-pal.so.0, needed by /opt/openfoam211/platforms/linux64GccDPOpt/lib/openmpi-system/libPstream.so, not found (try using -rpath or -rpath-link)
/opt/openfoam211/platforms/linux64GccDPOpt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Waitall'
/opt/openfoam211/platforms/linux64GccDPOpt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Abort'
/opt/openfoam211/platforms/linux64GccDPOpt/lib/openmpi-system/libPstream.so: undefined reference to `ompi_mpi_double'
/opt/openfoam211/platforms/linux64GccDPOpt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Get_count'
/opt/openfoam211/platforms/linux64GccDPOpt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Init'
/opt/openfoam211/platforms/linux64GccDPOpt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Probe'
/opt/openfoam211/platforms/linux64GccDPOpt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Send'
/opt/openfoam211/platforms/linux64GccDPOpt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Allreduce'
/opt/openfoam211/platforms/linux64GccDPOpt/lib/openmpi-system/libPstream.so: undefined reference to `ompi_mpi_packed'
/opt/openfoam211/platforms/linux64GccDPOpt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Buffer_detach'
/opt/openfoam211/platforms/linux64GccDPOpt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Bsend'
/opt/openfoam211/platforms/linux64GccDPOpt/lib/openmpi-system/libPstream.so: undefined reference to `ompi_mpi_byte'
/opt/openfoam211/platforms/linux64GccDPOpt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Irecv'
/opt/openfoam211/platforms/linux64GccDPOpt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Recv'
/opt/openfoam211/platforms/linux64GccDPOpt/lib/openmpi-system/libPstream.so: undefined reference to `ompi_mpi_comm_world'
/opt/openfoam211/platforms/linux64GccDPOpt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Get_processor_name'
/opt/openfoam211/platforms/linux64GccDPOpt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Test'
/opt/openfoam211/platforms/linux64GccDPOpt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Isend'
/opt/openfoam211/platforms/linux64GccDPOpt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Finalize'
/opt/openfoam211/platforms/linux64GccDPOpt/lib/openmpi-system/libPstream.so: undefined reference to `ompi_mpi_op_sum'
/opt/openfoam211/platforms/linux64GccDPOpt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Buffer_attach'
/opt/openfoam211/platforms/linux64GccDPOpt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Comm_size'
/opt/openfoam211/platforms/linux64GccDPOpt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Comm_rank'
collect2: error: ld returned 1 exit status

我猜问题出在 open-mpi 的安装上。如何检查/修复错误?

【问题讨论】:

【参考方案1】:

首先,检查您是否确实安装了 Open MPI。

其次,检查 OpenFOAM 是否正确设置为使用 Open MPI:请参阅etc/bashrc(或etc/cshrc)中的相应选项。还要确保你已经为 Open MPI 设置了任何需要的环境变量(我没有任何 Open MPI 经验,我使用 Intel MPI 构建,并且有一些环境变量需要通过手动调用一些脚本来设置)。

第三,检查wmake 发出的链接命令行以构建您的求解器, 以构建libPstream(在主要的 OpenFOAM 构建过程中)。如果它不打印链接行,编辑wmake/Makefile 使其打印出来。其中一些行(我认为libPstream's)应该包含一些链接选项,并且很可能是与 Open MPI 相关的路径。

【讨论】:

以上是关于openfoam openmpi 错误:找不到 libmpi.so.0的主要内容,如果未能解决你的问题,请参考以下文章

OpenFoam:在 polyMesh 文件夹中找不到 blockMeshDict 文件

如何指定 OpenMPI 使用的端口范围?

OpenFOAM:GCE 与 AWS EC2 性能对比

Windows 10 Cygwin 中的 OpenMPI java 绑定

“找不到 -l <​​目录>”错误 - CMake

如何解决 gmsh Mesh 生成错误