Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!

linker cannot reconnize -lz

dingjun_chencmgl_ca
141 Views

Hi, Intel technician,

I have a question for you about Intel 2017 Fortran compiler for Linux.

Under Linux, when I applied Intel 2017 Fortran ifort to my application and the following linker error occurred.  -lz is not recognized by 2017 ifort.exe.

The exactly same makefile is applied to 2015 Frortran ifort works and there is no such an error.

 

Please do me favor and tell me how to fix the following linker error.

 

Thanks in advance,

 

Best regards,

 

Dingjun

 

 

 

 

-bash-4.2$ make -j 16 imex.exe
/opt/intel/compilers_and_libraries_2017.1.132/linux/bin/intel64/ifort -V > compver.txt 2>&1 ; /opt/intel/compilers_and_libraries_2017.1.132/linux/bin/intel64/icc -V >> compver.txt 2>&1 ; echo "IMEX built on `uname -a`" >> compver.txt
./compver_gen.exe ; rm -f compver.txt
/opt/intel/compilers_and_libraries_2017.1.132/linux/bin/intel64/ifort -g -O3 -simd -auto -cm -w -fpp -DPN -DF95 -DLINUX -DLINUX_X64 -DOPENMP_VER -DSR3_LIB -DNO_UNROLL -threads -openmp -c compver.f
ls imex.exe > imex.exe ; \
         rm -f imex.exe ; \
     /opt/intel/compilers_and_libraries_2017.1.132/linux/bin/intel64/ifort -g  -auto -cm -w -openmp -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_LARGEFILE_SUPPORT -threads -lz  imex.o allcat.o asignv.o dynamx.o dygrck.o dbgpar.o aqcal.o begin.o bryflw.o callap.o calljb.o calllp.o callls.o callsc.o callsl.o callst.o callwm.o call_eqtpar.o chkcmx.o cldate.o clday.o compak.o conv.o cubeq.o datini.o datum.o dbrent.o denogs.o dhsfcalc.o dicrak.o diform.o diltab.o dmndmx.o dnpntr.o dpdzwb.o dvzcal.o dwlayr.o endmci.o endpts.o eqnmfc.o eqnsa.o eqnsav.o eqnsfv.o expiry.o ffrict.o fluxsct.o flxscout.o fluxsfm.o grgetsim.o hystst.o incomp.o indasr.o indata.o indatm.o indbug.o indt.o indynm.o inendpt_recur.o ineqil.o infohd.o inhert_gm.o iniblks.o inini1.o inini2.o ininit.o inio.o iniord.o innum.o inrel.o inres.o inres_fsct.o intplt.o intwrt.o inwell.o inwint.o jbuild.o jst.o krochk.o krolup.o lescal.o lessr2.o linint.o lstpar.o lstpro.o matbal.o matinv.o maxchg.o mcinit.o mnbrak.o md2sur.o mxasin.o mxcent.o mxcspf.o mxdmnew.o mxeos.o mxgetf.o mxinit.o mxptos.o mxrops.o mxsetf.o mxwskp.o ndarcy.o nondarcy.o opprnt.o outin.o outv.o outflux.o pcmnmx.o phswch.o plawln.o plawrg.o plchi.o pldchi.o pormci.o porcrb.o portab.o poten.o power.o prckey.o prkrpc.o prnbgn.o propc.o propi.o proppc.o propsn.o propsp.o propwb.o prpsat.o psdobb.o psdocm.o psdoi.o psdosb.o psfcal.o pthresh.o pthrsh_iregn.o pvtchk.o qquit.o rdprn.o relpmc.o resid.o resolve_cons.o resolve_ipr.o resolve_link.o resolve_op.o resolve_open.o resolve_stop.o resolve_tsrsm.o restrd.o restrd_tm.o restwt.o rk4wb.o rkintdf.o rkintmo.o rkintw.o rkqcwb.o rhows.o rstrcn.o rstrdd.o satlrt.o satrbl.o sbasin.o sctcal.o secout.o secsr2.o secwel.o setpfc.o setprf.o settbp.o setupv.o shif.o simdim.o sltsmo.o slvint.o solpas.o sorland.o spcchr.o spcsrf.o srfint.o srfout.o srgrid.o stab.o strsr2.o swtsmo.o sur2md.o tabsat.o tblint.o tblchk.o thswch.o timsum.o totpi.o trap.o trmcrb.o tsbomb.o tsconv.o tshead.o tswcnv.o tswell.o tswlap.o unitcn.o upkcyc.o validk.o varass.o velcty.o vrec.o watrvs.o wbcomp.o wecho.o welbr1.o welbr2.o welbr3.o welbr4.o welbr5.o welbr7.o welbrn.o welcum.o welhed.o well.o wellcs.o welout.o welpis.o welscl.o welsrf.o whpcal.o wlmpas.o wlrate.o wpinit.o wpnter.o wdpntr.o wscout.o xfcalc.o simver.o compver.o cmgfile_aloc.o eqtpar_aloc.o grmod0_aloc.o grmod1_aloc.o grmod2_aloc.o imex1_aloc.o imex2_aloc.o imex3_aloc.o kwcom1_aloc.o mxgr01_aloc.o mxinit_aloc.o mxprsl_aloc.o mxslvr_aloc.o mxslvr1_aloc.o mxwell_aloc.o point_aloc.o prtcm_aloc.o ptlocal_aloc.o sector_aloc.o sgcom0_aloc.o sgcom1_aloc.o sgcom2_aloc.o sgcom3_aloc.o sgcom4_aloc.o sgcom5_aloc.o sgscan0_aloc.o sr2com_aloc.o wmcom1_aloc.o wmcom2_aloc.o wmcom3_aloc.o wmcom4_aloc.o wmcom5_aloc.o wscom1_aloc.o aimptp.o aimptr.o avmulp.o avmult.o eqtpar.o forbkp.o forbkv.o genlup.o genluv.o jdump.o mindeg.o minsqp.o minvsq.o order.o orderp.o parasol.o prepro.o preprp.o presym.o presyp.o pstpro.o pstprp.o rdsord.o scalp.o scalpp.o symfcp.o symfcv.o gradrg.o grappk.o graqui.o grcell.o grckey.o grcnc1.o grcnc1_call.o grcnc2.o grcnc4.o grcnc5.o grcnc6.o grcnc7.o grcnc8.o grsrcd.o grcnc8nb.o grcnc8nb_call.o grcorn2nd.o grcncb.o grcnct.o grcncx.o grcncw.o grcnmp.o grcnnp.o grcnpn.o grcorn.o grcvnd.o grdbas.o grdbug.o grdbst.o grget.o grini0.o grinit.o grlast.o grload.o grmai1.o grmain.o grmess.o grnhrt.o grpdgd.o grpkpt.o grmkpt.o grptcs.o grrgtl.o grrdap.o grrdar.o grrdcp.o grrdg2.o grrdg3.o grrdg4.o grrdg5.o grrdg6.o grrdgf.o gramal.o gramck.o gramcn.o grampt.o grptwtsr.o grrdgr.o grrdpa.o grrdrg.o grread.o grresr.o grrev1.o grrev2.o grrevu.o grscan.o grset.o grspec.o grspt1.o grspt2.o grspt4.o grspt5.o grspt6.o grspt5nb.o grspt6nb.o grsptl.o grtrnf.o grunit.o grutil.o grvar1.o grvar2.o grvarm.o grvldk.o grwritecn.o igrlnk.o hydfrac.o hf_refgridcalc.o hf_refgridcalc_CP.o blksat.o condpt.o dtbinp.o dwodgo.o frcmoody.o gasden.o kro3p.o mcdeps.o mcdpfn.o mcdpit.o mcsort.o mdqcin.o oilden.o pcgwoc.o ptmech1.o rk4in.o rk4in2.o rk4st2.o rk4stp.o rkqci2.o rkqcin.o rmbgin.o satsmc.o tbintg.o watden.o welprm.o pschbd.o psgnbs.o pslvds.o pslvst.o pspldn.o psreor.o psrtls.o psslds.o ps2dds.o ps2dds_regular.o ps2dds_general.o ps2dds_actpls.o ps2dds_wrkbalance.o ps2dds_auxil.o psspa2.o psspg1.o psvrtx.o acopy.o aucopy.o cginit.o cstfun.o cstijk.o cstuba.o dpnter.o ijktps.o inuba.o ipftpm.o ipmtpf.o prtbln.o prtcon.o prtset.o ptasin.o ptcsva.o ptprn.o ubatcs.o rpfmln.o rppmul.o rptabl.o cscord.o pickpa.o prsegs.o sgallcat.o sgallcatsm.o sgbrmdq.o sgbrrd.o sgccomps.o sgchkcmp.o sgcmpdpcorr.o sgdfiftbrd.o sgdhspmrd.o sgdhsrd.o sgdhswm.o sgdhstbrd.o sgdimen.o sgebrd.o sgelemfo.o sgelemls.o sgenexrd.o sgeqpmrd.o sgeqptrd.o sgflowpath.o sggdbklst.o sgget.o sgget1.o sggrafdat.o sghtcalcrd.o sginit.o sginpt.o sgipsact.o sgjctprn.o sgrkintw.o sglenhtc.o sglenlst.o sglftgsrd.o sglgpfrrd.o sglinkdp.o sglmpmrgwm.o sglumprd.o sglyad.o sglypr.o sgmcon.o sgmonrd.o sgolsch.o sgout1.o sgout2.o sgoutlets.o sgpird.o sgparnt.o sgpoiste.o sgptrd.o sgptsync.o sgrefjctrd.o sgsachcorr.o sgscansm.o sgsclrmvwm.o sgset.o sgsgds.o sgstruct.o sgtbrd.o sgtepmrd.o sgtopmrd.o sgtord.o sgseglst.o sgperfwm.o sgpmptabsm.o sgptpmrd.o sgptptrd.o sgpjllst.o sgprgraf.o sgprsrg.o sgrsrd.o sgrswt.o sgsegflor.o sgsyncap.o sgsynclus.o sgsynintpr.o sgsettrd.o sgtseqpmrd.o sgtseqrd.o sgtsmdq.o sgtsopes.o sgtspdrd.o sgtspmrd.o sgtsrm.o sgunit.o sgupdate.o sgvalidk.o sgvalvdp.o sgvirtchk.o sgvirtpk.o sgwbhtmrd.o sgwbhtrd.o sgwbpmrd.o sgwellid.o sgweltree2.o sgwhdcal.o sgwindcalwm.o sgwindptwm.o sgwinterrd.o sgwipmrd.o sgwiptrd.o sgwlstrd.o sgwphitv.o sgwpmrd.o sgxyzitp.o treestr.o treestr2.o treetrv.o tsregs.o ubastring.o ubahpsrt.o ubalt.o ubaeq.o wbrtls.o srclos.o srcpin.o srdict.o srfrwd.o srgeta.o srinit.o srnonstdfile.o srrdea.o srrdin.o srrdt2.o srrdt2c.o srrdt3.o srrdt4.o srrdt5.o srrdt6.o srrdtm.o srrkls.o srscan.o srsclr.o srscrr.o srscxd.o srseta.o srskip.o srskt2.o srvrat.o srwkls.o srwkni.o srwpar.o srwpt2.o srwret.o srwrfn.o srwrt1.o srwrt2.o srwrt2c.o srwrt3.o srwrt4.o srwrt5.o srwrt6.o srwrtm.o xdrint.o aiqual.o bicgstab.o cdatim.o chtoup.o cmgtar.o cpack.o cst_bm.o datime.o dbgbrk.o dbtoch.o exxit.o getcpu.o getdpr.o getclk.o getwrd.o header.o hepsrt.o ihpsrt.o inaray.o inuary.o infile.o in8toch.o inltoch.o intabl.o intoch.o kyobls.o kyskip.o kwget.o kwset.o lnb.o messag.o parse.o procstat.o rcaray.o rcdpr.o rdaray.o rdblkgrp.o rdline.o rltoch.o setio.o siggst.o str_delim.o string.o tearwd.o wsallc.o wscall.o wschck.o wsfree.o wsinit.o wsprnt.o  wmalin.o wmbdin.o wmbrwi.o wmbwit.o wmcent.o wmcgin.o wmcknm.o wmclin.o wmcmpi.o wmcmpp.o wmcmsg.o wmcnvt.o wmcsin.o wmcsvi.o wmcwsi.o wmcwst.o wmdrin.o wmdvin.o wmdwsm.o wmfcin.o wmfclu.o wmfmiw.o wmfmpw.o wmfrbk.o wmfwin.o wmgcci.o wmgccp.o wmgccv.o wmgcin.o wmgdri.o wmgdrp.o wmget.o wmgetf.o wmgetforsg.o wmgetll.o wmgetsg.o wmghyd.o wmghyi.o wmgimr.o wmglin.o wmglls.o wmgnlu.o wmgpmr.o wmgrai.o wmgrap.o wmgrcn.o wmgrin.o wmgrls.o wmgydi.o wmgydr.o wmgyfi.o wmgyfs.o wmhfpin.o wmhydi.o wmhydr.o wmhyfs.o wmhymd.o wmhysi.o wmichc.o wmigai.o wmigap.o wmilst.o wmimap.o wminit.o wminmr.o wminsr.o wminje.o wminpt.o wmipai.o wmipap.o wmipr.o wmisin.o wmisum.o wmitin.o wmitlu.o wmkyin.o wmlbin.o wmlcin.o wmlgci.o wmlgcp.o wmlgin.o wmlifd.o wmlift.o wmllin.o wmllrc.o wmlmpsetlysm.o wmlmpmrgsm.o wmlyid.o wmlynm.o wmlopd.o wmlypr.o wmlimc.o wmlioc.o wmlpmc.o wmlpoc.o wmlsin.o wmlsrt.o wmlyad.o wmlyif.o wmlypn.o wmlypnsg.o wmmain.o wmmani.o wmmanp.o wmmcni.o wmmcon.o wmmimr.o wmmirt.o wmmirz.o wmmisi.o wmmnti.o wmmpmr.o wmmprt.o wmmprz.o wmmpsi.o wmmsnt.o wmmssm.o wmmtri.o wmmtrt.o wmmwpr.o wmmxit.o wmmxth.o wmncch.o wmncci.o wmndpn.o wmndti.o wmocni.o wmocon.o wmopnl.o wmopnw.o wmotin.o wmowwi.o wmowwp.o wmpchc.o wmpiin.o wmplri.o wmplrt.o wmplst.o wmprin.o wmprmr.o wmprn1.o wmprn3.o wmprn4.o wmprn5.o wmprn6.o wmprnt.o wmprod.o wmpsum.o wmptin.o wmptlu.o wmpwwo.o wmqimx.o wmqpmx.o wmrcal.o wmrcit.o wmrcyc.o wmrgin.o wmrkai.o wmrkap.o wmrlin.o wmrllr.o wmrlnl.o wmropn.o wmresetlysg.o wmrsrd.o wmrswt.o wmrtgi.o wmrtgp.o wmrtinsm.o wmrtzo.o wmrzth.o wmrzoi.o wmscan.o wmscin.o wmsclrmvsm.o wmscpm.o wmset.o wmsetf.o wmsgwhdcal.o wmsgwhpcal.o wmsgwin.o wmsgwly.o wmsgwindcalsm.o wmsr2h.o wmsr2m.o wmsrln.o wmtrch.o wmtrin.o wmtrst.o wmtrte.o wmtrwt.o wmupcm.o wmvldk.o wmvpin.o wmwain.o wmwbhp.o wmwcut.o wmwfri.o wmwfrg.o wmwfrp.o wmwgfp.o wmwhin.o wmwhsm.o wmwhyd.o wmwindptsm.o wmwlin.o wmwlls.o wmwlpn.o wmwlsr.o wmwlwt.o wmwshut.o wmwtin.o   grspt3.o gmresp.o solver.o tsio.o      imex1_mod.o imex2_mod.o imex3_mod.o mxgr01_mod.o mxinit_mod.o mxslvr1_mod.o mxslvr_mod.o mxprsl_mod.o mxwell_mod.o params_mod.o sector_mod.o aimint_mod.o aimloc_mod.o eqtpar_mod.o grmod0_mod.o grmod1_mod.o grmod2_mod.o hydfrac_mod.o domain2dproc_mod.o point_mod.o ptlocal_mod.o prtcm_mod.o sgcom0_mod.o sgcom1_mod.o sgcom2_mod.o sgcom3_mod.o sgcom4_mod.o sgscan0_mod.o sgcom5_mod.o sr2com_mod.o sr3int_mod.o xdrint_mod.o srdict_mod.o cmgfile_mod.o globstore_mod.o kwcom1_mod.o large_int_mod.o platform.o toolsint_mod.o wscom1_mod.o wmcom1_mod.o wmcom2_mod.o wmcom3_mod.o wmcom4_mod.o wmcom5_mod.o \
           libsecure.a librlm.a libbinarrayfile.a -L/opt/intel/compilers_and_libraries_2017.1.132/linux/mkl/lib/intel64 -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core libSR3SimInterface.a libhdf5_cpp.a libhdf5_hl.a libhdf5.a libboost_regex.a libboost_system.a libboost_filesystem.a libstdc++.a -oimex.exe ; \
     echo 'Done.'
