运行的openmpi命令 “mpicxx hello_cxx.cc -o你好”,而的openmpi:错误:“MPI”尚未声明
hello_cxx.cc: In function ‘int main(int, char**)’:
hello_cxx.cc:25:5: error: ‘MPI’ has not been declared
MPI::Init();
^~~ hello_cxx.cc:26:12: error: ‘MPI’ has not been declared
rank = MPI::COMM_WORLD.Get_rank();
^~~ hello_cxx.cc:27:12: error: ‘MPI’ has not been declared
size = MPI::COMM_WORLD.Get_size();
^~~ hello_cxx.cc:31:5: error: ‘MPI’ has not been declared
MPI::Finalize();
^~~
为了帮助这将真正帮助看看,你把在这里的代码,而不是只有两行。 –
此外,它也会帮助您知道哪些操作系统,您使用的OpenMPI版本。 –
我已经尝试了3个不同的版本,都是Ubuntu Kylin 17.04中的版本2或更高版本。 –