F77(1) — HP-UX
NAME
f77, fc − FORTRAN 77 compiler
SYNOPSIS
f77 [ options ] file ...
fc [ options ] file ...
DESCRIPTION
F77 and fc are names for the same HP-UX FORTRAN 77 compiler. The compiler accepts the following types of file arguments (see the DEPENDENCIES section for additional file types):
(1) Arguments whose names end with .f are taken to be FORTRAN 77 source files. They are compiled, and each object file is left in the current directory in a file whose name is that of the source, with .o substituted for .f. (The .o file will not be created for a single source that is compiled and loaded, nor for any source which fails to compile correctly.)
(2) Arguments whose names end with .o are passed on to the linker (ld(1)) to be linked into the final program.
Arguments can be passed to the compiler through the FCOPTS environment variable as well as on the command line. The compiler picks up the value of FCOPTS and places its contents before any arguments on the command line. For example,
FCOPTS=-v
export FCOPTS
fc -L prog.f
is equivalent to
fc -v -L prog.f
Options
The following options are recognized:
−A<secondary>
Generate errors for features not part of the ANSI 77 standard. As a side effect, the −K option is set if neither secondary option R nor r is specified.
Secondary is one or more of the letters from the set {aAhHmMnNrRsS}. The secondary specifies what exceptions to the standard are allowed. Secondary is optional. If it is not specified, no exceptions to the ANSI standard are allowed. If secondary is specified, only the specified exceptions are allowed and all other exceptions are recognized with an error. If secondary is a uppercase letter, the specified exception is completely ignored. If the secondary is a lowercase letter, the exception specified generates a warning and not an error.
The exceptions that are recognized with a secondary specification are:
H or h
recognizes Hollerith data as a non-ANSI exception. H produces no warnings; h produces warnings.
M or m
allows the MIL-STD-1753 extensions. M produces no warnings; m produces warnings.
N or n
allows NAMELIST as a non-ANSI exception. N produces no warnings; n produces warnings.
R or r
allows recursion. R produces no warnings; r produces warnings. As a side effect, DATA statements amid executable statements will produce errors.
S or s
allows selected syntactical features: lowercase letters, tabs, quotation marks, and symbolic names with a length greater than six characters. S produces no warnings; s produces warnings.
A or a
allows recognition of all the exceptions listed above; all other ANSI extensions are disallowed. A produces no warnings for all exceptions allowed; a produces warnings.
−a Issue warnings for non-ANSI features (same as $OPTION ANSI ON and the +s option).
−c Suppress linking and produce object (.o) files from source files.
−C Enable range checking (same as $OPTION RANGE ON).
−D Compile debug lines as source statements. Source lines with a "D" or "d" in column 1 are treated as comments by default.
−g Cause the compiler to generate additional information needed by a symbolic debugger. (This option may be incompatible with optimization.)
−G Prepare object files for profiling with gprof (see gprof(1)).
−I2 Make default size of integers and logicals INTEGER*2 and LOGICAL*2 (same as $OPTION SHORT).
−I4 Make default size of integers and logicals INTEGER*4 and LOGICAL*4. This is the compiler’s default.
−K Automatically SAVE all local variables in all subprograms. This option forces static storage for these variables in order to provide a convenient path for importing FORTRAN 66 and FORTRAN 77 programs which were written to depend on static allocation of memory (that is, variables retaining their values between invocations of the respective program units).
−lx Cause the linker to search first in the library named by /lib/libx.a and then in /usr/lib/libx.a. (See ld(1).)
−L Write a program listing to the standard output during compilation.
−n Cause the output file from the linker to be marked shared.
−N Prevent the output file from the linker from being marked shared.
−o outfile Name the output file from the linker outfile instead of a.out.
−onetrip Execute any DO loop at least once.
−O Invoke the assembly code optimizer.
−p Prepare object files for profiling with prof (see prof(1)).
−q Cause the output file from the linker to be marked demand load.
−Q Prevent the output file from the linker from being marked demand load.
−s Cause the output of the linker to be stripped of symbol table information (see ld(1) and strip(1)). (This option is incompatible with symbolic debugging.)
−S Compile the named source files and leave the assembly language output in corresponding files whose names are suffixed with .s (no .o files are created).
−t c,name Substitute or insert subprocess c with name where c is one or more implementation-dependent set of identifiers indicating the subprocess(es). Works in two modes:
1. If c is a single identifier, name represents the full path name of the new subprocess.
2. If c is a set of identifiers, name represents a prefix to which the standard suffixes are concatenated to construct the full path names of the new subprocesses.
One or more values that c can assume are:
c Compiler body (standard suffix is f77comp)
0 Same as c
l Linker (standard suffix is ld)
For other values that c can assume, see the DEPENDENCIES section below.
−u Force types of identifiers to be implicitly undeclared (same as specifying IMPLICIT NONE; no other IMPLICIT statements are permitted).
−U Use uppercase for external names (default is lowercase).
−v Enable the verbose mode, producing a step-by-step description of the compilation process on the standard error output.
−w Suppress warning messages (same as $OPTION WARNINGS OFF).
−w66 Enable warnings about FORTRAN 66 features used.
−W c,arg1[,arg2,...,argN]
Cause arg1 through argN to be handed off to subprocess c. The argi take the form -argoption[,argvalue], where argoption is the name of an option recognized by the subprocess and argvalue is a separate argument to argoption where necessary. The c can assume the values listed under the −t option, as well as those of d (driver program), which has a special meaning explained below.
The −W d option specification allows additional implementation-specific options to be recognized and passed through the compiler driver to the appropriate subprocesses (see −W above). For example, on the Series 500:
-W d,-Q,dfile,-e
will send the options −Q dfile and −e through the compiler driver. Furthermore, a shorthand notation for this mechanism can be used by prepending + to the option name; as in:
+Q dfile +e
which is equivalent to the previous option expression. Note that for simplicity this shorthand is applied to each implementation-specific option individually, and that the argvalue is no longer separated from the argoption by a comma (see −W).
DEPENDENCIES
Series 300:
Arguments whose names end with .c or .s are taken to be C or assembly source programs and are compiled or assembled, producing .o files.
Arguments whose names end with .r are taken to be ratfor(1) source programs. These are first transformed by the ratfor preprocessor, and then compiled by f77 producing .o files.
The −t and −W options allow c to assume the following values:
r Ratfor preprocessor (standard suffix is ratfor)
c Compiler front end (standard suffix is f77pass1)
0 Same as c
p Procedure integrator (standard suffix is c0)
1 Code generator (standard suffix is f1)
2 Optimizer (standard suffix is c2)
a Assembler (standard suffix is as)
l Linker (standard suffix is ld)
Specifying −W1, −l will cause source file line numbers to be printed as assembly code comments for debugging purposes.
The −K option has two side effects:
(a)All non-initialized variables are initialized to zero, and
(b)the DATA statement may appear among executable statements.
The following option is supported:
−Y Enable 8- and 16-bit NLS support in strings and comments. In the default case, NLS is not enabled. The −Y option has an optional parameter specifying the 16-bit language name. There must be no blanks between −Y and the language parameter.
The implementation-specific options on the Series 300 are:
+A Cause the compiler to align data using "old" alignment rules where non-character items 4 bytes and larger are aligned on 2-byte boundaries instead of 4-byte boundaries.
+b Cause the MC68010 compiler to generate code for floating point operations that use the 98635A floating point card if it is installed at run-time. If the card is not installed, floating point operations will be done in software. This option is meaningless for the MC68020 compiler.
+bfpa Cause the MC68020 compiler to generate code that uses the 98248A floating point accelerator card, if it is installed at run-time. If the card is not installed, floating point operations will be done on the MC68881 math coprocessor. This option is meaningless for the MC68010 compiler.
+B Cause the compiler to treat the backslash character (\) as a C-like escape character.
+e Enable "other vendor" compatibility mode for importing non-HP code. This is equivalent to specifying all the +E options and the -K option. Some register allocation is turned off and all local variables in subprograms have static storage.
+E<secondary>
This option enables specific "other vendor" compatibility modes. Defined values for secondary are:
0 Enable extended-range DO loops and jump into IF blocks. This option disables some register allocation.
1 Cause the linker to search the compatibility library /usr/lib/libFext.a in addition to the regular FORTRAN libraries.
+f Cause the MC68010 compiler to generate code for the 98635A floating point card. This code does not run unless the card is installed. This option is meaningless for the MC68020 compiler.
+ffpa Cause the MC68020 compiler to generate code for the 98248A floating point accelerator card. This code does not run unless the card is installed. This option is meaningless for the MC68010 compiler.
+M Prevent the MC68020 compiler from generating in-line code for the MC68881 math coprocessor. Library routines will be referenced for matherr capability. This option is meaningless for the MC68010 compiler.
+N<secondary><n>
This option lets the user set the initial size of internal compiler tables. However, these tables are expanded automatically by the compiler as needed. Secondary is one of the letters from the set {acenqstx}, and n is an integer value. Secondary and n are not optional. The table sizes can be re-specified using one of the secondary letters and the number n as follows:
a Initial size of external label name storage table (default is 10000 bytes).
c Initial size of control statements table (default is 20 table entries).
e Initial number of expression tree nodes (default is 1000 entries).
n Initial size of the hash table of symbols (default is 401 table entries).
q Initial size of equivalence table (default is 150 table entries).
s Initial size of statement label table (default is 201 table entries).
t Initial size of external symbol storage table (default is 40000 bytes).
x Initial size of external symbol table (default is 200 table entries).
+P<secondary>
Cause specific optimizations to be performed. Defined values for secondary are:
1 Invoke the assembly code optimizer (equivalent to −O option).
2 Invoke the procedure integrator.
+R Write cross reference and symbol table information to the standard output during compilation.
+s Issue warnings for non-ANSI features (same as $OPTION ANSI ON). The −a option should be used instead of +s.
+U Distinguish uppercase and lowercase (case is significant). Keywords are only recognized in lowercase.
+x Cause the compiler to generate inline code for the MC68020 and MC68881. This is the default on MC68020 machines.
+X Cause the compiler to generate "generic" MC68010 code. The code will also run on MC68020 processors, but it will not take advantage of new architectural capabilities. This is the default on MC68010 machines.
Series 500:
The following options are not implemented: −A, −a, −G, −O, −p, −S, −w66.
The following option is supported:
−Y Enable 8- and 16-bit NLS support in strings and comments. In the default case, NLS is not enabled.
The implementation-specific options on the Series 500 are:
+e Write errors to the standard error output.
+F Cause the compiler to generate information used by various program analysis programs.
+Q dfile Specify dfile as the option file.
+s Issue warnings for non-ANSI features (same as $OPTION ANSI ON).
+T Cause the running program to issue a procedure traceback for runtime errors.
+Vc Put all COMMON variables in the virtual data area.
+Vd Put all statically allocated (SAVE statement) variables and initialized (DATA statement) variables in the virtual data area.
+Vf put all FORMAT strings in the virtual data area.
Series 800:
The −a, −A, −w66, and −G options are not currently supported.
The −O option has an optional parameter specifying the optimization level. A parameter of ‘1’ causes only level 1 optimizations to be performed, and a parameter of ‘2’ causes all optimizations to be performed. The option −O is the same as −O2.
The implementation-specific options on the Series 800 are:
+Q dfile Specify dfile as the option file.
+s Issue warnings for non-ANSI features (same as $OPTION ANSI ON).
+T Cause the running program to issue a procedure traceback for runtime errors.
FILES
a.outlinked executable output file
file.finput file (FORTRAN source file)
file.oobject file
/lib/libc.aC library; see section (3) of this manual
/lib/libm.amath library
Series 300
| /bin/as10 | assembler (MC68010 version) |
| /bin/as20 | assembler (MC68020 version) |
| /lib/c0 | procedure integrator |
| /lib/c210 | assembly code optimizer (MC68010 version) |
| /lib/c220 | assembly code optimizer (MC68020 version) |
| /usr/lib/end.o | symbolic debugger string buffer |
| /lib/f110 | compiler code generator (MC68010 version) |
| /lib/f120 | compiler code generator (MC68020 version) |
| /usr/lib/f77pass110 | compiler front end (MC68010 version) |
| /usr/lib/f77pass120 | compiler front end (MC68020 version) |
| file.c | input file (C source file) |
| file.r | input file (ratfor source file) |
| file.s | input file (assembly source file) |
| /lib/frt0.o | run-time startoff routine |
| /lib/libc_p.a | C library (profiling) |
| /usr/lib/libFext.a | compatibility function library |
| /usr/lib/libFext_p.a | compatibility function library (profiling) |
| /usr/lib/libF77.a | intrinsic function library |
| /usr/lib/libF77_p.a | intrinsic function library (profiling) |
| /usr/lib/libI77.a | FORTRAN I/O library |
| /usr/lib/libI77_p.a | FORTRAN I/O library (profiling) |
| /lib/libm_p.a | math library (profiling) |
| /lib/gfrt0.o | startoff with profiling via gprof |
| /lib/mfrt0.o | startoff with profiling via prof |
Series 500
| /usr/tmp/∗ | temporary files used by the compiler; |
| names are created by tmpnam(3S). | |
| /usr/lib/end.o | symbolic debugger string buffer |
| /usr/lib/f77comp | compiler |
| /lib/frt0.o | runtime startup |
| /lib/libF77.a | FORTRAN math library |
| /lib/libI77.a | FORTRAN I/O library |
Series 800
| /usr/lib/f77comp | compiler |
| /lib/crt0.o | runtime startup |
| /usr/lib/libcl.a | FORTRAN math and I/O libraries |
AUTHOR
F77 and fc were developed by HP.
SEE ALSO
as(1), asa(1), cc(1), gprof(1), ld(1), prof(1), strip(1), matherr(3M).
DIAGNOSTICS
The diagnostics produced by f77 are intended to be self-explanatory. If a listing is requested (−L option), errors are written to the listing file. If no listing is being generated, errors are written to the standard error output.
Series 500: Errors are written both to the listing file and the standard error output if both the −L and +e options are specified. Occasional messages may be produced by the linker.
Series 800: Errors are written to both the listing file and the standard error output if the −L option is specified and if the standard output and standard error output are not directed to the same place.
WARNINGS
Series 500: The −Q dfile option has a new meaning; use +Q dfile to specify an option file.
INTERNATIONAL SUPPORT
8- and 16-bit data only in strings and comments, 8-bit file names.
Hewlett-Packard Company — Version B.1, May 11, 2021