F77(1) BSD F77(1)
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 and interprets them as follows.
Arguments whose names end with .f are taken to be FORTRAN 77 source
programs; f77 compiles them, and leaves each object program 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 taken to be FORTRAN 77 source
programs. These are first processed by the C preprocessor before being
compiled by f77.
Arguments whose names end with .r are taken to be Ratfor source programs;
these are first transformed by the appropriate preprocessor, then
compiled by f77.
Arguments whose names end with .c are taken to be C source programs and
are compiled, producing a .o file.
Arguments whose names end with .e or .s (EFL or assembly source programs)
are not supported by Domain/OS BSD.
The Domain/OS BSD 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.
NOTE: You can typically improve run-time performance if you compile your
code 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. The option -A cpu,3000, for example, generates
optimal code for the DSP90, DN330, DN560, DN570, DN580, DN3000, DN3500,
DN4000, and DN4500 processors.
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
compiled.
-Dname=def
-Dname 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)
-g Produce additional debug information for dbx or dde.
-o output Name the final output file output instead of a.out. If you
specify a different name, 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 Causes 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.
-Wc,arg1,[,arg2...]
Hand off the arguments argi 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
otherwise 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
otherwise 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.
-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.
-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 Round and store floating-point numbers before
comparisons. This option is implemented only on
workstations with a 68881 processor.
-nfrnd (D) Do not round and store floating-point numbers
before comparisons. This option is implemented
only on workstations with a 68881 processor.
-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 runtime and
resolve global variable references. Thus you
can use pathname as a library file for many
different programs.
-inline char Select char as an in-line comment designator.
(Default char is "{".)
-l [file] 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 Generate final error and warning count message.
-nmsgs Suppress final error and warning count message.
-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. 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. Note:
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. Note: this
option applies only if used with the -exp option
and with a compiler 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 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 map and cross-
reference listing.
-xrs (D) Save registers across a call to an external
subprogram.
-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.
-Idir 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.)
-Uname 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
preprocessors to .r files; put the result in the file with the
suffix 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.
-Rx 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, -Ex, -N, and -U.
Other arguments are taken to be 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 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
comply with ANSI rules. Same as /com/cc -nansi option.
-A cpu,id Generate code for a particular class of processor; the default
id is any. Values for id are as follows:
any Series 10000 code, if you're
compiling on a Series 10000
workstation, or 680x0 code, if
you're compiling on a
680x0-based workstation
a88k Series 10000 code
m68k 680x0-based code
160 DSP160 code
460 DSP460 code
660 660 code
90 DSP90 code
330 DN330 code
560 DN560 code
570 DN570 code
580 DN580 code
3000 DN3000, DN3500, DN4000, and DN4500 code
FPA1 Floating-Point Accelerator Board
for DN3500, DN4000, and DN4500
FPX Floating-Point Accelerator Board for DN5xx
PEB Performance Enhancement Board
The following values for id are synonyms: 160, 460, and 660.
Also, the following values for id are synonyms: 90, 330, 560,
570, 580, and 3000. Using a processor-specific code generation
mode can result in programs that run faster.
-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 runtype 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.