Problem with MPI in Redhat 9
Hi.
I am using Redhat Linux 9 and LAM 6.5.8/MPI 2 C++/ROMEO -Indiana University (it go with Redhat, I think so).
I have a C program like this (greetings.c)
######################################
#include <stdio.h>
#include "mpi.h"
main (int argc, char** argv) {
int my_rank;
int p;
int source;
int dest;
int tag = 50;
char message[100];
MPI_Status status;
MPI_Init(&argc, &argv);
MPI_Comm_rank(MPI_COMM_WORLD, &my_rank);
MPI_Comm_Size(MPI_COMM_WORLD, &p);
if (my_rank != 0) {
sprintf(message, "Greetings from process %d!", my_rank);
dest = 0;
MPI_Send(message, strlen(message) + 1, MPI_CHAR, dest, tag, MPI_COMM_WORLD);
}
else {
for (source = 1; source < p; source++) {
MPI_Recv(message, 100, MPI_CHAR, source, tag, MPI_COMM_WORLD, &status);
printf("%s\n", message);
}
}
MPI_Finalize();
}
####################################
And when I run this command
mpicc -o greetings greetings.c
I have a error message like this
/usr/bin/ld: cannot find -laio
collect2: ld returned 1 exit status
Can any one help me please. Thank you very much
|