2015-07-03 48 views
0

每当我尝试编译openfoam求解器,我得到的错误:openfoam了openmpi错误:libmpi.so.0找不到

/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 

我想这个问题是安装了openmpi的。我如何检查/修复错误?

回答

1

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

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

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