ld: cannot find -lz
Done.
 

 

 

0 Kudos
1 Reply
Kevin_D_Intel
Employee
141 Views

The Intel compiler’s handling of the -l option has not changed between 2015 (15.0) and 2017 (17.0) releases; both pass the option directly to the linker. The -l<namespec> option adds a named archive to the link. In your case <namespec> is “z” so the linker searches for libz.a or libz.so.

From the link command-line shown the app expects to use the system's libz (and not a privately built version) which must be missing from your system. Perhaps you are not building with Intel 2015 and 2017 on the same Linux system.

I suspect the root cause of the issue is the Linux system with 2017 is lacking an RPM so you should check for a missing zlib RPM. I don’t know your Linux distro, but on RHEL 7.0, libz.zo.1 installs from the zlib RPM:

$ rpm -qf /usr/lib64/libz.so.1
zlib-1.2.7-13.el7.x86_64

$ ls -l /usr/lib64/libz.*
lrwxrwxrwx. 1 root root    13 Mar 31  2015 /usr/lib64/libz.so -> libz.so.1.2.7
lrwxrwxrwx. 1 root root    13 Mar 29  2015 /usr/lib64/libz.so.1 -> libz.so.1.2.7
-rwxr-xr-x. 1 root root 90632 Jan 27  2014 /usr/lib64/libz.so.1.2.7

Reply