undefined reference to

Hi,

I have installed PGI Workstation Complete in Fedora Core 4 system. I need it to compile MM5 model. but when I try to compile, I am getting this:
error while loading shared libraries: /opt/pgi/linux86/6.1/lib/libpgc.so: cannot restore segment prot after reloc: Permission denied


it seems that problem is with reading the libraries, because at the end of output appears:

/opt/pgi/linux86/6.1/lib/libf2c.a(open.o)(.text+0x35f): In function f_open': open.c: warning: the use of tmpnam’ is dangerous, better use mkstemp' /opt/pgi/linux86/6.1/lib/libf2c.a(lread.o)(.text+0x19d): In function l_R’:
lread.c: undefined reference to __ctype_b' /opt/pgi/linux86/6.1/lib/libf2c.a(lread.o)(.text+0x248):lread.c: undefined reference to __ctype_b’
/opt/pgi/linux86/6.1/lib/libf2c.a(lread.o)(.text+0x2a6):lread.c: undefined reference to __ctype_b' /opt/pgi/linux86/6.1/lib/libf2c.a(lread.o)(.text+0x2ce):lread.c: undefined reference to __ctype_b’
/opt/pgi/linux86/6.1/lib/libf2c.a(lread.o)(.text+0x77e): In function l_L': lread.c: undefined reference to __ctype_b’
/opt/pgi/linux86/6.1/lib/libf2c.a(lread.o)(.text+0x9ba):lread.c: more undefined references to `__ctype_b’ follow
make[1]: [terrain.exe] Error 2 (ignored)


all the make.out file look so:

uname -a > .tmpfile
grep crayx1 .tmpfile ;
if [ $? = 0 ]; then echo “Compiling for CRAY X1” ;
( cd src ; make -i -f Makefile.x1 all
“RM = /bin/rm -f” “RM_LIST = *.o *.f core .tmpfile terrain.exe data_area.exe rdem.exe rdnml”
“LN = ln -s” “MACH = crayx1”
“MAKE = make -i -f Makefile” “CPP = cpp”
“CPPFLAGS = -eZ -I. -DNCARG -DRECLENBYTE -UCRAY”
“FC = ftn” "FCFLAGS = -I. -ra "
"LDOPTIONS = " "CFLAGS = "
"LOCAL_LIBRARIES= " ) ;
else
grep CRAY .tmpfile ;
if [ $? = 0 ]; then echo “Compiling for CRAY” ;
( cd src ; make -i -f Makefile all
“RM = /bin/rm -f” “RM_LIST = *.o *.f core .tmpfile terrain.exe data_area.exe rdem.exe rdnml”
“LN = ln -s” “MACH = CRAY”
“MAKE = make -i -f Makefile” “CPP = /opt/ctl/bin/cpp”
“CPPFLAGS = -I. -C -P -DNCARG -DRECLENBYTE”
“FC = f90” “FCFLAGS = -I.”
"LDOPTIONS = " "CFLAGS = "
“LOCAL_LIBRARIES= -L/usr/local/lib -lncarg -lncarg_gks -lncarg_c -lX11 -lm” ) ;
else
grep OSF .tmpfile ;
if [ $? = 0 ]; then echo “Compiling for Compaq” ;
( cd src ; make -i -f Makefile all
“RM = /bin/rm -f” “RM_LIST = *.o *.f core .tmpfile terrain.exe data_area.exe rdem.exe rdnml”
“LN = ln -s” “MACH = DEC”
“MAKE = make -i -f Makefile” “CPP = /usr/bin/cpp”
“CPPFLAGS = -I. -C -P -DNCARG”
“FC = f77” “FCFLAGS = -I. -convert big_endian -fpe”
"LDOPTIONS = " "CFLAGS = "
“LOCAL_LIBRARIES= -L/usr/local/ncarg/lib -lncarg -lncarg_gks -lncarg_c -lX11 -lm” ) ;
else
grep IRIX .tmpfile ;
if [ $? = 0 ]; then echo “Compiling for SGI” ;
( cd src ; make -i -f Makefile all
“RM = /bin/rm -f” “RM_LIST = *.o *.f core .tmpfile terrain.exe data_area.exe rdem.exe rdnml”
“LN = ln -s” “MACH = SGI”
“MAKE = make -i -f Makefile” “CPP = /lib/cpp”
“CPPFLAGS = -I. -C -P -DNCARG”
“FC = f77” “FCFLAGS = -I. -n32”
“LDOPTIONS = -n32” “CFLAGS = -I. -n32”
“LOCAL_LIBRARIES= -L/usr/local/ncarg/lib -L/usr/local/lib -lncarg -lncarg_gks -lncarg_c -lX11 -lm” ) ;
else
grep HP .tmpfile ;
if [ $? = 0 ]; then echo “Compiling for HP” ;
( cd src ; make -i -f Makefile all
“RM = /bin/rm -f” “RM_LIST = *.o *.f core .tmpfile terrain.exe data_area.exe rdem.exe rdnml”
“LN = ln -s” “MACH = HP”
“MAKE = make -i -f Makefile” “CPP = /opt/langtools/lbin/cpp”
“CPPFLAGS= -I. -C -P -DNCARG -DRECLENBYTE”
“FC = f77” “FCFLAGS = -I. -O”
"LDOPTIONS = " “CFLAGS = -Aa”
“LOCAL_LIBRARIES= -L/usr/local/ncarg/lib -L/usr/local/lib -lncarg -lncarg_gks -lncarg_c -lX11 -lm” ) ;
else
grep SUN .tmpfile ;
if [ $? = 0 ]; then echo “Compiling for SUN” ;
( cd src ; make -i -f Makefile all
“RM = /bin/rm -f” “RM_LIST = *.o *.f core .tmpfile terrain.exe data_area.exe rdem.exe rdnml”
“LN = ln -s” “MACH = SUN”
“MAKE = make -i -f Makefile” “CPP = /usr/ccs/lib/cpp”
“CPPFLAGS=-I. -C -P -DNCARG -DRECLENBYTE”
“FC = f77” “FCFLAGS = -I.”
"LDOPTIONS = " “CFLAGS = -I.”
“LOCAL_LIBRARIES= -L/usr/local/ncarg/lib -L/usr/openwin/lib -L/usr/dt/lib -lncarg -lncarg_gks -lncarg_c -lX11 -lm” ) ;
else
grep AIX .tmpfile ;
if [ $? = 0 ]; then echo “Compiling for IBM” ;
( cd src ; make -i -f Makefile all
“RM = /bin/rm -f” “RM_LIST = *.o *.f core .tmpfile terrain.exe data_area.exe rdem.exe rdnml”
“LN = ln -s” “MACH = IBM”
“MAKE = make -i -f Makefile” “CPP = /usr/lib/cpp”
“CPPFLAGS = -I. -C -P -DNCARG -DRECLENBYTE”
“FC = xlf” “FCFLAGS = -I. -O -qmaxmem=-1”
“LDOPTIONS = -bmaxstack:512000000 -bmaxdata:2000000000” “CFLAGS = -I.”
“LOCAL_LIBRARIES= -L/usr/local/lib32/r4i4 -lncarg -lncarg_gks -lncarg_c -lX11 -lm” ) ;
else
grep Darwin .tmpfile ;
if [ $? = 0 ]; then echo “Compiling for MAC” ;
( cd src ; make -i -f Makefile all
“RM = /bin/rm -f” “RM_LIST = *.o *.f core .tmpfile terrain.exe data_area.exe rdem.exe rdnml”
“LN = ln -s” “MACH = IBM”
“MAKE = make -i -f Makefile” “CPP = /usr/bin/cpp”
“CPPFLAGS = -I. -C -P -DNONCARG -DRECLENBYTE -xassembler-with-cpp”
“FC = xlf” "FCFLAGS = -I. -O "
“LDOPTIONS = -Wl,-stack_size,10000000,-stack_addr,0xc0000000” “CFLAGS = -I.”
“LOCAL_LIBRARIES= -L/usr/local/ncarg/lib -lncarg -lncarg_gks -lncarg_c -L/usr/X11R6/lib -lX11 -lm” ) ;
else
grep Linux .tmpfile ;
if [ $? = 0 ]; then echo “Compiling for Linux” ;
( cd src ; make -i -f Makefile all
“RM = /bin/rm -f” “RM_LIST = *.o *.f core .tmpfile terrain.exe data_area.exe rdem.exe rdnml”
“LN = ln -s” “MACH = SGI”
“MAKE = make -i -f Makefile” “CPP = /lib/cpp”
“CPPFLAGS = -I. -C -traditional -DNCARG -DRECLENBYTE”
“FC = pgf90” “FCFLAGS = -I. -byteswapio”
"LDOPTIONS = " “CFLAGS = -I.”
“LOCAL_LIBRARIES= -L/usr/local/ncarg/lib -L/usr/X11R6/lib -lncarg -lncarg_gks -lncarg_c -lX11 -L/opt/pgi/linux86/lib -L/usr/lib -lf2c” ) ;
else echo “Do not know how to compile for the cat .tmpfile machine.”
fi ;
fi ;
fi ;
fi ;
fi ;
fi ;
fi ;
fi ;
fi ;
fi ;
( /bin/rm -f terrain.exe ; ln -s src/terrain.exe . ) ;
Linux localhost.localdomain 2.6.11-1.1369_FC4smp #1 SMP Thu Jun 2 23:08:39 EDT 2005 i686 i686 i386 GNU/Linux
Compiling for Linux
make[1]: Entering directory /home/audrius/TERRAIN/src' /bin/rm -f ia.f cut -c1-72 ia.F | /lib/cpp -I. -C -traditional -DNCARG -DRECLENBYTE -DSGI > ia.f /bin/rm -f ia.o pgf90 -c -I. -byteswapio ia.f /bin/rm -f ia.f /bin/rm -f anal2.f cut -c1-72 anal2.F | /lib/cpp -I. -C -traditional -DNCARG -DRECLENBYTE -DSGI > anal2.f /bin/rm -f anal2.o pgf90 -c -I. -byteswapio anal2.f /bin/rm -f anal2.f /bin/rm -f bint.f cut -c1-72 bint.F | /lib/cpp -I. -C -traditional -DNCARG -DRECLENBYTE -DSGI > bint.f /bin/rm -f bint.o pgf90 -c -I. -byteswapio bint.f /bin/rm -f bint.f /bin/rm -f bndry.f cut -c1-72 bndry.F | /lib/cpp -I. -C -traditional -DNCARG -DRECLENBYTE -DSGI > bndry.f /bin/rm -f bndry.o pgf90 -c -I. -byteswapio bndry.f /bin/rm -f bndry.f /bin/rm -f crlnd.f cut -c1-72 crlnd.F | /lib/cpp -I. -C -traditional -DNCARG -DRECLENBYTE -DSGI > crlnd.f /bin/rm -f crlnd.o pgf90 -c -I. -byteswapio crlnd.f /bin/rm -f crlnd.f /bin/rm -f crter.f cut -c1-72 crter.F | /lib/cpp -I. -C -traditional -DNCARG -DRECLENBYTE -DSGI > crter.f /bin/rm -f crter.o pgf90 -c -I. -byteswapio crter.f /bin/rm -f crter.f /bin/rm -f dfclrs.f cut -c1-72 dfclrs.F | /lib/cpp -I. -C -traditional -DNCARG -DRECLENBYTE -DSGI > dfclrs.f /bin/rm -f dfclrs.o pgf90 -c -I. -byteswapio dfclrs.f /bin/rm -f dfclrs.f /bin/rm -f exaint.f cut -c1-72 exaint.F | /lib/cpp -I. -C -traditional -DNCARG -DRECLENBYTE -DSGI > exaint.f /bin/rm -f exaint.o pgf90 -c -I. -byteswapio exaint.f /bin/rm -f exaint.f /bin/rm -f finprt.f cut -c1-72 finprt.F | /lib/cpp -I. -C -traditional -DNCARG -DRECLENBYTE -DSGI > finprt.f /bin/rm -f finprt.o pgf90 -c -I. -byteswapio finprt.f /bin/rm -f finprt.f /bin/rm -f fudger.f cut -c1-72 fudger.F | /lib/cpp -I. -C -traditional -DNCARG -DRECLENBYTE -DSGI > fudger.f /bin/rm -f fudger.o pgf90 -c -I. -byteswapio fudger.f /bin/rm -f fudger.f /bin/rm -f interp.f cut -c1-72 interp.F | /lib/cpp -I. -C -traditional -DNCARG -DRECLENBYTE -DSGI > interp.f /bin/rm -f interp.o pgf90 -c -I. -byteswapio interp.f /bin/rm -f interp.f /bin/rm -f label.f cut -c1-72 label.F | /lib/cpp -I. -C -traditional -DNCARG -DRECLENBYTE -DSGI > label.f /bin/rm -f label.o pgf90 -c -I. -byteswapio label.f /bin/rm -f label.f /bin/rm -f lakes.f cut -c1-72 lakes.F | /lib/cpp -I. -C -traditional -DNCARG -DRECLENBYTE -DSGI > lakes.f /bin/rm -f lakes.o pgf90 -c -I. -byteswapio lakes.f /bin/rm -f lakes.f /bin/rm -f latlon.f cut -c1-72 latlon.F | /lib/cpp -I. -C -traditional -DNCARG -DRECLENBYTE -DSGI > latlon.f /bin/rm -f latlon.o pgf90 -c -I. -byteswapio latlon.f /bin/rm -f latlon.f /bin/rm -f llxy.f cut -c1-72 llxy.F | /lib/cpp -I. -C -traditional -DNCARG -DRECLENBYTE -DSGI > llxy.f /bin/rm -f llxy.o pgf90 -c -I. -byteswapio llxy.f /bin/rm -f llxy.f /bin/rm -f mxmnll.f cut -c1-72 mxmnll.F | /lib/cpp -I. -C -traditional -DNCARG -DRECLENBYTE -DSGI > mxmnll.f /bin/rm -f mxmnll.o pgf90 -c -I. -byteswapio mxmnll.f /bin/rm -f mxmnll.f /bin/rm -f nestll.f cut -c1-72 nestll.F | /lib/cpp -I. -C -traditional -DNCARG -DRECLENBYTE -DSGI > nestll.f /bin/rm -f nestll.o pgf90 -c -I. -byteswapio nestll.f /bin/rm -f nestll.f /bin/rm -f oned.f cut -c1-72 oned.F | /lib/cpp -I. -C -traditional -DNCARG -DRECLENBYTE -DSGI > oned.f /bin/rm -f oned.o pgf90 -c -I. -byteswapio oned.f /bin/rm -f oned.f /bin/rm -f outpt.f cut -c1-72 outpt.F | /lib/cpp -I. -C -traditional -DNCARG -DRECLENBYTE -DSGI > outpt.f /bin/rm -f outpt.o pgf90 -c -I. -byteswapio outpt.f /bin/rm -f outpt.f /bin/rm -f output.f cut -c1-72 output.F | /lib/cpp -I. -C -traditional -DNCARG -DRECLENBYTE -DSGI > output.f /bin/rm -f output.o pgf90 -c -I. -byteswapio output.f /bin/rm -f output.f /bin/rm -f pltter.f cut -c1-72 pltter.F | /lib/cpp -I. -C -traditional -DNCARG -DRECLENBYTE -DSGI > pltter.f /bin/rm -f pltter.o pgf90 -c -I. -byteswapio pltter.f /bin/rm -f pltter.f /bin/rm -f rdldtr.f cut -c1-72 rdldtr.F | /lib/cpp -I. -C -traditional -DNCARG -DRECLENBYTE -DSGI > rdldtr.f /bin/rm -f rdldtr.o pgf90 -c -I. -byteswapio rdldtr.f /bin/rm -f rdldtr.f /bin/rm -f replace.f cut -c1-72 replace.F | /lib/cpp -I. -C -traditional -DNCARG -DRECLENBYTE -DSGI > replace.f /bin/rm -f replace.o pgf90 -c -I. -byteswapio replace.f /bin/rm -f replace.f /bin/rm -f rflp.f cut -c1-72 rflp.F | /lib/cpp -I. -C -traditional -DNCARG -DRECLENBYTE -DSGI > rflp.f /bin/rm -f rflp.o pgf90 -c -I. -byteswapio rflp.f /bin/rm -f rflp.f /bin/rm -f setup.f cut -c1-72 setup.F | /lib/cpp -I. -C -traditional -DNCARG -DRECLENBYTE -DSGI > setup.f /bin/rm -f setup.o pgf90 -c -I. -byteswapio setup.f /bin/rm -f setup.f /bin/rm -f sint.f cut -c1-72 sint.F | /lib/cpp -I. -C -traditional -DNCARG -DRECLENBYTE -DSGI > sint.f /bin/rm -f sint.o pgf90 -c -I. -byteswapio sint.f /bin/rm -f sint.f /bin/rm -f smth121.f cut -c1-72 smth121.F | /lib/cpp -I. -C -traditional -DNCARG -DRECLENBYTE -DSGI > smth121.f /bin/rm -f smth121.o pgf90 -c -I. -byteswapio smth121.f /bin/rm -f smth121.f /bin/rm -f smther.f cut -c1-72 smther.F | /lib/cpp -I. -C -traditional -DNCARG -DRECLENBYTE -DSGI > smther.f /bin/rm -f smther.o pgf90 -c -I. -byteswapio smther.f /bin/rm -f smther.f /bin/rm -f smthtr.f cut -c1-72 smthtr.F | /lib/cpp -I. -C -traditional -DNCARG -DRECLENBYTE -DSGI > smthtr.f /bin/rm -f smthtr.o pgf90 -c -I. -byteswapio smthtr.f /bin/rm -f smthtr.f /bin/rm -f terdrv.f cut -c1-72 terdrv.F | /lib/cpp -I. -C -traditional -DNCARG -DRECLENBYTE -DSGI > terdrv.f /bin/rm -f terdrv.o pgf90 -c -I. -byteswapio terdrv.f /bin/rm -f terdrv.f /bin/rm -f terrain.f cut -c1-72 terrain.F | /lib/cpp -I. -C -traditional -DNCARG -DRECLENBYTE -DSGI > terrain.f /bin/rm -f terrain.o pgf90 -c -I. -byteswapio terrain.f /bin/rm -f terrain.f /bin/rm -f tfudge.f cut -c1-72 tfudge.F | /lib/cpp -I. -C -traditional -DNCARG -DRECLENBYTE -DSGI > tfudge.f /bin/rm -f tfudge.o pgf90 -c -I. -byteswapio tfudge.f /bin/rm -f tfudge.f /bin/rm -f vtran.f cut -c1-72 vtran.F | /lib/cpp -I. -C -traditional -DNCARG -DRECLENBYTE -DSGI > vtran.f /bin/rm -f vtran.o pgf90 -c -I. -byteswapio vtran.f /bin/rm -f vtran.f /bin/rm -f xyobsll.f cut -c1-72 xyobsll.F | /lib/cpp -I. -C -traditional -DNCARG -DRECLENBYTE -DSGI > xyobsll.f /bin/rm -f xyobsll.o pgf90 -c -I. -byteswapio xyobsll.f /bin/rm -f xyobsll.f /bin/rm -f hiresmap.f cut -c1-72 hiresmap.F | /lib/cpp -I. -C -traditional -DNCARG -DRECLENBYTE -DSGI > hiresmap.f /bin/rm -f hiresmap.o pgf90 -c -I. -byteswapio hiresmap.f /bin/rm -f hiresmap.f /bin/rm -f plots.f cut -c1-72 plots.F | /lib/cpp -I. -C -traditional -DNCARG -DRECLENBYTE -DSGI > plots.f /bin/rm -f plots.o pgf90 -c -I. -byteswapio plots.f /bin/rm -f plots.f /bin/rm -f crvst.f cut -c1-72 crvst.F | /lib/cpp -I. -C -traditional -DNCARG -DRECLENBYTE -DSGI > crvst.f /bin/rm -f crvst.o pgf90 -c -I. -byteswapio crvst.f /bin/rm -f crvst.f /bin/rm -f crvst30s.f cut -c1-72 crvst30s.F | /lib/cpp -I. -C -traditional -DNCARG -DRECLENBYTE -DSGI > crvst30s.f /bin/rm -f crvst30s.o pgf90 -c -I. -byteswapio crvst30s.f /bin/rm -f crvst30s.f /bin/rm -f nestbdy.f cut -c1-72 nestbdy.F | /lib/cpp -I. -C -traditional -DNCARG -DRECLENBYTE -DSGI > nestbdy.f /bin/rm -f nestbdy.o pgf90 -c -I. -byteswapio nestbdy.f /bin/rm -f nestbdy.f /bin/rm -f crsoil.f cut -c1-72 crsoil.F | /lib/cpp -I. -C -traditional -DNCARG -DRECLENBYTE -DSGI > crsoil.f /bin/rm -f crsoil.o pgf90 -c -I. -byteswapio crsoil.f /bin/rm -f crsoil.f /bin/rm -f equate.f cut -c1-72 equate.F | /lib/cpp -I. -C -traditional -DNCARG -DRECLENBYTE -DSGI > equate.f /bin/rm -f equate.o pgf90 -c -I. -byteswapio equate.f /bin/rm -f equate.f /bin/rm -f labels.f cut -c1-72 labels.F | /lib/cpp -I. -C -traditional -DNCARG -DRECLENBYTE -DSGI > labels.f /bin/rm -f labels.o pgf90 -c -I. -byteswapio labels.f /bin/rm -f labels.f /bin/rm -f labelv.f cut -c1-72 labelv.F | /lib/cpp -I. -C -traditional -DNCARG -DRECLENBYTE -DSGI > labelv.f /bin/rm -f labelv.o pgf90 -c -I. -byteswapio labelv.f /bin/rm -f labelv.f /bin/rm -f patch.f cut -c1-72 patch.F | /lib/cpp -I. -C -traditional -DNCARG -DRECLENBYTE -DSGI > patch.f /bin/rm -f patch.o pgf90 -c -I. -byteswapio patch.f /bin/rm -f patch.f /bin/rm -f plotcon.f cut -c1-72 plotcon.F | /lib/cpp -I. -C -traditional -DNCARG -DRECLENBYTE -DSGI > plotcon.f /bin/rm -f plotcon.o pgf90 -c -I. -byteswapio plotcon.f /bin/rm -f plotcon.f /bin/rm -f watercheck.f cut -c1-72 watercheck.F | /lib/cpp -I. -C -traditional -DNCARG -DRECLENBYTE -DSGI > watercheck.f /bin/rm -f watercheck.o pgf90 -c -I. -byteswapio watercheck.f /bin/rm -f watercheck.f /bin/rm -f crlwmsk.f cut -c1-72 crlwmsk.F | /lib/cpp -I. -C -traditional -DNCARG -DRECLENBYTE -DSGI > crlwmsk.f /bin/rm -f crlwmsk.o pgf90 -c -I. -byteswapio crlwmsk.f /bin/rm -f crlwmsk.f /bin/rm -f soil_tg.f cut -c1-72 soil_tg.F | /lib/cpp -I. -C -traditional -DNCARG -DRECLENBYTE -DSGI > soil_tg.f /bin/rm -f soil_tg.o pgf90 -c -I. -byteswapio soil_tg.f /bin/rm -f soil_tg.f /bin/rm -f water_vfr.f cut -c1-72 water_vfr.F | /lib/cpp -I. -C -traditional -DNCARG -DRECLENBYTE -DSGI > water_vfr.f /bin/rm -f water_vfr.o pgf90 -c -I. -byteswapio water_vfr.f /bin/rm -f water_vfr.f /bin/rm -f check_data.f cut -c1-72 check_data.F | /lib/cpp -I. -C -traditional -DNCARG -DRECLENBYTE -DSGI > check_data.f /bin/rm -f check_data.o pgf90 -c -I. -byteswapio check_data.f /bin/rm -f check_data.f /bin/rm -f terrestial_info.f cut -c1-72 terrestial_info.F | /lib/cpp -I. -C -traditional -DNCARG -DRECLENBYTE -DSGI > terrestial_info.f /bin/rm -f terrestial_info.o pgf90 -c -I. -byteswapio terrestial_info.f /bin/rm -f terrestial_info.f /bin/rm -f write_fieldrec.f cut -c1-72 write_fieldrec.F | /lib/cpp -I. -C -traditional -DNCARG -DRECLENBYTE -DSGI > write_fieldrec.f /bin/rm -f write_fieldrec.o pgf90 -c -I. -byteswapio write_fieldrec.f /bin/rm -f write_fieldrec.f pgf90 -o terrain.exe ia.o anal2.o bint.o bndry.o crlnd.o crter.o dfclrs.o exaint.o finprt.o fudger.o interp.o label.o lakes.o latlon.o llxy.o mxmnll.o nestll.o oned.o outpt.o output.o pltter.o rdldtr.o replace.o rflp.o setup.o sint.o smth121.o smther.o smthtr.o terdrv.o terrain.o tfudge.o vtran.o xyobsll.o hiresmap.o plots.o crvst.o crvst30s.o nestbdy.o crsoil.o equate.o labels.o labelv.o patch.o plotcon.o watercheck.o crlwmsk.o soil_tg.o water_vfr.o check_data.o terrestial_info.o write_fieldrec.o -L/usr/local/ncarg/lib -L/usr/X11R6/lib -lncarg -lncarg_gks -lncarg_c -lX11 -L/opt/pgi/linux86/lib -L/usr/lib -lf2c /opt/pgi/linux86/6.1/lib/libf2c.a(open.o)(.text+0x35f): In function f_open’:
open.c: warning: the use of tmpnam' is dangerous, better use mkstemp’
/opt/pgi/linux86/6.1/lib/libf2c.a(lread.o)(.text+0x19d): In function l_R': lread.c: undefined reference to __ctype_b’
/opt/pgi/linux86/6.1/lib/libf2c.a(lread.o)(.text+0x248):lread.c: undefined reference to __ctype_b' /opt/pgi/linux86/6.1/lib/libf2c.a(lread.o)(.text+0x2a6):lread.c: undefined reference to __ctype_b’
/opt/pgi/linux86/6.1/lib/libf2c.a(lread.o)(.text+0x2ce):lread.c: undefined reference to __ctype_b' /opt/pgi/linux86/6.1/lib/libf2c.a(lread.o)(.text+0x77e): In function l_L’:
lread.c: undefined reference to __ctype_b' /opt/pgi/linux86/6.1/lib/libf2c.a(lread.o)(.text+0x9ba):lread.c: more undefined references to __ctype_b’ follow
make[1]: [terrain.exe] Error 2 (ignored)
/bin/rm -f data_area.exe
pgf90 -o data_area.exe latlon.o llxy.o mxmnll.o nestll.o rflp.o setup.o outpt.o vtran.o search.o data30s.o data_area.o -L/usr/local/ncarg/lib -L/usr/X11R6/lib -lncarg -lncarg_gks -lncarg_c -lX11 -L/opt/pgi/linux86/lib -L/usr/lib -lf2c
/bin/rm -f rdem.exe
pgf90 -o rdem.exe cr30sdata.o read30s.o rdem.o ia.o -L/usr/local/ncarg/lib -L/usr/X11R6/lib -lncarg -lncarg_gks -lncarg_c -lX11 -L/opt/pgi/linux86/lib -L/usr/lib -lf2c
make[1]: Leaving directory `/home/audrius/TERRAIN/src’

