Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ fc(1) — HP-UX 7.01

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

as(1)

asa(1)

cc(1)

gprof(1)

ld(1)

prof(1)

strip(1)

matherr(3M)

F77(1)

NAME

f77, fc − FORTRAN 77 compiler

SYNOPSIS

f77 [ options ] file ... 
fc [ options ] file ... 

Remarks:

The fc command conflicts with the built-in ksh(1) fc command, and is therefore considered obsolescent, but is retained for backward compatibility.  Refer to ksh(1) for information about the fc command history editor. 

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
f77 -L prog.f

is equivalent to

f77 -v -L prog.f

The TMPDIR environment variable can be set to specify a directory with temporary files, to be used instead of the default directories /tmp and /usr/tmp. 

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}, and 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 an uppercase letter, the specified exception is completely ignored.  If secondary is a lowercase letter, the exception specified generates a warning but not an error. 

A secondary specification causes the following exceptions to be recognized:

H or h Recognize Hollerith data as a non-ANSI exception.  H produces no warnings; h produces warnings. 

M or m Allow MIL-STD-1753 extensions.  M produces no warnings; m produces warnings. 

N or n Allow NAMELIST as a non-ANSI exception.  N produces no warnings; n produces warnings. 

R or r Allow recursion.  R produces no warnings; r produces warnings.  As a side effect, DATA statements amid executable statements produce errors. 

S or s Allow 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 Allow 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. 

−Idir Add dir to the list of directories that are searched for $INCLUDE files whose names do not begin with /.  Initially, only the directory containing the source file is searched. 

−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 full optimization. 

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

+Q dfile Cause dfile to be read before compilation of each source file.  Dfile can only contain compiler directives. 

−R4 Make the default size of floating-point constants REAL*4.  This is the compiler’s default. 

−R8 Make the default size of floating-point constants REAL*8.  For example, the constant 3.5 would be treated as if it was the constant 3.5D0 if the -R8 option was specified. 

−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). 

+s Issue warnings for non-ANSI features (same as $OPTION ANSI ON).  The −a option should be used instead of +s. 

−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 800:

- -W d,-Q,dfile,-s

sends the options −Q dfile and −s through the compiler driver.  Furthermore, a shorthand notation for this mechanism can be used by placing + in front of the option name as in:

+Q dfile +s

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

−y Generate additional information needed by static analysis tools, and ensure that the program is linked as required for static analysis.  This option is incompatible with optimization. 

−Y Enable 8- and 16-bit Native Language Support (NLS) in strings and comments.  In the default case, NLS is not enabled. 

+R Write cross reference and symbol table information to standard output during compilation. 

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 standard error output. 

Series 800: Errors are written to both the listing file and the standard error output if the −L option is specified and if standard output and standard error output are not directed to the same place. 

DEPENDENCIES

Series 300

The −y option is not supported on the Series 300. 

Arguments whose names end with .c or .s are assumed to be C or assembly source programs, and are compiled or assembled, producing .o files. 

Arguments whose names end with .r are assumed to be ratfor(1) source programs.  These are first transformed by the ratfor preprocessor, 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 Peephole optimizer (standard suffix is c2)

g Global optimizer (standard suffix is c1)

a Assembler (standard suffix is as)

l Linker (standard suffix is ld)

Specifying −W1, −l causes 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 can appear among executable statements. 

The following implementation-specific options are supported on the Series 300:

+A Cause the compiler to align data using alignment rules where non-character items 4 bytes and larger are aligned on 2-byte boundaries instead of 4-byte boundaries. 

+A<secondary>
Set the alignment of data items within FORTRAN STRUCTUREs.  Defined values for secondary are:

3 Set the alignment of data items within FORTRAN STRUCTUREs to be the same as the alignment produced by the Series 300 C compiler.  This is the same as the $HP9000_300 ALIGNMENT ON option.  This is the compiler default. 

8 Set the alignment of data items within FORTRAN STRUCTUREs to be the same as the alignment produced by the Series 800 C compiler.  This is the same as the $HP9000_800 ALIGNMENT ON option. 

N Set the alignment of data items within FORTRAN STRUCTUREs to be the same as the alignment produced by an industry standard FORTRAN compiler.  This is the same as the $NOSTANDARD ALIGNMENT ON option. 

+bfpa Cause the compiler to generate code that uses the HP98248A 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.

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

2 Enable a non-standard interpretation of logical data. The value of a logical is determined by the value of the lowest order bit, rather than by a zero or non-zero value.  The logical value of true is represented as -1, rather than +1. This option is the same as the inline $NOSTANDARD LOGICAL compiler option. 

3 Causes the compiler to pass character item parameters with the length at the end of the parameter list. 

+ffpa Cause the compiler to generate code for the HP98248A floating-point accelerator card. This code does not run unless the card is installed.

+M Prevent the compiler from generating in-line code for the MC68881 math coprocessor.  Library routines will be referenced for matherr capability. 

+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). 

+O<secondary>
Cause specific optimizations to be performed. Defined values for secondary are:

1 Invoke the peephole assembly code optimizer only. 

2 Invoke the global optimizer and the peephole optimizer.  This is the same as the −O option. 

