Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29262 Discussions

mpiifort, undefined refence to PMPI_ , MPI_

mugun33
Beginner
1,028 Views


Dear All,
I have compiled my MPI model source code with mpiifort.
After creating the object files, during the linking step, there are some errors,
(undefined references to PMPI_???)
Is there any solution for this?,

my $LD_LIBRARY_PATH is
/SFS/progs/intel/ict/3.0/mpi/3.0/lib64:/SFS/progs/intel/fce/9.1.032/lib:
/SFS/progs/intel/cce/9.1.038/lib:
/SFS/LSF_HPC/ego/1.2/linux2.6-glibc2.3-x86_64/lib:
/SFS/LSF_HPC/7.0/linux2.6-glibc2.3-x86_64/lib

thank you very much in advance

Murat Gunduz

======ERROR MESSAGE===============================
cd /SFS/users/gunduz.murat/hycom/CASa0.04/src_2.1.35e++_30_mpi
setenv ARCH intelIFC
setenv TYPE `echo $cwd | awk -F"_" '{print $NF}'`
echo /SFS/users/gunduz.murat/hycom/CASa0.04/src_2.1.35e++_30_mpi
awk -F_ {print $NF}
if ( ! -e ../config/intelIFC_mpi ) then
make hycom ARCH=intelIFC TYPE=mpi
mpiifort -DIA32 -DREAL8 -DMPI -DSERIAL_IO -DTIMER -g -convert big_endian -assume byterecl -cm -vec_report0 -w -O3 -tpp7 -xW -r8 -c mod_xc.F
mpiifort -DIA32 -DREAL8 -DMPI -DSERIAL_IO -DTIMER -g -convert big_endian -assume byterecl -cm -vec_report0 -w -O3 -tpp7 -xW -r8 -c mod_za.F
mpiifort -DIA32 -DREAL8 -DMPI -DSERIAL_IO -DTIMER -g -convert big_endian -assume byterecl -cm -vec_report0 -w -O3 -tpp7 -xW -r8 -c mod_pipe.F
mpiifort -DIA32 -DREAL8 -DMPI -DSERIAL_IO -DTIMER -g -convert big_endian -assume byterecl -cm -vec_report0 -w -O3 -tpp7 -xW -r8 -c mod_hycom.F
mpiifort -g -convert big_endian -assume byterecl -cm -vec_report0 -w -O3 -tpp7 -xW -r8 -c archiv.f
mpiifort -g -convert big_endian -assume byterecl -cm -vec_report0 -w -O3 -tpp7 -xW -r8 -c barotp.f
mpiifort -g -convert big_endian -assume byterecl -cm -vec_report0 -w -O3 -tpp7 -xW -r8 -c bigrid.f
mpiifort -g -convert big_endian -assume byterecl -cm -vec_report0 -w -O3 -tpp7 -xW -r8 -c blkdat.f
mpiifort -g -convert big_endian -assume byterecl -cm -vec_report0 -w -O3 -tpp7 -xW -r8 -c cnuity.f
mpiifort -g -convert big_endian -assume byterecl -cm -vec_report0 -w -O3 -tpp7 -xW -r8 -c convec.f
mpiifort -g -convert big_endian -assume byterecl -cm -vec_report0 -w -O3 -tpp7 -xW -r8 -c diapfl.f
mpiifort -g -convert big_endian -assume byterecl -cm -vec_report0 -w -O3 -tpp7 -xW -r8 -c dpthuv.f
mpiifort -g -convert big_endian -assume byterecl -cm -vec_report0 -w -O3 -tpp7 -xW -r8 -c dpudpv.f
mpiifort -g -convert big_endian -assume byterecl -cm -vec_report0 -w -O3 -tpp7 -xW -r8 -c forfun.f
mpiifort -g -convert big_endian -assume byterecl -cm -vec_report0 -w -O3 -tpp7 -xW -r8 -c geopar.f
mpiifort -g -convert big_endian -assume byterecl -cm -vec_report0 -w -O3 -tpp7 -xW -r8 -c hybgen.f
mpiifort -g -convert big_endian -assume byterecl -cm -vec_report0 -w -O3 -tpp7 -xW -r8 -c icloan.f
mpiifort -g -convert big_endian -assume byterecl -cm -vec_report0 -w -O3 -tpp7 -xW -r8 -c inicon.f
mpiifort -g -convert big_endian -assume byterecl -cm -vec_report0 -w -O3 -tpp7 -xW -r8 -c inigiss.f
mpiifort -g -convert big_endian -assume byterecl -cm -vec_report0 -w -O3 -tpp7 -xW -r8 -c inikpp.f
mpiifort -g -convert big_endian -assume byterecl -cm -vec_report0 -w -O3 -tpp7 -xW -r8 -c inimy.f
mpiifort -g -convert big_endian -assume byterecl -cm -vec_report0 -w -O3 -tpp7 -xW -r8 -c latbdy.f
mpiifort -g -convert big_endian -assume byterecl -cm -vec_report0 -w -O3 -tpp7 -xW -r8 -c matinv.f
mpiifort -g -convert big_endian -assume byterecl -cm -vec_report0 -w -O3 -tpp7 -xW -r8 -c momtum.f
mpiifort -g -convert big_endian -assume byterecl -cm -vec_report0 -w -O3 -tpp7 -xW -r8 -c mxkprf.f
mpiifort -g -convert big_endian -assume byterecl -cm -vec_report0 -w -O3 -tpp7 -xW -r8 -c mxkrt.f
mpiifort -g -convert big_endian -assume byterecl -cm -vec_report0 -w -O3 -tpp7 -xW -r8 -c mxkrtm.f
mpiifort -g -convert big_endian -assume byterecl -cm -vec_report0 -w -O3 -tpp7 -xW -r8 -c mxpwp.f
mpiifort -g -convert big_endian -assume byterecl -cm -vec_report0 -w -O3 -tpp7 -xW -r8 -c overtn.f
mpiifort -g -convert big_endian -assume byterecl -cm -vec_report0 -w -O3 -tpp7 -xW -r8 -c poflat.f
mpiifort -g -convert big_endian -assume byterecl -cm -vec_report0 -w -O3 -tpp7 -xW -r8 -c prtmsk.f
mpiifort -g -convert big_endian -assume byterecl -cm -vec_report0 -w -O3 -tpp7 -xW -r8 -c psmoo.f
mpiifort -g -convert big_endian -assume byterecl -cm -vec_report0 -w -O3 -tpp7 -xW -r8 -c restart.f
mpiifort -g -convert big_endian -assume byterecl -cm -vec_report0 -w -O3 -tpp7 -xW -r8 -c thermf.f
mpiifort -g -convert big_endian -assume byterecl -cm -vec_report0 -w -O3 -tpp7 -xW -r8 -c trcupd.f
mpiifort -g -convert big_endian -assume byterecl -cm -vec_report0 -w -O3 -tpp7 -xW -r8 -c tsadvc.f
mpiifort -DIA32 -DREAL8 -DMPI -DSERIAL_IO -DTIMER -g -convert big_endian -assume byterecl -cm -vec_report0 -w -O3 -tpp7 -xW -r8 -c machine.F
mpiifort -DIA32 -DREAL8 -DMPI -DSERIAL_IO -DTIMER -g -convert big_endian -assume byterecl -cm -vec_report0 -w -O3 -tpp7 -xW -r8 -c wtime.F
gcc -DIA32 -DREAL8 -DMPI -DSERIAL_IO -DTIMER -O -c machi_c.c
mpiifort -DIA32 -DREAL8 -DMPI -DSERIAL_IO -DTIMER -g -convert big_endian -assume byterecl -cm -vec_report0 -w -O3 -tpp7 -xW -r8 -c isnan.F
mpiifort -DIA32 -DREAL8 -DMPI -DSERIAL_IO -DTIMER -g -convert big_endian -assume byterecl -cm -vec_report0 -w -O3 -tpp7 -xW -r8 -c hycom.F
mpiifort -g -convert big_endian -assume byterecl -cm -vec_report0 -w -O3 -tpp7 -xW -r8 -Bstatic -o hycom hycom.o mod_xc.o mod_za.o mod_pipe.o mod_hycom.o archiv.o barotp.o bigrid.o blkdat.o cnuity.o convec.o diapfl.o dpthuv.o dpudpv.o forfun.o geopar.o hybgen.o icloan.o inicon.o inigiss.o inikpp.o inimy.o latbdy.o matinv.o momtum.o mxkprf.o mxkrt.o mxkrtm.o mxpwp.o overtn.o poflat.o prtmsk.o psmoo.o restart.o thermf.o trcupd.o tsadvc.o machine.o wtime.o machi_c.o isnan.o
/SFS/progs/intel/ict/3.0/mpi/3.0/lib64/libmpiif.a(abortf.o)(.text+0x9): In function `MPI_ABORT':
: undefined reference to `PMPI_Abort'
/SFS/progs/intel/ict/3.0/mpi/3.0/lib64/libmpiif.a(allreducef.o)(.text+0x51): In function `MPI_ALLREDUCE':
: undefined reference to `PMPI_Allreduce'
/SFS/progs/intel/ict/3.0/mpi/3.0/lib64/libmpiif.a(barrierf.o)(.text+0x8): In function `MPI_BARRIER':
: undefined reference to `PMPI_Barrier'
/SFS/progs/intel/ict/3.0/mpi/3.0/lib64/libmpiif.a(bcastf.o)(.text+0xf): In function `MPI_BCAST':
: undefined reference to `PMPI_Bcast'
/SFS/progs/intel/ict/3.0/mpi/3.0/lib64/libmpiif.a(comm_dupf.o)(.text+0x7): In function `MPI_COMM_DUP':
: undefined reference to `PMPI_Comm_dup'
/SFS/progs/intel/ict/3.0/mpi/3.0/lib64/libmpiif.a(comm_rankf.o)(.text+0x7): In function `MPI_COMM_RANK':
: undefined reference to `PMPI_Comm_rank'
/SFS/progs/intel/ict/3.0/mpi/3.0/lib64/libmpiif.a(comm_sizef.o)(.text+0x7): In function `MPI_COMM_SIZE':
: undefined reference to `PMPI_Comm_size'
/SFS/progs/intel/ict/3.0/mpi/3.0/lib64/libmpiif.a(finalizef.o)(.text+0x6): In function `MPI_FINALIZE':
: undefined reference to `PMPI_Finalize'
/SFS/progs/intel/ict/3.0/mpi/3.0/lib64/libmpiif.a(initf.o)(.text+0x19): In function `MPI_INIT':
: undefined reference to `PMPI_Init'
/SFS/progs/intel/ict/3.0/mpi/3.0/lib64/libmpiif.a(isendf.o)(.text+0x1a): In function `MPI_ISEND':
: undefined reference to `PMPI_Isend'
/SFS/progs/intel/ict/3.0/mpi/3.0/lib64/libmpiif.a(recv_initf.o)(.text+0x1a): In function `MPI_RECV_INIT':
: undefined reference to `PMPI_Recv_init'
/SFS/progs/intel/ict/3.0/mpi/3.0/lib64/libmpiif.a(recvf.o)(.text+0x32): In function `MPI_RECV':
: undefined reference to `MPI_F_STATUS_IGNORE'
/SFS/progs/intel/ict/3.0/mpi/3.0/lib64/libmpiif.a(recvf.o)(.text+0x59): In function `MPI_RECV':
: undefined reference to `PMPI_Recv'
/SFS/progs/in tel/ict/3.0/mpi/3.0/lib64/libmpiif.a(request_freef.o)(.text+0x6): In function `MPI_REQUEST_FREE':
: undefined reference to `PMPI_Request_free'
/SFS/progs/intel/ict/3.0/mpi/3.0/lib64/libmpiif.a(send_initf.o)(.text+0x1a): In function `MPI_SEND_INIT':
: undefined reference to `PMPI_Send_init'
/SFS/progs/intel/ict/3.0/mpi/3.0/lib64/libmpiif.a(sendf.o)(.text+0xe): In function `MPI_SEND':
: undefined reference to `PMPI_Send'
/SFS/progs/intel/ict/3.0/mpi/3.0/lib64/libmpiif.a(setbot.o)(.text+0x15): In function `mpirinitc_':
: undefined reference to `MPI_F_STATUS_IGNORE'
/SFS/progs/intel/ict/3.0/mpi/3.0/lib64/libmpiif.a(setbot.o)(.text+0x1c): In function `mpirinitc_':
: undefined reference to `MPI_F_STATUSES_IGNORE'
/SFS/progs/intel/ict/3.0/mpi/3.0/lib64/libmpiif.a(startallf.o)(.text+0x7): In function `MPI_STARTALL':
: undefined reference to `PMPI_Startall'
/SFS/progs/intel/ict/3.0/mpi/3.0/lib64/libmpiif.a(waitallf.o)(.text+0x20): In function `MPI_WAITALL':
: undefined reference to `MPI_F_STATUSES_IGNORE'
/SFS/progs/intel/ict/3.0/mpi/3.0/lib64/libmpiif.a(waitallf.o)(.text+0x36): In function `MPI_WAITALL':
: undefined reference to `PMPI_Waitall'
/SFS/progs/intel/ict/3.0/mpi/3.0/lib64/libmpiif.a(wtimef.o)(.text+0x7): In function `MPI_WTIME':
: undefined reference to `b_use_gettimeofday'
/SFS/progs/intel/ict/3.0/mpi/3.0/lib64/libmpiif.a(wtimef.o)(.text+0x44): In function `MPI_WTIME':
: undefined reference to `MPID_Wtime_todouble'
make: *** [hycom] Error 1
 

0 Kudos
1 Reply
TimP
Honored Contributor III
1,028 Views

Your LD_LIBRARY_PATH should be set according to the mpivars script in your Intel MPI installation, and the ifortvars and iccvars scripts in the compiler installations. As you are finding libmpiif.a, you should be getting the libraries in the same directory which would satisfy those MPI calls.

Maybe your option -Bstatic is causing trouble. For mpiifort, there are separate options for specifying static linking of Intel libraries:

-static_mpi for static linking of Intel MPI libraries

-i-static for static linking of all Intel Fortran and C compiler libraries

-static for static linking of everything including linux libraries

Weoften use the -i-static option, so that Intel compiler libraries aren't required on the cluster, but we generally allow the MPI and linux libraries to link dynamic.

You might first try without any static link. Then, you could try

-Bstatic -Bdynamic

so that only the special librairies you have would be subject to -Bstatic.

Also, your compilers are out of date,but that wouldn't cause the linkage problem.

0 Kudos
Reply