Any suggestions, ideas or comments would be appreciated.

Hi audriusLT,

/opt/pgi/linux86/6.1/lib/libpgc.so: cannot restore segment prot after reloc: Permission denied

This usually means that you don’t have execute permission on libpgc.so.

“__ctype_b” errors occur when a library was built on an older Linux system where a reference is made to __ctype_b instead of the more current __ctype_b_loc. (See PGI FAQ for more information). Note that “libf2c.a” is not part of the standard PGI install, so I assume it was added by someone at your site in order to support g77 built NCARG libraries?

Try removing “-lf2c” from your options and relink. If you get new undefined g77 references, try adding “-g77libs” which will have the PGI compiler automatically add the correct g77 runtime libraries, assuming you have g77 installed. If neither of these work, then you’ll need to recompile the NCARG libraries for use on FC6.

Hope this helps,
Mat

Hi : mkcolg

I have the same problem in running MM5. I change the -lf2c to -lg2c. But the problem still exist. I am using kubuntu 7.1. Is there anyother possibility to sovle this problme? Thanks

Hi ljwu,

Undefined reference to “__ctype_b” are almost always the result of moving pre-compiled code (such as a library) from one OS to another (typically RedHat to SuSE) or an older to a new version of the OS. What library is giving you the undefined reference error? How and and on what type of system was this library compiled? What OS and what version of PGI are you using?

  • Mat