Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ f77(1) — CLIX 3.1r7.6.22

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

adb(1)

cc(1)

as(1)

ld(1)

sdb(1)

ratfor(1)

efl(1)

prof(1)

m4(1)

monitor(3)



  f77(1)                              CLIX                              f77(1)



  NAME

    f77 - Runs a FORTRAN compiler

  SYNOPSIS

    f77 [flag ... ] file ...

  FLAGS

    -c     Suppress the link edit pass of the compilation and force an object
           file to be produced even if only one program is compiled.

    -C     Turn on run-time checking of subranges and array bounds.  The code
           will be much slower under this flag.

    -D name
           (.F file only) Define name to the preprocessor with the value 1.
           This is equivalent to putting

           #define name 1

           at the top of the source file.

    -D name = string
           (.F file only) Define name to the preprocessor with the value
           string.  This is equivalent to putting

           #define name string

           at the top of the source file.

    -E xxx Pass the string xxx to EFL as a flag when preprocessing .e files
           into .f files.

    -F     Do not produce assembly, object, or executable files.  Produce only
           FORTRAN source files.  For each .F source language file, preprocess
           the file with the C preprocessor and leave the preprocessor output
           on a file whose name ends in .f.  Similarly, preprocess each .e
           file with the EFL preprocessor and each .r file with the RATFOR
           preprocessor.

    -g     Cause the compiler to generate additional information needed for
           the use of source language debuggers like sdb.  A frame pointer is
           generated to facilitate stack backtracing.

    -ga    A frame pointer is generated, but -ga does not produce the extra
           debugging information that is generated when -g is specified.

    -I dir Add the directory dir to the list of directories searched for
           include filenames that are not absolute (do not start with /).



  2/94 - Intergraph Corporation                                              1






  f77(1)                              CLIX                              f77(1)



           Multiple -I flags can be specified, and each directory will be
           searched, in the order encountered, before a standard list of
           directories is searched.

    -i2    Make the type INTEGER be INTEGER*2 and the type LOGICAL be
           LOGICAL*2.  By default, INTEGER is the type INTEGER*4 and LOGICAL
           is the type LOGICAL*4.

    -m     Process RATFOR (.r) and EFL (.e) files with m4 before running the
           appropriate preprocessor.

    -o filename
           Place the executable binary output from the link edit pass into the
           file named filename.  If this flag is not specified the executable
           file will be named a.out.  This flag is ignored if -c, -S, or -F is
           present.

    -onetrip
           Execute at least one iteration of every DO loop.  The default case
           assumes that if the lower bound exceeds the upper bound, no
           iterations of the DO loop are to be performed (as specified by the
           ANSI FORTRAN-77 standard).  The resolution of this case was
           unspecified under the ANSI FORTRAN-66 standard and some important
           implementations (especially IBM) chose to always execute the loop
           at least once.  The use of this flag makes the compiler
           incompatible with the ANSI FORTRAN-77 standard, but it may be
           necessary for compatible processing when certain old FORTRAN-66
           programs are involved.

    -1 (one)
           Equivalent to -onetrip.

    -O     The -O flag activates Green Hills optimizers that are safe to use
           on all programs, except for the loop optimizer.

    -OM    This flag is equivalent to -O except that it also allows the
           optimizer to assume that memory locations do not change except by
           explicit stores.  That is, the optimizer is guaranteed that no
           memory locations are I/O device registers that can be changed by
           external hardware and no memory locations are shared with other
           processes that can change them asynchronously with respect to the
           current process.  This compile time flag must be used with extreme
           caution (or not at all) in device drivers, operating systems,
           shared memory environments, and when interrupts (or CLIX signals)
           are present.

    -OL    Optimize the program to be as fast as possible even if the program
           must be bigger.  In particular, most of the available resources are
           allocated to optimizations of the innermost loops.  The -OL compile
           time flag will perform optimizations that may make the program
           faster but larger.  It is counter-productive to specify -OL on code



  2                                              Intergraph Corporation - 2/94






  f77(1)                              CLIX                              f77(1)



           that contains no loops or that is rarely executed as it will make
           the whole program larger but no faster.  After experimenting with a
           program, it is possible to discover which modules benefit from -OL
           and which ones do not.  In addition, -OL causes all scalar
           multiplies to be performed inline, and larger block moves to be
           performed with sequential moves rather than an inline loop.

    -OLM   This flag is equivalent to -OL and -OM.

    -OML   This flag is equivalent to -OLM.

    -p     Arrange for the compiler to produce code that counts the number of
           times each routine is called.  If link editing occurs, replace the
           standard libraries with libraries compiled for profiling.  Also, if
           link editing, replace the standard startoff routine by one that
           automatically calls monitor at the start and arranges to write out
           a mon.out file at normal termination of execution of the object
           program.  An execution profile can then be generated by using prof.

    -R str Pass the string str to the RATFOR preprocessor as a flag when
           translating .r files into .f files.

    -S     Compile the named source programs and leave the assembler-language
           output on corresponding files suffixed by .s.  The assembler and
           link edit passes are suppressed.

    -u     Make the default data type for undeclared variables undefined.
           This is equivalent to putting

           IMPLICIT UNDEFINED(A-Z)

           at the top of the source file.

    -U     Do not convert uppercase letters in names to lowercase.  By
           default, FORTRAN is not case-sensitive and all externally visible
           FORTRAN names contain only lowercase letters.  This flag can be
           used to gain access to external names that contain uppercase.
           However, using this flag makes the compiler incompatible with the
           ANSI FORTRAN-77 standard.

    -v     Display the program name and command line arguments as each pass is
           invoked.

    -w     Suppress warning diagnostics.

    -Wc,arg1,[arg2 ... ]
           Pass the listed argument(s) argi to phase c where c is one of
           [p01almerc].  (See the section on compilation phases above.)

    -X n   Turn on compile-time flag number n.  The available compile-time
           flags are listed below.



  2/94 - Intergraph Corporation                                              3






  f77(1)                              CLIX                              f77(1)



           9     Disable the local (peephole) optimizer.

           18    Do not allocate programmer-defined local variables to a
                 register.  This flag suppresses optimizations that frustrate
                 debuggers.

           32    Display the names of files as they are opened.  This is
                 useful for determining why the compiler cannot find an
                 include file.

           37    Emit a warning when dead code is eliminated.

           39    Do not move frequently used procedure and data addresses to
                 registers.

           50    Push arguments on the stack.  The default is to pass the
                 first two arguments in registers.  This flag is not
                 recommended because it produces a calling sequence
                 incompatible with the rest of the CLIX System.

           54    Inform the optimizer that no memory locations can change
                 value asynchronously with respect to the running program.  -
                 O2 sets this compile-time flag (see -O2 above).

           58    Do not put an underscore in front of the names of global
                 variables and procedures.  This flag is not recommended
                 because it produces symbols incompatible with the rest of the
                 CLIX System.

           62    (Default) The target processor is a CLIPPER microprocessor.

           68    This makes characters unsigned as they are in some
                 implementations of FORTRAN.  The default is signed
                 characters.

           71    Use the single precision math library interface.

           74    (Default) The target system is CLIX System V.

           77    Turn off compile-time checking of FORMAT statements.  Use
                 this flag if the run-time library supports FORMAT statement
                 features that the FORTRAN compiler is not aware of.

           79    Pad Hollerith constants on the right with blanks.  The
                 default is that only the first byte of the Hollerith is
                 significant and the constant is zero padded on the left.

           80    Disable the code hoisting optimization.  This can speed up
                 compilation in some cases.

           82    Process lines starting with x, X, d, and D.  The default is



  4                                              Intergraph Corporation - 2/94






  f77(1)                              CLIX                              f77(1)



                 to treat them as comments.  Used for enabling debugging
                 statements.

           87    Disable the optimization that deletes all code that stores
                 into or modifies variables that are never read from.

           89    Pack structures with no space between members even if doing
                 so makes the elements inaccessible due to machine data
                 alignment constraints.

           105   Allow #define symbols to be redefined to the preprocessor.

           151   Do not allow dollar signs in names.  The default allows
                 dollars signs for VMS compatibility.

           168   Do not move invariant floating-point expressions out of
                 loops.

           175   (Default) For System V compatibility, name the main program
                 MAIN__ .  If this flag is not specified or turned off (with
                 -Z175), the name for the main program is MAIN_.

           176   Always convert computations involving floating-point values
                 to DOUBLE PRECISION.  By default, the compiler tries to
                 shorten computations to REAL if the result would be the same.

           190   Assume halfword objects are not aligned.

           191   Assume word objects are not aligned.

           192   Assume single precision objects are not aligned.

           193   Assume double precision objects are not aligned.

           194   Assume word objects are aligned only to halfword boundaries.

           195   Assume single precision objects are aligned only to halfword
                 boundaries.

           196   Assume double precision objects are aligned only to halfword
                 boundaries.

           197   Assume double precision objects are aligned only to word
                 boundaries.

    -Y[p012aclSILU],dirname
           Use dirname to locate the phase(s) or directory(ies) specified by
           the key letter(s).  The key letters [p012acl] represent the phases
           described above.  The additional key letters have the following
           meanings:




  2/94 - Intergraph Corporation                                              5






  f77(1)                              CLIX                              f77(1)



           S   The directory containing the startup routines.

           I   The default directory searched for the #include preprocessor
               directives.

           L   The first default library directory searched (see ld()).

           U   The second default library directory searched (see ld()).

           If the location of a phase is being specified, the new pathname for
           the phase will be dirname/phasename.  The exact name used for
           phasename depends on the compiler driver used and the phase
           involved.  See FILES below.  If more than one -Y flag is applied to
           a phase or directory, the last specification is used.

           -Z n   Turn off flag number n.  This is the reverse of the -X flag.
                  This flag is useful if a version of the compiler has a flag
                  that is turned on by default, and the user wants to turn it
                  off.

           -#     Display the program name and command line arguments as each
                  pass is invoked.

           -##    Verbose like -#, only more so.

           -###   Display the program name and command line arguments for each
                  pass, but do not invoke the pass.

  DESCRIPTION

    The f77 command controls the compilation and link editing of FORTRAN and
    other source programs.  The compilation process is divided into several
    passes.  Each pass is invoked with appropriate arguments and flags.

    f77 uses the high-performance CLIPPER FORTRAN compiler developed by Green
    Hills, Inc. under Intergraph Corporation contract.  The CLIPPER FORTRAN
    compiler has been designed to improve general code performance based on
    selectable optimizations.

    Each command line argument represents an flag or a file name.  A large
    number of flags (discussed below), and seven types of filename arguments
    are understood.  Any filename or flag not recognized are passed to the
    link editor.

    The file arguments are processed in left to right order as they appear on
    the command line.  The generated object files are passed on to the link
    edit pass in the same order.

  Compilation Phases

    The compilation phases and their names are largely historic.  Each phase



  6                                              Intergraph Corporation - 2/94






  f77(1)                              CLIX                              f77(1)



    is approximately implemented as a single command.  There are a number of
    flags that control the invocation of each phase.  Such flags use key
    letters to indicate a particular phase.

    The phases and their key letters are:

    p          The C preprocessor phase.  This phase processes the
               preprocessor directives in a source file.  Preprocessor
               directives are given on lines whose first character is the #
               symbol.  The preprocessor implements file inclusion,
               conditional code inclusion, macro definition, and macro
               expansion (see cpp).

    0 (zero)   The C source analysis phase.  This phase analyzes the
               (preprocessed) source file according to the rules of the C
               language proper.  Syntax and semantic errors are detected here.
               Typically, an internal or intermediate representation of the
               source file is built.

    1 (one)    The FORTRAN source analysis phase.  This phase analyzes the
               source file according to the rules of the FORTRAN language
               proper.  Syntax and semantic errors are detected here.
               Typically, an internal or intermediate representation of the
               source file is built.

    a          The assembler phase.  The assembler phase translates the
               assembler code into an object (or binary) file.

    l          The link edit phase.  Startoff routines, generated objects, and
               standard libraries are linked together into an image file (see
               ld).

    m          The macro preprocessing phase.  The macro preprocessing phase
               expands m4 macros into the appropriate character sequences,
               (see m4).

    e          The efl phase.  This phase preprocesses efl commands and
               constructs into the appropriate FORTRAN source, (see efl).

    r          The ratfor phase.  This phase preprocesses ratfor commands and
               constructs into the appropriate FORTRAN source, (see ratfor).

    c          The cc phase.  This phase invokes the cc command on the
               indicated C source files, (see cc).

    The CLIPPER FORTRAN compiler implements the source analysis, and code
    generation phases in one program (/lib/fcom).  For the flags that take a
    phase key letter, 1 indicates this program.

    The assembler (/bin/as) and link editor (/bin/ld) implement the assembler
    and link editor phases, respectively.



  2/94 - Intergraph Corporation                                              7






  f77(1)                              CLIX                              f77(1)



    Each input file is processed by each phase in sequence.  If an error
    occurs in a phase, further processing of the input file that contained the
    error is abandoned.  (The assembler will not be invoked if a compiler
    error occurred).  Any remaining input files are compiled (or assembled),
    but the link edit phase is not performed.

  Filenames

    f77 recognizes seven types of filename arguments.  Based on the suffix of
    each input file, f77 selects the various preprocessors and compilers used
    to process the file.  The output of each pass is a file whose suffix
    indicates the type of result.  The suffixes f77 recognizes or generates
    are listed below approximately in the order that the passes are performed.

    .e   EFL source file.  The source file is translated using an EFL
         preprocessor resulting in a .f source file that is then processed as
         described under .f below.  .e Files may be optionally preprocessed by
         the m4 macro-processor before they are translated by the EFL
         preprocessor (see efl).

    .r   RATFOR source file.  The source file is translated using a RATFOR
         preprocessor resulting in a .f source file, that is then processed as
         described under .f below.Files with a .r suffix may be optionally
         preprocessed by the m4 macro-processor before they are translated by
         the RATFOR preprocessor (see ratfor).

    .F   FORTRAN source file.  The source file is compiled using the CLIPPER
         FORTRAN compiler.  Files with a .F suffix may contain C preprocessor
         directives (that is, #define) handled by the built-in CLIPPER FORTRAN
         C preprocessor.  The compiler generates a .s file that is processed
         as described under .s below.

    .f   FORTRAN source file.  The source file is compiled using the CLIPPER
         FORTRAN compiler.  The compiler generates a .s file that is processed
         as described under .s below.

    .c   C source file.  The source file is compiled using the cc command
         resulting in a .o file (see cc).

    .s   (Command Argument) Assembler source file.  Each .s file given as a
         command argument is processed by the cc command resulting in a .o
         file (see cc).

    .s   (Generated) Assembler source file.  Each assembler source file
         generated by the CLIPPER FORTRAN compiler is processed using the as
         command resulting in a .o file (see as).

    .o   Relocatable object file.  The object filename is simply passed to the
         link edit pass.

  FILES



  8                                              Intergraph Corporation - 2/94






  f77(1)                              CLIX                              f77(1)



    file.f                 FORTRAN source input file

    file.F                 FORTRAN source input file, C preprocessor used

    file.e                 EFL source input file

    file.r                 RATFOR source input file

    file.c                 C source input file

    file.s                 Assembler source input file; generated or input

    file.o                 Object file; generated or input

    a.out                  Default linked output

    /tmp/F77*              Temporary

    /usr/tmp/F77*          Temporary

    /bin/cc                C compiler

    /usr/bin/RATFOR        RATFOR preprocessor

    /usr/bin/efl           EFL preprocessor

    /usr/bin/m4            m4 macro-processor

    /bin/as                Assembler, as

    /bin/ld                Link Editor, ld

    /lib/crt[1n].o         Run-time start-off

    /lib/mcrt[1n].o        Profiling start-off

    /lib/libF77.a          Standard FORTRAN Library

    /lib/libm.a            Standard Math Library

    /lib/libc.a            Standard C Library

    /usr/lib/libbsd.a      BSD support library (referenced by /lib/libf.a)

    /usr/lib/libp/lib*.a   Profiled versions of libraries

    /lib/libf.a            Green Hills FORTRAN library

  DIAGNOSTICS

    The diagnostics produced by f77 itself are intended to be self-



  2/94 - Intergraph Corporation                                              9






  f77(1)                              CLIX                              f77(1)



    explanatory.  Occasional messages may be produced by the various
    preprocessor, C compiler, assembler, or link editor passes.

  RELATED INFORMATION

    Commands: adb(1), cc(1), as(1), ld(1), sdb(1), ratfor(1), efl(1), prof(1),
    m4(1)

    Functions: monitor(3)

    CLIX Programming Guide











































  10                                             Intergraph Corporation - 2/94




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