Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ f77(1) — Sun FORTRAN 1.2

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 ] [ −dalign ] [ −dryrun ] [ −Dname[=def ] ] [ −e ]

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

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

[ −o outfile ] [ −onetrip ] [ −O[123] ] [ −p ] [ −pg ] [ −pic ] [ −PIC ] [ −pipe ]

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

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 runtime 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 common block 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.  For example, the command “f77 -align _BUFFO_ GROWTH.F” causes BUFFO to be page-aligned. 

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

−dalign Generate double load/store instructions wherever possible to give faster execution.  Using this option automatically triggers the −f option (see  below) to cause all double typed data to be double aligned.  Note that with  the −dalign option, you may not get the usual alignment guaranteed by ANSI standard FORTRAN so you may be sacrificing portability to gain speed.  See also "Shared Libraries" in Programming Utilities and Libraries . 
(Sun-4 only).

−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 Align local data and common blocks on 8-byte boundaries.  Resulting code may not be standard and may not be portable. 

float_option Floating-point code generation option.  This option does not apply to the Sun-4, which generates SPARC floating-point instructions.  For the Sun-2 and Sun-3, float_option can be one of:

−f68881
Generate in-line code for the Motorola MC68881 floating-point coprocessor (Sun-3 only).

−ffpa Generate in-line code for the Sun-3 Floating-Point Accelerator board (Sun-3 only). 

−fsky Generate in-line code for the Sky Floating-Point Processor (Sun-2 only). 

−fsoft
Generate software floating-point calls (Sun-2 and Sun-3 systems, for which this is the default).

−fstore
Insure that expressions allocated to extended precision registers are rounded to storage precision whenever an assignment occurs in the source code.  Only has effect when −f68881 is specified. (Sun-3 only)

−fswitch
Generate runtime-switched floating-point calls. The compiled object code is linked at runtime to routines that support one of the above types of floating-point code.  This was the default in previous releases. Only for use with programs that are floating-point intensive and which must be portable to machines with various floating-point options (Sun-2 or Sun-3).

−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 Sun-4 only.  Allow for misaligned data in memory.  Use this option only if you get a warning 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[123] Optimize the object code.  This invokes both the global intermediate code optimizer and the object code optimizer. 

−O1 Peephole Optimization only.  Do not use −O1 unless −O2 and −O3 result in excessive compilation time, or running out of swap space. 

−O2 Partial optimization.  Does a restricted set of global optimizations.  Do not use −O2 unless −O3 results in excessive compilation time, or running out of swap space.  (Same as −P )

−O3 Global Optimization.  (same as −O)

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

1. Change from -O3 to -O2 . 

2. Divide large, complicated routines into smaller, simpler ones. 

3. Increase the limit for the stacksize: insert the line

"limit stacksize 8 megabytes" into your .cshrc file. 

4. Repartition you disk with two to four times as much swap space. 

Backup everything first. 

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 runtime 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 runtime recording mechanism that produces a gmon.out file (at normal termination). 

−pic Produce position-independent code.  Each reference to a global datum is generated as a dereference of a pointer in the global offset table.  Each function call is generated in pc-relative addressing mode through a procedure linkage table.  The size of the global offset table is limited to 64K on MC68000-family processors, or to 8K on SPARC processors. 

−PIC Similar to -pic, but allows the global offset table to span the range of 32-bit addresses.  This is for use in those rare cases where there are too many global data objects for −pic . 

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

−P See the −O2 option. 

−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, iropt, inline, ld, or optim. 

−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 f77pass1, inline, c2, cg, or optim). 

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

ENVIRONMENT

FLOAT_OPTION
When no floating-point option is specified, the compiler uses the value of this environment variable (if set).  Recognized values are: f68881, ffpa, fsky, fswitch and fsoft. 

FILES

a.out executable output file

file.a library of object files

file.d tcov(1) test coverage input file

file.f Sun FORTRAN source file

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

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

file.vf VMS FORTRAN source file for f77cvt(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)

/lib/c2 optional optimizer for Sun-2, Sun-3, or Sun-4. 

/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

/lib/Mcrt1.o startup code for −f68881 option

/lib/optim optional optimizer for Sun386i. 

/lib/Scrt1.o startup code for −fsky option

/lib/Wcrt1.o startup code for −ffpa option

/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

Floating-Point Programmer’s Guide for the Sun Workstation

Programming Utilities and Libraries

DIAGNOSTICS

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

Sun Release 4.0  —  Last change: 16 September 1988

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