Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

cc(1)

f77cvt(1)

fpr(1)

fsplit(1)

gprof(1)

ld(1)

prof(1)

F77(1)  —  USER COMMANDS

NAME

f77 − Sun FORTRAN compiler

SYNOPSIS

f77 [ −66 ] [ −a ] [ −align _block ] [ −ansi ] [ −c ] [ −C ] [ −dryrun ] [ −Dname[=def ] ] [ −e ]

[ −f ] [ −F ] [ −g ] [ −help ] [ −i2 ] [ −i4 ]

[ −Ipathname ] [ −llib ] [ −Ldir ] [ −misalign ] [ −N[cdlnqsx]nnn ]

[ −o outfile ] [ −onetrip ] [ −O ] [ −p ] [ −pg ] [ −pipe ] [ −P ] [ −Qoption prog opt ]

[ −Qpath pathname ] [ −Qproduce sourcetype ] [ −S ] [ −temp=dir ] [ −time ]

[ −u ] [ −U ] [ −v ] [ −w[66]]   sourcefile ...

DESCRIPTION

f77 is the Sun FORTRAN compiler, which translates programs written in the Sun FORTRAN programming language into executable load modules or into relocatable binary programs for subsequent linking with ld(1).  Sun FORTRAN is a superset of FORTRAN 77, with many extensions, including those to provide compatibility with VMS FORTRAN (in conjunction with f77cvt(1)).  In addition to the many flag arguments (options), f77 accepts several types of files. 

Files with names ending in .f are taken to be Sun FORTRAN source files; they are compiled, and each object program is put in the current directory in a file with the same name as the source, with .o substituted for .f. 

Files with names ending in .F are also taken to be Sun FORTRAN source files, but they are preprocessed by the C preprocessor (equivalent to a cc −E command) before they are compiled by the f77 compiler. 

Files with names ending in .c or .s are taken to be C or assembly source files and are compiled or assembled, producing .o files. 

Files with names ending in .il are taken to be in-line expansion code template files; these are used to expand calls to selected routines in-line when the −O option is in effect. 

Files with names ending in .vf or .for are assumed by the f77cvt(1) source code converter (not by the f77 compiler) to be valid VMS FORTRAN source files and are converted to source files acceptable to both Sun FORTRAN and VMS FORTRAN compilers, except for possible VMS FORTRAN features which it can’t convert, which are reported by error messages. 

OPTIONS

SunOS-4 3.2 (SPARC). 
See ld(1) for link-time options. 

−66 Report non-FORTRAN 66 constructs as errors. 

−a Insert code to count how many times each basic block is executed.  Invokes a run-time recording mechanism that creates a .d file for every .f file (at normal termination).  The .d file accumulates execution data for the corresponding source file.  The tcov(1) utility can then be run on the source file to generate statistics about the program. 

−align  _block
Cause the global symbol whose FORTRAN name is block to be page-aligned: its size is increased to a whole number of pages, and its first byte is placed at the beginning of a page.  This option is passed on to the linker; it’s a linker option. 

−ansi Identify all non-ANSI extensions.  Note that f77cvt provides an option to flag any Sun FORTRAN extensions that it uses during the conversion of a VMS FORTRAN source file. 

−c Suppress linking with ld(1) and produce a .o file for each source file.  A single object file can be named explicitly using the −o option. 

−C Compile code to check that subscripts are within the declared array bounds. 

−dryrun Show but do not execute the commands constructed by the compilation driver. 

−Dname[=def ]
Define a symbol name to the C preprocessor, cpp(1).  Equivalent to a #define directive in the source.  If no def is given, name is defined as ‘1’ ( .F suffix files only). 

−e Accept extended source lines, up to 132 characters long. 

−f Force 8-byte quantities that are in common to start at a location that is a multiple of 8.  Resulting code may not be standard and may not be portable. 

−F Apply the C preprocessor to .F files.  Put the result in corresponding .f files, but do not compile them.  No linking is done. 

−g Produce additional symbol table information for dbx(1) and pass the −lg flag to ld(1). 

−help Display an equivalent of this list of options. 

−i2 Make the default size of integer and logical constants and variables two bytes. 

−i4 Make the default size of integer and logical constants and variables four bytes (this is the default). 

−Ipathname Add pathname to the list of directories in which to search for #include files with relative filenames (not beginning with /).  The preprocessor first searches for #include files in the directory containing sourcefile, then in directories named with −I options (if any), and finally in /usr/include/f77 (applies to processing of .F suffix files only). 

−llib Link with object library lib (for ld(1)). 

−Ldir Add dir to the list of directories containing object-library routines (for linking using ld(1)). 

−misalign Allow for misaligned data in memory.  Use this option only if the compiler reports that COMMON or EQUIVALENCE statements cause data to be misaligned. 
WARNING: With this option, the compiler will generate very much slower code for references to dummy arguments. If you can, you should recode the indicated section instead of recompiling with this option. 

−N[cdlnqsx]nnn
Make static tables in the compiler bigger. f77 complains if tables overflow and suggests you apply one or more of these flags.  These flags have the following meanings:

c Maximum depth of nesting for control statements (for example, DO loops).  Default is 20. 

d Maximum depth of nesting for data structures and unions.  Default is 20. 

l Maximum number of continuation lines for a continued statement. The default is 19 (1 initial and 19 continuation). 

