并行程序编译错误
我编写了一个并行代码,我可以编译它并在 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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
谷歌搜索 显示
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.