"use mpi" in MPICH2

Now I have a problem with MPICH2 when I compile the code using “use mpi”

It compiles successfully with “include mpif.h”, but not with “use mpi”. The error message is

pgf95 -o vect testsimple2.f95 -L /opt/pgi/linux86-64/2010/lib -lacml -g -Mextend -Mpreprocess -Mmpi=mpich2 -I./mpi
testsimple2.o: In function .C1_283': testsimple2.f95:(.data+0xe8): undefined reference to mpi_sizeofs_’
make: *** [test] Error 2

The code is simple with initialization and finalization only.

Thanks,
Tuan

Hi Tuan,

Add “-lmpichf90” to your link.

Though, we probably should be adding this by default when using “-Mmpi” with a F90 driver. I put in a request (TPR#16989)

Thanks,
Mat

Thank Mat for your information.

Tuan.