problems compling program with Fedora Core 4

Hi all,
I have the NCAR SCM (Single Column Model) compiled and running using RedHat 9.0, PGF77 version 5.0 , gcc296. On my laptop with Fedora Core 4 and PGF77 version 6.2, gcc32 and am getting a bunch of errors for many of the subroutines which ultimately leads failure to compile; for example

buoyan.o(.text+0x16a): In function buoyan_': buoyan.F: undefined reference to __mth_i_idnintx’
buoyan.o(.text+0x226):buoyan.F: undefined reference to __mth_i_dlogx' buoyan.o(.text+0x238):buoyan.F: undefined reference to __mth_i_dlogx’
buoyan.o(.text+0x2db):buoyan.F: undefined reference to __mth_i_dpowdx' buoyan.o(.text+0x514):buoyan.F: undefined reference to __mth_i_dpowdx’
buoyan.o(.text+0x6e6):buoyan.F: undefined reference to __mth_i_dpowdx' buoyan.o(.text+0x72b):buoyan.F: undefined reference to __mth_i_dexpx’
buoyan.o(.text+0x98f):buoyan.F: undefined reference to `__mth_i_dexpx’

The fortran 77 compile command is
pgf77 -c -r8 -i4 -O2 -DLINUX -DSCM -DCCM_VERS=3 -DCCM3_ -DCCM_MINOR_VERS=6 -DPLON=1 -DPLEV=18 -DPLEVR=18 -DPCNST=1 -DPTRM=42 -DPTRN=42 -DPTRK=42 -DPLON=1 -DPLAT=1 -DPNATS=0 -I/home/dadams/scm/sccm-1.2/mymods -I/home/dadams/scm/sccm-1.2/ccm3.6 -I/home/dadams/scm/sccm-1.2/init -I/usr/local/lib/netcdf-3.6.1/include

and the final compile command is
gcc32 -o …/sccm -L/usr/local/lib/netcdf-3.6.1/lib -lnetcdf -L/usr/pgi/linux86/6.2/lib /usr/pgi/linux86/6.2/lib/pgi.ld -lpgftnrtl -lpgc -lm

Any ideas how I might resolve this problem?

Hi David,

The problem is that your missing the PGI SSE math libraries (-lpgsse1 -lpgsse2) from your link line. While you can add these, the prefered way to fix this is to use pgf77 to link instead of gcc32. This way you don’t need to worry about which PGI libraries need to be added. If your main program in C, add “-Mnomain” so that the Fortran “main” is not used.

Hope this helps,

Hi Mat,
thanks, it worked. I included them in the link line:

gcc32 -L /usr/pgi/linux86/6.2/lib /usr/pgi/linux86/6.2/lib/pgi.ld -lpgsse1 -lpgsse2 -lpgftnrtl -lpgc -lm

I couldn’t use pgf77 to link because the model programmers recommended that it not be done --something about machine dependence.

thanks a bunch,