F77(1) — USER COMMANDS
NAME
f77 − FORTRAN 77 compiler
SYNOPSIS
f77 [ −c ] [ −g ] [ −a ] [ −o output ] [ −O ] [ −C ] [ −Dname ] [ −Dname[=def]] [ float_option ] [ −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 linking with ld(1). 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 meanings as for cc(1). See ld(1) for link-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).
−a Insert code into the program to count how many times each basic block in the program is executed. After the program is compiled with this option, there will be a .d file for every .f file compiles with the −a option. The .d file accumulates execution data for the corresponding source file. The tcov(1) utility can then be run on the source file to generate statistics about the program.
−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 name to the C preprocessor, as if by ‘#define’. If no definition is given, the name is defined as "1". ( .F suffix files only).
float_option
Floating-point code generation option. Can be one of:
−fsoft software floating-point calls (This is the default).
−fsky in-line code for Sky floating-point processor (supported on Sun-2 systems).
−f68881 in-line code for Motorola 68881 floating-point processor (supported only on Sun-3 systems).
−fswitch run-time-switched floating-point calls. The compiled object code is linked at run-time to routines that support one of the above types of floating point code. This was the default in previous releases. Only for use with programs that are floating-point intensive and which must be portable to machines with various floating-point options.
When invoked without float_option, the compiler interrogates the FLOAT_OPTION environment variable to determine the type of floating-point code to generate. Legal values for FLOAT_OPTION are: ‘fsoft’, ‘fsky’, ‘f68881’, and ‘fswitch’.
−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 linking 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 sizes 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 linker 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 linked (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
cc(1), gprof(1), ld(1), prof(1), ratfor(1)
DIAGNOSTICS
The diagnostics produced by f77 itself are intended to be self-explanatory. Occasional messages may be produced by the linker.
Sun Release 3.0β — Last change: 21 December 1985