[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GEMPAK #JUX-858931]: PGF fortran code and gnu-built gempak libraries



Neil,

This is useful and does mention the same thing I did regarding the need for 
libg2c which
they are tracking on installation of the PGI compilers.

Since we compile the g77 code with "no_second_underscore", you won't have that 
problem to
add the -Msecond_underscore as in their response.

The gfortran compiler man page at present mentions problems with the F77 
compiler, and 
recommends use of the g77 from 3.4.4 until they have fixed those problems.

GEMPAK Fortran code will continue to adhere to the Fortran 77 standard and C 
will be used rather
than dynamic memory or pointers in F90 spec since it is much easier in the long 
run to do C and migrate 
that direction rather than try to support many flavors of Fortran (as you have 
witnessed).

Steve Chiswell
Unidata User Support


> Thanks Steve. FYI, here's a possibly useful response from PGI support
> for approximately the same question:
> ===============
> > Do you have any guidance for compiling fortran code with calls to gnu-
> > built (gcc,g77) libraries?
> >
> > We've got the GEMPAK package from Unidata at UCAR. They don't support
> a
> > build of GEMAPK using PGI fortran compilers because of the limitation
> of
> > only one unit number assigned to the same file.
> 
> Neil,
> 
> If the user's system has g77 on it, we typically find it
> at install time and locate libg2c, which is needed usually to
> link g77 compiled code. In that case
> pgf90 -o x x.f -g77libs
> 
> or
> 
> pgf90 -o x x.f -g77libs -Msecond_underscore
> 
> would cause the lib to be entered in the link line.
> (g77 often appends a second underscore to symbols, which
> we can also do for this purpose).
> 
> Unfortunately, many new linux versions have gfortran, not
> g77, and that is not compatible with pgf90.
> 
> gcc compiled objects are never a difficulty.
> 
> regards,
> dave
> ======================
> 
> So if we can't get PGI-built GEMPAK libraries to include on a compiler
> invocation line for our PGI compilers and local code, then perhaps this
> is the way to include the gnu-built GEMPAK libraries.
> Comments?
> 
> -Neil
> 
> On Thu, 2006-04-27 at 16:02 -0600, Unidata GEMPAK Support wrote:
> > > Can you provide any guidance for writing and compiling fortran code, 77
> > > or 90, using the PGF compiler and GEMPAK libraries built with the
> > > default gnu gcc and g77 compiler builds?
> > >
> >
> > Neil,
> >
> > I don't have any experience mixing the usage. Both require the use of
> > the "_" character in the C calls to a fortran routine, and the g77 code
> > would be compiled with the no_second_underscore flag, so that should be 
> > compatible.
> > You will probably have to add to your link line some GLIB specific 
> > libraries, including the
> > libg2c gnu library for g77 if you are using pgf77 as the linker.
> >
> > Steve Chiswell
> > Unidata User Support
> >
> > Ticket Details
> > ===================
> > Ticket ID: JUX-858931
> > Department: Support GEMPAK
> > Priority: Normal
> > Status: Closed
> >
> >
> --
> Neil R. Smith, Comp. Sys. Mngr.         address@hidden
> Dept. Atmospheric Sci., Texas A&M Univ. 979/845-6272 FAX:979/862-4466
> 
> 
> 
> 
> 


Ticket Details
===================
Ticket ID: JUX-858931
Department: Support GEMPAK
Priority: Normal
Status: Closed