我從來沒有在VS08之外做過任何主要編程。在Ubuntu上爲mpi.h設置G ++或ICC
我正試圖編譯一個名爲LAMMPS的程序與兩個相關的make文件中的任何一個。一個調用g ++,另一個調用icc(英特爾編譯器)。
ICC產生這樣的錯誤:
icc -O -DLAMMPS_GZIP -DMPICH_SKIP_MPICXX -DFFT_FFTW -M write_restart.cpp > write_restart.d write_restart.cpp(15): catastrophic error: cannot open source file "mpi.h" #include "mpi.h"
和g ++引發此錯誤
g++ -g -O -DLAMMPS_GZIP -DMPICH_SKIP_MPICXX -DFFT_FFTW -M verlet.cpp > verlet.d pointers.h:25: fatal error: mpi.h: No such file or directory compilation terminated.
的mpi.h文件位於/ usr/lib中/了openmpi /包括
它是我的理解是,我需要設置$ PATH變量,其中讀取
bash: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin:/opt/intel/bin:/usr/lib/openmpi/include:
和$ LD_LIBRARY_PATH目前讀
/usr/lib/openmpi/lib:
那麼,如何一個包括mpi.h文件?所以icc或g ++找到它?
Make文件吐出立即與崩潰>致命錯誤MPI_Comm_rank可執行:無效通信,錯誤堆棧: MPI_Comm_rank(106):MPI_Comm_rank(COMM = 0x8e5bc0,秩= 0x2854d00)失敗 MPI_Comm_rank(64).:無效的通信器 – Mikhail 2011-04-23 09:41:00
好的,所以我把它設置爲「mpiC++。mpich2」而不是「mpiC++」時使用g ++。 – Mikhail 2011-04-23 21:32:48