📄 fort77.html
字号:
<p>The standard error shall be used only for diagnostic messages. If more than one <i>file</i> operand ending in <b>.f</b> (orpossibly other unspecified suffixes) is given, for each such file:</p><pre><tt>"%s:\n", <</tt><i>file</i><tt>></tt></pre><p>may be written to allow identification of the diagnostic message with the appropriate input file.</p><p>This utility may produce warning messages about certain conditions that do not warrant returning an error (non-zero) exitvalue.</p></blockquote><h4><a name="tag_04_57_12"></a>OUTPUT FILES</h4><blockquote><p>Object files, listing files, and executable files shall be produced in unspecified formats.</p></blockquote><h4><a name="tag_04_57_13"></a>EXTENDED DESCRIPTION</h4><blockquote><h5><a name="tag_04_57_13_01"></a>Standard Libraries</h5><p>The <i>fort77</i> utility shall recognize the following <b>-l</b> operand for the standard library:</p><dl compact><dt><b>-l f</b></dt><dd>This library contains all functions referenced in the ANSI X3.9-1978 standard. This operand shall not be required to bepresent to cause a search of this library.</dd></dl><p>In the absence of options that inhibit invocation of the link editor, such as <b>-c</b>, the <i>fort77</i> utility shall causethe equivalent of a <b>-l f</b> operand to be passed to the link editor as the last <b>-l</b> operand, causing it to besearched after all other object files and libraries are loaded.</p><p>It is unspecified whether the library <b>libf.a</b> exists as a regular file. The implementation may accept as <b>-l</b>operands names of objects that do not exist as regular files.</p><h5><a name="tag_04_57_13_02"></a>External Symbols</h5><p>The FORTRAN compiler and link editor shall 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-defined maximum symbol length isunspecified.</p><p>The compiler and link editor shall support a minimum of 511 external symbols per source or object file, and a minimum of 4095external symbols total. A diagnostic message is written to standard output if the implementation-defined limit is exceeded; otheractions are unspecified.</p></blockquote><h4><a name="tag_04_57_14"></a>EXIT STATUS</h4><blockquote><p>The following exit values shall be returned:</p><dl compact><dt> 0</dt><dd>Successful compilation or link edit.</dd><dt>>0</dt><dd>An error occurred.</dd></dl></blockquote><h4><a name="tag_04_57_15"></a>CONSEQUENCES OF ERRORS</h4><blockquote><p>When <i>fort77</i> encounters a compilation error, it shall write a diagnostic to standard error and continue to compile othersource code operands. It shall return a non-zero exit status, but it is implementation-defined whether an object module is created.If the link edit is unsuccessful, a diagnostic message shall be written to standard error, and <i>fort77</i> shall exit with anon-zero status.</p></blockquote><hr><div class="box"><em>The following sections are informative.</em></div><h4><a name="tag_04_57_16"></a>APPLICATION USAGE</h4><blockquote><p>None.</p></blockquote><h4><a name="tag_04_57_17"></a>EXAMPLES</h4><blockquote><p>The following usage example compiles <b>xyz.f</b> and creates the executable file <b>foo</b>:</p><pre><tt>fort77 -o foo xyz.f</tt></pre><p>The following example compiles <b>xyz.f</b> and creates the object file <b>xyz.o</b>:</p><pre><tt>fort77 -c xyz.f</tt></pre><p>The following example compiles <b>xyz.f</b> and creates the executable file <b>a.out</b>:</p><pre><tt>fort77 xyz.f</tt></pre><p>The following example compiles <b>xyz.f</b>, links it with <b>b.o</b>, and creates the executable <b>a.out</b>:</p><pre><tt>fort77 xyz.f b.o</tt></pre></blockquote><h4><a name="tag_04_57_18"></a>RATIONALE</h4><blockquote><p>The name of this utility was chosen as <i>fort77</i> to parallel the renaming of the C compiler. The name <i>f77</i> was notchosen to avoid problems with historical implementations. The ANSI X3.9-1978 standard was selected as a normative referencebecause the ISO/IEC version of FORTRAN-77 has been superseded by the ISO/IEC 1539:1990 standard (Fortran-90).</p><p>The file inclusion and symbol definition <b>#define</b> mechanisms used by the <a href="../utilities/c99.html"><i>c99</i></a>utility were not included in this volume of IEEE Std 1003.1-2001-even though they are commonly implemented-since there isno requirement that the FORTRAN compiler use the C preprocessor.</p><p>The <b>-onetrip</b> option was not included in this volume of IEEE Std 1003.1-2001, even though many historicalcompilers support it, because it is derived from FORTRAN-66; it is an anachronism that should not be perpetuated.</p><p>Some implementations produce compilation listings. This aspect of FORTRAN has been left unspecified because there wascontroversy concerning the various methods proposed for implementing it: a <b>-V</b> option overlapped with historical vendorpractice and a naming convention of creating files with <b>.l</b> suffixes collided with historical <a href="../utilities/lex.html"><i>lex</i></a> file naming practice.</p><p>There is no <b>-I</b> option in this version of this volume of IEEE Std 1003.1-2001 to specify a directory for fileinclusion. An INCLUDE directive has been a part of the Fortran-90 discussions, but an interface supporting that standard is not inthe current scope.</p><p>It is noted that many FORTRAN compilers produce an object module even when compilation errors occur; during a subsequentcompilation, the compiler may patch the object module rather than recompiling all the code. Consequently, it is left to theimplementor whether or not an object file is created.</p><p>A reference to MIL-STD-1753 was removed from an early proposal in response to a request from the POSIX FORTRAN-binding standarddevelopers. It was not the intention of the standard developers to require certification of the FORTRAN compiler, andIEEE Std 1003.9-1992 does not specify the military standard or any special preprocessing requirements. Furthermore, useof that document would have been inappropriate for an international standard.</p><p>The specification of optimization has been subject to changes through early proposals. At one time, <b>-O</b> and <b>-N</b> wereBooleans: optimize and do not optimize (with an unspecified default). Some historical practice led this to be changed to:</p><dl compact><dt><b>-O</b> 0</dt><dd>No optimization.</dd><dt><b>-O</b> 1</dt><dd>Some level of optimization.</dd><dt><b>-O </b> <i>n</i></dt><dd>Other, unspecified levels of optimization.</dd></dl><p>It is not always clear whether "good code generation" is the same thing as optimization. Simple optimizations of local actionsdo not usually affect the semantics of a program. The <b>-O</b> 0 option has been included to accommodate the very particularnature of scientific calculations in a highly optimized environment; compilers make errors. Some degree of optimization isexpected, even if it is not documented here, and the ability to shut it off completely could be important when porting anapplication. An implementation may treat <b>-O</b> 0 as "do less than normal" if it wishes, but this is only meaningful if any ofthe operations it performs can affect the semantics of a program. It is highly dependent on the implementation whether doing lessthan normal is logical. It is not the intent of the <b>-O</b> 0 option to ask for inefficient code generation, but rather to assurethat any semantically visible optimization is suppressed.</p><p>The specification of standard library access is consistent with the C compiler specification. Implementations are not requiredto have <b>/usr/lib/libf.a</b>, as many historical implementations do, but if not they are required to recognize <b>f</b> as atoken.</p><p>External symbol size limits are in normative text; conforming applications need to know these limits. However, the minimummaximum symbol length should be taken as a constraint on a conforming application, not on an implementation, and consequently theaction taken for a symbol exceeding the limit is unspecified. The minimum size for the external symbol table was added for similarreasons.</p><p>The CONSEQUENCES OF ERRORS section clearly specifies the behavior of the compiler when compilation or link-edit errors occur.The behavior of several historical implementations was examined, and the choice was made to be silent on the status of theexecutable, or <b>a.out</b>, file in the face of compiler or linker errors. If a linker writes the executable file, then links iton disk with <a href="../functions/lseek.html"><i>lseek</i>()</a>s and <a href="../functions/write.html"><i>write</i>()</a>s, thepartially linked executable file can be left on disk and its execute bits turned off if the link edit fails. However, if the linkerlinks the image in memory before writing the file to disk, it need not touch the executable file (if it already exists) because thelink edit fails. Since both approaches are historical practice, a conforming application shall rely on the exit status of<i>fort77</i>, rather than on the existence or mode of the executable file.</p><p>The <b>-g</b> and <b>-s</b> options are not specified as mutually-exclusive. Historically these two options have beenmutually-exclusive, but because both are so loosely specified, it seemed appropriate to leave their interaction unspecified.</p><p>The requirement that conforming applications specify compiler options separately is to reserve the multi-character option namespace for vendor-specific compiler options, which are known to exist in many historical implementations. Implementations are notrequired to recognize, for example, <b>-gc</b> as if it were <b>-g</b> <b>-c</b>; nor are they forbidden from doing so. TheSYNOPSIS shows all of the options separately to highlight this requirement on applications.</p><p>Echoing filenames to standard error is considered a diagnostic message because it would otherwise be difficult to associate anerror message with the erring file. They are described with "may" to allow implementations to use other methods of identifyingfiles and to parallel the description in <a href="../utilities/c99.html"><i>c99</i></a>.</p></blockquote><h4><a name="tag_04_57_19"></a>FUTURE DIRECTIONS</h4><blockquote><p>A compilation system based on the ISO/IEC 1539:1990 standard (Fortran-90) may be considered for a future version; it mayhave a different utility name from <i>fort77</i>.</p></blockquote><h4><a name="tag_04_57_20"></a>SEE ALSO</h4><blockquote><p><a href="ar.html"><i>ar</i></a>, <a href="asa.html"><i>asa</i></a>, <a href="c99.html"><i>c99</i></a>, <a href="umask.html"><i>umask</i>()</a>, the System Interfaces volume of IEEE Std 1003.1-2001, <i>exec</i></p></blockquote><h4><a name="tag_04_57_21"></a>CHANGE HISTORY</h4><blockquote><p>First released in Issue 4.</p></blockquote><h4><a name="tag_04_57_22"></a>Issue 6</h4><blockquote><p>This utility is marked as part of the FORTRAN Development Utilities option.</p><p>The normative text is reworded to avoid use of the term "must" for application requirements.</p></blockquote><div class="box"><em>End of informative text.</em></div><hr size="2" noshade><center><font size="2"><!--footer start-->UNIX ® is a registered Trademark of The Open Group.<br>POSIX ® is a registered Trademark of The IEEE.<br>[ <a href="../mindex.html">Main Index</a> | <a href="../basedefs/contents.html">XBD</a> | <a href="../utilities/contents.html">XCU</a> | <a href="../functions/contents.html">XSH</a> | <a href="../xrat/contents.html">XRAT</a>]</font></center><!--footer end--><hr size="2" noshade></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -