F77(1) — USER COMMANDS
NAME
f77 − FORTRAN 77 compiler
SYNOPSIS
f77 [ −c ] [ −g ] [ −o output ] [ −O ] [ −C ] [ −Dname ] [ −Dname[=def]] [ −fsky ] [ −F ]
[ −i2 ] [ −Idir ] [ −m ] [ −N[qxscn]nnn ] [ −onetrip ] [ −p ] [ −pg ] [ −Rx ] [ −S ]
[ −u ] [ −U ] [ −v ] [ −w[66 ]] filename ...
DESCRIPTION
f77 is the UNIX FORTRAN 77 compiler, which translates programs written in the FORTRAN 77 programming language into executable load modules or into relocatable binary programs for subsequent loading via the ld(1) linker. In addition to the many flag arguments (options), f77 accepts several types of files:
Filenames ending in .f are taken to be FORTRAN 77 source programs; they are compiled, and each object program is left in the file (in the current directory) whose name is that of the source with .o substituted for .f. Filenames ending in .F are also taken to be FORTRAN 77 source programs, but they are preprocessed by the C preprocessor (equivalent to a cc −E command) before they are compiled by the f77 compiler.
Filenames ending in .r are taken to be Ratfor source programs; these are first transformed by the ratfor(1) preprocessor, then compiled by f77.
In the same way, filenames ending in .c or .s are taken to be C or assembly source programs and are compiled or assembled, producing .o files.
OPTIONS
The following options have the same meaning as for cc(1). See ld(1) for load-time options.
−c Suppress loading and produce a .o file for each source file.
−g Produce additional symbol table information for dbx(1). Also pass the −lg flag to ld(1).
−o output
Name the final output file output instead of a.out.
The following options are peculiar to f77:
−O Optimize the object code. This invokes both the global intermediate code optimizer and the object code optimizer.
−C Compile code to check that subscripts are within the declared array bounds.
−Dname
−Dname=definition
Define the name to the C preprocessor, as if by ‘#define’. If no definition is given, the name is defined as "1". ( .F suffix files only).
−fsky Generate code which assumes the presence of a SKY floating-point processor board. Programs compiled with this option can only be run in systems that have a SKY board installed. Programs compiled without the −fsky option will use the SKY board if it is present, but won’t run as fast as they would if the −fsky option were used. If any part of a program is compiled using the −fsky option, you must also use this option when linking with the f77 command, since a different set of startup routines is required.
−F Apply the C preprocessor to .F files and the Ratfor preprocessor to .r files, putting the results in the corresponding .f files, but do not compile them. No loading is done. However, any .c or .s files are compiled or assembled. .f, but do not compile.
−i2 Make the default size of integer and logical constants and variables two bytes rather than four bytes.
−Idir ‘#include’ files whose names do not begin with ‘/’ are always sought by the C preprocessor first in the directory of the file argument, then in directories named in −I options, then in the /usr/include/f77 directory (applies to processing of .F suffix files only).
−m Apply the M4 preprocessor to each .r file before transforming it with the Ratfor preprocessor.
−N[qxscn]nnn
Make static tables in the compiler bigger. f77 complains if tables overflow and suggests you apply one or more of these flags. These flags have the following meanings:
q Maximum number of equivalenced variables. Default is 150.
x Maximum number of external names (common block, subroutine, and function names). Default is 200.
s Maximum number of statement numbers. Default is 401.
c Maximum depth of nesting for control statements (for example, DO loops). Default is 20.
n Maximum number of identifiers. Default is 1009.
One may use multiple −N options to increase the size of multiple tables.
−onetrip
Compile DO loops so that they are performed at least once if reached. FORTRAN 77 DO loops are not performed at all if the upper limit is smaller than the lower limit.
−p Produce code to count the number of times each routine is called and estimate the fraction of time spent in each routine. The results of this profiling appear in a file called mon.out when the program being profiled terminates normally. An execution profile of the program can then be produced using the prof(1) utility.
−pg Produce counting code in the manner of −p, but invoke a run-time recording mechanism that keeps more extensive statistics and produces a gmon.out file at normal termination. An execution profile can then be generated by use of gprof(1).
−Rx Use the string x as a Ratfor option in processing .r files.
−S Compile the named programs, and leave the assembly language output on corresponding files suffixed .s (no .o file is created).
−u Make the default type of a variable ‘undefined’ rather than using the FORTRAN default rules.
−U Do not convert upper case letters to lower case. The default is to convert upper case letters to lower case, except within character string constants.
−v Print the version number of the compiler, and the name of each pass as it executes.
−w[66]
Suppress all warning messages, or if the option is −w66, supress only FORTRAN 66 compatibility warnings.
Other arguments are taken to be either loader option arguments, or f77-compatible object programs, typically produced by an earlier run, or libraries of f77-compatible routines. These programs, together with the results of any compilations specified, are loaded (in the order given) to produce an executable program in the file specified by the −o option, or in a file named a.out if the −o option is not specified.
FILES
file.[fFrsc]input file
file.oobject file
a.outlinked output
./fort[pid].?temporary
/usr/include/f77directory searched by the FORTRAN 77 include statement
/usr/lib/f77pass1parser
/lib/f1code generator
/lib/c2optional optimizer
/lib/cppC preprocessor
/lib/bin/ratforRatfor preprocessor
/usr/lib/libf77.aFortran library
/lib/libc.aC library, see Section 3
mon.outfile produced for analysis by prof(1)
gmon.outfile produced for analysis by gprof(1)
SEE ALSO
FORTRAN Programmer’s Guide for the Sun Workstation
prof(1), gprof(1), cc(1), ld(1), ratfor(1)
DIAGNOSTICS
The diagnostics produced by f77 itself are intended to be self-explanatory. Occasional messages may be produced by the loader.
Sun Release 2.0 — Last change: 1 February 1985