Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ f77(1) — NEWS-os 5.0.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

cc(1)

as(1)

efl(1)

ratfor(1)

m4(1)

monstartup(3)

prof(1)

ld(1)

dbx(1)

what(1)

cord(1)

pixie(1)

ftoc(1)



f77(1)                   USER COMMANDS                     f77(1)



NAME
     f77 - MIPS Fortran 77 compiler

SYNOPSIS
     f77 [ option ] ... file ...

DESCRIPTION
     F77, the MIPS ucode Fortran 77 compiler, produces  files  in
     the  following  formats:  MIPS  object code in MIPS extended
     coff format (the normal result), binary or  symbolic  ucode,
     ucode object files and binary or symbolic assembly language.
     F77 accepts several types of arguments:

     Arguments whose names end with `.f' are assumed to  be  For-
     tran 77 source programs.  They are compiled, and each object
     program is left in the file whose name consists of the  last
     component of the source with `.o' substituted for `.f'.  The
     `.o' file is only deleted when a single  source  program  is
     compiled  and  loaded all at once.  Files ending in `.F' are
     assumed to contain Fortran code which is to be  run  through
     the C preprocessor first.

     Arguments whose names end with `.r' or `.e' are  assumed  to
     be  RATFOR or EFL source programs, respectively.  These pro-
     grams are first transformed by the appropriate  preprocessor
     and then compiled by f77, producing `.o' files.

     Arguments whose names end with `.s' are assumed to  be  sym-
     bolic  assembly  language  source programs.  They are assem-
     bled, producing a `.o' file.  Arguments whose names end with
     `.i'  are  assumed  to be Fortran 77 source after being pro-
     cessed by the C preprocessor.   They  are  compiled  without
     being processed by the C preprocessor.

     If the highest level of optimization is specified (with  the
     -O3  flag)  or  only  ucode  object files are to be produced
     (with the -j flag) each Fortran 77,  RATFOR  or  EFL  source
     file  is compiled into a ucode object file. The ucode object
     file is left in a file whose name consists of the last  com-
     ponent  of  the source with `.u' substituted for `.f', `.r',
     or `.e'.

     The suffixes described below primarily aid compiler develop-
     ment  and are not generally used.  Arguments whose names end
     with `.B', `.O', `.S', and `.M'  are assumed  to  be  binary
     ucode,  produced  by  the front end, optimizer, ucode object
     file splitter  and  ucode  merger  respectively.   Arguments
     whose  names end with `.U' are assumed to be symbolic ucode.
     Arguments whose names end with `.G' are assumed to be binary
     assembly  language,  which is produced by the code generator
     and the symbolic to binary assembler.




                                                                1





f77(1)                   USER COMMANDS                     f77(1)



     Files that are assumed to be binary ucode,  symbolic  ucode,
     or  binary  assembly  language by the suffix conventions are
     also assumed to have their corresponding symbol table  in  a
     file with a `.T' suffix.

     F77 always defines the C preprocessor macros sony, sonyrisc,
     mips,  hostmips  and  unix to the C macro preprocessor.  If
     the -cpp option is present f77 defines  the  C  preprocessor
     macro  LANGUAGEFORTRAN  when a `.f', `.r', or `.e'  file is
     being compiled.  F77 will define the  C  preprocessor  macro
     LANGUAGEASSEMBLY  when  a  `.s' file is being compiled.  It
     also defines SYSTYPESYSV by default but this changes if the
     -systype   name  option  is  specified  (see the description
     below).


     The following options are interpreted by f77  and  have  the
     same meaning in cc(1).  See ld(1) for load-time options.

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

     -g0     Have the compiler produce no symbol  table  informa-
             tion for symbolic debugging.  This is the default.

     -g1     Have the compiler produce  additional  symbol  table
             information for accurate but limited symbolic debug-
             ging of partially optimized code.

     -g or -g2
             Have the compiler produce  additional  symbol  table
             information  for  full symbolic debugging and not do
             optimizations that limit full symbolic debugging.

     -g3     Have the compiler produce  additional  symbol  table
             information  for  full  symbolic debugging for fully
             optimized code.   This  option  makes  the  debugger
             inaccurate.

     -w      Suppress warning messages.

     -p0     Do not permit any profiling.  This is  the  default.
             If  loading  happens,  the  standard runtime startup
             routine (crt0.o) is used, no  profiling  library  is
             searched.

     -p1 or -p
             Set up for profiling by  periodically  sampling  the
             value  of  the  program  counter.   This option only
             effects the loading.   When  loading  happens,  this
             option replaces the standard runtime startup routine



                                                                2





