home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / f77cmd.zip / f77 / f77.doc < prev    next >
Text File  |  1994-09-05  |  15KB  |  397 lines

  1.  
  2.  
  3.  
  4. F77(1)                                                     F77(1)
  5.  
  6.  
  7. NAME
  8.        f77 - Fortran 77 Compiler
  9.  
  10. SYNOPSIS
  11.        f77  [-a] [-c] [-C] [-Dmacro[=def]] [-f] [-g] [-Idir] [-k]
  12.        [-Ldir] [-Ntnnn] ] [-o outfile] [-O] [-P  prog:opt]  [-r8]
  13.        [-Tdir  ]  [-u]  [-v] [-w] [-w66] [-Zopt] [-1] input_files
  14.        [-lx]
  15.  
  16. DESCRIPTION
  17.        f77 is a bourne shell script that utilizes the duo of  the
  18.        f2c Fortran 77 to C converter, and the gcc/emx C compiler,
  19.        to provide a user interface similar to native  Fortran  77
  20.        compilers.   These  applications must be installed on your
  21.        system for f77 to work.
  22.  
  23.        f77 runs in one of two modes, link mode, or compile  mode.
  24.        By  default,  f77  runs  in  link  mode. In this mode, f77
  25.        attempts to create an executable  from  objects  that  are
  26.        explicitly  specified,  and  those  objects  compiled from
  27.        explicitly specified source code files. If the  -c  option
  28.        is  present,  f77 runs in compile only mode. In this mode,
  29.        f77 creates objects for each specified  source  file.  Any
  30.        explicitly  specified  object  files  are ignored, and the
  31.        linking of an executable is suppressed.
  32.  
  33. OPTIONS
  34.        f77 recognizes the following command line switches:
  35.  
  36.        -a     Allocation of memory for local Fortran 77 variables
  37.               occurs  dynamically  at  execution  time (variables
  38.               that explicitly  appear  in  a  DATA,  EQUIVALENCE,
  39.               NAMELIST,  or  SAVE statement are always statically
  40.               allocated memory at compile time.)  The default  is
  41.               to use static compile time allocation for all vari-
  42.               ables.  This option only applies to Fortran  source
  43.               code files.
  44.  
  45.        -c     Run  in  compile only mode, suppress the linking of
  46.               an executable. Any object files or libraries in the
  47.               the  list  of  input files are quietly ignored. The
  48.               default is to run in link mode.
  49.  
  50.        -C     The code is instrumented to check at run time, that
  51.               array  subscripts are within the dimensioned bounds
  52.               of the array. This does not apply  to  arrays  that
  53.               are  declared  with  adjustable  dimensions.   This
  54.               option only applies to Fortran source code files.
  55.  
  56.        -Dmacro[=def]
  57.  
  58.               Define a macro to be presented to the C  preproces-
  59.               sor.  The  C  preprocessor is run when processing a
  60.               .fpp source code file, and by the C compiler itself
  61.  
  62.  
  63.  
  64.                            8 Aug, 1994                          1
  65.  
  66.  
  67.  
  68.  
  69.  
  70. F77(1)                                                     F77(1)
  71.  
  72.  
  73.               when compiling a .c source code file.
  74.  
  75.        -f     Enable  free format Fortran 77 source. Source lines
  76.               longer than  72  characters  are  accepted.  Source
  77.               lines  less  than 72 characters are not padded with
  78.               blanks. This option is passed directly to  the  f2c
  79.               converter.
  80.  
  81.        -g     Generate  symbol  table  information  for  use with
  82.               debuggers, such as gdb(1).  Note that if one  wants
  83.               to  create an excutable instrumented for debugging,
  84.               by seperately compiling source into  a  relocatable
  85.               object,  followed by linking, the -g flag should be
  86.               included in both invocations of f77.   This  option
  87.               applies to both Fortran and C source code files.
  88.  
  89.        -Idir
  90.  
  91.               Insert  the  directory  dir at the beginning of the
  92.               path to be  searched  by  the  C  preprocessor  for
  93.               include  files.  Note that this option only affects
  94.               the behavior of the C  preprocessor.  It  does  not
  95.               affect  the  manner  in  which  the  f2c  converter
  96.               locates include  files  referenced  in  Fortran  77
  97.               source code.
  98.  
  99.        -k     Keep the .c output file from the f2c converter when
  100.               compiling a .f file. Also, keep the .f output  file
  101.               from the C preprocessor when compiling a .fpp file.
  102.               The .c and .f file names are obtained by  replacing
  103.               the  .f or .fpp suffix of the input file name. Note
  104.               that any already existing files  with  these  names
  105.               will be quietly overwritten. The default is to cre-
  106.               ate temporary files in the current directory.
  107.  
  108.        -Ldir
  109.  
  110.               Insert the directory dir at the  beginning  of  the
  111.               path  to  be  searched for library files during the
  112.               link phase.
  113.  
  114.        -Ntnnn
  115.  
  116.               Modify the length of statically  allocated  tables,
  117.               internal  to the f2c converter. In general, when an
  118.               internal table overflow occurs, f2c  will  issue  a
  119.               diagnostic message that describes the syntax of the
  120.               option required to correct the problem. See  f2c(1)
  121.               for a complete description.
  122.  
  123.        -ooutput
  124.  
  125.               In  the  default  link  mode, this option specifies
  126.               that the linked executable  file  should  be  named
  127.  
  128.  
  129.  
  130.                            8 Aug, 1994                          2
  131.  
  132.  
  133.  
  134.  
  135.  
  136. F77(1)                                                     F77(1)
  137.  
  138.  
  139.               output  instead  of the default name of a.exe. Note
  140.               that gcc/emx may not create an executable  file  if
  141.               your  file  name  fails to have a .exe suffix!!! In
  142.               compile only mode, (when the -c switch is present),
  143.               this  specifies  that the object file to be created
  144.               should be named output.  The default name  is  con-
  145.               structed  by  replacing  the relevant suffix of the
  146.               input file with  a  .o  (or  .obj,  see  the  -Zopt
  147.               option)  suffix.  In compile mode, this option only
  148.               makes sense when a single source code input file is
  149.               being compiled.
  150.  
  151.        -O     When   the  -O  option  is  present,  the  compiler
  152.               attempts to reduce the size of the  generated  code
  153.               and  execution  time.  When  -O is absent, the com-
  154.               piler's goal is to reduce the cost of the  compila-
  155.               tion  itself,  see the gcc/emx documentation.  This
  156.               option applies to both Fortran and  C  source  code
  157.               files.
  158.  
  159.        -Pprog:opt
  160.  
  161.               Pass  the  option(s)  opt  to the compilation phase
  162.               program prog.  Legal values for prog are; cpp, f2c,
  163.               cc,  or ld.  To pass multiple options, use a quoted
  164.               string for prog:opt.   The  option(s)  in  opt  are
  165.               passed  directly  to  prog, f77 does not attempt to
  166.               validate them in any way.
  167.  
  168.        -r8    Automatically promote all Fortran variables of type
  169.               REAL  to DOUBLE PRECISION, and type COMPLEX to DOU-
  170.               BLE COMPLEX.  This option only applies  to  Fortran
  171.               source code files.
  172.  
  173.        -Tdir  Create  temporary files created by the C preproces-
  174.               sor and the f2c converter  in  the  directory  dir.
  175.               This switch is ignored if the -k switch is present.
  176.               (See above.)
  177.  
  178.        -u     Make the default  type  of  all  Fortran  variables
  179.               undefined.
  180.  
  181.        -v     Print the command line for each subprocess executed
  182.               by f77.  This option is also passed to the  gcc/emx
  183.               compiler  and  the  loader,  causing them to do the
  184.               same.
  185.  
  186.        -w     Suppress the printing of all warning messages  from
  187.               the  f2c  converter.  Obviously,  this  option only
  188.               applies  to  compilation  of  Fortran  source  code
  189.               files.
  190.  
  191.        -w66   Suppress  the  printing of Fortran 66 compatibility
  192.               warning messages from the f2c converter. Obviously,
  193.  
  194.  
  195.  
  196.                            8 Aug, 1994                          3
  197.  
  198.  
  199.  
  200.  
  201.  
  202. F77(1)                                                     F77(1)
  203.  
  204.  
  205.               this  option only applies to compilation of Fortran
  206.               source code files.
  207.  
  208.        -Zopt  Options beginning with -Z are  passed  directly  to
  209.               the gcc/emx compiler and the linker. In particular,
  210.               the -Zomf option will generate OS/2  object  module
  211.               format  object  files,  and  ".obj" will become the
  212.               expected  suffix  of  all  object  files.  See  the
  213.               gcc/emx  documentation  for  the  most accurate and
  214.               complete information.
  215.  
  216.        -1     Generate code where Fortran DO loops  are  executed
  217.               at  least  once,  regardless  of  the values of the
  218.               lower and upper limits of the loop index.  In  For-
  219.               tran 77, a DO loop where the lower limit is greater
  220.               than the upper limit is not executed.  This  option
  221.               only  applies to compilation of Fortran source code
  222.               files.
  223.  
  224.        input_files
  225.  
  226.               Input file(s) that end with a '.fpp',  '.f',  '.c',
  227.               '.o', or '.obj' suffix.
  228.  
  229.               Files that end with a .f suffix are assumed to con-
  230.               tain Fortran 77 source code. They are first  trans-
  231.               lated  to C source code using the f2c converter and
  232.               then compiled with the gcc/emx compiler. The inter-
  233.               mediate  C  source  code  is written to a temporary
  234.               file, unless the -k option is present. The compiled
  235.               relocatable object code is written to a file in the
  236.               current directory (regardless of  the  location  of
  237.               the  input  file),  with the same name as the input
  238.               file, with a .o (or .obj,  see  the  -Zopt  option)
  239.               suffix substituted for the .f suffix.
  240.  
  241.               Files with names ending in .fpp are assumed to con-
  242.               tain Fortran 77  source  code  and  C  preprocessor
  243.               directives. However, they are first preprocessed by
  244.               the C preprocessor before being compiled as  above.
  245.               The  intermediate  processed Fortran 77 source code
  246.               is written to  a  temporary  file,  unless  the  -k
  247.               option is present.
  248.  
  249.               Note that the .fpp suffix convention is a departure
  250.               from the UNIX convention which is a .F suffix.  The
  251.               .fpp convention is used under OS/2 because the OS/2
  252.               file system preserves, but ignores case. In partic-
  253.               ular,  you  can't  have files with both a .f and .F
  254.               suffix in the same directory, (they would equate to
  255.               the same file since case is ignored). I just pulled
  256.               the .fpp suffix out of thin air. The script can  be
  257.               configured  to  use  another  suffix for this if so
  258.               desired.
  259.  
  260.  
  261.  
  262.                            8 Aug, 1994                          4
  263.  
  264.  
  265.  
  266.  
  267.  
  268. F77(1)                                                     F77(1)
  269.  
  270.  
  271.               Files with names ending in .c are assumed  to  con-
  272.               tain  C  source  code.   They are compiled with the
  273.               gcc/emx compiler,  with  the  compiled  relocatable
  274.               object code written to a file in the current direc-
  275.               tory with the same name as the input file,  with  a
  276.               .o  (or  .obj, see the -Zopt option) suffix substi-
  277.               tuted for the .c suffix.
  278.  
  279.        -lx    Link the executable with the library libx.a where x
  280.               is a string. (The latest version of gcc/emx is such
  281.               that, for example, the argument -lvector would link
  282.               the executable with the library vector.a for method
  283.               1  objects,  or  vector.lib  for  method   2,   omf
  284.               objects.)  If the -c option is present, this option
  285.               is ignored.
  286.  
  287. FILES
  288.        files.fpp files.f files.c
  289.  
  290.               Input source code file(s).
  291.  
  292.        files.o files.obj
  293.  
  294.               Input relocatable object file(s).
  295.  
  296.        f77.$$.[fc]
  297.  
  298.               Temporary source code files.
  299.  
  300. EXAMPLES
  301.        Compile the Fortran 77 code in example.f to example.o,  an
  302.        EMX  method  1  object  file, keep the converted C code in
  303.        example.c, and be verbose;
  304.  
  305.               f77 -c -k -v example.f
  306.  
  307.        Compile the Fortran 77 code in example.f  to  example.obj,
  308.        an  EMX method 2 object file, keep the converted C code in
  309.        example.c, and be verbose;
  310.  
  311.               f77 -c -Zomf -Zmtd -k -v example.f
  312.  
  313. SEE ALSO
  314.        f2c(1), gcc(1)
  315.  
  316.        S. I. Feldman and P. J. Weinberger, 'A Portable Fortran 77
  317.        Compiler'  UNIX  Time  Sharing System Programmer's Manual,
  318.        Tenth Edition, Volume 2, AT&T Bell Laboratories, 1990.
  319.  
  320. DIAGNOSTICS
  321.        f77 checks arguments that correspond to directories in the
  322.        file system to see if they are valid. If a directory argu-
  323.        ment dir does not exist, or is not a directory,  the  fol-
  324.        lowing message is issued;
  325.  
  326.  
  327.  
  328.                            8 Aug, 1994                          5
  329.  
  330.  
  331.  
  332.  
  333.  
  334. F77(1)                                                     F77(1)
  335.  
  336.  
  337.               directory:  dir  does not exist, or is not a direc-
  338.               tory
  339.  
  340.        f77 also checks file arguments to see if they  are  valid.
  341.        If  a file argument file does not exist, or is not a regu-
  342.        lar file, the following message is issued;
  343.  
  344.               file: file does not exist, or is not a regular file
  345.  
  346. AUTHOR
  347.        f77  is  a  derivative  work of the fc bourne shell script
  348.        from the f2c distribution. The complete  f2c  distribution
  349.        can   be   obtained   by   anonymous  ftp  from  the  host
  350.        netlib.att.com. To obtain f2c by e-mail, send a message to
  351.        <netlib@research.att.com>.   Use  "help"  for  the subject
  352.        line, or as the message body.  The directions for request-
  353.        ing  f2c  will  be mailed back to you. This hacked version
  354.        and man page was done by <jcp%octagon.UUCP@ucsd.edu>.
  355.  
  356. BUGS
  357.        The behavior of f77 depends (heavily) on various  features
  358.        of  the gcc/emx compiler. The results may be unpredictable
  359.        if a different C compiler is used instead.
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.                            8 Aug, 1994                          6
  395.  
  396.  
  397.