Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ f77(1) — HP-UX 5.20

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

as(1)

asa(1)

cc(1)

ld(1)

strip(1)

matherr(3M)

F77(1)  —  HP-UX

NAME

f77, fc − FORTRAN 77 compiler

SYNOPSIS

f77 [ options ] files
fc [ options ] files

DESCRIPTION

F77 is the HP-UX FORTRAN 77 compiler.  It accepts several types of file arguments, see the HARDWARE DEPENDENCIES section below for exceptions:

(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 which 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:

−c suppress linking and produce object (.o) files from source files. 

−C enable range checking (same as $OPTION  RANGE  ON). 

−D compile debug lines (source lines with a "D" or "d" in column 1 are treated as comments by default). 

−g causes the compiler to generate additional information needed for the use of a symbolic debugger.  (This option may be incompatible with optimization.) 

−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 (i.e. variables retaining their values between invocations of the respective program units). 

−lx causes 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 stdout during compilation. 

−n causes the output file from the linker to be marked shared. 

−N causes the output file from the linker to not be 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 (see prof(1)). 

−q causes the output file from the linker to be marked demand load. 

−Q causes the output file from the linker to not be marked demand load. 

−s causes 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 of an 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 HARDWARE 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 upper case for external names (default is lower case). 

−v enable the verbose mode, producing a step-by-step description of the compilation process on stderr. 

−w suppress warning messages (same as $OPTION  WARNINGS  OFF). 

−w66 suppress warnings about FORTRAN 66 features used. 

−W c,arg1[,arg2,...,argN]
causes arg1 through argN to be handed off to subprocess c.  The argi are of 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 values that c can assume are those listed under the −t option, as well as 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). 

HARDWARE DEPENDENCIES

Series 200, 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 option have additional values that c can assume:

r ratfor preprocessor (standard suffix is ratfor)

1 code generator (standard suffix is f1)

2 optimizer (standard suffix is c2)

a assembler (standard suffix is as)

c compiler body (standard suffix is _f77pass1_)

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 −L option is not implemented. 

The following option is supported:

−Y enables 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 200 and Series 300 are:

+A causes 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 causes the MC68010 compiler to generate code for floating point operations that will use the 98635 floating point card if it is installed in the computer at run-time (if not installed, operations will be done in software). 

+B causes the compiler to treat the backslash character (\) as a C-like escape character.

+f causes the MC68010 compiler to generate code for floating point operations that must use the 98635 floating point card.  This code does not run unless the floating point card is installed. 

+M causes the MC68020 compiler to NOT generate in-line code for the MC68881 math coprocessor.  Library routines will be referenced for matherr capability. 

+N<secondary><n>
This option adjusts the size of internal compiler tables. The compiler uses fixed size arrays for certain internal tables. Secondary is one of the letters from the set {qsxcnaet}, 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:

q maximum size of equivalence table (default is 150 table entries). 

s maximum size of statement label table (default is 201 table entries). 

x maximum size of external symbol table (default is 200 table entries). 

c maximum size of control statements table (default is 20 table entries). 

n maximum size of the hash table of symbols (default is 401 table entries). 

a maximum size of external label name storage table (default is 10000 bytes). 

e maximum number of expression tree nodes (default is 1000 entries). 

t maximum size of external symbol storage table (default is 40000 bytes). 

+s issue warnings for non-ANSI features (same as $OPTION  ANSI  ON). 

+U upper and lower case are distinguished (case is significant).  Keywords are only recognized in lower case. 

+x causes the compiler to generate inline code for the MC68020 and MC68881.  This is the default on MC68020 machines. 

+X causes 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:  −O, −p, −S, −w66. 

The following option is supported:

−Y enables 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 stderr. 

+F causes 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 causes the running program to issue a procedure traceback for runtime errors. 

+Vc put all COMMONs in the virtual data area. 

+Vd put all SAVE’d and initialized (DATA statement) variables in the virtual data area. 

+Vf put all FORMAT strings in the virtual data area. 

Series 800:
The −w66 option is not implemented. 

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 causes the running program to issue a procedure traceback for runtime errors. 

FILES

Series 200, Series 300

a.out linked executable output file
/lib/c2 assembly code optimizer
/lib/c210 assembly code optimizer (MC68010 version)
  linked to /usr/lib/c2 on MC68010 systems
/lib/c220 assembly code optimizer (MC68020 version)
  linked to /usr/lib/c2 on MC68020 systems
/usr/lib/end.o symbolic debugger string buffer
/lib/f1 compiler pass 2
/lib/f110 compiler pass 2 (MC68010 version)
  linked to /usr/lib/f1 on MC68010 systems
/lib/f120 compiler pass 2 (MC68020 version)
  linked to /usr/lib/f1 on MC68020 systems
/usr/lib/f77pass1 compiler pass 1
/usr/lib/f77pass110 compiler pass 1 (MC68010 version)
  linked to /usr/lib/f77pass1 on MC68010 systems
/usr/lib/f77pass120 compiler pass 1 (MC68020 version)
  linked to /usr/lib/f77pass1 on MC68020 systems
file.c input file (C source file)
file.f input file (FORTRAN source file)
file.o object file
file.r input file (ratfor source file)
file.s input file (assembly source file)
/lib/frt0.o run-time startoff routine
/lib/libc.a C library; See Section (3) of this manual
/usr/lib/libF77.a intrinsic function library
/usr/lib/libI77.a FORTRAN I/O library
/lib/libm.a math library
/lib/mfrt0.o startoff with profiling

Series 500

/usr/tmp/∗ temporary files used by the compiler;
names are created by tmpnam(3S).
a.out linked executable output file
/usr/lib/end.o symbolic debugger string buffer
/usr/lib/f77comp compiler
file.f input file (FORTRAN source file)
file.o object file
/lib/frt0.o runtime startup
/lib/libF77.a FORTRAN math library
/lib/libI77.a FORTRAN I/O library
/lib/libc.a C library; See Section (3) of this manual
/lib/libm.a math library

Series 800

a.out linked executable output file
/usr/lib/f77comp compiler
file.f input file (FORTRAN source file)
file.o object file
/lib/crt0.o runtime startup
/usr/lib/libcl.a FORTRAN math and I/O libraries
/lib/libc.a C library; See Section (3) of this manual
/lib/libm.a math library

AUTHOR

F77 and fc were developed by the Hewlett-Packard Company. 

SEE ALSO

as(1), asa(1), cc(1), ld(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 stderr. 

Series 500: Errors will be written to both the listing file and stderr if the −L and +e options are both specified.  Occasional messages may be produced by the linker. 

Series 800: Errors will be written to both the listing file and stderr if the −L option is specified and if stdout and stderr are not directed to the same place. 

WARNINGS

The −s option has a new meaning; use +s for non-ANSI warnings. 

Series 200, Series 300:  The −U option has a new meaning; use +U for case sensitivity. 

The +k option has been removed for Series 200, Series 300 because it is the default. 

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 filenames. 

Hewlett-Packard Company  —  Version B.1,  May 11, 2021

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026