BSD 4_4 release
[unix-history] / usr / src / usr.bin / f77 / f77.vax / f77.1
.\" Copyright (c) 1991 The Regents of the University of California.
.\" All rights reserved.
.\"
.\" This module is believed to contain source code proprietary to AT&T.
.\" Use and redistribution is subject to the Berkeley Software License
.\" Agreement and your Software Agreement with AT&T (Western Electric).
.\"
.\" This module is believed to contain source code proprietary to AT&T.
.\" Use and redistribution is subject to the Berkeley Software License
.\" Agreement and your Software Agreement with AT&T (Western Electric).
.\"
.\" @(#)f77.1 6.10 (Berkeley) 8/8/91
.Dd August 8, 1991
.Dt F77 1
.Os BSD 4
.Sh NAME
.Nm f77
.Nd Fortran 77 compiler
.Sh SYNOPSIS
.Nm f77
.Op option
.Ar ...
.Ar file ...
.Sh DESCRIPTION
.Nm F77
is the
.Ux
Fortran 77 compiler.
It accepts several types of arguments:
.Pp
Arguments whose names end with `.f' are taken to be
Fortran 77 source programs;
they are compiled, and
each object program is left on the file in the current directory
whose name is that of the source with `.o' substituted
for `.f'.
.Pp
Arguments whose names end with `.F' are also taken to be Fortran 77 source
programs; these are first processed by the C preprocessor before being
compiled by
.Nm f77 .
.Pp
Arguments whose names end with `.r' or `.e' are taken to be Ratfor
or
.Tn EFL
source programs respectively; these are first transformed by the
appropriate preprocessor, then compiled by
.Nm f77 .
.Pp
Arguments whose names end with `.c' or `.s' are taken to be C or assembly
source programs and are compiled or assembled, producing a `.o' file.
.Pp
The following options have the same meaning as in
.Xr cc 1 .
See
.Xr ld 1
for load-time options.
.Bl -tag -width Fl
.It Fl c
Suppress loading and produce `.o' files for each source
file.
.It Fl g
Produce additional symbol table information for
.Xr dbx 1
and pass the
.Fl \&lg
flag to
.Xr \&ld 1
so that on abnormal terminations, the memory image is written
to file
.Pa core .
Incompatible with
.Fl O .
.It Fl o Ns Ar output
Name the final output file
.Ar output
instead of
.Sq Pa a.out .
.It Fl p
Prepare object files for profiling, see
.Xr prof 1 .
.It Fl \&pg
Causes the compiler to produce counting code in the manner of
.Fl p ,
but invokes a run-time recording mechanism that keeps more extensive
statistics and produces a
.Pa gmon.out
file at normal termination. An execution profile can then be generated
by use of
.Xr gprof 1 .
.It Fl w
Suppress all warning messages.
If the option is
.Ql \-w66 ,
only Fortran 66 compatibility warnings are suppressed.
.It Fl D Ns Ar name Ns =def
.It Fl D Ns Ar name
Define the
.Ar name
to the C preprocessor, as if by `#define'. If no definition is given, the name
is defined as "1". (`.F' suffix files only).
.It Fl I Ns Ar dir
`#include' files whose names do not begin with `/' are always sought
first in the directory of the
.Ar file
argument, then in directories named in
.Fl I
options, then in directories on a standard list. (`.F' suffix files only).
.It Fl O
Invoke an
object-code optimizer.
Incompatible with
.Fl g .
.It Fl S
Compile the named programs, and leave the
assembler-language output on corresponding files suffixed `.s'.
(No `.o' is created.).
.Pp
The following options are peculiar to
.Nm f77 .
.It Fl d
Used for debugging the compiler.
.It Fl i2
On machines which support short integers, make the default integer constants
and variables short.
.Fl i4
is the standard value of this option). All logical quantities will be short.
.It Fl q
Suppress printing of file names and program unit names during compilation.
.It Fl m
Apply the M4 preprocessor to each `.r' file before transforming
it with the Ratfor or
.Tn EFL
preprocessor.
.It Fl onetrip
.It Fl 1
Compile DO loops that 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.)
.It Fl r8
Treat all floating point variables,
constants, functions and intrinsics
as double precision and all complex
quantities as double complex.
.It Fl u
Make the default type of a variable `undefined' rather than using the default Fortran rules.
.It Fl v
Print the version number of the compiler, and the name of each pass as it
executes.
.It Fl C
Compile code to check that subscripts are within declared array bounds.
For multi-dimensional arrays, only the equivalent linear subscript is checked.
.It Fl F
Apply the C preprocessor to `.F' files, and the
.Tn EFL ,
or Ratfor preprocessors
to `.e' and `.r' files, put the
result in the file with the suffix changed to `.f', but do not compile.
.It Fl E Ns Ar x
Use the string
.Ar x
as an EFL option in processing `.e' files.
.It Fl R Ns Ar x
Use the string
.Ar x
as a Ratfor option in processing `.r' files.
.Sm off
.It N Op Cm qxscn Ar nnn
.Sm on
Make static tables in the compiler bigger. The compiler will complain
if it overflows its tables and suggest you apply one or more of these
flags. These flags have the following meanings:
.Bl -tag -width Ds
.It Cm q
Maximum number of equivalenced variables. Default is 150.
.It Cm x
Maximum number of external names (common block names, subroutine and
function names). Default is 200.
.It Cm s
Maximum number of statement numbers. Default is 401.
.It Cm c
Maximum depth of nesting for control statements (e.g. DO loops). Default is
20.
.It Ar n
Maximum number of identifiers. Default is 1009.
.El
.It Fl U
Do not convert upper case letters to lower case. The default is to convert
Fortran programs to lower case except within character string constants.
.El
.Pp
Other arguments
are taken
to be either loader option arguments, or
.Nm F77 Ns -compatible
object programs, typically produced by an earlier
run,
or perhaps libraries of
.Nm F77 Ns -compatible
routines.
These programs, together with the results of any
compilations specified, are loaded (in the order
given) to produce an executable program with name
.Sq Pa a.out .
.Pp
Programs compiled with
.Nm f77
produce memory dumps in file
.Pa core
upon abnormal termination if the
.Sq Fl
flag was specified during loading.
If the environment variable
.Ev f77_dump_flag
is set to a value beginning with
.Sq Ar y
or
.Sq Ar n ,
dumps for abnormal terminations are respectively forced or
suppressed.
.Sh FILES
.Bl -tag -width /usr/lib/libI77_p.a -compact
.It file.[fFresc]
Input file.
.It Pa file.o
Object file.
.It Pa a.out
Loaded output.
.It Pa /usr/lib/f77pass1
Compiler.
.It Pa /libexec/f1
Pass 2.
.It Pa /libexec/c2
Optional optimizer.
.It Pa /usr/bin/cpp
C preprocessor.
.It Pa /usr/lib/libF77.a
Intrinsic function library.
.It Pa /usr/lib/libI77.a
Fortran I/O library.
.It Pa /usr/lib/libU77.a
.Ux
interface library.
.It Pa /usr/lib/libm.a
Math library.
.It Pa /usr/lib/libc.a
C library, see section 3.
.It Pa /usr/lib/libF77_p.a
Profiling intrinsic function library.
.It Pa /usr/lib/libI77_p.a
Profiling Fortran I/O library.
.It Pa /usr/lib/libU77_p.a
Profiling
.Ux
interface library.
.It Pa /usr/lib/libm_p.a
Profiling math library.
.It Pa /usr/lib/libc_p.a
Profiling C library, see section 3.
.It Pa mon.out
File produced for analysis by
.Xr prof 1 .
.It Pa gmon.out
File produced for analysis by
.Xr gprof 1 .
.El
.Sh SEE ALSO
.Xr fpr 1 ,
.Xr fsplit 1 ,
.Xr ld 1 ,
.Xr ar 1 ,
.Xr ranlib 1 ,
.Xr dbx 1 ,
.Xr intro 3f
.Xr efl 1 ,
.Xr ratfor 1 ,
.Xr struct 1 ,
.Xr prof 1 ,
.Xr gprof 1 ,
.Xr cc 1
.Rs
.%A S. I. Feldman
.%A P. J. Weinberger
.%A J. Berkman
.%T "A Portable Fortran 77 Compiler"
.Re
.Rs
.%A D. L. Wasley
.%A J. Berkman
.%T "Introduction to the F77 IO Library"
.Re
.Sh DIAGNOSTICS
The diagnostics produced by
.Nm f77
itself are intended to be
self-explanatory.
Occasional messages may be produced by the loader.
.Sh HISTORY
The
.Nm F77
complier appeared in
.At v7 .
.Sh BUGS
Files longer than about 50,000 lines must be split up to be compiled.