f77(1)                   USER COMMANDS                     f77(1)



             with the profiling runtime startup routine (mcrt0.o)
             and   searches   the   level   1  profiling  library
             (libprof1.a).  When profiling happens,  the  startup
             routine  calls  monstartup(3)  and  produces  a file
             mon.out that contains execution-profiling  data  for
             use with the postprocessor prof(l).

     -O0     Turn off all optimizations.

     -O1     Turn on all optimizations that can be done  quickly.
             This is the default.

     -O or -O2
             Invoke the  global  ucode  optimizer.   -O3  Do  all
             optimizations, including global register allocation.
             This option must precede all source file  arguments.
             With this option, a ucode object file is created for
             each Fortran 77, RATFOR, or EFL source file and left
             in  a  `.u'  file.   The  newly created ucode object
             files, the ucode object files specified on the  com-
             mand  line  and  the runtime startup routine and all
             the runtime libraries are ucode  linked.   Optimiza-
             tion  is done on the resulting ucode linked file and
             then it is linked as normal producing  an  ``a.out''
             file.  No resulting `.o' file is left from the ucode
             linked result as in previous releases.  In  fact  -c
             can no longer be specified with -O3.

     -feedback file
             Used with the -cord option to  specify  file  to  be
             used  as  a feedback file.  This file is produced by
             prof(1) with its -feedback option from an  execution
             of the program produced by pixie(1).

     -cord   Run  the  procedure-rearranger,  cord(1),   on   the
             resulting  file after linking.  The rearrangement is
             done to reduce the cache conflicts of the  program's
             text.   The  output  of  cord(1) is left in the file
             specified by the -o  output  option  or  `a.out'  by
             default.  At least one -feedback file must be speci-
             fied.

     -j      Compile the specified source programs, and leave the
             ucode object file output in corresponding files suf-
             fixed with `.u'.

     -ko output
             Name the output file created by the ucode loader  as
             output.  This  file is not removed.  If this file is
             compiled, the object file is left in  a  file  whose
             name consists of output with the suffix changed to a
             `.o'.  If output has no suffix,  a  `.o'  suffix  is



                                                                3





