peaceman
peaceman

Reputation: 1529

parallel program compiling error

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

Upvotes: 1

Views: 460

Answers (1)

Sam Miller
Sam Miller

Reputation: 24174

usr/bin/ld :cannot find -lcr

Googling around shows the cr library is provided by the Berkeley Lab Checkpoint Restart (BLCR) package. I think you need to install it.

Upvotes: 1

Related Questions