运行 OpenMPI 命令“mpicxx hello_cxx.cc -o hello”时总是出现以下错误
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();
^~~