home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 22 gnu
/
22-gnu.zip
/
f77cmd.zip
/
f77
/
f77.doc
< prev
next >
Wrap
Text File
|
1994-09-05
|
15KB
|
397 lines
F77(1) F77(1)
NAME
f77 - Fortran 77 Compiler
SYNOPSIS
f77 [-a] [-c] [-C] [-Dmacro[=def]] [-f] [-g] [-Idir] [-k]
[-Ldir] [-Ntnnn] ] [-o outfile] [-O] [-P prog:opt] [-r8]
[-Tdir ] [-u] [-v] [-w] [-w66] [-Zopt] [-1] input_files
[-lx]
DESCRIPTION
f77 is a bourne shell script that utilizes the duo of the
f2c Fortran 77 to C converter, and the gcc/emx C compiler,
to provide a user interface similar to native Fortran 77
compilers. These applications must be installed on your
system for f77 to work.
f77 runs in one of two modes, link mode, or compile mode.
By default, f77 runs in link mode. In this mode, f77
attempts to create an executable from objects that are
explicitly specified, and those objects compiled from
explicitly specified source code files. If the -c option
is present, f77 runs in compile only mode. In this mode,
f77 creates objects for each specified source file. Any
explicitly specified object files are ignored, and the
linking of an executable is suppressed.
OPTIONS
f77 recognizes the following command line switches:
-a Allocation of memory for local Fortran 77 variables
occurs dynamically at execution time (variables
that explicitly appear in a DATA, EQUIVALENCE,
NAMELIST, or SAVE statement are always statically
allocated memory at compile time.) The default is
to use static compile time allocation for all vari-
ables. This option only applies to Fortran source
code files.
-c Run in compile only mode, suppress the linking of
an executable. Any object files or libraries in the
the list of input files are quietly ignored. The
default is to run in link mode.
-C The code is instrumented to check at run time, that
array subscripts are within the dimensioned bounds
of the array. This does not apply to arrays that
are declared with adjustable dimensions. This
option only applies to Fortran source code files.
-Dmacro[=def]
Define a macro to be presented to the C preproces-
sor. The C preprocessor is run when processing a
.fpp source code file, and by the C compiler itself
8 Aug, 1994 1
F77(1) F77(1)
when compiling a .c source code file.
-f Enable free format Fortran 77 source. Source lines
longer than 72 characters are accepted. Source
lines less than 72 characters are not padded with
blanks. This option is passed directly to the f2c
converter.
-g Generate symbol table information for use with
debuggers, such as gdb(1). Note that if one wants
to create an excutable instrumented for debugging,
by seperately compiling source into a relocatable
object, followed by linking, the -g flag should be
included in both invocations of f77. This option
applies to both Fortran and C source code files.
-Idir
Insert the directory dir at the beginning of the
path to be searched by the C preprocessor for
include files. Note that this option only affects
the behavior of the C preprocessor. It does not
affect the manner in which the f2c converter
locates include files referenced in Fortran 77
source code.
-k Keep the .c output file from the f2c converter when
compiling a .f file. Also, keep the .f output file
from the C preprocessor when compiling a .fpp file.
The .c and .f file names are obtained by replacing
the .f or .fpp suffix of the input file name. Note
that any already existing files with these names
will be quietly overwritten. The default is to cre-
ate temporary files in the current directory.
-Ldir
Insert the directory dir at the beginning of the
path to be searched for library files during the
link phase.
-Ntnnn
Modify the length of statically allocated tables,
internal to the f2c converter. In general, when an
internal table overflow occurs, f2c will issue a
diagnostic message that describes the syntax of the
option required to correct the problem. See f2c(1)
for a complete description.
-ooutput
In the default link mode, this option specifies
that the linked executable file should be named
8 Aug, 1994 2
F77(1) F77(1)
output instead of the default name of a.exe. Note
that gcc/emx may not create an executable file if
your file name fails to have a .exe suffix!!! In
compile only mode, (when the -c switch is present),
this specifies that the object file to be created
should be named output. The default name is con-
structed by replacing the relevant suffix of the
input file with a .o (or .obj, see the -Zopt
option) suffix. In compile mode, this option only
makes sense when a single source code input file is
being compiled.
-O When the -O option is present, the compiler
attempts to reduce the size of the generated code
and execution time. When -O is absent, the com-
piler's goal is to reduce the cost of the compila-
tion itself, see the gcc/emx documentation. This
option applies to both Fortran and C source code
files.
-Pprog:opt
Pass the option(s) opt to the compilation phase
program prog. Legal values for prog are; cpp, f2c,
cc, or ld. To pass multiple options, use a quoted
string for prog:opt. The option(s) in opt are
passed directly to prog, f77 does not attempt to
validate them in any way.
-r8 Automatically promote all Fortran variables of type
REAL to DOUBLE PRECISION, and type COMPLEX to DOU-
BLE COMPLEX. This option only applies to Fortran
source code files.
-Tdir Create temporary files created by the C preproces-
sor and the f2c converter in the directory dir.
This switch is ignored if the -k switch is present.
(See above.)
-u Make the default type of all Fortran variables
undefined.
-v Print the command line for each subprocess executed
by f77. This option is also passed to the gcc/emx
compiler and the loader, causing them to do the
same.
-w Suppress the printing of all warning messages from
the f2c converter. Obviously, this option only
applies to compilation of Fortran source code
files.
-w66 Suppress the printing of Fortran 66 compatibility
warning messages from the f2c converter. Obviously,
8 Aug, 1994 3
F77(1) F77(1)
this option only applies to compilation of Fortran
source code files.
-Zopt Options beginning with -Z are passed directly to
the gcc/emx compiler and the linker. In particular,
the -Zomf option will generate OS/2 object module
format object files, and ".obj" will become the
expected suffix of all object files. See the
gcc/emx documentation for the most accurate and
complete information.
-1 Generate code where Fortran DO loops are executed
at least once, regardless of the values of the
lower and upper limits of the loop index. In For-
tran 77, a DO loop where the lower limit is greater
than the upper limit is not executed. This option
only applies to compilation of Fortran source code
files.
input_files
Input file(s) that end with a '.fpp', '.f', '.c',
'.o', or '.obj' suffix.
Files that end with a .f suffix are assumed to con-
tain Fortran 77 source code. They are first trans-
lated to C source code using the f2c converter and
then compiled with the gcc/emx compiler. The inter-
mediate C source code is written to a temporary
file, unless the -k option is present. The compiled
relocatable object code is written to a file in the
current directory (regardless of the location of
the input file), with the same name as the input
file, with a .o (or .obj, see the -Zopt option)
suffix substituted for the .f suffix.
Files with names ending in .fpp are assumed to con-
tain Fortran 77 source code and C preprocessor
directives. However, they are first preprocessed by
the C preprocessor before being compiled as above.
The intermediate processed Fortran 77 source code
is written to a temporary file, unless the -k
option is present.
Note that the .fpp suffix convention is a departure
from the UNIX convention which is a .F suffix. The
.fpp convention is used under OS/2 because the OS/2
file system preserves, but ignores case. In partic-
ular, you can't have files with both a .f and .F
suffix in the same directory, (they would equate to
the same file since case is ignored). I just pulled
the .fpp suffix out of thin air. The script can be
configured to use another suffix for this if so
desired.
8 Aug, 1994 4
F77(1) F77(1)
Files with names ending in .c are assumed to con-
tain C source code. They are compiled with the
gcc/emx compiler, with the compiled relocatable
object code written to a file in the current direc-
tory with the same name as the input file, with a
.o (or .obj, see the -Zopt option) suffix substi-
tuted for the .c suffix.
-lx Link the executable with the library libx.a where x
is a string. (The latest version of gcc/emx is such
that, for example, the argument -lvector would link
the executable with the library vector.a for method
1 objects, or vector.lib for method 2, omf
objects.) If the -c option is present, this option
is ignored.
FILES
files.fpp files.f files.c
Input source code file(s).
files.o files.obj
Input relocatable object file(s).
f77.$$.[fc]
Temporary source code files.
EXAMPLES
Compile the Fortran 77 code in example.f to example.o, an
EMX method 1 object file, keep the converted C code in
example.c, and be verbose;
f77 -c -k -v example.f
Compile the Fortran 77 code in example.f to example.obj,
an EMX method 2 object file, keep the converted C code in
example.c, and be verbose;
f77 -c -Zomf -Zmtd -k -v example.f
SEE ALSO
f2c(1), gcc(1)
S. I. Feldman and P. J. Weinberger, 'A Portable Fortran 77
Compiler' UNIX Time Sharing System Programmer's Manual,
Tenth Edition, Volume 2, AT&T Bell Laboratories, 1990.
DIAGNOSTICS
f77 checks arguments that correspond to directories in the
file system to see if they are valid. If a directory argu-
ment dir does not exist, or is not a directory, the fol-
lowing message is issued;
8 Aug, 1994 5
F77(1) F77(1)
directory: dir does not exist, or is not a direc-
tory
f77 also checks file arguments to see if they are valid.
If a file argument file does not exist, or is not a regu-
lar file, the following message is issued;
file: file does not exist, or is not a regular file
AUTHOR
f77 is a derivative work of the fc bourne shell script
from the f2c distribution. The complete f2c distribution
can be obtained by anonymous ftp from the host
netlib.att.com. To obtain f2c by e-mail, send a message to
<netlib@research.att.com>. Use "help" for the subject
line, or as the message body. The directions for request-
ing f2c will be mailed back to you. This hacked version
and man page was done by <jcp%octagon.UUCP@ucsd.edu>.
BUGS
The behavior of f77 depends (heavily) on various features
of the gcc/emx compiler. The results may be unpredictable
if a different C compiler is used instead.
8 Aug, 1994 6