Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

cc(1V)

gprof(1)

ld(1)

prof(1)

ratfor(1)

F77(1)  —  USER COMMANDS

NAME

f77 − FORTRAN 77 compiler

SYNOPSIS

f77 [ −66 ] [ −a ] [ −align _block ] [ −c ] [ −C ] [ −dryrun ] [ −Dname[=def ] ] [ float_option ]

[ −fstore ] [ −F ] [ −g ] [ −help ] [ −i2 ] [ −i4 ]

[ −Ipathname ] [ −llib ] [ −Ldir ] [ −m4 ] [ −N[qxscn]nnn ]

[ −o outfile ] [ −onetrip ] [ −O ] [ −p ] [ −pg ] [ −pipe ] [ −P ] [ −Qoption prog opt ]

[ −Qpath pathname ] [ −Qproduce sourcetype ] [ −S ] [ −temp=dir ] [ −time ]

[ −u ] [ −U ] [ −v ] [ −w[66]] sourcefile ...

DESCRIPTION

f77 is the 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.

Filenames ending in .c or .s are taken to be C or assembly source programs and are compiled or assembled, producing .o files. 

Filenames ending in .il are taken to be in-line expansion code template files; these are used to expand calls to selected routines in-line when the −O option is in effect. 

OPTIONS

See ld(1) for link-time options.

−66 Report non-FORTRAN 66 constructs as errors

−a Insert code to count how many times each basic block is executed.  Creates a .d file for every .f file compiled.  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 a line-by-line execution profile of the program.

−align _block
Cause the global symbol whose FORTRAN name is block to be page-aligned: its size is increased to a whole number of pages, and its first byte is placed at the beginning of a page. 

−c Suppress linking with ld(1) and produce a .o file for each source file.  A single object file can be named explicitly using the −o option. 

−C Compile code to check that subscripts are within the declared array bounds. 

−dryrun Show but do not execute the commands constructed by the compilation driver. 

−Dname[=def ]
Define a symbol name to the C preprocessor (cpp(1)). Equivalent to a #define directive in the source.  If no def is given, name is defined as ‘1’ ( .F suffix files only). 

float_option Floating-point code generation option.  Can be one of:

−f68881
Generate in-line code for the Motorola MC68881 floating-point coprocessor (supported only on Sun-3 systems).

−ffpa Generate in-line code for the Sun Floating-Point Accelerator (supported only on Sun-3 systems). 

−fsky Generate in-line code for the Sky floating-point processor (supported only on Sun-2 systems). 

−fsoft
Generate software floating-point calls (this is the default).

−fswitch
Generate run-time-switched floating-point calls. The compiled object code is linked at runtime 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.

−fstore Insure that expressions allocated to extended precision registers are rounded to storage precision whenever an assignment occurs in the source code.  Only has effect when −f68881 or −ffpa, and −O or −P are specified. 

−F Apply the C preprocessor to .F files and the Ratfor preprocessor to .r files.  Put the result in corresponding .f files, but do not compile them.  No linking is done. 

−g Produce additional symbol table information for dbx(1) and pass the −lg flag to ld(1).

−help Display helpful information about f77. 

−i2 Make the default size of integer and logical constants and variables two bytes. 

−i4 Make the default size of integer and logical constants and variables four bytes (this is the default). 

−Ipathname Add pathname to the list of directories in which to search for #include files with relative filenames (not beginning with /).  The preprocessor first searches for #include files in the directory containing sourcefile, then in directories named with −I options (if any), and finally in /usr/include/f77 (applies to processing of .F suffix files only). 

−llib Link with object library lib (for ld(1)).

−Ldir Add dir to the list of directories containing object-library routines (for linking using ld(1)).

−m4 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. 

Multiple −N options increase sizes of multiple tables. 

−o outfile Name the output file outfile.  outfile must have the appropriate suffix for the type of file to be produced by the compilation (see FILES, below).  outfile cannot be the same as sourcefile (the compiler will not overwrite the source file). 

