Manual: f77(1)
Please contact
or
Mt Xia
for assistance with all your shell programming needs.
f77(1) f77(1)
Name
f77 - invokes the Digital Fortran 77 (formerly DEC Fortran) compiler
Syntax
f77 [ options ] filename [ options ]
Description
The f77 command invokes the Digital Fortran 77 (FORTRAN-77) compiler. It
produces object code files in ULTRIX RISC or Digital UNIX Alpha extended
coff format.
The f77 command interprets arguments (filenames) as follows:
++ Arguments with the suffix .f, .for, or .FOR are interpreted as
FORTRAN-77 source programs. These programs are compiled, and the name
of the resulting object program is the basename of the source file
with a .o substituted for the .f, .for, or .FOR. (For example, in
source file myfile.f, myfile is the basename; so the object program is
named myfile.o.) If the source program is compiled and loaded, the .o
file is deleted.
++ Arguments with the suffix .F are interpreted as FORTRAN source pro-
grams, which must be processed by the C preprocessor ( cpp(1)) before
being compiled.
++ Arguments with the suffix .r or .e are interpreted as ratfor or efl
source programs, respectively. These programs are first transformed
by the appropriate preprocessor and then compiled.
++ Arguments with the suffix .i are interpreted as FORTRAN-77 source pro-
grams that have been preprocessed by cpp(1). They are compiled
without further preprocessing.
When a source program requires preprocessing by cpp(1), efl(1), ratfor(1),
or m4(1), the name of the output file generated by the preprocessor con-
sists of the basename of the source input file with the appropriate prepro-
cessor suffix. For example:
m4 myfile.r => myfile.p
efl myfile.e => myfile.f
ratfor myfile.r => myfile.f
cpp myfile.F => myfile.i
Note that if you have myfile.F and myfile.i as distinct files, cpp(1)
overwrites myfile.i to produce an output file with the same name.
If the environment variable DECFORT is set, the value is used as the name
of the compiler to invoke. If the environment variable DECFORT_FPP is set,
the value is used as the name of the preprocessor for FORTRAN files. If
the environment variable TMPDIR is set, the value is used as the directory
for temporary files.
If the environment variable DECFORT_INIT is defined, its value has to have
the form
[[pre] [:: [post]]
where the items in "[...]" are optional and can be empty, and where "pre"
and "post" are strings to be added to the command line. "pre" is added to
the front of the command line, before any characters the user typed;
"post" is added to the end of the command line.
The f77 command passes the following command line options to cpp(1):
-Dname=def, -Dname, -I, -Idir, -M, -Uname, and -Wp,.... Depending on which
platform you are using, the f77 command defines the following cpp(1) macros
to cpp(1):
++ All platforms: LANGUAGE_FORTRAN, __LANGUAGE_FORTRAN__, unix, __unix__
++ RISC only: host_mips, __host_mips__
++ Alpha only: __alpha
++ Digital UNIX only: __osf__
++ ULTRIX RISC only: MIPSEL, mips, __mips__
For example, if you are using a Digital UNIX Alpha system, the following
cpp(1) macros are defined to cpp(1): LANGUAGE_FORTRAN,
__LANGUAGE_FORTRAN__, unix, __unix__, __alpha, and __osf__.
The following examples demonstrate optimizing across multiple input files:
1. f77 -o foo ax.f bx.f cx.f
This command causes the files ax.f, bx.f, and cx.f to be
compiled as one program, with the resulting executable
file foo.
2. f77 -c -O4 ax.f bx.f cx.f
This command causes the files ax.o, bx.o and cx.o to
be created. Inter-procedural optimization is hindered
because these input files are separately compiled.
3. f77 -c -o foo.o -O4 ax.f bx.f cx.f
This command causes the files ax.f, bx.f and cx.f to be
compiled as one program, with the resulting object file
foo.o. This produces better optimization.
f77 sends its output to stderr. Upon completion, the f77 driver returns one
of the following status values:
0 - SUCCESS
1 - FAILURE
2 - SUBPROCESS_FAILURE (preprocessor, decfort, or ld)
3 - SIGNAL
You can override some options specified on the command line by using the
OPTIONS statement in your FORTRAN source program. An OPTIONS statement
affects only the program unit where the statement occurs. For more infor-
ma
For more information on this version of the Digital Fortran 77 compiler,
see the release notes in /usr/lib/cmplrs/fort/relnotes.
Options
Some f77 options are specified using keywords. Specify these options in the
form: -name keyword. You must spell out the -name completely, but you can
abbreviate the keyword to its shortest unique prefix (4 characters is the
recommended length). For example, you can specify -assume
noaccuracy_sensitive as -assume noac, and -check underflow as -check unde.
The f77 command takes the following options:
-1 Executes at least one iteration of DO loops. (FORTRAN-77 DO
loops are not executed if the upper limit is smaller than the
lower limit.) This option has the same effect as -nof77.
-66 Allows extensions that enhance FORTRAN-66 compatibility (same
as the -nof77 option).
-align commons
Aligns all COMMON block entities on natural boundaries, up to
4-bytes. The default is -align nocommons.
-align dcommons
Aligns all COMMON block entities on natural boundaries, up to
8-bytes. The default is -align nocommons. For optimal per-
formance on Alpha systems, specify -align records (the
default) and -align dcommons.
-align norecords
Aligns all RECORD fields on the next available byte boundary,
instead of natural boundaries. The default is -align records,
unless you specify -vms (which sets the -align norecords
option).
-ana Produces a file containing analysis information (about the
source code being compiled) for use with the Source Code
Analyzer (SCA). The name of the file is the basename of the
source file with a .ana substituted for the .f, .for, or .FOR.
The default is not to produce an analysis file. This option
is only available on ULTRIX systems.
-assume backslash
Treats the backslash (\) character literally in character
literals. The default is -assume nobackslash, which treats
the backslash character as C-style control (escape) character
syntax.
-assume byterecl
Specifies (for unformatted data files) that the units for the
OPEN statement RECL specifier (record length) value are in
bytes, not longwords (four-byte units). For formatted files,
the RECL unit is always in bytes.
INQUIRE returns RECL in bytes if the unit is not open.
INQUIRE returns RECL in longwords if the file is open for
unformatted data (and -assume byterecl is not specified); oth-
erwise, it returns RECL in bytes.
-assume dummy_aliases
Assumes that dummy (formal) arguments to procedures share
memory locations with other dummy arguments or with COMMON
variables that are assigned. These program semantics slow
performance and do not strictly obey the FORTRAN-77 Standard.
The default is -assume nodummy_aliases.
-assume
accuracy_sensitive.
-vms is used). The default is -assume
source_include, which tells the compiler to search the direc-
tory the source file is in for any INCLUDEs.
-assume nounderscore
Does not append a trailing underscore character to external
user-defined names: the main program name, named COMMON, BLOCK
DATA, and names implicitly or explicitly declared EXTERNAL;
the name of blank COMMON remains _BLNK__. FORTRAN intrinsic
names are not affected. The default is -assume underscore.
-automatic Places local variables on the run-time stack. The default is
-noautomatic.
-bestGnum Requests examination of source module data items during compi-
lation and linking to calculate the best number of bytes to be
used for the -G num option. Summary information is written to
stdout, including a recommended value for -G num. This option
is only available on ULTRIX RISC systems.
-C Generates code to perform run-time checks on subscript and
substring expressions (same as the -check bounds option). An
error is reported if the expression is outside the dimension
of the array or the length of the string. The default
suppresses range checking.
-c Suppresses the loading phase of the compilation and forces an
object file to be produced even if only one program is com-
piled. If you specify multiple files and want full interpro-
cedural optimizations, you must also specify the -o option.
(This creates a single .o file.)
-call_shared Produces a dynamic executable that uses shareable objects dur-
ing run-time. The linker searches for unresolved references
in shared library (.so) files before searching in archive
library (.a) files. The run-time loader is invoked to bring in
all required shareable objects and resolve any symbols that
remained undefined during static link-time. This is the
default. This option is only available on Digital UNIX sys-
tems.
-check bounds
Generates code to perform run-time checks on subscript and
substring expressions. An error is reported if the expression
is outside the dimension of the array or the length of the
string. The default is -check nobounds.
-check noformat
Suppresses the FORVARMIS fatal error. This error occurs at
run time when the data type of an item being formatted for
output does not match the format descriptor being used (for
example, a REAL*4 item formatted with an I edit descriptor).
If -vms is specified, the default is -check format; otherwise,
the default is -check noformat.
With -check noformat, the data item is formatted using the
specified descriptor unless the length of the item cannot
accomodate the descriptor (for example, it is still an error
to pass an INTEGER*2 item to an E edit descriptor).
-check nooutput_conversion
Suppresses the OUTCONERR continuable error message. This
error occurs at run time when a data item is too large to fit
in a designated FORMAT descriptor field. The field is filled
with asterisks (*) and execution continues. If -vms is speci-
fied, the default is -check output_conversion, which displays
the OUTCONERR message; otherwise, the default is -check
nooutput_conversion.
-check nopower
Suppresses the run-time errors for 0.0**0.0 and
**, so 0.0**0.0 is
1.0 and (-3.0)**3.0 is -27.0. The default is -check power,
which causes fatal run-time errors for these cases.
-check overflow
Generates code to trap on integer overflow. The default is
-check nooverflow.
-check underflow
Produces a message at run time to warn that floating-point
underflow has occurred. Floating-point underflow replaces the
result with 0, unless you specify the -fpe3 or -fpe4 option.
The default is -check nounderflow.
-check_bounds
Generates code to perform run-time checks on subscript and
substring expressions (same as the -check bounds option). An
error is reported if the expression is outside the dimension
of the array or the length of the string. The default
suppresses range checking.
-col72 Treats the statement field of each source line as ending in
column 72 (same as the -noextend_source option).
-convert big_endian
Specifies that unformatted data will be in big endian integer
format of the appropriate size: INTEGER*1, INTEGER*2, or
INTEGER*4; and IEEE floating point format of the appropriate
size: REAL*4, REAL*8, COMPLEX*8, or COMPLEX*16. Note that
INTEGER*1 data is the same for little endian and big endian.
The default is -convert native. For more information, see
your DEC Fortran user manual.
-convert cray
Specifies that unformatted data will be in big endian integer
format of the appropriate size: INTEGER*1, INTEGER*2, or
INTEGER*4; and CRAY (TM) floating-point format of size REAL*8
or COMPLEX*16.
The default is -convert native. For more information, see
your DEC Fortran user manual.
-convert fdx Specifies that unformatted data will be in little endian
integer format of the appropriate size: INTEGER*1, INTEGER*2,
or INTEGER*4; Digital VAX floating-point format F_floating for
size REAL*4 or COMPLEX*8, D_floating for size REAL*8 or COM-
PLEX*16, and X_floating for REAL*16.
The default is -convert native. For more information, see
your DEC Fortran user manual.
-convert fgx Specifies that unformatted data will be in little endian
integer format of the appropriate size: INTEGER*1, INTEGER*2,
or INTEGER*4; Digital VAX floating-point format F_floating for
size REAL*4 or COMPLEX*8, floating-point format G_floating of
size REAL*8 or COMPLEX*16, and X_floating for REAL*16.
The default is -convert native. For more information, see
your DEC Fortran user manual.
-convert ibm Specifies that unformatted data will be in big endian integer
format of the appropriate size: INTEGER*1, INTEGER*2, or
INTEGER*4; and IBM (TM) System\370 floating-point format of
size REAL*4 or COMPLEX*8 (IBM short 4) and size REAL*8 or COM-
PLEX*16 (IBM long 8).
The default is -convert native. For more information, see
your DEC Fortran user manual.
-convert native. For more information, see
your DEC Fortran user manual.
-convert native
Specifies that unformatted data should not be converted. This
is the default.
-convert vaxd
Specifies that unformatted data will be in little endian
integer format of the appropriate size: INTEGER*1, INTEGER*2,
or INTEGER*4; and Digital VAX floating-point format F_floating
for size REAL*4 or COMPLEX*8, D_floating for size REAL*8 or
COMPLEX*16, and H_floating for REAL*16.
The default is -convert native. For more information, see
your DEC Fortran user manual.
-convert vaxg
Specifies that unformatted data will be in little endian
integer format of the appropriate size: INTEGER*1, INTEGER*2,
or INTEGER*4; and Digital VAX floating-point format F_floating
for size REAL*4 or COMPLEX*8, floating-point format G_floating
of size REAL*8 or COMPLEX*16, and H_floating for REAL*16.
The default is -convert native. For more information, see
your DEC Fortran user manual.
-cord Runs the cord(1) procedure-rearranger on the resulting file
after linking. This rearrangement reduces the cache conflicts
of the program's text. The output of cord(1) is left in the
file specified by the -o output option (or a.out, by default).
At least one -feedback file must be specified.
-cpp Runs cpp(1) on all FORTRAN source files before compiling.
This includes FORTRAN source files created by ratfor(1) or
efl(1).
-cross_reference
Includes in the listing (if one is generated with -V ), a
cross-reference of all symbols used in the source program,
along with line numbers of definitions and uses (same as the
-show xref option). The default is -nocross_reference.
-Dname Defines the name for cpp(1), as if by #define. If no defini-
tion is given, the name is defined as "1".
-diag Produces a file containing compiler messages and diagnostic
information for use with the Language Sensitive Editor (LSE).
The name of the file is the basename of the source file with a
.dia substituted for the .f, .for, or .FOR. The default is not
to produce a diagnostic file. This option is only available
on ULTRIX systems.
-d_lines Compiles lines having a D in column 1 of the source program.
The default is to treat such lines as comments.
-double_size 64
Defines DOUBLE PRECISION declarations, constants, functions,
and intrinsics as REAL*8; it has no effect on DOUBLE COMPLEX
data. This option is only available on Digital UNIX systems.
This is the default.
-double_size 128
Defines DOUBLE PRECISION declarations, constants, functions,
and intrinsics as REAL*16; it has no effect on DOUBLE COMPLEX
data. This option is only available on Digital UNIX systems.
The default is -double_size 64.
-E Uses any remaining characters in the argument as efl(1)
options when processing an .e file. The temporary file, used
as the output of efl(1), consists of the last component of the
source file with a .f substituted for the .e. This temporary
file is removed unless you specify the -K option.
-error_limit nn
Specifies the maximum number of error-level or fatal-level
compiler errors allowed for a file specified on the f77 com-
mand line. If you specify -noerror_limit, there is no limit
on the number of errors that are allowed. The default is
-error_limit 30 (or a maximum of 30 error-level and fatal-
level messages).
If -c is specified on the command line and the maximum number
of errors is reached, a warning message is issued and the next
file (if any) on the command line is compiled. If -c is not
specified, a warning message is issued and compilation ter-
minates.
-extend_source
Treats the statement field of each source line as ending in
column 132, instead of column 72. The default is
-noextend_source.
-F Applies the efl(1) and ratfor(1) preprocessors to relevant
files and puts the result in files whose names have their suf-
fix changed to .f. (No .o files are created.)
-f66 Allows extensions that enhance FORTRAN-66 compatibility (same
as the -nof77 option).
-f77 Enforces FORTRAN-77 semantics instead of FORTRAN-66 semantics.
This is the default.
-fast Sets the following command options that can improve run-time
performance: -assume noaccuracy_sensitive, -align dcommons,
-math_library fast, and -O4 (the default).
-feedback file
Specifies the file to be used by cord(1) or the compiler for
further optimizations. This file is produced by prof(1) with
its -feedback option from an execution of the program produced
by pixie(1).
-fpe0 or -fpe
Terminates a program during run time if a floating-point
operation results in overflow, a division by zero, or invalid
data; before termination, the compiler issues a message, and
creates a core dump file. In the case of floating-point under-
flow, the program does not terminate, but continues with the
underflow value set to zero. (The compiler issues a warning
message if -check underflow is set). This is the default.
-fpe1 Continues program execution if a floating-point operation
results in overflow, a division by zero, invalid data, or
floating-point underflow (the underflow value is set to zero,
and the compiler issues a warning message if -check underflow
is set).
-fpe2 Continues program execution if a floating-point operation
results in overflow, a division by zero, invalid data, or
floating-point underflow, and prints a warning message in the
first two instances. In the case of floating-point underflow,
the underflow value is set to zero. Upon program completion,
the compiler provides a count of how many times each exception
occurred.
-fpe3 Continues program execution if a floating-point operation
results in overflow, a division by zero, invalid data, or
floating-point underflow (the compiler issues a warning mes-
sage if -check underflow is set). For underflow, the under-
flow value is not set to zero, and gradual underflow occurs.
-fpe4 Continues program execution if a floating-point operation
results in overflow, a division by zero, invalid data, or
floating-point underflow, and prints a warning message in the
first two instances. Upon program completion, the compiler
provides a count of how many times each exception occurred.
For underflow, the underflow value is not set to zero, and
gradual underflow occurs.
-fpp Runs fpp(1) on all FORTRAN files before compiling; it has no
effect on compilation of C programs. fpp(1) handles a subset
of the functionality of cpp(1). This option is only available
on Digital UNIX systems.
-fprm chopped
Causes the compiler to round results of calculations toward
zero.
-fprm dynamic
Allows run-time selection of a rounding mode by calling the
Digital UNIX write_rnd(3) routine. The read_rnd(3) routine
can be used to find the current rounding mode (which is stored
in the floating-point control register (fpcr)).
If you specify -fprm dynamic without calling the write_rnd(3)
routine, the default setting ( -fprm nearest ) is used.
-fprm minus_infinity
Causes the compiler to round results of calculations toward
the next smallest representative value.
-fprm nearest
Causes the compiler to round results of calculations toward
the nearest representable value. This is the default.
-G num Specifies the maximum size ( num ), in bytes, of a COMMON
block to be accessed from the global pointer. The argument
num is assumed to be a decimal number. If num is zero, no
data is accessed from the global pointer. The default value
for num is 8 bytes. This option is only available on ULTRIX
RISC systems. (Also see the -bestGnum option.)
-g0 Prevents symbolic debugging information from appearing in the
object file.
-g1 Produces traceback information (showing pc to line correla-
tion) in the object file, substantially increasing its size.
This is the default.
-g2 or -g Produces traceback and symbolic debugging information in the
object file. This option sets the -O0 option. However, if
you specify an explicit -O option, the specified option is
effective.
-g3 Produces traceback and symbolic debugging information in the
object file, and performs whatever optimizations you specify.
This option can produce additional debugging information
describing the effects of optimizations, but debugging inaccu-
racies can occur as a result of the optimizations that have
been performed.
-gen_feedback
Directs the compiler to generate code that will produce accu-
rate feedback information when profiled. The steps are:
1. f77 -gen_feedback -o x x.f
2. pixie x
3. x.pixie
4. prof x -pixie -feedback x.fb x.Addrs x.Counts
5. f77 -feedback x.fb -O5 -fast -o x x.f
-granularity byte
Ensures that data of byte size can be accessed from different
threads sharing data in memory.
-granularity longword
Ensures that naturally aligned data of longword size (4 bytes)
can be accessed from different threads sharing data in memory.
When this option is in effect, attempts to access smaller size
data or misaligned data can result in data items that are
inconsistently updated for multiple threads.
-granularity quadword
Ensures that naturally aligned data of quadword size (8 bytes)
can be accessed from different threads sharing data in memory.
This is the default. When this option is in effect, attempts
to access smaller size data or misaligned data can result in
data items that are inconsistently updated for multiple
threads.
-I Prevents cpp(1) from searching for #include files in the stan-
dard directory /usr/include. It also prevents the compiler
from searching there for files specified in an INCLUDE state-
ment.
-Idir Directs the search for cpp(1) #include files and files speci-
fied in a Digital Fortran INCLUDE statement. The file names
must not begin with slash (/). Directories are searched in the
following order: (1) the directory preceding the input file
name on the command line; (2) the directories specified by the
-Idir option; (3) the standard directory /usr/include. (See
also the -noinclude option.)
-i2 Makes default integer and logical variables 2-bytes long (same
32. For optimal performance on Alpha systems, use 4- or 8-
byte integer or logical values instead of 2-byte values.
-i4 Makes default integer and logical variables 4-bytes long (same
as the -integer_size 32 option). This is the default.
-i8 Makes default integer and logical variables 8-bytes long (same
as the -integer_size 64 option). This option is only avail-
able on Alpha systems. The default is -integer_size 32.
-ident Specifies that what(1) style identification strings should be
placed in the .o object file. The formats of the strings are:
(c)compiler-identification
(m)module-name
(d)date
These strings are always created for Fortran main programs,
and when the CDEC$ IDENT statement in source creates a what(1)
module identification string. The default is -noident.
-inline all Inlines every call that it is possible to inline while still
generating correct code. However, recursive routines will not
cause an infinite loop at compile time.
-inline manual
Inlines only statement functions. This is the default for
optimization levels -O2 and -O3.
-inline none Suppresses all inlining of routines. This is the default for
optimization levels -O0 and -O1.
-inline size Inlines all of the routines in the -inline manual category,
plus any additional calls that the compiler determines will
improve run-time performance without significantly increasing
the size of the program. This option was previously called
-inline automatic (and -inline space ).
-inline speed
Inlines all of the routines in the -inline manual category,
plus any additional calls that the compiler determines will
improve run-time performance, even where it may signficantly
increase the size of the program. This is the default for
optimization levels -O, -O4, and -O5.
-integer_size 16
Makes default integer and logical variables 2-bytes long. The
default is -integer_size 32. For optimal performance on Alpha
systems, use 4- or 8-byte integer or logical values instead of
2-byte values.
-integer_size 32
Makes default integer and logical variables 4-bytes long.
This is the default.
-integer_size 64
Makes default integer and logical variables 8-bytes long.
This option is only available on Alpha systems. The default
is -integer_size 32.
-K Does not remove temporary files created during compilation and
linking. This option does not affect the naming of temporary
files. To see the names and locations of the temporary files,
specify -v.
-L Prevents the linker from searching for libraries in the stan-
dard directories.
-Ldir Directs the linker to search for libraries in dir before
searching the standard directories.
-lstring Searches -libstring libraries for ld (see ld(1) ). This
option should be placed at the end of the command line.
-M Tells cpp(1) to generate dependency lists suitable for
make(1), instead of the normal output.
-m Applies the m4(1) preprocessor to each efl or ratfor source
file before transforming it with the ratfor(1) or efl(1)
preprocessors. The temporary file used as the output of m4(1)
consists of the last component of the source file with a .p
substituted for the .e or .r. This temporary file is removed
unless you specify the -K option.
-machine_code
Includes in the listing (if one is generated with -V ), a
machine language representation of the compiled code. This
machine language cannot be assembled. The default is
-nomachine_code.
-math_library accurate
Specifies that the compiler is to select the version of the
math library routine which provides the most accurate result
for mathematical intrinsic functions. This is the default.
For certain ranges of input values, the selected routine may
execute more slowly than if you used -math_library fast.
-math_library fast
Specifies that the compiler is to select the version of the
math library routine which provides the highest execution per-
formance for certain mathematical intrinsic functions, such as
EXP and SQRT.
For certain ranges of input values, the selected routine may
accurate (the default setting) provides.
-names as_is Causes the compiler to distinguish between uppercase and
lowercase letters in identifiers and external names. The
default is -names lowercase.
-names lowercase
Causes the compiler to treat uppercase and lowercase letters
as equivalent in identifiers and to force all external names
to be lowercase. This is the default.
-names uppercase
Causes the compiler to treat uppercase and lowercase letters
as equivalent in identifiers and to force all external names
to be uppercase. The default is -names lowercase.
-noautomatic Causes all local variables to be statically allocated. This
is the default.
-nocpp Does not run cpp(1) on any FORTRAN source files before compil-
ing. This includes FORTRAN source files created by ratfor(1)
or efl(1).
-noerror_limit
Specifies that there is no limit to the number of error-level
or fatal-level compiler errors allowed for a file specified on
the command line.
-noextend_source
Treats the statement field of each source line as ending in
column 72 of the source program. This is the default.
-nof77 Allows extensions that enhance FORTRAN-66 compatibility.
-nofpp Does not run fpp(1) (or cpp(1) ) on FORTRAN source files
before compiling.
-nofor_main Specifies that the main program is not written in FORTRAN, and
prevents the compiler from linking for_main.o into applica-
tions. This option is only available on Digital UNIX systems.
The default is -for_main.
-noi4 Makes default integer and logical variables 2-bytes long (same
as the -integer_size 16 option). For optimal performance on
Alpha systems, use 4- or 8-byte integer or logical values
instead of 2-byte values.
-noident Specifies that what(1) style identification strings should not
be placed in the .o object file, unless the source contains
the CDEC$ IDENT statement or a main program.
-noinclude Directs the compiler not to search in /usr/include for files
specified in a Digital Fortran INCLUDE statement. You can
specify the -Idir option along with this option. This option
has no effect on searches for cpp(1) #include files.
-noinline Suppresses all inlining of routines (same as the -inline none
option).
-non_shared Does not produce a dynamic executable. The linker will search
regular archive library (.a) files to resolve undefined refer-
ences; .so files are not searched. Object files (.o suffix)
from archives are included in the executable produced. This
option is only available on Digital UNIX systems. The default
is -call_shared.
-nopipeline Disables the use of instruction scheduling to certain inner-
most loops. Also disables prefetching of data to reduce the
impact of cache misses.
This option must be specified if you want this type of optimi-
zation disabled and you are also specifying -O5, since -pipe-
line is performed by default at the -O5 level of optimization.
-norecursive Compiles all FUNCTION and SUBROUTINE procedures for non-
recursive execution. This is the default.
-noreentrancy
Tells the Digital Fortran RTL that the program will not be
relying on threaded or asynchronous (AST) reentrancy. This
option is the same as the -reentrancy none option.
-norun Directs the driver not to execute the compiler and other
phases of the process. If you use this option with the -v
option, you can see what would have been executed.
-nospeculate Disables all speculative code scheduling. This option is only
available on systems running Digital UNIX Version 4.0 or
higher. This is the same as the -speculate none option.
-notransform_loops
Disables a group of loop transformation optimizations that
apply to array references within loops. This group of optimi-
zations includes loop blocking, loop distribution, loop
fusion, loop interchange, loop scalar replacement, and outer
loop unrolling.
This option must be specified if you want this type of optimi-
zation disabled and you are also specifying -O5, since
-transform_loops is performed by default at the -O5 level of
optimization.
-nowarn Suppresses all warning messages. This option has the same
effect as -warn nogeneral.
-O0 Disables all optimizations. Does not check for unassigned
variables.
-O1 Enables local optimizations and recognition of common subex-
pressions. The call graph determines the order of compilation
of procedures.
-O2 Enables global optimization and all -O1 optimizations. This
includes code motion, strength reduction and test replacement,
split lifetime analysis, code scheduling, and inlining of
arithmetic statement functions.
-O3 Enables additional global optimizations that improve speed (at
the cost of extra code size), for example: integer multiplica-
tion and division expansion (using shifts), loop unrolling,
and code replication to eliminate branches. Also performs all
-O2 optimizations.
-O4 or -O Enables inline expansion of small procedures and all -O3
optimizations. This is the default. However, if you specify
the -g option, the default is -O0. (See also the -g2 or -g
option.)
-O5 Enables software pipelining, loop transformation optimiza-
tions, and other optimizations, including byte-vectorization,
and insertion of additional NOPs (No Operations) for alignment
of multi-issue sequences.
Loop transformation optimizations are a group of optimizations
that apply to array references within loops. These optimiza-
tions can improve the performance of the memory system and can
apply to multiple nested loops. This type of optimization can
also be specified by using the -transform_loops option.
Software pipelining applies instruction scheduling to certain
innermost loops, allowing instructions within a loop to "wrap
around" and execute in a different iteration of the loop.
This can reduce the impact of long-latency operations, result-
ing in faster loop execution. This type of optimization can
also be specified by using the -pipeline option.
To determine whether using -O5 benefits your particular
program, you should time program execution for the same pro-
gram compiled with -O4.
-o output Names the final output file output. The a.out file is unaf-
fected.
-om Performs code optimization after linking, including NOP (No
Operation) removal, .lita removal, and reallocation of common
symbols. This option also positions the global pointer regis-
ter so the maximum addresses fall in the gp-accessible window.
The -om option is supported only for programs compiled with
the -non_shared option.
The following options can be passed directly to -om by using
the -WL compiler option:
++ -WL,-om_compress_lita
Removes unused .lita entries after optimization, and then
compresses the .lita section.
Removes dead code (unreachable instructions) generated
after applying optimizations. The .lita section is not
compressed by this option.
++ -WL,-om_no_inst_sched
Turns off instruction scheduling.
++ -WL,-om_no_align_labels
Turns off alignment of labels. Normally, the -om option
quadword aligns the targets of all branches to improve
loop performance.
Sets the size threshold of common symbols. Every common
symbol whose size is less than or equal to "num" will be
allocated close to each other. This option can be used to
improve the probability that the symbol can be accessed
directory from the global pointer register. Normally, the
-om option tries to collect all common symbols together.
-onetrip Executes at least one iteration of DO loops. (FORTRAN-77 DO
loops are not executed if the upper limit is smaller than the
lower limit.) This option has the same effect as -nof77.
-P Runs only cpp(1) and puts the result for each source file, by
suffix convention (for example, .f, .r, .e, and .s), in a
corresponding .i file, after being processed by the appropri-
ate preprocessors. The .i file does not have line numbers (#)
in it. This option sets the -cpp option.
-p0 Does not permit profiling. If loading occurs, the standard
run-time startup routine (crt0.o) is used, and the profiling
libraries are not searched. This is the default.
-p1 or -p Sets up profiling by periodically sampling the value of the
program counter. This option only effects the loading. When
loading occurs, this option replaces the standard run-time
startup routine with the profiling runtime startup routine
(mcrt0.o) and searches the level 1 profiling library
(libprof1.a).
When profiling occurs, the startup routine calls monstartup(3)
and produces the file mon.out, which contains execution-
profiling data for use with the postprocessor prof(l). If you
specify -p1 or -p, you should also specify -g1 or higher.
-pad_source Specifies that source records shorter than the statement field
width are to padded with spaces on the right, out to the end
of the statement field. This affects the interpretation of
character and Hollerith literals that are continued across
source records.
The default is -nopad_source, which causes a warning to be
displayed if a character or Hollerith literal that ends before
the statement field ends is continued onto the next source
record.
-pg Sets up profiling for gprof(1), which produces a call graph
showing the execution of the program. With this option, the
standard run-time startup routine is replaced by the gcrt0.o
routine, and ld(1) inserts calls to _mcount at each entry
label.
Programs that are linked with the -pg option and then run,
produce the files gmon.out and gmon.sum. File gmon.out con-
tains a dynamic call graph and profile; file gmon.sum contains
a summarized dynamic call graph and profile. To display the
output, run gprof on the gmon.out file.
-pipeline Applies instruction scheduling to certain innermost loops,
allowing instructions within a loop to "wrap around" and exe-
cute in a different iteration of the loop. This can reduce
the impact of long-latency operations, resulting in faster
loop execution. -pipeline also enables prefetching of data to
reduce the impact of cache misses.
This type of optimization can be specified for optimization
levels -O2 and higher; it is performed by default if -O5 is in
effect.
-R Uses any remaining characters in the argument as ratfor
options whenever processing a .r file. The temporary file,
used as the output of ratfor(1), consists of the last com-
ponent of the source file with a .f substituted for the .r.
This temporary file is removed unless you specify the -K
option.
-r8 Defines REAL declarations, constants, functions, and intrin-
sics as DOUBLE PRECISION (REAL*8), and defines COMPLEX
declarations, constants, functions, and intrinsics as DOUBLE
COMPLEX (COMPLEX*16). This option is the same as the
-real_size 64 option.
-r16 Defines REAL declarations, constants, functions, and intrin-
sics as REAL*16. It does not affect COMPLEX objects. This
option is the same as the -real_size 128 option.
-real_size 32
Defines REAL declarations, constants, functions, and intrin-
sics as REAL*4, and defines COMPLEX declarations, constants,
functions, and intrinsics as COMPLEX (COMPLEX*8). This is the
default.
-real_size 64
Defines REAL declarations, constants, functions, and intrin-
sics as DOUBLE PRECISION (REAL*8), and defines COMPLEX
declarations, constants, functions, and intrinsics as DOUBLE
COMPLEX (COMPLEX*16). The default is -real_size 32.
-real_size 128
Defines REAL declarations, constants, functions, and intrin-
sics as REAL*16. It does not affect COMPLEX objects.
-recursive Compiles all FUNCTION and SUBROUTINE procedures for possible
recursive execution. This sets the -automatic option. The
default is -norecursive.
-reentrancy asynch
Tells the Digital Fortran RTL that the program may contain
asynchronous (AST) handlers that could call the RTL. This
causes the RTL to guard against AST interrupts inside its own
critical regions.
-reentrancy none
Tells the Digital Fortran RTL that the program will not be
relying on threaded or asynchronous (AST) reentrancy. So, the
RTL will not guard against such interrupts inside the RTL.
This is the default and is the same as the -noreentrancy
option.
-reentrancy threaded
Tells the Digital Fortran RTL that the program is mul-
tithreaded, such as programs using the DECthreads library.
This causes the RTL to use thread locking to guard its own
critical regions.
-S Creates an assembleable listing file of the compiled source.
The name of this listing file is the base name of the source
file with a .s substituted for the .f, .for, or .FOR. No link
step occurs.
You cannot generate a -S listing and a -V listing in the same
compilation.
-shared Produces a dynamic shareable object for inclusion in a shared
library. The linker will produce a shareable object that other
dynamic executables can use at run-time. If you also specify
the -c option, a .o file is created; otherwise, a .so file is
created. This option is only available on Digital UNIX sys-
tems. The default is -call_shared.
-show code Includes in the listing (if one is generated with -V ), a
machine language representation of the compiled code (same as
the -machine_code option). This machine language cannot be
assembled. The default is -show nocode.
-show include
Includes in the listing (if one is generated with -V ), any
text file specified with INCLUDE in the source program. The
default is -show noinclude.
-show nomap Excludes from the listing (if one is generated with -V ),
information about the symbols used in the source program. The
default is -show map.
-show xref Includes in the listing (if one is generated with -V ), a
cross-reference of all symbols used in the source program,
along with line numbers of definitions and uses (same as the
-cross_reference option). The default is -show noxref.
-speculate all
Enables speculative code scheduling for all routines in the
program. This option is only available on systems running
Digital UNIX Version 4.0 or higher.
Speculation occurs when a conditionally executed instruction
is moved to a position before a test instruction so that the
moved instruction is then executed unconditionally. This
reduces instruction latency stalls, but performance may be
reduced because the run-time system must dismiss exceptions
caused by speculative instructions. Speculation affects code
most noticeably at -O3 and higher.
Any exception (for example: SIGSEGV, SIGBUS, or SIGFPE), any-
where in the entire program, is assumed to be speculative.
All of these exceptions are quietly dismissed without calling
any user-mode signal handler. If a module is compiled using
-speculate all, it cannot be linked with any other module or
library that does its own exception processing.
Since speculation turns off some run-time error checking, this
option should not be used while debugging or while testing for
errors.
-speculate by_routine
Indicates that all routines in the current module can do
speculation, but this speculation will not affect routines in
other modules in the program. This option is only available
on systems running Digital UNIX Version 4.0 or higher.
-speculate none
Disables all speculative code scheduling. This option is only
available on systems running Digital UNIX Version 4.0 or
higher. This is the same as the -nospeculate option.
-stand mia Controls whether the compiler suppresses diagnostic messages
for extensions to the ANSI FORTRAN-77 standard that are
included in the NTT Technical Requirement TR550001, Multiven-
dor Integration Architecture (MIA) Version 1.1, Division 2,
Part 3-2, Programming Language FORTRAN. This option enables
syntax checking ( -stand syntax ) to be performed. The
default is -stand nomia.
-stand semantic
Causes the compiler to issue informational messages for state-
ments that conform to the ANSI Standard but become nonstandard
because of how they are used. This option sets the -stand
syntax option. The default is -stand nosemantic.
-stand nosource_form.
-stand syntax
Causes the compiler to issue informational messages for syntax
extensions to the ANSI Standard. The default is -stand nosyn-
tax.
-static Causes all local variables to be statically allocated (same as
the -noautomatic option). This is the default.
-std Produces warnings for things that are not standard in the
language (same as the -stand semantic -stand syntax options).
-synchronous_exceptions
Causes the compiler to generate TRAPB instructions after every
floating-point instruction. This is a very expensive but
effective way to synchronize the instruction stream containing
floating-point exceptions so the failing instruction can be
accurately located by the debugger or a handler. The default
is -nosynchronous_exceptions. This option is only available
on Digital UNIX systems.
-syntax_only Controls whether the source file is checked only for correct
syntax. No code is generated, no object file is produced, and
some error checking done by the optimizer is bypassed (for
example, checking for uninitialized variables). This option
allows you to do a quick syntax check of your source file.
The default is -nosyntax_only.
-transform_loops
include:
Loop blocking
Loop distribution
Loop fusion
Loop interchange
Loop scalar replacement
Outer loop unrolling
This type of optimization can be specified for optimization
levels -O2 and higher; it is performed by default if -O5 is in
effect.
To determine whether using -transform_loops benefits your par-
ticular program, you should time program execution for the
same program (or subprogram) compiled at -O4.
-tune Selects processor-specific instruction tuning for implementa-
tions of the Alpha architecture. The format is:
-tune generic | host | ev4 | ev5
Regardless of the setting of the -tune option, the generated
code will run correctly on all implementations of the Alpha
architecture. Tuning for a specific implementation can
improve run-time performance; it is also possible that code
tuned for a specific target may run slower on another target.
The following are -tune options:
++ generic
Selects instruction tuning that is appropriate for all
implementations of the Alpha architecture. This is the
default.
++ host
Selects instruction tuning that is appropriate for the
machine the compilation is occurring on.
++ ev4
Selects instruction tuning for the 21064, 20164A, 21066,
and 21068 implementations of the Alpha architecture.
++ ev5
Selects instruction tuning for the 21164 implementation of
the Alpha architecture.
-U Causes the compiler to distinguish between uppercase and
lowercase letters in identifiers and external names. This
option is the same as the -names as_is option.
-Uname Tells cpp(1) to remove any initial definition of name.
-u Makes the default type of a variable undefined (IMPLICIT
NONE), which causes the compiler to issue a warning for any
undeclared symbols (same as the -warn declarations option).
This behavior differs from default FORTRAN rules.
-unroll n Controls loop unrolling done by the optimizer (at levels -O3
are to be unrolled; it must be an integer in the range 0
through 16. -nounroll is not allowed. The default is -unroll
0 (where the optimizer uses its default unroll amount).
-V Creates a listing file of the source file with various
compile-time information appended. The name of the listing
file is the basename of the source file with a .l substituted
for the .f, .for, or .FOR.
How you compile source files determines how the listing file
is created. If you compile several source files together, one
listing file is created (named with the basename of the first
input file and the .l suffix). If you compile source files
one at a time, a separate listing file is created for each
input file (named with the basename of the input file and the
.l suffix).
-v Prints the passes as they execute with their arguments and
their input and output files; also prints final resource usage
in the C-shell time format.
-vms Causes the run-time system to behave like Digital Fortran on
OpenVMS VAX systems (VAX FORTRAN) in the following ways:
++ Reinforces certain defaults
Reinforces the following Digital Fortran 77 defaults:
-fpe0, -static, -names lowercase (so A is equivalent to
a), and -norecursive. You can override this by specifying
the option on the command line. For example, if you
specify -vms -fpe2, you get -fpe2. The -vms option also
forces -check format and -check output_conversion.
++ Alignment
-vms does not affect the alignment of fields in records or
items in COMMON. Use -align norecords to pack fields of
records on the next byte boundary for compatibility with
Digital Fortran on OpenVMS VAX systems.
++ INCLUDE qualifiers
Recognizes /LIST and /NOLIST at the end of the file path-
name in an INCLUDE statement at compile time.
If the file name in the INCLUDE statement does not specify
the complete path, the path used is the current directory.
++ Quotation mark character (")
Recognizes a quotation mark as starting an octal constant
(such as "177) instead of a character literal ("...").
++ Control character syntax
Does not recognize the \n control character syntax in
character literals (same as the -assume backslash option).
++ Deleted records in relative files
When a record in a relative file is deleted, the first
byte of that record is set to a known character (currently
'@'). Attempts to read that record later result in
ATTACCNON errors. The rest of the record (the whole
record, if -vms is not set) is set to nulls for unformat-
ted files and spaces for formatted files.
++ ENDFILE records
When an ENDFILE is performed on a sequential unit, an
actual one byte record containing a Ctrl/D is written to
the file. If -vms is not set, an internal ENDFILE flag is
set and the file is truncated.
The -vms option does not affect ENDFILE on relative files;
such files are truncated.
++ Reading deleted records and ENDFILE records
The run-time direct access READ routine checks the first
byte of the retrieved record. If this byte is '@' or NULL
("\0"), then ATTACCNON is returned.
The run-time sequential access READ routine checks to see
if the record it just read is one byte long and contains a
Ctrl/D. If this is true, it returns EOF.
++ OPEN effects
Carriage control defaults to FORTRAN if the file is for-
matted, and the unit is connected to a terminal (checked
by means of isatty(3) ). Otherwise, carriage control
defaults to LIST.
The -vms option affects the record length for direct
access and relative organization files. The buffer size
is increased by one (to accommodate the deleted record
character).
++ Implied logical unit numbers
Recognizes certain environment variables at run time for
ACCEPT, PRINT, and TYPE statements, and for READ and WRITE
statements that do not specify a unit number, such as:
READ (*,1000). For more information, see your DEC Fortran
user manual.
++ Treatment of blanks in input
Causes the defaults for keyword BLANK= in OPEN statements
to become 'NULL' for an explicit OPEN, and 'ZERO' for an
implicit OPEN of an external or internal file.
-Wp,arg1[,arg2...]
Passes switches arg1[,arg2...] to cpp(1) that the driver does
not normally pass to cpp(1); for example: -Wp,-C,-M passes -C
-M to cpp(1). -Wp,... does not invoke cpp(1); use -cpp to
force the execution of cpp(1).
-w Suppresses all warning messages (same as the -nowarn option).
-w1 Suppresses warnings about unused variables (same as the -warn
nounused option).
-warn argument_checking
Enables warnings about argument mismatches between caller and
callee, when compiled together. The default is -warn
noargument_checking.
-warn declarations
Makes the default type of a variable undefined (IMPLICIT
NONE), which causes the compiler to issue a warning for any
undeclared symbols. This behavior differs from default FOR-
TRAN rules. The default is -warn nodeclarations.
-warn noalignments
Suppresses warning messages for data that is not naturally
aligned. The default is -warn alignments.
-warn nogeneral
Suppresses all warning messages (same as the -nowarn option).
The default is -warn general.
-warn noinformational
Suppresses all informational messages. The default is -warn
informational, unless you also specify -warn nogeneral. In
this case, no warning or informational messages are displayed.
-warn nouncalled
Suppresses warning messages when a statement function is never
called. The default is -warn uncalled.
-warn nouninitialized
Suppresses warning messages for a variable that is used before
a value is assigned to it. The default is -warn uninitialized.
-warn nounreachable
Suppresses warning messages for a section of code that is
unreachable (no path to it). The default is -warn unreachable.
-warn nousage
Suppresses warning messages about questionable programming
practices which, although allowed, often are the result of
programming errors. For example, a continued character or
Hollerith literal whose first part ends before the statement
field and appears to end with trailing spaces. The default is
-warn usage.
-warn truncated_source
Displays a warning at compile time when there are source
characters to the right of column 80 (or column 132 if
-extend_source is specified) in a non-comment line. The
default is -warn notruncated_source, which suppresses the
warning.
-warn unused Enables warning messages about unused variables. The default
is -warn nounused.
-what Prints the version strings of the f77 driver and the Digital
Fortran 77 compiler. If -what appears alone on the command
line, the compiler is not executed.
f77 ignores the following options and displays an informative message say-
ing they are unsupported:
-align8
-align16
-align32 Allows misalignment in COMMON.
-col120 Truncates source after column 120.
-q Does not display file and program names.
-w66 Suppresses F66 compatibility warnings.
f77 does not process the following options, but passes them to the cc(1)
compiler:
-D num Tells ld(1) to set the data segment origin. If num starts
with a hexadecimal letter, precede it with the digit "0".
-fptm x Tells cc(1) how to support exception handling (on Digital UNIX
systems only).
-ko output Tells cc(1) the name for the output file created by ucode
loader.
-N... Tells cc(1) to enlarge static tables.
-Olimit num Tells cc(1) to NOOPT if a routine is too big.
-systype name
Names compilation environment (on ULTRIX RISC systems only).
-T num Tells ld(1) to set the text segment origin. If num starts
with a hexadecimal letter, precede it with the digit "0".
-W... Passes command line options to other phases of the compilation
process.
f77 stops compilation if the following option is specified:
-EB Produces big endian byte order.
The compiler assumes other arguments are either loader options or FORTRAN-
77-compatible object files, typically produced by an earlier f77 run, or by
libraries of FORTRAN-77-compatible routines. These files, together with
the results of any compilations specified, are loaded in the order given,
producing an executable program with the default name a.out.
Restrictions
The standard library, /usr/lib/libc.a, is loaded with the -lc loader option
and not a full pathname. The wrong library can be loaded if there are files
with the name libc.a in the directories specified with the -L loader
option, or in the default directories searched by the loader.
Diagnostics
The f77 command produces diagnostic messages that are intended to be self-
explanatory. The loader can also produce occasional messages.
Files
a.out Loaded output
file.f Input file
file.o Object file
mon.out File produced for analysis by
prof(1)
/tmp/for* Temporary
/usr/bin/efl Extended FORTRAN language preproces-
sor
/usr/bin/f77 FORTRAN compilation driver
/usr/bin/fpr Formats FORTRAN carriage-control
listings for printing
/usr/bin/fsplit Utility to break FORTRAN modules
into individual routines
/usr/bin/ld Link editor (ld)
/usr/bin/ratfor Rational FORTRAN dialect preproces-
sor
/usr/include Standard directory for `#include'
files
/usr/include/foriosdefs.f PARAMETER statements for the values
of IOSTAT
/usr/include/for_fpe_flags.f PARAMETER statements defining the
flags for floating point exception
handling used by FOR_GET_FPE( ) and
FOR_SET_FPE( )
/usr/lib/cmplrs/fort/decfort Digital Fortran 77 compiler
/usr/lib/cord Procedure-rearranger
/usr/lib/cpp C macro preprocessor
/usr/lib/crt0.o Run-time startup
/usr/lib/ftoc Interface between prof(1) and
cord(1)
/usr/lib/libc.a Standard library, see intro(3)
/usr/lib/libfor.a Digital Fortran I/O support
/usr/lib/libi Internationalization library
/usr/lib/libm.a Math library
/usr/lib/libots.a Digital Fortran run-time string
support
/usr/lib/libprof1.a Level 1 profiling library
/usr/lib/libUfor.a Digital Fortran UNIX interface
library, see intro(3f)
/usr/lib/mcrt0.o Startup for profiling
The following files are only available on ULTRIX systems:
/usr/lib/libfor_G0.a Libfor for use with -G 0
/usr/lib/libUfor_G0.a LibUfor for use with -G 0
/usr/lib/libutil.a Digital Fortran miscellaneous run-
time support
/usr/lib/libutil_G0.a Libutil for use with -G 0
/usr/lib/nls/msg/ENG_GB.MCS/for_msg.cat
FORTRAN run-time message catalog
The following files are only available on Digital UNIX systems:
/usr/lib/fpp FORTRAN macro preprocessor
/usr/lib/libFutil.a Digital Fortran miscellaneous run-
time support
/usr/lib/nls/msg/en_US.88591/for_msg.cat
FORTRAN run-time message catalog
/usr/shlib/libc.so Standard library, see intro(3)
/usr/shlib/libFutil.so Digital Fortran miscellaneous run-
time support
/usr/shlib/libfor.so Digital Fortran I/O support
/usr/shlib/libots.so Digital Fortran run-time string sup-
port
/usr/shlib/libUfor.so Digital Fortran UNIX interface
library, see intro(3f)
See Also
as(1), cc(1), cord(1), cpp(1), dbx(1), decladebug(1), efl(1), fpr(1),
fsplit(1), ftoc(1), gprof(1), ld(1), lex(1), m4(1), pixie(1), prof(1), rat-
for(1), what(1), monstartup(3), read_rnd(3), write_rnd(3), intro(3f)
DEC Fortran Language Reference Manual
DEC Fortran user manual
Digital Fortran 77 release notes in /usr/lib/cmplrs/fort/relnotes
Digital Fortran 77 help file (text format) in
/usr/lib/cmplrs/fort/decfortran.hlp
|