3 Invoke the procedure integrator along with the global optimizer and the peephole optimizer. 

+P<secondary>
Cause specific optimizations to be performed. Defined values for secondary are:

1 Invoke the assembly code optimizer (equivalent to +O1 option). 

2 Invoke the procedure integrator. 

+U Distinguish uppercase and lowercase (case is significant).  Keywords are only recognized in lowercase. 

Series 800

The −A, −w66, −R4, and −R8 options are not currently supported. 

The TMPDIR environment variable is not supported. 

The −Y option additionally enables NLS support of lexical comparisons of 8- and 16-bit data.  This option also causes /usr/lib/libportnls.a to be linked in between libcl.a and libc.a.  If the −Y option is not specified, the library /usr/lib/libnlsstubs.a is linked in between libcl.a and libc.a. 

The −l option, when used with the isam library, will cause /usr/lib/libmap.a, /usr/lib/libfh.a, and /usr/lib/libfhsup.a to be linked in between libcl.a and libc.a.  If the −lisam option is not given, the library /usr/lib/libisamstubs.a is linked in between libcl.a and libc.a. 

The following implementation-specific options are supported on the Series 800:

+A Cause the compiler to align data using alignment rules where non-character items 4 bytes and larger are aligned on 2-byte boundaries instead of 4-byte boundaries.  This is the same as $HP1000

+A<secondary>
Set the alignment of data items within FORTRAN STRUCTUREs.  Defined values for secondary are:

3 Set the alignment of data items within FORTRAN STRUCTUREs.  to be the same as the alignment produced by the Series 300 C compiler.  This is the same as the $HP9000_300 ALIGNMENT ON option. 

N This option is not currently supported. 

+e Enable “other vendor” compatibility mode.  This is equivalent to specifying the $NOSTANDARD compiler directive at the beginning of the program file. 

+E<secondary>
This option enables specific “other vendor” compatibility modes. Defined values for secondary are:

0 This is provided for compatibility reasons only.  Extended-range DO loops and jumps into IF blocks are enabled by default on Series 800 systems. 

1 This is the same as specifying the $NOSTANDARD SYSTEM compiler directive.  It tells the compiler to treat calls to the routines DATE, IDATE, SECNDS, TIME, RAN and EXIT as calls to intrinsics. 

2 This is the same as specifying the $NOSTANDARD LOGICALS compiler directive.  It tells the compiler to treat -1 as .TRUE.  and zero as .FALSE. 

3 This is the same as specifying the $NOSTANDARD CHARS compiler directive.  It tells the compiler to pass character item parameters with the length at the end of the parameter list. 

4 This is the same as specifying the $NOSTANDARD IO compiler directive.  It allows the output of numeric data types ( INTEGER, REAL, DOUBLE and QUAD ) with alpha format specifiers ( A and R

+O<opt>
Invoke optimizations selected by opt. If opt is 1, only level 1 optimizations are performed, If opt is 2, all optimizations are performed.  The option −O is the same as +O2. 

+T Cause the running program to issue a procedure traceback for runtime errors. 

AUTHOR

F77 and fc were developed by HP. 

FILES

a.out linked executable output file

file.f input file (FORTRAN source file)

file.o object file

/lib/libc.a C library; see Section 3 of this manual and intro(3).

/lib/libm.a math library

/tmp/fc* compiler temporary files

Series 300

/bin/as20 assembler

/lib/c0 procedure integrator

/lib/c1 global optimizer

/lib/c2 assembly code optimizer

/usr/lib/end.o symbolic debugger string buffer

/lib/f1 compiler code generator

/usr/lib/f77pass1 compiler front end

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/libp/libc.a C library (profiling)

/usr/lib/libFext.a compatibility function library

/lib/libp/libFext.a compatibility function library (profiling)

/usr/lib/libF77.a intrinsic function library

/lib/libp/libF77.a intrinsic function library (profiling)

/usr/lib/libI77.a FORTRAN I/O library

/lib/libp/libI77.a FORTRAN I/O library (profiling)

/lib/libp/libm.a math library (profiling)

/lib/gfrt0.o startoff with profiling via gprof

/lib/mfrt0.o startoff with profiling via prof

/usr/tmp/fxr* temporary files for cross referencing

Series 800

/usr/lib/f77comp compiler

/lib/crt0.o runtime startup

/usr/lib/libcl.a FORTRAN math and I/O libraries

/usr/lib/libportnls.a NLS run-time library

/usr/lib/libnlsstubs.a stubs for NLS library routines

/usr/lib/libmap.a ISAM run-time support library

/usr/lib/libfh.a ISAM run-time support library

/usr/lib/libfhsup.a ISAM run-time support library

/usr/lib/libisamstubs.a stubs for ISAM library routines

/usr/lib/nls/$LANG/f77_msgs.cat
error message catalog

SEE ALSO

as(1), asa(1), cc(1), gprof(1), ld(1), prof(1), strip(1), matherr(3M). 

EXTERNAL INFLUENCES

International Code Set Support

Single- and multi-byte character code sets are supported in comments and strings. 

Hewlett-Packard Company  —  HP-UX Release 7.0: Sept 1989

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