F77 BSD F77
NAME
f77 - FORTRAN 77 compiler
SYNOPSIS
f77 [option] ... file ...
DESCRIPTION
f77 is the Domain/OS BSD interface to the preprocessors (cpp, ratfor,
etc.), the Domain FTN compiler, and the link editor (ld). It accepts
several types of arguments. It interprets arguments whose names end with
.f as FORTRAN 77 source programs; they are compiled, and each object pro-
gram is left in the current directory in a file whose name is that of the
source, with .o substituted for .f.
Arguments whose names end with .F are also interpreted as FORTRAN 77
source programs; these are processed by the C preprocessor before being
compiled by f77.
Arguments whose names end with .r are interpreted as Ratfor source pro-
grams. These are first transformed by the appropriate preprocessor, then
compiled by f77.
Arguments whose names end with .c are interpreted as C source programs
and are compiled as such.
Arguments whose names end with .e or .s (EFL and assembly source pro-
grams) are not supported.
The f77 command provides some unique options; not all standard UNIX
options are available. f77 recognizes the following as preprocessor
options: -C, -D, -I, and -Uname. f77 recognizes the following as link
editor options: -a, -l, -o, -r, -s, -t, -u, -x, -z, -L, -M, and -V.
You can typically improve the run-time performance of your program if you
compile it using the -A cpu,id option with a processor-specific id. Use
an argument appropriate to the CPU type of the machine(s) on which you
will run the executable file. For example, the -A cpu,mathchip option
generates optimal code for the DSP90, DN330, DN560, DN570, DN580, DN2500,
DN3000, DN3500, DN4000, and DN4500 processors, and for the HP Apollo
Series 400s and 400t. Use the cpuhelp utility to help you choose the -A
cpu argument best suited to your needs. For information about this util-
ity, type man cpuhelp.
OPTIONS
The following options have the same meaning as in cc (1). See ld (1) for
load-time options.
-c Suppress the linking phase of the compilation and force an
object file to be produced, even if only one program is com-
piled.
-g Produce additional debug information for dbx or dde.
-o output Name the final output file output instead of a.out. If you
specify output, the system leaves any existing a.out files
undisturbed.
-O Produce optimized code.
-p Arrange for the compiler to produce code which counts the
number of times each routine is called. If loading takes
place, replace the standard startup routine by one which
automatically calls monitor(1) at the start and arranges to
write out a mon.out file at normal termination of execution of
the object program. An execution profile can then be generated
by use of prof(1).
-pg Cause the compiler to produce counting code in the manner of
-p, but invokes 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).
-w Suppress all warning messages.
-W c,arg1[,arg2...]
Hand off the arguments argN to pass c where c is one of p, 0,
or l, indicating the preprocessor, compiler, or linker. You can
use the -W0 option to access /com/ftn options that are other-
wise not available with the /bin/f77 command. For example,
-W0,-l,foo passes the option -l foo to the compiler. You can
use the -Wp options to access /bin/cpp options that are other-
wise not available with the /bin/f77 command. For example,
-Wp,-C passes the option -C to the C preprocessor. Note that
no space is permitted between the comma and the option name.
The following /com/ftn options can be used with the -W0 option
(default options are indicated by "(D)"):
-ac (D) Produce absolute code. The alternative option is
-pic, which forces the compiler to produce
position-independent code.
-alnchk Display messages about alignment of data. Default
for Series 10000 compilers.
-cond Compile lines with D or d in column 1.
-ncond (D) Ignore lines with D or d in column 1.
-config var1...varN
Set conditional compilation variables to true.
-db (D) Generate minimal debugging information.
-dbs Generate full debugger preparation. Same as f77 -g
option.
-dba Generate full debugger preparation, but do not
optimize code.
-ndb Do not generate any debugger preparation.
-dynm (D) Allocate local variables on the stack (dynamic
storage). Compare to -save option.
-exp Generate expanded code listing (implies -l).
-nexp (D) Suppress expanded code listing.
-ff Activate free format: length of source lines may
be up to 1024 characters; ampersand (&) in column 1
specifies a continuation line.
-frnd Rounds floating-point numbers at key points during
program execution. Using this option may result in
a loss of performance.
-nfrnd (D) Optimizes execution by computing floating-point
expressions in greater precision than that speci-
fied by the program, when the compiler detects an
opportunity to do so.
-indexl Disable some optimizations generated for subscript
calculations, and cause all array indexing to use
4-byte integer arithmetic.
-nindexl (D)Use all the optimizations generated for subscript
calculations.
-info level Control the output of informational messages. The
five informational levels are 0, 1, 2 (default), 3,
and 4.
-ninfo Suppress informational messages.
-inlib pathname
Load pathname (a PIC binary file) at run time and
resolve global variable references. Thus you can
use pathname as a library file for many different
programs.
-inline charSelect char as an in-line comment designator.
(Default char is "{".)
-l [pathname]
Generate compilation listing. If no pathname is
specified, the listing is written to a file with
the same name as the source file, but with the
suffix .lst.
-nl (D) Suppress compilation listing.
-l*1 Use logical*1 as the default logical type.
-l*2 Use logical*2 as the default logical type.
-l*4 (D) Use logical*4 as the default logical type.
-msgs (D) Generate final error and warning count message.
-nmsgs Suppress final error and warning count message.
-natural Make natural alignment the default for this compi-
lation.
-nnatural (D)
Make word alignment the default for this compila-
tion.
-nclines Suppress generation of COFF line number tables.
Applies only to 680x0 target compilers.
-opt [n] Perform global optimization. n is a single-digit
integer in the range 0 to 4, indicating the level
of optimization performed. -opt 0 is identical to
the obsolete switch -nopt. If n is omitted, 3 is
the default level (same as f77 -O). Increasing the
optimization level results in faster execution of
your program, at the expense of longer compilation
time. See the Domain FORTRAN Language Reference
manual for details.
-pic Produce position-independent object code. The
default is to produce absolute code.
-prasm (D) Use Series 10000 assembly language format for the
expanded listing generated by -exp. This option
applies only if used with the -exp option and with
a compiler that generates Series 10000 code.
-nprasm Use 68000 assembly language format for the expanded
listing generated by -exp. This option applies
only if used with the -exp option and with a com-
piler that generates Series 10000 code.
-save Allocate space for local variables in static
storage, rather than on the stack. Compare with
-dynm.
-type Issue warning messages for variables not explicitly
typed.
-ntype (D) Suppress checking for explicit declarations of
variables.
-xref Insert a symbol table map and cross reference in
the listing file. This generates the listing file
at program_name.lst, even if you omit -l.
-nxref (D) Suppress creation of symbol table map and cross-
reference listing.
-xrs (D) Save registers across a call to an external subpro-
gram.
-nxrs Do not assume that calls to external subprograms
have saved the registers.
-zero Initialize to zero all common blocks and statically
allocated variables.
-nzero (D) Do not initialize all common blocks and statically
allocated variables.
The following /bin/cpp options can be used with the -Wp option:
-C Prevents the preprocessor from stripping C-style
comments.
-D name=def
-D name Define the name to the C preprocessor, as if by
#define. If you do not supply a definition, define
name as 1 (.F suffix files only). (cpp switch)
-I dir Change the search path for #include files with
names not beginning with a slash (/). Look first in
the directory of the source file in which the
#include directive occurs; then in directories
named in this option; and finally, in directories
on a standard list. (.F suffix files only.)
-U name Remove any initial definition of name.
The following options are peculiar to f77.
-C Compile code to check that subscripts are within declared array
bounds. For multidimensional arrays, check only the equivalent
linear subscript.
-F Apply the C preprocessor to .F files, apply the Ratfor prepro-
cessors to .r files; put the result in the file with the suf-
fix changed to .f, but do not compile.
-i2 Make the default integer constants and variables short (2
bytes). The default -i4 tells the compiler to make all
integers four bytes.
-m Apply the M4 macro preprocessor to each .r (Ratfor) source file
before transforming it with the Ratfor preprocessor.
-q Suppress printing of filenames and program-unit names during
compilation.
-R x Use the string x as a Ratfor option in processing .r files.
-v Print the version number of the compiler, and the name of each
pass as it executes.
The following options are not supported in the Domain/OS BSD version of
f77: -d, -lg, -S, -onetrip, -1, -r8, -u, -E x, -N, and -U.
Other arguments are taken to be loader option arguments, f77-compatible
object programs, or libraries of f77-compatible routines. These pro-
grams, together with the results of any compilations specified, are
loaded (in the order given) to produce an executable program with the
name a.out.
DOMAIN/OS BSD EXTENSIONS
The -A option identifies Domain/OS BSD extensions to f77 and ld; see
ld(1) for additional information about this option.
-A nansi Pass to the C compiler a C source code file that does not com-
ply with ANSI rules. Same as /com/cc -nansi option.
-A cpu,id Generate code for a particular class of processor. The default
id is mathlib_sr10 if you are compiling for a 680x0-based
workstation, and a88k if you are compiling for a Series 10000
workstation. Values for id are as follows:
mathlib_sr10
Code for workstations with an MC68020 or
MC68030 microprocessor and an MC68881 or
MC68882 floating-point coprocessor, or with
an MC68040 microprocessor
mathlib Code for MC68020-, MC68030-, and
MC68040-based workstations (425t, 433s).
Code compiled with this option runs only on
SR10.3. Use mathlib_sr10 if your code
must also run on SR10.0, SR10.1, or SR10.2.
mathchip Code for MC68020- or MC68030-based
3000 workstations with an MC6888x floating-point
580 coprocessor (400t, 400s, DN4500, DN4000,
570 DN3500, DN3000, DN2500, DN580, DN570,
560 DN560, DN330, DSP90). These seven
330 arguments are synonyms. Use the
90 mathchip argument; the other arguments
may become obsolete at a future release.
a88k Series 10000 code
FPA1 Code for DN3000, DN4000, or DN4500
workstations with an FPA1 floating-point
accelerator unit
FPX Code for DN5xx workstations with an FPX
floating-point accelerator unit
PEB Code for workstations (including DN100, DN320,
DN400, DN600) with a Performance Enhancement
Board
160 Code for a DSP160, DN460, or DN660 workstation.
460 These three arguments are synonyms.
660
any Series 10000 code, if you are compiling for a
Series 10000 workstation, or generic MC680x0
code, if you are compiling for a MC680x0-based
workstation
m68k Generic MC680x0-based code
Using a processor-specific code generation mode can result in
programs that run faster. Use the cpuhelp utility to help you
choose the -A cpu argument best suited to your needs. For
information about this utility, type man cpuhelp.
-A sys[type],sys
Define the target system type (sys) for the compiled object;
sys may be one of the following:
any Version independent
bsd4.2 Berkeley version 4.2
bsd4.3 Berkeley version 4.3
sys5 UNIX System V
sys5.3 UNIX System V Release 3
-A run[type],sys
Like -A sys[type],sys this option passes sys information to the
compiler and linker. Values for sys are the same as for -A
sys[type],sys.
FILES
file.[fFrc] Input file
file.o Object file
a.out Loaded output
./fort[pid].? Temporary
/usr/lib/cpp C preprocessor
/usr/apollo/lib/ftn Compiler
/usr/lib/libF77.a Intrinsic function library
/usr/lib/libI77.a FORTRAN I/O library
/usr/lib/libU77.a UNIX interface library
mon.out File produced for analysis by prof(1)
gmon.out File produced for analysis by gprof(1)
The following files are not supported.
/usr/lib/f77pass1 Compiler
/lib/f1 Pass 2
/lib/c2 Optional optimizer
/usr/lib/libF77_p.a Profiling intrinsic function library
/usr/lib/libI77_p.a Profiling FORTRAN I/O library
/usr/lib/libU77_p.a Profiling UNIX interface library
DIAGNOSTICS
The diagnostics produced by f77 itself are intended to be self-
explanatory. The loader may produce occasional messages.
NOTES
After processing .F files, the C preprocessor leaves the resulting file
in the current directory, in a file whose name is that of the source,
with .f substituted for .F. If there is a previously existing .f file of
the same name, it will be overwritten.
SEE ALSO
ratfor(1), fpr(1), fsplit(1), ld(1), ar(1), dbx(1), struct(1), prof(1),
gprof(1), cc(1), intro(3f); the Domain FORTRAN Language Reference.