2015-07-03 50 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相關的路徑。