LAM/MPI logo

LAM/MPI General User's Mailing List Archives

  |   Home   |   Download   |   Documentation   |   FAQ   |   all just in this list

From: Jeff Squyres (jsquyres_at_[hidden])
Date: 2003-05-19 13:01:32


On Mon, 19 May 2003, Martin Dimitrov wrote:

> I am a newbe to MPI and LAM. I was trying to compile a simple HelloWorld
> program like this:
>
> [slice4e_at_cserver HelloWorld]$ mpicc HelloWorldMPI.cpp
> /tmp/ccFGypJl.o(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
> collect2: ld returned 1 exit status

For C++ programs, use mpiCC. See the mpicc(1) and mpiCC(1) man pages.

> and then like this:
>
> [slice4e_at_cserver HelloWorld]$ gcc -lmpi HelloWorldMPI.cpp
> HelloWorldMPI.cpp:2:17: mpi.h: No such file or directory
> HelloWorldMPI.cpp: In function `int main(int, char**)':
> HelloWorldMPI.cpp:7: `MPI_Init' undeclared (first use this function)
> HelloWorldMPI.cpp:7: (Each undeclared identifier is reported only once for each
> function it appears in.)
> HelloWorldMPI.cpp:9: `MPI_Finalize' undeclared (first use this function)
> [slice4e_at_cserver HelloWorld]$
>
> And it does not work. Please help me. It seems that gcc does not know
> where the mpi.h file is located. On the other hand I cannot understand
> the mpicc error message at all.
>
> How can I make gcc know where the mpi.h is? How can I make it work?

I would *strongly* encourage you to use the LAM wrapper compilers because
the list of flags that they pass to the underlying compiler is subject to
change at any time (e.g., they are dramatically different depending on
your version of LAM, what your specific configuration is, etc.).

-- 
{+} Jeff Squyres
{+} jsquyres_at_[hidden]
{+} http://www.lam-mpi.org/