Problems in compiling MPICH2

Hi,

I’m having problems in compiling mpich2 on a Linux (MDK10.1) machine using pgif90 (6.0 Release). The error in the compilation, relevant to the examples, is:

/home/bellanca/software/mpich2/mpich2-1.0.1_pgi/lib/libmpich.a(setbotf.o)(.data+0x0): undefined reference to __pgdbg_stub' /home/bellanca/software/mpich2/mpich2-1.0.1_pgi/lib/libmpich.a(setbotf.o)(.data+0x4): undefined reference to pgf90_compiled’

Any idea?

Thanks in advance.

Gaetano

Hi Geatano,


This error occurs when you try to link a pgf90 compiled object with a C compiler and have not included the pgf90 runtime support libraries. To solve either:

  1. Add the pgf90 runtime support libraries to the link line.

Example:

../bin/mpicc -L../lib -o cpi cpi.o  -lm -lmpich  -lpthread  -lrt  -pgf90libs

Note that the “-pgf90libs” flag is new to the 6.0 release. For older version of the compiler you’ll need to list out the libraries.

../bin/mpicc -L../lib -o cpi cpi.o  -lm -lmpich  -lpthread  -lrt  -lpgf90 -lpgf90_rpm1 -lpgf902 -lpgf90rtl -lpgftnrtl
  1. Reconfigure and recompile the MPICH2 libraries setting “FC” to pgf77 instead of pgf90.

Hope this helps,
Mat