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
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.
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?
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
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?