mpich compiling error

Hi,

I have followed the guide in the PGI official site (http://www.pgroup.com/resources/mpich/mpich126_pgi60.htm) to compile mpich-1.2.7p1 with pgi-6.1.6. And the mentioned “MPICH 64-bit Patch” is also added to the source code. My configure is

env CFLAGS="-fast -DFIX_PTR_153_1_3800" CXXFLAGS="-fast" FFLAGS="-fast" F90FLAGS="-fast" LDFLAGS="-fast" OPTFLAGS="-fast" CC=“pgcc” CXX=“pgCC” F90=“pgf90” FC=“pgf77” CPP=“pgCC -E” ./configure --prefix=/home/vasp/opt/mpich-1.2.7p1

However, when I type “make”, the below error occurs:

Making Fortran interface
pgcc -I. -I/home/vasp/soft/mpich-1.2.7p1/src/fortran/src -I…/include -I/home/vasp/soft/mpich-1.2.7p1/src/fortran/include -I… -I/home/vasp/soft/mpich-1.2.7p1/include -I/home/vasp/soft/mpich-1.2.7p1/include -I/home/vasp/soft/mpich-1.2.7p1/mpid/ch_p4 -I/home/vasp/soft/mpich-1.2.7p1/mpid/util -fast -DFIX_PTR_153_1_3800 -DUSE_SOCKLEN_T -DUSE_U_INT_FOR_XDR -DHAVE_MPICHCONF_H -c abortf.c
pgcc -I. -I/home/vasp/soft/mpich-1.2.7p1/src/fortran/src -I…/include -I/home/vasp/soft/mpich-1.2.7p1/src/fortran/include -I… -I/home/vasp/soft/mpich-1.2.7p1/include -I/home/vasp/soft/mpich-1.2.7p1/include -I/home/vasp/soft/mpich-1.2.7p1/mpid/ch_p4 -I/home/vasp/soft/mpich-1.2.7p1/mpid/util -fast -DFIX_PTR_153_1_3800 -DUSE_SOCKLEN_T -DUSE_U_INT_FOR_XDR -DHAVE_MPICHCONF_H -c addressf.c
PGC-S-0035-Syntax error: Recovery attempted by replacing ‘/’ by double 0.00000000000000000E+0 (addressf.c: 230)
PGC-W-0155-Long value is passed to a nonprototyped function - argument #2 (addressf.c: 230)
PGC-W-0155-Long value is passed to a nonprototyped function - argument #4 (addressf.c: 230)
PGC-S-0035-Syntax error: Recovery attempted by replacing ‘/’ by double 0.00000000000000000E+0 (addressf.c: 254)
PGC-W-0155-Long value is passed to a nonprototyped function - argument #2 (addressf.c: 254)
PGC/x86-64 Linux/x86-64 6.1-6: compilation completed with severe errors
make[3]: *** [addressf.o] Error 2
make[2]: *** [flibs] Error 2
make[1]: *** [mpi-modules] Error 1
make: *** [mpi] Error 2

Can anybody help me?

Thanks in advance.

Yi-An

Hi Yi-An,

The patch is for mpich1.2.6 only. Note that the content of those 3 files have been changed quite a bit in 1.2.7p1. Should you remove the patch, it would compile just fine. We will update the web page for 1.2.7patch as soon as it is available.

In case, you would like to compile with MPICH1.2.6, the error is caused by the patch file having /*, */ as comment in C file. Adding -B to your CFLAGS should eliminate the error.

Hongyon

Hi, Hongyon

Thank you very much for your reply.

I followed your advice and it works. I can compile mpich-1.2.6 with no errors (use patchs your site provides). The configure is

env CFLAGS="-fast -DFIX_PTR_153_1_3800 -B" CXXFLAGS="-fast" FFLAGS="-fast" F90FLAGS="-fast" LDFLAGS="-fast" OPTFLAGS="-fast" CC=“pgcc” CXX=“pgCC” F90=“pgf90” FC=“pgf77” CPP=“pgCC -E” LIB="-L/home/vasp/opt/pgi/linux86-64/6.1/lib -lpgf90 -lpgf90rtl -lpgftnrtl -lpgc" ./configure --prefix=/home/vasp/opt/mpich-1.2.6

However, when I compile BLACS (use pgf77 and pgcc) and then Scalapack (mpif90 and mpicc), the below errors occur:

mpicc -o /home/vasp/lib/scalapack-1.7.5-pgi/TESTING/xigemr pigemrdrv.o /home/vasp/lib/scalapack-1.7.5-pgi/libscalapack.a /home/vasp/lib/BLACS-pgi/LIB/blacsCinit_MPI-LINUX-0.a /home/vasp/lib/BLACS-pgi/LIB/blacs_MPI-LINUX-0.a /home/vasp/lib/BLACS-pgi/LIB/blacsCinit_MPI-LINUX-0.a /home/vasp/opt/mpich-1.2.6/lib/libmpich.a
/home/vasp/lib/BLACS-pgi/LIB/blacs_MPI-LINUX-0.a(igamn2d_.C)(.text+0x267): In function Cigamn2d': : undefined reference to __c_mset2’
/home/vasp/lib/BLACS-pgi/LIB/blacs_MPI-LINUX-0.a(BI_imvcopy.o)(.text+0x4f): In function BI_imvcopy': : undefined reference to __c_mcopy4’
/home/vasp/lib/BLACS-pgi/LIB/blacs_MPI-LINUX-0.a(BI_imvcopy.o)(.text+0xf0): In function BI_imvcopy': : undefined reference to __c_mcopy4’
/home/vasp/lib/BLACS-pgi/LIB/blacs_MPI-LINUX-0.a(BI_ivmcopy.o)(.text+0x4f): In function BI_ivmcopy': : undefined reference to __c_mcopy4’
/home/vasp/lib/BLACS-pgi/LIB/blacs_MPI-LINUX-0.a(BI_ivmcopy.o)(.text+0xf0): In function BI_ivmcopy': : undefined reference to __c_mcopy4’
/home/vasp/opt/mpich-1.2.6/lib/libmpich.a(mperror.o)(.text+0xbe): In function MPIR_Errors_are_fatal': : undefined reference to __builtin_va_gparg1’
/home/vasp/opt/mpich-1.2.6/lib/libmpich.a(mperror.o)(.text+0xce): In function MPIR_Errors_are_fatal': : undefined reference to __builtin_va_gparg1’
/home/vasp/opt/mpich-1.2.6/lib/libmpich.a(mperror.o)(.text+0xde): In function MPIR_Errors_are_fatal': : undefined reference to __builtin_va_gparg1’
/home/vasp/opt/mpich-1.2.6/lib/libmpich.a(mperror.o)(.text+0x25b): In function MPIR_Errors_warn': : undefined reference to __builtin_va_gparg1’
/home/vasp/opt/mpich-1.2.6/lib/libmpich.a(mperror.o)(.text+0x26b): In function MPIR_Errors_warn': : undefined reference to __builtin_va_gparg1’
/home/vasp/opt/mpich-1.2.6/lib/libmpich.a(mperror.o)(.text+0x27b): more undefined references to __builtin_va_gparg1' follow /home/vasp/opt/mpich-1.2.6/lib/libmpich.a(ptrcvt.o)(.text+0xfe): In function MPIR_InitPointer’:
: undefined reference to __c_mzero8' /home/vasp/opt/mpich-1.2.6/lib/libmpich.a(p4_utils.o)(.text+0x1906): In function p4_usclock’:
: undefined reference to __mth_i_dfloatuk' /home/vasp/opt/mpich-1.2.6/lib/libmpich.a(p4_utils.o)(.text+0x1914): In function p4_usclock’:
: undefined reference to __mth_i_dfloatuk' /home/vasp/opt/mpich-1.2.6/lib/libmpich.a(p4_utils.o)(.text+0x1926): In function p4_usclock’:
: undefined reference to __mth_i_dfloatuk' /home/vasp/opt/mpich-1.2.6/lib/libmpich.a(debugutil.o)(.data+0x58): undefined reference to __pgdbg_stub’
/home/vasp/opt/mpich-1.2.6/lib/libmpich.a(p4_alloc.o)(.text+0x797): In function alloc_global': : undefined reference to __c_mset4’
collect2: ld returned 1 exit status
mpicc: No such file or directory
make[1]: *** [/home/vasp/lib/scalapack-1.7.5-pgi/TESTING/xigemr] Error 1
make[1]: Leaving directory `/home/vasp/lib/scalapack-1.7.5-pgi/REDIST/TESTING’
make: *** [redistexe] Error 2

I have also tried compiling scalapack with mpif77, but more errors occur. Can you help me?

Thanks a lot.

Yi-An

Yi-An,

Can you add -v to your mpicc command and send us the output? __c_mcopy’s are in libpgc.a and it should find them if your mpicc use pgcc.

For example,
mpicc -v -o /home/vasp/lib/scalapack-1.7.5-pgi/TESTING/xigemr pigemrdrv.o /home/vasp/lib/scalapack-1.7.5-pgi/libscalapack.a /home/vasp/lib/BLACS-pgi/LIB/blacsCinit_MPI-LINUX-0.a /home/vasp/lib/BLACS-pgi/LIB/blacs_MPI-LINUX-0.a /home/vasp/lib/BLACS-pgi/LIB/blacsCinit_MPI-LINUX-0.a /home/vasp/opt/mpich-1.2.6/lib/libmpich.a

Hongyon

Hi, hongyon,

Thank you.

I followed your suggestion and found I had been using the wrong “mpicc” command which is compiled by gcc in my system by default. I am sorry for that.

After I used the right “mpicc” and “mpif77”, the scalapack can be compiled with no errors. However, when I type “make exe” to create the test executable, the below errors occur:

/home/vasp/opt/mpich-1.2.6/bin/mpif77 -o /home/vasp/lib/scalapack-1.7.5-pgi/TESTING/xssep psseptst.o pssepsubtst.o pssepchk.o pssepqtq.o pslagsy.o pslatms.o pslasizesep.o pslasizesyevx.o pssepdriver.o pssepreq.o pssepinfo.o pslasizesyev.o pssqpsubtst.o pslasizesqp.o pssdpsubtst.o psmatgen.o pmatgeninc.o /home/vasp/lib/scalapack-1.7.5-pgi/libscalapack.a /home/vasp/lib/BLACS-pgi/LIB/blacsF77init_MPI-LINUX-0.a /home/vasp/lib/BLACS-pgi/LIB/blacs_MPI-LINUX-0.a /home/vasp/lib/BLACS-pgi/LIB/blacsF77init_MPI-LINUX-0.a /home/vasp/lib/BLACS-pgi/LIB/blacsCinit_MPI-LINUX-0.a /home/vasp/lib/BLACS-pgi/LIB/blacs_MPI-LINUX-0.a /home/vasp/lib/BLACS-pgi/LIB/blacsCinit_MPI-LINUX-0.a /home/vasp/lib/libblas.a /home/vasp/opt/mpich-1.2.6/lib/libmpich.a
/home/vasp/lib/scalapack-1.7.5-pgi/libscalapack.a(pssyev.o)(.text+0xd5f): In function pssyev_': : undefined reference to psgemr2d_’
/home/vasp/lib/scalapack-1.7.5-pgi/libscalapack.a(pssyntrd.o)(.text+0x6ad): In function pssyntrd_': : undefined reference to pstrmr2d_’
/home/vasp/lib/scalapack-1.7.5-pgi/libscalapack.a(pssyntrd.o)(.text+0x8e5): In function pssyntrd_': : undefined reference to pstrmr2d_’
/home/vasp/lib/scalapack-1.7.5-pgi/libscalapack.a(pslamr1d.o)(.text+0xe0): In function pslamr1d_': : undefined reference to psgemr2d_’
make[1]: *** [/home/vasp/lib/scalapack-1.7.5-pgi/TESTING/xssep] Error 2
make[1]: Leaving directory `/home/vasp/lib/scalapack-1.7.5-pgi/TESTING/EIG’
make: *** [scalapackexe] Error 2

Any suggestions?

Thank you very much for your kind attention.

Yi-An

Yi-An,

Those routines are in REDIST directory. You might want to try:
make lib or make redistlib first.

Hongyon

Hi, hongyon,

Thank you for your reply.

Before “make exe”, I do “make lib” firstly. But, unfortunately, the above mentioned errors still occur. Therefore, I wonder if there are something else wrong?

Thanks.

Yi-An

Yi-An,

What is the output of " nm libscalapack.a |grep psgemr2d"? Is psgemr2d_ defined anywhere?

If not, I would try to clean all objects and libraries and build again.
Also, make sure that in SLmake.inc, you have CDEFS as:

CDEFS = -DAdd_ -DNO_IEEE $(USEMPI)

and I would also check if compilation log file if files in REDIST get compiled.

Hongyon

Hi, hongyon,

Thanks

Yi-An