并行程序编译错误
我编写了一个并行代码,我可以编译它并在 win7 下运行它,但现在我必须在 linux ubuntu 11.04 下运行它,当我编译代码时,我收到此错误:
usr/bin/ld :cannot find -lcrcollect2
:ld returned 1 退出状态
我的编译器是 mpicxx,我使用 mpich2。 我的代码大约有 3000 行,但我使用以下代码进行测试
#include <iostream>
#include <mpi.h>
using namespace std;
int main(int argc, char ** argv){
int mynode, totalnodes;
MPI_Init(&argc,&argv);
MPI_Comm_size(MPI_COMM_WORLD, &totalnodes);
MPI_Comm_rank(MPI_COMM_WORLD, &mynode);
cout << "Hello world from process " << mynode;
cout << " of " << totalnodes << endl;
MPI_Finalize();
}
,并使用此命令进行编译 mpicxx hello.cpp
I write a parallel code that I can compile it and run it under win7 but now I have to run it under linux ubuntu 11.04 when I compile my code I get this error:
usr/bin/ld :cannot find -lcr
collect2:ld returned 1 exit status
my compiler is mpicxx and I use mpich2.
my code has about 3000 lines but I use the following code for testing
#include <iostream>
#include <mpi.h>
using namespace std;
int main(int argc, char ** argv){
int mynode, totalnodes;
MPI_Init(&argc,&argv);
MPI_Comm_size(MPI_COMM_WORLD, &totalnodes);
MPI_Comm_rank(MPI_COMM_WORLD, &mynode);
cout << "Hello world from process " << mynode;
cout << " of " << totalnodes << endl;
MPI_Finalize();
}
and I use this command for compiling it mpicxx hello.cpp
谷歌搜索 显示
cr
库由伯克利实验室检查点重启 (BLCR) 包。我认为你需要安装它。Googling around shows the
cr
library is provided by the Berkeley Lab Checkpoint Restart (BLCR) package. I think you need to install it.