undefined symbol `MPI_recv'
When I link my M开发者_JAVA技巧PI C program, I get the following error:
undefined reference to MPI_recv
.
What should i do to solve this error?
It is MPI_Recv
, not MPI_recv
.
You need to link to the MPI library that provides the MPI_recv()
function. For example, with gcc
, you would add an option like -lmpi
to your compile line.
MPI implementations usually provide a compilation utility scripts that basically sets up the correct compilation & linking environment, libraries and calls gcc (e.g.) with the correct command line.
Try this:
mpicc my_prog.c
Hope this helps.
A.
精彩评论