# mpich compiling error

**URL:** <https://forums.developer.nvidia.com/t/mpich-compiling-error/130838>\
**Category:** Legacy PGI Compilers (archived)\
**Created:** [August 16, 2007, 3:32am UTC](https://forums.developer.nvidia.com/t/mpich-compiling-error/130838 "2007-08-16T03:32:20Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![hlzya](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@hlzya](https://forums.developer.nvidia.com/u/hlzya)\
**Post date:** [August 16, 2007, 3:32am UTC](https://forums.developer.nvidia.com/t/mpich-compiling-error/130838/1 "2007-08-16T03:32:20Z")

</div>

Hi,

I have followed the guide in the PGI official site ([http://www.pgroup.com/resources/mpich/mpich126\_pgi60.htm](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

---

<div class="post-metadata">

**Author:** ![hongyon](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@hongyon](https://forums.developer.nvidia.com/u/hongyon)\
**Post date:** [August 16, 2007, 6:22pm UTC](https://forums.developer.nvidia.com/t/mpich-compiling-error/130838/2 "2007-08-16T18:22:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![hlzya](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@hlzya](https://forums.developer.nvidia.com/u/hlzya)\
**Post date:** [August 17, 2007, 10:15am UTC](https://forums.developer.nvidia.com/t/mpich-compiling-error/130838/3 "2007-08-17T10:15:33Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![hongyon](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@hongyon](https://forums.developer.nvidia.com/u/hongyon)\
**Post date:** [August 17, 2007, 6:57pm UTC](https://forums.developer.nvidia.com/t/mpich-compiling-error/130838/4 "2007-08-17T18:57:59Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![hlzya](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@hlzya](https://forums.developer.nvidia.com/u/hlzya)\
**Post date:** [August 18, 2007, 3:25am UTC](https://forums.developer.nvidia.com/t/mpich-compiling-error/130838/5 "2007-08-18T03:25:31Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![hongyon](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@hongyon](https://forums.developer.nvidia.com/u/hongyon)\
**Post date:** [August 18, 2007, 6:04pm UTC](https://forums.developer.nvidia.com/t/mpich-compiling-error/130838/6 "2007-08-18T18:04:49Z")

</div>

Yi-An,

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

Hongyon

---

<div class="post-metadata">

**Author:** ![hlzya](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@hlzya](https://forums.developer.nvidia.com/u/hlzya)\
**Post date:** [August 24, 2007, 2:46pm UTC](https://forums.developer.nvidia.com/t/mpich-compiling-error/130838/7 "2007-08-24T14:46:18Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![hongyon](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@hongyon](https://forums.developer.nvidia.com/u/hongyon)\
**Post date:** [August 24, 2007, 5:09pm UTC](https://forums.developer.nvidia.com/t/mpich-compiling-error/130838/8 "2007-08-24T17:09:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![hlzya](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@hlzya](https://forums.developer.nvidia.com/u/hlzya)\
**Post date:** [August 25, 2007, 8:43am UTC](https://forums.developer.nvidia.com/t/mpich-compiling-error/130838/9 "2007-08-25T08:43:17Z")

</div>

Hi, hongyon,

Thanks

Yi-An
