NAME
fort77 — FORTRAN
compiler (FORTRAN)
SYNOPSIS
fort77 |
[-c][-g][-L
directory]... [-O
optlevel][-o
outfile][-s][-w]
operand... |
DESCRIPTION
The fort77 utility is the interface to the
FORTRAN compilation system; it will accept the full FORTRAN-77 language
defined by the ANSI X3.9-1978 standard. The system conceptually consists of
a compiler and link editor. The files referenced by operand s are compiled
and linked to produce an executable file. It is unspecified whether the
linking occurs entirely within the operation of
fort77 ; some systems may produce objects that are
not fully resolved until the file is executed.
If the -c option is present, for all
pathname operands of the form file. f the files:
$(basename pathname .f).o will be created or
overwritten as the result of successful compilation. If the
-c option is not specified, it is unspecified
whether such .o files are created or deleted for the file.
f operands.
If there are no options that prevent link editing (such
as -c) and all operands compile and link without
error, the resulting executable file will be written into the file named by
the -o option (if present) or to the file
a.out. The
executable file will be created as specified in the
XSH
specification, except that the file permissions will be set to:
- S_IRWXO | S_IRWXG | S_IRWXU
OPTIONS
The fort77 utility supports the XBD
specification,
Utility
Syntax Guidelines , except that:
- The
-llibrary operands have the format of options, but their position within a list of operands affects the order in which libraries are searched. - The order of specifying the multiple
-Loptions is significant. - Portable applications must specify each option separately; that is,
grouping option letters (for example,
-cg) need not be recognised by all implementations.
The following options are supported:
- -c
- Suppress the link-edit phase of the compilation, and do not remove any object files that are produced.
- -g
- Produce symbolic information in the object or executable files; the nature of this information is unspecified, and may be modified by implementation-dependent interactions with other options.
- -s
- Produce object or executable files, or both, from which symbolic and other
information not required for proper execution using the XSH specification
exec family has been removed (stripped). If both
-gand-soptions are present, the action taken is unspecified. - -o outfile
- Use the pathname outfile , instead of the default a.out , for the
executable file produced. If the
-ooption is present with-c, the result is unspecified. - -L directory
- Change the algorithm of searching for the libraries named in
-loperands to look in the directory named by the directory pathname before looking in the usual places. Directories named in-Loptions will be searched in the specified order. At least ten instances of this option will be supported in a singlefort77command invocation. If a directory specified by a-Loption contains a file named libf.a , the results are unspecified. - -O optlevel
- Specify the level of code optimisation. If the optlevel option-argument is
the digit 0, all special code optimisations will be disabled. If it is the
digit 1, the nature of the optimisation is unspecified. If the
-Ooption is omitted, the nature of the system's default optimisation is unspecified. It is unspecified whether code generated in the presence of the -O 0 option is the same as that generated when-Ois omitted. Other optlevel values may be supported. - -w
- Suppress warnings.
Multiple instances of -L options can be
specified.
OPERANDS
An operand is either in the form of a pathname or the form
-l library . At least one operand of the pathname
form will be specified. The following operands are supported:
- file.f
- The pathname of a FORTRAN source file to be compiled and optionally passed
to the link editor. The filename operand will be of this form if the
-coption is used. - file.a
- A library of object files typically produced by ar(1) , and passed directly to the link editor. Implementations may recognise implementation-dependent suffixes other than .a as denoting object file libraries.
- file.o
- An object file produced by
fort77-cand passed directly to the link editor. Implementations may recognise implementation-dependent suffixes other than .o as denoting object files.
The processing of other files is implementation-dependent.
- -l library
- (The letter ell.) Search the library named:
A library is searched when its name is encountered, so the placement of a
liblibrary.a
-loperand is significant. Several standard libraries can be specified in this manner, as described in the EXTENDED DESCRIPTION section. Implementations may recognise implementation-dependent suffixes other than .a as denoting libraries.
STDIN
Not used.
INPUT FILES
The input file must be one of the following: a text file
containing FORTRAN source code; an object file in the format produced by
fort77 -c ; or a library of
object files, in the format produced by archiving zero or more object files,
using ar(1) . Implementations may supply additional
utilities that produce files in these formats. Additional input files are
implementation-dependent.
A tab character encountered within the first six characters on a line of source code will cause the compiler to interpret the following character as if it were the seventh character on the line (that is, in column 7).
ENVIRONMENT VARIABLES
The following environment variables affect the execution of
fort77 :
LANG- Provide a default value for the internationalisation variables that are
unset or null. If
LANGis unset or null, the corresponding value from the implementation-dependent default locale will be used. If any of the internationalisation variables contains an invalid setting, the utility will behave as if none of the variables had been defined. LC_ALL- If set to a non-empty string value, override the values of all the other internationalisation variables.
LC_CTYPE- Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single- as opposed to multi-byte characters in arguments and input files).
LC_MESSAGES- Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error.
NLSPATH- Determine the location of message catalogues for the processing of LC_MESSAGES .
TMPDIR- Determine the pathname that should override the default directory for temporary files, if any.
ASYNCHRONOUS EVENTS
Default.
STDOUT
Not used.
STDERR
Used only for diagnostic messages. If more than one file operand ending in .f (or possibly other unspecified suffixes) is given, for each such file:
"%s:\n", <file> may be
written to allow identification of the diagnostic message with the
appropriate input file.
This utility may produce warning messages about certain conditions that do not warrant returning an error (non-zero) exit value.
OUTPUT FILES
Object files, listing files and executable files are produced in unspecified formats.
EXTENDED DESCRIPTION
Standard Libraries
The fort77 utility recognises the
following -l operand for the standard library:
- -l f
- This library contains all library functions referenced in the ANSI X3.9-1978 standard. This operand is not required to be present to cause a search of this library.
In the absence of options that inhibit invocation of the
link editor, such as
-c, the
fort77 utility will cause the equivalent of a
-l f operand to be passed to the link editor as the last
-l operand, causing it to be searched after all
other object files and libraries are loaded.
It is unspecified whether the library
libf.a exists as a
regular file. The implementation may accept as -l
operands names of objects that do not exist as regular files.
External Symbols
The FORTRAN compiler and link editor support the significance of external symbols up to a length of at least 31 bytes; case folding is permitted. The action taken upon encountering symbols exceeding the implementation-dependent maximum symbol length is unspecified.
The compiler and link editor support a minimum of 511 external symbols per source or object file, and a minimum of 4095 external symbols total. A diagnostic message is written to standard output if the implementation-dependent limit is exceeded; other actions are unspecified.
EXIT STATUS
The following exit values are returned:
CONSEQUENCES OF ERRORS
When fort77 encounters a compilation
error, it will write a diagnostic to standard error and continue to compile
other source code operands. It will return a non-zero exit status, but it is
implementation-dependent whether an object module is created. If the link
edit is unsuccessful, a diagnostic message will be written to standard
error, and fort77 will exit with a non-zero
status.
APPLICATION USAGE
None.
EXAMPLES
The following are examples of usage:
- fort77 -o foo xyz.f
- Compiles xyz.f and creates the executable file foo .
- fort77 -c xyz.f
- Compiles xyz.f and creates the object file xyz.o .
- fort77 xyz.f
- Compiles xyz.f and creates the executable file a.out .
- fort77 xyz.f b.o
- Compiles xyz.f , links it with b.o and creates the executable a.out .
FUTURE DIRECTIONS
A compilation system based on FORTRAN-90 (ISO/IEC 1539:1991) will
be considered for a future issue; it may have a different utility name from
fort77 .