−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. 

−O Optimize the object code.  This invokes both the global intermediate code optimizer and the object code optimizer. 

−p Prepare the object code to collect data for profiling with prof(1). Invokes a run-time recording mechanism that produces a mon.out file (at normal termination). 

−pg Prepare the object code to collect data for profiling with gprof(1). Invokes a run-time recording mechanism that produces a gmon.out file (at normal termination). 

−pipe Use pipes, rather than intermediate files between compilation stages.  Very cpu-intensive. 

−P Partial optimization.  Does a restricted set of global optimizations.  Do not use −P unless −O results in excessive compilation time. 

−Qoption prog opt
Pass the option opt to the program prog.  The option must be appropriate to that program and may begin with a minus sign.  prog can be one of: as, c2, cg, cpp, f77pass1, iropt, inline, ld, m4, or ratfor. 

−Qpath pathname
Insert directory pathname into the compilation search path (to use alternate versions of programs invoked during compilation). 

−Qproduce sourcetype
Produce source code of the type sourcetype.  sourcetype can be one of:

.f Source file from ratfor(1).

.o Object file from as(1).

.s Assembler source (from f77pass1, inline c2 or cg).

−S Compile the named programs, and leave the assembly language output on corresponding files suffixed .s (no .o file is created). 

−temp=dir Set directory for temporary files to be dir. 

−time Report execution times for the various compilation passes. 

−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 Verbose.  Print the version number of the compiler and the name of each program it executes. 

−w[66] Suppress all warning messages.  −w66 supresses 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. 

ENVIRONMENT

FLOAT_OPTION
When no floating-point option is specified, the compiler uses the value of this environment variable (if set).  Recognized values are: f68881, ffpa, fsky, fswitch and fsoft. 

FILES

a.out executable output file

file.a library of object files

file.c C source file

file.d tcov(1) test coverage input file

file.f FORTRAN 77 source file

file.F FORTRAN 77 source file for cpp(1)

file.il inline expansion file

file.o object file

file.p Pascal source file

file.r Ratfor source file

file.s assembler source file

file.S assembler source for cpp(1)

file.tcov output from tcov(1)

/lib/bin/ratfor Ratfor preprocessor

/lib/c2 optional optimizer

/lib/cg FORTRAN 77 code generator

/lib/compile compiler command-line processing driver

/lib/cpp macro preprocessor

/lib/crt0.o runtime startoff

/lib/Fcrt1.o startup code for −fsoft option

/lib/gcrt0.o startoff for gprof-profiling

/lib/libc.a standard library, see intro(3)

/lib/mcrt0.o startoff for profiling

/lib/Mcrt1.o startup code for −f68881 option

/lib/Scrt1.o startup code for −fsky option

/lib/Wcrt1.o startup code for −ffpa option

/usr/include/f77 directory searched by the FORTRAN 77 include statement

/usr/lib/f77pass1
FORTRAN 77 parser

/usr/lib/libc_p.a profiling library, see intro(3)

/usr/lib/libF77.a FORTRAN 77 library

/usr/lib/inline inline expander of library calls

/usr/lib/libI77.a FORTRAN 77 library

/usr/lib/libm.a math library

/usr/lib/libpfc.a startup code for combined Pascal and FORTRAN 77 programs

/usr/lib/libU77.a
FORTRAN 77 library

/tmp/∗ compiler temporary files

mon.out file produced for analysis by prof(1)

gmon.out file produced for analysis by gprof(1)

SEE ALSO

cc(1V), gprof(1), ld(1), prof(1), ratfor(1)

FORTRAN Programmer’s Guide

Floating-Point Programmer’s Guide for the Sun Workstation

DIAGNOSTICS

The diagnostics produced by f77 itself are intended to be self-explanatory.  Occasional messages may be produced by the linker. 

Sun Release 3.2  —  Last change: 8 April 1986

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026