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

problem about linking a mixed c/fortran parallel code with mpif77

lei_c_
Beginner
367 Views

Hi,
I have a problem linking a mixed c/fortran code with mpif77:

the option for compilers and the error message are following :

.........

.........

icc -O0 -DPP_RHOMB_TRUNC=15 -I/snfs01/elfin/mpich2/include -DWORD4 -DLINUX -o om3coupled.o -c om3coupled.c
om3coupled.c(4172): warning #592: variable "ellen" is used before its value is set
send_and_receive_v(west, tag, msg_in, ellen, stride, elcnt, east, msg_out);

om3coupled.c(4172): warning #592: variable "stride" is used before its value is set
send_and_receive_v(west, tag, msg_in, ellen, stride, elcnt, east, msg_out);

om3coupled.c(4172): warning #592: variable "elcnt" is used before its value is set
send_and_receive_v(west, tag, msg_in, ellen, stride, elcnt, east, msg_out);

make: Compiling coup_restrt.F
ifort -E -DPP_RHOMB_TRUNC=15 -I/snfs01/elfin/mpich2/include -DWORD4 -DLINUX -I. -I./MPI -DPP_MPI coup_restrt.F > coup_restrt.f
ifort -O3 -unroll -o coup_restrt.o -c coup_restrt.f
make: Compiling pradalb.F
ifort -E -DPP_RHOMB_TRUNC=15 -I/snfs01/elfin/mpich2/include -DWORD4 -DLINUX -I. -I./MPI -DPP_MPI pradalb.F > pradalb.f
ifort -O3 -unroll -o pradalb.o -c pradalb.f