n Maximum number of identifiers.  Default is 1009. 

q Maximum number of equivalenced variables.  Default is 150. 

s Maximum number of statement numbers.  Default is 401. 

x Maximum number of external names (common block, subroutine, and function names).  Default is 200. 

Multiple −N options increase sizes of multiple tables. 

−o outfile Name the output file outfile.  outfile must have the appropriate suffix for the type of file to be produced by the compilation (see FILES, below).  outfile cannot be the same as sourcefile (the compiler will not overwrite the source file). 

−onetrip Compile DO loops so that they are performed at least once if reached.  Otherwise, Sun FORTRAN DO loops are not performed at all if the upper limit is smaller than the lower limit. 

−O Optimize the object code.  This invokes both the global intermediate code optimizer and the object code optimizer. 

If the optimizer runs out of swap space, try any of the following possibly corrective measures (listed in increasing order of difficulty):

Change from -O to -P. 

Divide large, complicated routines into smaller, simpler ones. 

Reinstall with about four times as much swap space.  You may well need help from your system administrator to do this. 

−p Prepare the object code to collect data for profiling with prof(1).  Invokes a run-time recording mechanism that produces a mon.out file (at normal termination). 

−pg Prepare the object code to collect data for profiling with gprof(1).  Invokes a run-time recording mechanism that produces a gmon.out file (at normal termination). 

−pipe Use pipes, rather than intermediate files between compilation stages.  Very cpu-intensive. 

−P Partial optimization.  Does a restricted set of global optimizations.  Do not use −P unless −O results in excessive compilation time. 

−Qoption prog opt
Pass the option opt to the program prog.  The option must be appropriate to that program and may begin with a minus sign.  prog can be one of: as, c2, cg, cpp, f77pass1, inline, iropt, or ld. 

−Qpath pathname
Insert directory pathname into the compilation search path (to use alternate versions of programs invoked during compilation).  This path will also be searched first for certain relocatable object files that are implicitly referenced by the compiler driver (such files as ∗crt∗.o and bb_link.o ). 

−Qproduce sourcetype
Produce source code of the type sourcetype, where sourcetype can be one of:

.o Object file from as(1). 

.s Assembler source (from c2, cg, f77pass1, or inline ). 

−S Compile the named programs, and leave the assembly language output on corresponding files suffixed .s (no .o file is created). 

−temp=dir Set directory for temporary files to be dir. 

−time Report execution times for the various compilation passes. 

−u Make the default type of a variable ‘undefined’, rather than using the FORTRAN default rules. 

−U Do not convert upper case letters to lower case.  The default is to convert upper case letters to lower case, except within character string constants. 

−v Verbose.  Print the name of each pass as the compiler executes. 

−w[66] Suppress all warning messages. −w66 suppresses only FORTRAN 66 compatibility warnings. 

Other arguments are taken to be either linker option arguments, or f77-compatible object programs, typically produced by an earlier run, or libraries of f77-compatible routines.  These programs, together with the results of any compilations specified, are linked (in the order given) to produce an executable program in the file specified by the −o option, or in a file named a.out if the −o option is not specified. 

FILES

a.out executable output file

file.a library of object files

file.c C source file

file.d tcov(1) test coverage input file

file.f Sun FORTRAN source file

file.for VMS FORTRAN source file for f77cvt(1)

file.F Sun FORTRAN source file for cpp(1)

file.il inline expansion file

file.o object file

file.s assembler source file

file.S assembler source for cpp(1)

file.tcov output from tcov(1)

file.vf VMS FORTRAN source file for f77cvt(1)

/lib/c2 optional optimizer

/lib/cg Sun FORTRAN code generator

/lib/compile compiler command-line processing driver

/lib/cpp macro preprocessor

/lib/crt0.o runtime startup

/lib/Fcrt1.o startup code for −fsoft option

/lib/gcrt0.o startup for gprof-profiling

/lib/libc.a standard library, see intro(3)

/lib/mcrt0.o startup for profiling

/usr/include/f77
directory searched by the Sun FORTRAN INCLUDE statement

/usr/bin/f77 compiler command-line processing driver

/usr/bin/f77cvt
VMS FORTRAN source code converter

/usr/lib/f77pass1
Sun FORTRAN parser

/usr/lib/libc_p.a
profiling library, see intro(3)

/usr/lib/libF77.a
Sun FORTRAN library: General - other than I/O or UNIX interface

/usr/lib/inline inline expander of library calls

/usr/lib/libI77.a
Sun FORTRAN library: I/O routines

/usr/lib/libm.a
math library

/usr/lib/libpfc.a
startup code for combined Sun Pascal and Sun FORTRAN programs

/usr/lib/libU77.a
Sun FORTRAN library: interface to UNIX system calls

/tmp/∗ compiler temporary files

mon.out file produced for analysis by prof(1)

gmon.out file produced for analysis by gprof(1)

SEE ALSO

cc(1),  f77cvt(1),  fpr(1),  fsplit(1),  gprof(1),  ld(1),  prof(1)

Sun FORTRAN Programmer’s Guide

Sun FORTRAN Release Notes

DIAGNOSTICS

The diagnostics produced by f77 itself are intended to be self-explanatory.  Occasional messages may be produced by the linker. 
 

Sun Release 3.2  —  Last change: 21 October 1987

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