logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

fort77.1p (18732B)


  1. '\" et
  2. .TH FORT77 "1P" 2017 "IEEE/The Open Group" "POSIX Programmer's Manual"
  3. .\"
  4. .SH PROLOG
  5. This manual page is part of the POSIX Programmer's Manual.
  6. The Linux implementation of this interface may differ (consult
  7. the corresponding Linux manual page for details of Linux behavior),
  8. or the interface may not be implemented on Linux.
  9. .\"
  10. .SH NAME
  11. fort77
  12. \(em FORTRAN compiler (\fBFORTRAN\fP)
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. fort77 \fB[\fR-c\fB] [\fR-g\fB] [\fR-L \fIdirectory\fB]\fR...\fB [\fR-O \fIoptlevel\fB] [\fR-o \fIoutfile\fB] [\fR-s\fB]
  17. [\fR-w\fB] \fIoperand\fR...
  18. .fi
  19. .SH DESCRIPTION
  20. The
  21. .IR fort77
  22. utility is the interface to the FORTRAN compilation system; it shall
  23. accept the full FORTRAN-77 language defined by the ANSI\ X3.9\(hy1978 standard. The system
  24. conceptually consists of a compiler and link editor. The files
  25. referenced by
  26. .IR operand s
  27. are compiled and linked to produce an executable file. It is
  28. unspecified whether the linking occurs entirely within the operation of
  29. .IR fort77 ;
  30. some implementations may produce objects that are not fully resolved
  31. until the file is executed.
  32. .P
  33. If the
  34. .BR \-c
  35. option is present, for all pathname operands of the form
  36. .IR file \c
  37. .BR .f ,
  38. the files:
  39. .sp
  40. .RS 4
  41. .nf
  42. $(basename \fIpathname\fR.f).o
  43. .fi
  44. .P
  45. .RE
  46. .P
  47. shall be created or overwritten as the result of successful
  48. compilation. If the
  49. .BR \-c
  50. option is not specified, it is unspecified whether such
  51. .BR .o
  52. files are created or deleted for the
  53. .IR file \c
  54. .BR .f
  55. operands.
  56. .P
  57. If there are no options that prevent link editing (such as
  58. .BR \-c )
  59. and all operands compile and link without error, the resulting
  60. executable file shall be written into the file named by the
  61. .BR \-o
  62. option (if present) or to the file
  63. .BR a.out .
  64. The executable file shall be created as specified in the System Interfaces volume of POSIX.1\(hy2017, except
  65. that the file permissions shall be set to:
  66. S_IRWXO | S_IRWXG | S_IRWXU
  67. .P
  68. and that the bits specified by the
  69. .IR umask
  70. of the process shall be cleared.
  71. .SH OPTIONS
  72. The
  73. .IR fort77
  74. utility shall conform to the Base Definitions volume of POSIX.1\(hy2017,
  75. .IR "Section 12.2" ", " "Utility Syntax Guidelines",
  76. except that:
  77. .IP " *" 4
  78. The
  79. .BR \-l
  80. .IR library
  81. operands have the format of options, but their position within a list
  82. of operands affects the order in which libraries are searched.
  83. .IP " *" 4
  84. The order of specifying the multiple
  85. .BR \-L
  86. options is significant.
  87. .IP " *" 4
  88. Conforming applications shall specify each option separately; that is,
  89. grouping option letters (for example,
  90. .BR \-cg )
  91. need not be recognized by all implementations.
  92. .P
  93. The following options shall be supported:
  94. .IP "\fB\-c\fR" 10
  95. Suppress the link-edit phase of the compilation, and do not remove any
  96. object files that are produced.
  97. .IP "\fB\-g\fR" 10
  98. Produce symbolic information in the object or executable files; the
  99. nature of this information is unspecified, and may be modified by
  100. implementation-defined interactions with other options.
  101. .IP "\fB\-s\fR" 10
  102. Produce object or executable files, or both, from which symbolic and
  103. other information not required for proper execution using the
  104. .IR exec
  105. family of functions defined in the System Interfaces volume of POSIX.1\(hy2017 has been removed (stripped).
  106. If both
  107. .BR \-g
  108. and
  109. .BR \-s
  110. options are present, the action taken is unspecified.
  111. .IP "\fB\-o\ \fIoutfile\fR" 10
  112. Use the pathname
  113. .IR outfile ,
  114. instead of the default
  115. .BR a.out ,
  116. for the executable file produced. If the
  117. .BR \-o
  118. option is present with
  119. .BR \-c ,
  120. the result is unspecified.
  121. .IP "\fB\-L\ \fIdirectory\fR" 10
  122. Change the algorithm of searching for the libraries named in
  123. .BR \-l
  124. operands to look in the directory named by the
  125. .IR directory
  126. pathname before looking in the usual places. Directories named in
  127. .BR \-L
  128. options shall be searched in the specified order. At least ten
  129. instances of this option shall be supported in a single
  130. .IR fort77
  131. command invocation. If a directory specified by a
  132. .BR \-L
  133. option contains a file named
  134. .BR libf.a ,
  135. the results are unspecified.
  136. .IP "\fB\-O\ \fIoptlevel\fR" 10
  137. Specify the level of code optimization. If the
  138. .IR optlevel
  139. option-argument is the digit
  140. .BR '0' ,
  141. all special code optimizations shall be disabled. If it is the digit
  142. .BR '1' ,
  143. the nature of the optimization is unspecified. If the
  144. .BR \-O
  145. option is omitted, the nature of the system's default optimization is
  146. unspecified. It is unspecified whether code generated in the presence
  147. of the
  148. .BR \-O
  149. 0 option is the same as that generated when
  150. .BR \-O
  151. is omitted. Other
  152. .IR optlevel
  153. values may be supported.
  154. .IP "\fB\-w\fR" 10
  155. Suppress warnings.
  156. .P
  157. Multiple instances of
  158. .BR \-L
  159. options can be specified.
  160. .SH OPERANDS
  161. An
  162. .IR operand
  163. is either in the form of a pathname or the form
  164. .BR \-l
  165. .IR library .
  166. At least one operand of the pathname form shall be specified. The
  167. following operands shall be supported:
  168. .IP "\fIfile.\fBf\fR" 10
  169. The pathname of a FORTRAN source file to be compiled and optionally
  170. passed to the link editor. The filename operand shall be of this form
  171. if the
  172. .BR \-c
  173. option is used.
  174. .IP "\fIfile.\fBa\fR" 10
  175. A library of object files typically produced by
  176. .IR ar ,
  177. and passed directly to the link editor. Implementations may recognize
  178. implementation-defined suffixes other than
  179. .BR .a
  180. as denoting object file libraries.
  181. .IP "\fIfile.\fBo\fR" 10
  182. An object file produced by
  183. .IR fort77
  184. .BR \-c
  185. and passed directly to the link editor. Implementations may recognize
  186. implementation-defined suffixes other than
  187. .BR .o
  188. as denoting object files.
  189. .P
  190. The processing of other files is implementation-defined.
  191. .IP "\fB\-l\ \fIlibrary\fR" 10
  192. (The letter ell.) Search the library named:
  193. .RS 10
  194. .sp
  195. .RS 4
  196. .nf
  197. lib\fIlibrary\fR.a
  198. .fi
  199. .P
  200. .RE
  201. .P
  202. A library is searched when its name is encountered, so the placement of
  203. a
  204. .BR \-l
  205. operand is significant. Several standard libraries can be specified in
  206. this manner, as described in the EXTENDED DESCRIPTION section.
  207. Implementations may recognize implementation-defined suffixes other
  208. than
  209. .BR .a
  210. as denoting libraries.
  211. .RE
  212. .SH STDIN
  213. Not used.
  214. .SH "INPUT FILES"
  215. The input file shall be one of the following: a text file containing
  216. FORTRAN source code; an object file in the format produced by
  217. .IR fort77
  218. .BR \-c ;
  219. or a library of object files, in the format produced by archiving zero
  220. or more object files, using
  221. .IR ar .
  222. Implementations may supply additional utilities that produce files in
  223. these formats. Additional input files are implementation-defined.
  224. .P
  225. A
  226. <tab>
  227. encountered within the first six characters on a line of source code
  228. shall cause the compiler to interpret the following character as if it
  229. were the seventh character on the line (that is, in column 7).
  230. .SH "ENVIRONMENT VARIABLES"
  231. The following environment variables shall affect the execution of
  232. .IR fort77 :
  233. .IP "\fILANG\fP" 10
  234. Provide a default value for the internationalization variables that are
  235. unset or null. (See the Base Definitions volume of POSIX.1\(hy2017,
  236. .IR "Section 8.2" ", " "Internationalization Variables"
  237. for the precedence of internationalization variables used to determine
  238. the values of locale categories.)
  239. .IP "\fILC_ALL\fP" 10
  240. If set to a non-empty string value, override the values of all the
  241. other internationalization variables.
  242. .IP "\fILC_CTYPE\fP" 10
  243. Determine the locale for the interpretation of sequences of bytes of
  244. text data as characters (for example, single-byte as opposed to
  245. multi-byte characters in arguments and input files).
  246. .IP "\fILC_MESSAGES\fP" 10
  247. .br
  248. Determine the locale that should be used to affect the format and
  249. contents of diagnostic messages written to standard error.
  250. .IP "\fINLSPATH\fP" 10
  251. Determine the location of message catalogs for the processing of
  252. .IR LC_MESSAGES .
  253. .IP "\fITMPDIR\fP" 10
  254. Determine the pathname that should override the default directory for
  255. temporary files, if any.
  256. .SH "ASYNCHRONOUS EVENTS"
  257. Default.
  258. .SH STDOUT
  259. Not used.
  260. .SH STDERR
  261. The standard error shall be used only for diagnostic messages.
  262. If more than one
  263. .IR file
  264. operand ending in
  265. .BR .f
  266. (or possibly other unspecified suffixes) is given, for each such file:
  267. .sp
  268. .RS 4
  269. .nf
  270. "%s:\en", <\fIfile\fR>
  271. .fi
  272. .P
  273. .RE
  274. .P
  275. may be written to allow identification of the diagnostic message with
  276. the appropriate input file.
  277. .P
  278. This utility may produce warning messages about certain conditions that
  279. do not warrant returning an error (non-zero) exit value.
  280. .SH "OUTPUT FILES"
  281. Object files, listing files, and executable files shall be produced in
  282. unspecified formats.
  283. .SH "EXTENDED DESCRIPTION"
  284. .SS "Standard Libraries"
  285. .P
  286. The
  287. .IR fort77
  288. utility shall recognize the following
  289. .BR \-l
  290. operand for the standard library:
  291. .IP "\fB\-l\ f\fR" 10
  292. This library contains all functions referenced in the ANSI\ X3.9\(hy1978 standard. This
  293. operand shall not be required to be present to cause a search of this
  294. library.
  295. .P
  296. In the absence of options that inhibit invocation of the link editor,
  297. such as
  298. .BR \-c ,
  299. the
  300. .IR fort77
  301. utility shall cause the equivalent of a
  302. .BR "\-l\ f"
  303. operand to be passed to the link editor as the last
  304. .BR \-l
  305. operand, causing it to be searched after all other object files and
  306. libraries are loaded.
  307. .P
  308. It is unspecified whether the library
  309. .BR libf.a
  310. exists as a regular file. The implementation may accept as
  311. .BR \-l
  312. operands names of objects that do not exist as regular files.
  313. .SS "External Symbols"
  314. .P
  315. The FORTRAN compiler and link editor shall support the significance of
  316. external symbols up to a length of at least 31 bytes; case folding is
  317. permitted. The action taken upon encountering symbols exceeding the
  318. implementation-defined maximum symbol length is unspecified.
  319. .P
  320. The compiler and link editor shall support a minimum of 511 external
  321. symbols per source or object file, and a minimum of 4\|095 external
  322. symbols total. A diagnostic message is written to standard output if
  323. the implementation-defined limit is exceeded; other actions are
  324. unspecified.
  325. .SH "EXIT STATUS"
  326. The following exit values shall be returned:
  327. .IP "\00" 6
  328. Successful compilation or link edit.
  329. .IP >0 6
  330. An error occurred.
  331. .SH "CONSEQUENCES OF ERRORS"
  332. When
  333. .IR fort77
  334. encounters a compilation error, it shall write a diagnostic to standard
  335. error and continue to compile other source code operands. It shall
  336. return a non-zero exit status, but it is implementation-defined
  337. whether an object module is created. If the link edit is unsuccessful,
  338. a diagnostic message shall be written to standard error, and
  339. .IR fort77
  340. shall exit with a non-zero status.
  341. .LP
  342. .IR "The following sections are informative."
  343. .SH "APPLICATION USAGE"
  344. None.
  345. .SH EXAMPLES
  346. The following usage example compiles
  347. .BR xyz.f
  348. and creates the executable file
  349. .BR foo :
  350. .sp
  351. .RS 4
  352. .nf
  353. fort77 -o foo xyz.f
  354. .fi
  355. .P
  356. .RE
  357. .P
  358. The following example compiles
  359. .BR xyz.f
  360. and creates the object file
  361. .BR xyz.o :
  362. .sp
  363. .RS 4
  364. .nf
  365. fort77 -c xyz.f
  366. .fi
  367. .P
  368. .RE
  369. .P
  370. The following example compiles
  371. .BR xyz.f
  372. and creates the executable file
  373. .BR a.out :
  374. .sp
  375. .RS 4
  376. .nf
  377. fort77 xyz.f
  378. .fi
  379. .P
  380. .RE
  381. .P
  382. The following example compiles
  383. .BR xyz.f ,
  384. links it with
  385. .BR b.o ,
  386. and creates the executable
  387. .BR a.out :
  388. .sp
  389. .RS 4
  390. .nf
  391. fort77 xyz.f b.o
  392. .fi
  393. .P
  394. .RE
  395. .SH RATIONALE
  396. The name of this utility was chosen as
  397. .IR fort77
  398. to parallel the renaming of the C compiler. The name
  399. .IR f77
  400. was not chosen to avoid problems with historical implementations. The
  401. ANSI\ X3.9\(hy1978 standard was selected as a normative reference because the ISO/IEC version
  402. of FORTRAN-77 has been superseded by the ISO/IEC\ 1539:\|1991 standard.
  403. .P
  404. The file inclusion and symbol definition
  405. .BR #define
  406. mechanisms used by the
  407. .IR c99
  408. utility were not included in this volume of POSIX.1\(hy2017\(emeven though they are commonly
  409. implemented\(emsince there is no requirement that the FORTRAN compiler
  410. use the C preprocessor.
  411. .P
  412. The
  413. .BR \-onetrip
  414. option was not included in this volume of POSIX.1\(hy2017, even though many historical compilers
  415. support it, because it is derived from FORTRAN-66; it is an anachronism
  416. that should not be perpetuated.
  417. .P
  418. Some implementations produce compilation listings. This aspect of
  419. FORTRAN has been left unspecified because there was controversy
  420. concerning the various methods proposed for implementing it: a
  421. .BR \-V
  422. option overlapped with historical vendor practice and a naming
  423. convention of creating files with
  424. .BR .l
  425. suffixes collided with historical
  426. .IR lex
  427. file naming practice.
  428. .P
  429. There is no
  430. .BR \-I
  431. option in this version of this volume of POSIX.1\(hy2017 to specify a directory for file
  432. inclusion. An INCLUDE directive has been a part of the Fortran-90
  433. discussions, but an interface supporting that standard is not in the
  434. current scope.
  435. .P
  436. It is noted that many FORTRAN compilers produce an object module even
  437. when compilation errors occur; during a subsequent compilation, the
  438. compiler may patch the object module rather than recompiling all the
  439. code. Consequently, it is left to the implementor whether or not an
  440. object file is created.
  441. .P
  442. A reference to MIL-STD-1753
  443. was removed from an early proposal in response to a request from the
  444. POSIX FORTRAN-binding standard developers. It was not the intention of
  445. the standard developers to require certification of the FORTRAN
  446. compiler, and IEEE\ Std\ 1003.9\(hy1992 does not specify the military standard or any
  447. special preprocessing requirements. Furthermore, use of that document
  448. would have been inappropriate for an international standard.
  449. .P
  450. The specification of optimization has been subject to changes through
  451. early proposals. At one time,
  452. .BR \-O
  453. and
  454. .BR \-N
  455. were Booleans: optimize and do not optimize (with an unspecified
  456. default). Some historical practice led this to be changed to:
  457. .IP "\fB\-O\fR\ 0" 10
  458. No optimization.
  459. .IP "\fB\-O\fR\ 1" 10
  460. Some level of optimization.
  461. .IP "\fB\-O\ \fIn\fR" 10
  462. Other, unspecified levels of optimization.
  463. .P
  464. It is not always clear whether ``good code generation'' is the same
  465. thing as optimization. Simple optimizations of local actions do not
  466. usually affect the semantics of a program. The
  467. .BR \-O
  468. 0 option has been included to accommodate the very particular nature of
  469. scientific calculations in a highly optimized environment; compilers
  470. make errors. Some degree of optimization is expected, even if it is not
  471. documented here, and the ability to shut it off completely could be
  472. important when porting an application. An implementation may treat
  473. .BR \-O
  474. 0 as ``do less than normal'' if it wishes, but this is only meaningful
  475. if any of the operations it performs can affect the semantics of a
  476. program. It is highly dependent on the implementation whether doing
  477. less than normal is logical. It is not the intent of the
  478. .BR \-O
  479. 0 option to ask for inefficient code generation, but rather to assure
  480. that any semantically visible optimization is suppressed.
  481. .P
  482. The specification of standard library access is consistent with the C
  483. compiler specification. Implementations are not required to have
  484. .BR /usr/lib/libf.a ,
  485. as many historical implementations do, but if not they are required to
  486. recognize
  487. .BR f
  488. as a token.
  489. .P
  490. External symbol size limits are in normative text; conforming
  491. applications need to know these limits. However, the minimum maximum
  492. symbol length should be taken as a constraint on a conforming
  493. application, not on an implementation, and consequently the action
  494. taken for a symbol exceeding the limit is unspecified. The minimum size
  495. for the external symbol table was added for similar reasons.
  496. .P
  497. The CONSEQUENCES OF ERRORS section clearly specifies the behavior of
  498. the compiler when compilation or link-edit errors occur. The behavior
  499. of several historical implementations was examined, and the choice was
  500. made to be silent on the status of the executable, or
  501. .BR a.out ,
  502. file in the face of compiler or linker errors. If a linker writes the
  503. executable file, then links it on disk with
  504. \fIlseek\fR()s
  505. and
  506. \fIwrite\fR()s,
  507. the partially linked executable file can be left on disk and its
  508. execute bits turned off if the link edit fails. However, if the linker
  509. links the image in memory before writing the file to disk, it need not
  510. touch the executable file (if it already exists) because the link edit
  511. fails. Since both approaches are historical practice, a conforming
  512. application shall rely on the exit status of
  513. .IR fort77 ,
  514. rather than on the existence or mode of the executable file.
  515. .P
  516. The
  517. .BR \-g
  518. and
  519. .BR \-s
  520. options are not specified as mutually-exclusive. Historically, these two
  521. options have been mutually-exclusive, but because both are so loosely
  522. specified, it seemed appropriate to leave their interaction
  523. unspecified.
  524. .P
  525. The requirement that conforming applications specify compiler options
  526. separately is to reserve the multi-character option name space for
  527. vendor-specific compiler options, which are known to exist in many
  528. historical implementations. Implementations are not required to
  529. recognize, for example,
  530. .BR \-gc
  531. as if it were
  532. .BR \-g
  533. .BR \-c ;
  534. nor are they forbidden from doing so. The SYNOPSIS shows all of the
  535. options separately to highlight this requirement on applications.
  536. .P
  537. Echoing filenames to standard error is considered a diagnostic message
  538. because it would otherwise be difficult to associate an error message
  539. with the erring file. They are described with ``may'' to allow
  540. implementations to use other methods of identifying files and to
  541. parallel the description in
  542. .IR c99 .
  543. .SH "FUTURE DIRECTIONS"
  544. Future versions of this standard may withdraw this utility. There are
  545. implementations of compilers that conform to much more recent versions
  546. of the FORTRAN programming language. Since there is no active FORTRAN
  547. binding to POSIX.1\(hy2008, this standard does not need to specify any compiler.
  548. .SH "SEE ALSO"
  549. .IR "\fIar\fR\^",
  550. .IR "\fIasa\fR\^",
  551. .IR "\fIc99\fR\^",
  552. .IR "\fIumask\fR\^"
  553. .P
  554. The Base Definitions volume of POSIX.1\(hy2017,
  555. .IR "Chapter 8" ", " "Environment Variables",
  556. .IR "Section 12.2" ", " "Utility Syntax Guidelines"
  557. .P
  558. The System Interfaces volume of POSIX.1\(hy2017,
  559. .IR "\fIexec\fR\^"
  560. .\"
  561. .SH COPYRIGHT
  562. Portions of this text are reprinted and reproduced in electronic form
  563. from IEEE Std 1003.1-2017, Standard for Information Technology
  564. -- Portable Operating System Interface (POSIX), The Open Group Base
  565. Specifications Issue 7, 2018 Edition,
  566. Copyright (C) 2018 by the Institute of
  567. Electrical and Electronics Engineers, Inc and The Open Group.
  568. In the event of any discrepancy between this version and the original IEEE and
  569. The Open Group Standard, the original IEEE and The Open Group Standard
  570. is the referee document. The original Standard can be obtained online at
  571. http://www.opengroup.org/unix/online.html .
  572. .PP
  573. Any typographical or formatting errors that appear
  574. in this page are most likely
  575. to have been introduced during the conversion of the source files to
  576. man page format. To report such errors, see
  577. https://www.kernel.org/doc/man-pages/reporting_bugs.html .