f77(1)                   USER COMMANDS                     f77(1)



             appended to output.

     -k      Pass options that start  with  a  -k  to  the  ucode
             loader.   This  option  is  used  to  specify  ucode
             libraries  (with  -klx  )  and  other  ucode  loader
             options.

     -S      Compile the specified source programs and leave  the
             symbolic  assembly  language output in corresponding
             files suffixed with `.s'.

     -P      Run only the C macro preprocessor and put the result
             for  each  source  file  (by suffix convention, i.e.
             `.f', `.r', `.e' and `.s') in a  corresponding  `.i'
             file after being processed by appropriate preproces-
             sors.  The `.i' file has no `#' lines in  it.   This
             sets the -cpp option.

     -E      Run only the  C  macro  preprocessor  on  the  files
             (regardless  of  any  suffix  or  not), and send the
             result to the standard output.  This sets  the  -cpp
             option.

     -o output
             Name the final output file output.  If  this  option
             is used, the file `a.out' is undisturbed.

     -Dname=def
     -Dname  Define the name to the C macro preprocessor,  as  if
             by  `#define'.   If no definition is given, the name
             is defined as "1".

     -Uname  Remove any initial definition of name.

     -Idir   `#include' files whose names do not begin  with  `/'
             are always sought first in the directory of the file
             argument,  then  in  directories  specified  in   -I
             options,  and  finally  in  the  standard  directory
             (/usr/include).

     -I      This option will cause `#include' files never to  be
             searched    for    in    the    standard   directory
             (/usr/include).

     -G num  Specify the maximum size, in bytes, of a  data  item
             that is to be accessed from the global pointer.  Num
             is assumed to be a decimal number.  If num is  zero,
             no  data  is  accessed from the global pointer.  The
             default value for num is 8 bytes.

     -v      Print the passes as they execute  with  their  argu-
             ments and their input and output files.  Also prints



                                                                4





f77(1)                   USER COMMANDS                     f77(1)



             resource usage in the C-shell time format.

     -V      Print the version of the driver and the versions  of
             all passes.  This is done with the what(1) command.

     -std    Have the compiler produce warnings for  things  that
             are not standard in the language.

     -cpp    Run the C macro preprocessor on all  Fortran  source
             files   before  compiling.   This  includes  Fortran
             sources created by RATFOR or EFL .

     -nocpp  Do not run the C macro preprocessor on  any  Fortran
             source  files before compiling.  This is the default
             for mf77(1).  This includes Fortran sources  created
             by RATFOR or EFL .

     -Olimit num
             Specify the maximum size, in basic blocks, of a rou-
             tine that will be optimized by the global optimizer.
             If a routine has more  than  this  number  of  basic
             blocks  it  will not be optimized and a message will
             be printed.  An option specifying  that  the  global
             optimizer  is  to be run (-O, -O2, or -O3) must also
             be specified.   Num  is  assumed  to  be  a  decimal
             number.   The  default  value  for  num is 500 basic
             blocks.

     Either object file target byte ordering can be  produced  by
     f77.   The  default target byte ordering matches the machine
     where the compiler is running.   The  options  -EB  and  -EL
     specify  the  target  byte  ordering (big-endian and little-
     endian,  respectively).   The  compiler  also  defines  a  C
     preprocessor  macro  for  the target byte ordering.  These C
     preprocessor macros are MIPSEB and MIPSEL for big-endian and
     little-endian byte ordering respectively.

     If the specified target byte ordering  does  not  match  the
     machine  where  the  compiler  is  running, then the runtime
     startups and libraries come from /usr/libeb  for  big-endian
     runtimes  on a little-endian machine and from /usr/libel for
     little-endian runtimes on a big-endian machine.

     -EB  Produce object files targeted for big-endian byte  ord-
          ering.   The  C preprocessor macro MIPSEB is defined by
          the compiler.

     -EL  Produce object files targeted  for  little-endian  byte
          ordering.   The  C preprocessor macro MIPSEL is defined
          by the compiler.





                                                                5





f77(1)                   USER COMMANDS                     f77(1)



     The following options are specific for f77:

     -i2  Make the default integer constants and variables short.
          All  logical  quantities  will  be  short.   -i4 is the
          default.

     -onetrip or -1
          Compile DO loops that execute at least once if reached.
          (Fortran  77  DO  loops  are  not executed if the upper
          limit is smaller than the lower limit.)

     -66  Suppress extensions that enhance Fortran 66 compatibil-
          ity.

     -C   Generate code for  runtime  subscript  range  checking.
          The default suppresses range checking.

     -U   Do not ``fold''  cases.   F77  is  normally  a  no-case
          language  (for  example  a  equals  A).   The -U option
          causes f77 to treat uppercase and lowercase separately.

     -u   Make the default type of a variable  undefined,  rather
          than using the default Fortran rules.

     -w   Suppress all warning messages.  If the option is  -w66,
          only Fortran 66 compatibility warnings are suppressed.

     -w1  Suppress warnings about unused  variables  (but  permit
          other warnings unless -w is also specified).

     -F   Apply the EFL  and  RATFOR  preprocessors  to  relevant
          files  and  put  the  result  in files whose names have
          their suffix changed  to  `.f'.   (No  `.o'  files  are
          created.)

     -m   Apply the M4 preprocessor to each EFL or RATFOR  source
          file  before  transforming  it  with  the  ratfor(1) or
          efl(1) preprocessors.  The temporary file used  as  the
          output  of  the  m4(1) preprocessor is that of the last
          component of the source file with  a  `.p'  substituted
          for  the  `.e' or `.r'.  This temporary file is removed
          unless if the -K option is specified.

     -E   Use any remaining characters in  the  argument  as  EFL
          options whenever processing a `.e' file.  The temporary
          file used as the output of the EFL preprocessor has the
          last  component  of the source file with a `.f' substi-
          tuted for the `.e'.  This  temporary  file  is  removed
          unless the -K option is specified.

     -R   Use any remaining characters in the argument as  RATFOR
          options whenever processing a `.r' file.  The temporary



                                                                6





f77(1)                   USER COMMANDS                     f77(1)



          file used as the output of the RATFOR  preprocessor  is
          that  of  the  last component of the source file with a
          `.f' substituted for the `.r'.  This temporary file  is
          removed unless the -K option is specified.

     -automatic
          Place local variables on the runtime stack.   The  same
          restrictions  apply  for this option as they do for the
          automatic keyword.  This is the default.

     -static
          Cause all local variables to be staticly allocated.

     -noextendsource
          Pad each source line with blanks or truncate it as need
          be to make it 72 bytes long.

     -extendsource
          Pad each source line with blanks if need be to make  it
          132  bytes  long,  but do not truncate it if it exceeds
          132 bytes.

     -dlines
          The d_lines option specifies that lines  with  a  D  in
          column  1  are  to be compiled and not to be treated as
          comment lines. The default is to treat lines with  a  D
          in column 1 as comment lines.

     -col72
          This option sets the SVS Fortran 72 column option  mode
          for source statements.

     -col120
          This option sets  the  SVS  Fortran  default  mode  for
          source statements.

     -vms
          Cause the runtime system to  behave  like  VMS  Fortran
          with regard to interpreting carriage control on unit 6.

     -N[qxscnl]nnn
          Make static tables in the compiler bigger. The compiler
          will  complain  if  it overflows its tables and suggest
          you apply one or more of these flags. These flags  have
          the following meanings:

          q    Maximum number of equivalenced variables.  Default
               is 150.

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



                                                                7