make: Compiling foam.c
icc -O0 -DPP_RHOMB_TRUNC=15 -I/snfs01/elfin/mpich2/include -DWORD4 -DLINUX -o foam.o -c foam.c
make: Compiling UTP_main.c
icc -O0 -DPP_RHOMB_TRUNC=15 -I/snfs01/elfin/mpich2/include -DWORD4 -DLINUX -o UTP_main.o -c UTP_main.c
mpif77 -nofor-main -o foam abort.o abortf.o advnce.o aphys.o aqsat.o aqsatd.o assign.o atchbnd.o attach.o bandij.o basdy.o basdz.o basiy.o binsum.o bldfld.o bldfln.o bldfln_a.o blkdat.o blkres.o blowup.o bnddyi.o bsslzr.o bwd_fftx.o cainti.o caldyi.o ccm2.o cfftb.o cfftf.o change_dir.o cldclw.o cldems.o cldfrc.o cldint.o cldsav.o clock.o cmfmca.o cmphes.o cmplr.o cmpsnw.o cond.o copyac.o cpslhy.o cubxdr.o cubydr.o cubzdr.o dadadj.o data.o date.o decompose.o denormal860.o difcor.o dyn.o dyndrv.o endrun.o error_dup3.o esat.o esinti.o esslft.o extx.o extys.o extyv.o fft99.o fft_xpose_ccm.o fldlst.o flushpipe.o fmrgrid.o fwd_fftx.o g2spos.o gadd.o gather.o gauaw.o geomid.o gestbl.o gffgch.o gmax.o grcalc.o grdini.o grdxy.o grmult.o mgwinti.o mgwintr.o mgwdrag.o halfimax.o halfmax.o halfsum.o hchar.o hdinti.o herxin.o heryin.o herzin.o hordif.o hrintp.o hrvint.o hycoef.o idate.o igtseq.o inidat.o inifld.o inital.o initcom.o intbnd.o inthed.o intht.o inti.o iostop.o irdarr.o ishell.o ismax.o ismin.o isrchfgt.o isrchfle.o iwrtarr.o kdpfnd.o lagyin.o lcbas.o lcdbas.o lenchr.o limdx.o limdy.o limdz.o ljust.o log2xx.o logtrans.o lunits.o map.o mfinti.o mint.o mkslic.o msgbase.o mtdlss.o mvdiff.o navu.o omcalc.o outfld.o ovrlap.o oznini.o oznint.o parlyz.o pbinti.o pbldif.o pck_rstrt_b.o pdelb0.o permute.o phcs.o physdrv.o physics.o plevs0.o points.o pottem.o prealc.o preset.o prnthd.o qmassa.o qmassd.o qneg1.o qneg2.o qneg3.o qreig.o qsat.o quad.o qvdiff.o radabs.o radalb.o radclr.o radclw.o radcsw.o radctl.o radded.o radems.o radini.o radinp.o radoz2.o radozn.o radtpl.o radxfr.o rdbcst.o rdharr.o rdhdr.o rdrs1.o rdrs1_a.o readarr.o readrg.o reordp.o resetr.o resetr_sub.o restrt.o resume.o rfinti.o rfintr.o rft235.o rfric.o rftlon.o rgnfls.o ringimax.o ringmax.o ringsum.o s2gphi.o s2gvel.o savdis.o scan1.o scan1a.o scan2.o scatter.o scm0.o sdot.o settau.o sgexx.o sltb1.o sltini.o spegrd.o spetru.o spg_a.o spg_c.o spgrdrv.o spgrdrv_a.o spgrdrv_c.o sphdep.o splitg.o srfflx.o srfint.o srftsb.o srtrans.o sstan.o sstini.o sstint.o stats.o stepdrv.o stepdrv_c.o stepon.o swaptrans.o timers.o tiread.o torgrid.o tphys.o trajmp.o transpose.o trjgl.o trjmps.o trunc.o tsinti.o tstep.o unpka.o upcase.o vdiff.o vdinti.o vdintr.o vdplim.o virtem.o vqsat.o vqsatd.o vrtdep.o vrtmap.o wheneq.o whenfgt.o whenflt.o whenwr.o wrapup.o writeric.o writup.o wrtharr.o wrthdr.o wrtrs1.o wsds.o wshist.o xform.o xformdrv.o zint.o zmid.o conv_ccm.o buoyan.o cldprp.o closure.o q1q2.o convtran.o cldefr.o aermix.o trcab.o trcabn.o trcems.o trcmix.o trcplk.o trcpth.o whenne.o intmax.o comm/MPI/mpi.o comm/MPI/picl.o comm/MPI/sendrecv.o comm/MPI/swap.o mpi_coupled.o cvmgt.o om3coupled.o coup_restrt.o pradalb.o pcoszrs.o pcoupler.o coup_init.o ccm2lnd_drv.o csmice_drv.o ticezl.o tice3l.o pomtdlss.o posrfflx.o posrftsb.o priver.o pflxoce.o pflxsice.o foam.o UTP_main.o -L/snfs01/elfin/mpich2/lib -lmpich -lbsd

/snfs01/elfin/intel/composer_xe_2013.1.117/compiler/lib/intel64/libifcore.a(for_main.o): In function `main':
for_main.c:(.text+0x4a): undefined reference to `MAIN__'

The bold italic characters with a underline is error message.

(I run the programmes in clusters with linux centos 6.0, the compiler is  parallel_studio_xe_2013_update1_intel64 and the mpi ismpich2-1.5  )

Thanks for any help.

qqydss

0 Kudos
1 Reply
TimP
Honored Contributor III
367 Views
I don't see why -nofor-main is not taking effect. mpif77, if correctly built for mpich2, would have embedded in it the -L and -l specifications for mpich2, so it appears there may be a conflict. Likewise, mpif77 and mpicc would have embedded -I specification for the mpich2 so you wouldn't need a consistent MPI include directory in ./MPI when you use them in place of ifort and icc. If you are building an open source application such as Openfoam, the wiki pages and help site for that application would be a better source of knowledge than this one, particularly as you aren't using an Intel provided MPI.
0 Kudos
Reply