f77(1)                   USER COMMANDS                     f77(1)



          s    Maximum number of statement  numbers.  Default  is
               401.

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

          n    Maximum number of identifiers. Default is 1009.

          l    Maximum number of labels. Default is 125.

     The option described below is primarily used to provide UNIX
     compilation  environments  other than the native compilation
     environment.

     -systype name
          Use the named compilation environment name. See  compi-
          lation(7)  for  the  compilation  environments that are
          supported and their names.   This  has  the  effect  of
          changing  the  standard directory for `#include' files,
          the runtime libraries and where runtime  libraries  are
          searched for.  The new items are located in their usual
          paths but with /name prepended to their paths.  Also  a
          preprocessor  macro of the form SYSTYPENAME (with name
          capitalized)  is  defined  in  place  of  the   default
          SYSTYPESYSV.

     The options described below primarily aid compiler  develop-
     ment and are not generally used:

     -Hc  Halt compiling after the pass specified by the  charac-
          ter  c,  producing  an  intermediate  file for the next
          pass.  The c can be [ fjusmoca ]. It selects  the  com-
          piler  pass  in the same way as the -t option.  If this
          option is used, the symbol table file produced and used
          by the passes, is the last component of the source file
          with the suffix changed to `.T' and is not removed.

     -K   Build and use intermediate file  names  with  the  last
          component of the source file's  name replacing its suf-
          fix with the conventional suffix for the type  of  file
          (for  example  `.B'  file for binary ucode, produced by
          the front end).  These  intermediate  files  are  never
          removed  even  when  a  pass  encounters a fatal error.
          When ucode linking is performed and the  -K  option  is
          specified  the base name of the files created after the
          ucode link is `u.out' by default.   If  -ko  output  is
          specified,  the  base name of the object file is output
          without  the  suffix  if  it  exists  or  suffixes  are
          appended to output if it has no suffix.

     -#   Converts binary ucode files (`.B') or optimized  binary
          ucode  files  (`.O')  to  symbolic  ucode (a `.U' file)



                                                                8





f77(1)                   USER COMMANDS                     f77(1)



          using btou(1).  If a symbolic ucode file is to be  pro-
          duced  by  converting the binary ucode from the Fortran
          77 compiler front end then the front end option -Xu  is
          used instead of btou(1).

     -Wc[c...],arg1[,arg2...]
          Pass the argument[s]  argi  to  the  compiler  pass[es]
          c[c..].  The  c's are one of [ pfjusmocablyz ]. The c's
          selects the compiler pass in the same  way  as  the  -t
          option.

     The options -t[hpfjusmocablyzrFIUSMnt], -hpath, and -Bstring
     select a name to use for a particular pass, startup routine,
     or standard library.  These  arguments  are  processed  from
     left  to  right  so their order is significant.  When the -B
     option is encountered, the selection of  names  takes  place
     using  the last -h and -t options.  Therefore, the -B option
     is always required when using  -h  or  -t.   Sets  of  these
     options can be used to select any combination of names.

     The -EB or -EL options, the -p[01] options and the  -systype
     option  must  precede all -B options because they can affect
     the location of runtimes and what runtimes are used.

     -t[hpfjusmocablyzrFIUSMnt]
          Select the names.  The names selected are those  desig-
          nated by the characters following the -t option accord-
          ing to the following table:
          Name      Character
          include     h  (see note below)
          cpp         p
          fcom        f
          ujoin       j
          uld         u
          usplit      s
          umerge      m
          uopt        o
          ugen        c
          as0         a
          as1         b
          ld          l
          ftoc        y
          cord        z
          [m]crt0.o   r
          libF77.a    F
          libI77.a    I
          libU77.a    U
          libisam.a   S
          libm.a      M
          libprof1.a  n
          btou, utob  t
          If the character `h' is  in  the  -t  argument  then  a



                                                                9





f77(1)                   USER COMMANDS                     f77(1)



          directory  is  added  to  the list of directories to be
          used in searching for `#include' files.  This directory
          name  has the form COMP_TARGET_ROOT/usr/includestring .
          This directory is to contain the include files for  the
          string release of the compiler.  The standard directory
          is still searched.

     -hpath
          Use path rather than the directory where  the  name  is
          normally found.

     -Bstring
          Append string to all names specified by the -t  option.
          If  no  -t option has been processed before the -B, the
          -t option is assumed to be  ``hpfjusmocablyzrFIUSMnt''.
          This  list designates all names.  If no -t argument has
          been processed before the -B then a -Bstring is  passed
          to the loader to use with its -lx arguments.

     Invoking the compiler with a name of the form f77string  has
     the  same  effect  as using a -Bstring option on the command
     line.

     If the environment variable COMP_HOST_ROOT is set, the value
     is used as the root directory for all pass names rather than
     the default /. If the environment variable  COMP_TARGET_ROOT
     is  set,  the  value  is  used as the root directory for all
     include and library names rather than the  default  /.  This
     affects   the   standard  directory  for  `#include'  files,
     /usr/include, and the standard  library,  /usr/lib/libc.a  .
     If  this is set then the only directory that is searched for
     libraries, using the -lx option, is COMP_TARGET_ROOT/usr/lib
     .

     If the environment variable TMPDIR is set, the value is used
     as  the  directory  to place any temporary files rather than
     the default /tmp/ .

     If the environment variable RLS_ID_OBJECT is set, the  value
     is  used as the name of an object to link in if a link takes
     place.  This is used to add release identification  informa-
     tion  to objects.  It is always the last object specified to
     the loader.  See rls_id(1) for  the  tools  to  create  this
     information.

     Other arguments are assumed to be either loader  options  or
     Fortran 77-compatible object files, typically produced by an
     earlier  f77  run,  or  perhaps  libraries  of  Fortran  77-
     compatible routines.  These files, together with the results
     of any compilations  specified,  are  loaded  in  the  order
     given, producing an executable program with the default name
     a.out.



                                                               10





f77(1)                   USER COMMANDS                     f77(1)



FILES
     file.f               input file
     file.o               object file
     a.out                loaded output
     /tmp/ctm?            temporary
     /usr/lib/cpp         C macro preprocessor
     /usr/lib/fcom        Fortran 77 front end
     /usr/lib/ujoin       binary ucode and symbol table joiner
     /usr/bin/uld         ucode loader
     /usr/lib/usplit      binary ucode and symbol table splitter
     /usr/lib/umerge      procedure intergrator
     /usr/lib/uopt        optional global ucode optimizer
     /usr/lib/ugen        code generator
     /usr/lib/as0         symbolic to  binary  assembly  language
     translator
     /usr/lib/as1         binary assembly language assembler  and
     reorganizer
     /usr/lib/crt0.o      runtime startup
     /usr/lib/mcrt0.o     startup for profiling
     /usr/lib/libc.a      standard library, see intro(3)
     /usr/lib/libprof1.a  level 1 profiling library
     /usr/lib/libF77.a    Fortran intrinsic function library
     /usr/lib/libI77.a    Fortran I/O library
     /usr/lib/libU77.a    Fortran UNIX interface library
     /usr/lib/libisam.a   Indexed   sequential   access    method
     library
     /usr/lib/libm.a      Math library
     /usr/include         standard directory for `#include' files
     /usr/bin/ld          MIPS loader
     /usr/lib/ftoc        interface between prof(1) and cord(1)
     /usr/lib/cord        procedure-rearranger
     /usr/bin/btou        binary to symbolic ucode translator
     /usr/bin/utob        symbolic to binary ucode translator
     /usr/bin/efl         extended Fortran language preprocessor
     /usr/bin/ratfor      rational Fortran dialect preprocessor
     mon.out              file produced for analysis by prof(1)

     Runtime startups and libraries for the opposite byte sex  of
     machine  the  compiler is running on have the same names but
     are located in different directories.  For  big-endian  run-
     times on a little-endian machine the directory is /usr/libeb
     and for little-endian runtimes on a big-endian  machine  the
     directory is /usr/libel.

SEE ALSO
     Languages Programmer's Guide
     cc(1),  as(1),  efl(1),  ratfor(1),  m4(1),   monstartup(3),
     prof(1), ld(1), dbx(1), what(1), cord(1), pixie(1), ftoc(1)

DIAGNOSTICS
     The diagnostics produced by f77 are  intended  to  be  self-
     explanatory.   Occasional  messages  can  be produced by the



                                                               11





f77(1)                   USER COMMANDS                     f77(1)



     assembler or loader.

NOTES
     The standard library, /usr/lib/libc.a, is  loaded  by  using
     the  -lc  loader  option and not a full path name. The wrong
     one could be  loaded  if  there  are  files  with  the  name
     libc.astring in the directories specified with the -L loader
     option or in the default directories searched by the loader.

     The handling of include directories and libc.a is confusing.













































                                                               12



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