summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/gcc/f/g77.1
blob: b9709f3cd714843f37beb81bbc697f0e2bf9601e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
.\" Copyright (c) 1995, 1996 Free Software Foundation              -*-Text-*-
.\" See section COPYING for conditions for redistribution
.\" FIXME: no info here on predefines.  Should there be?  extra for F77...
.TH G77 1 "1996-03-01" "GNU Tools" "GNU Tools"
.de BP
.sp
.ti \-.2i
\(**
..
.SH NAME
g77 \- GNU project F77 Compiler (v0.5.18)
.SH SYNOPSIS
.RB g77 " [" \c
.IR option " | " "filename " ].\|.\|.
.SH WARNING
The information in this man page is an extract from the full
documentation of the GNU Fortran compiler, and is limited to the meaning of
the options.
.PP
This man page is not kept up to date except when volunteers want to
maintain it.  If you find a discrepancy between the man page and the
software, please check the Info file, which is the authoritative
documentation.
.PP
If we find that the things in this man page that are out of date cause
significant confusion or complaints, we will stop distributing the man
page.  The alternative, updating the man page when we update the Info
file, is impractical because the rest of the work of maintaining GNU Fortran
leaves us no time for that.  The GNU project regards man pages as
obsolete and should not let them take time away from other things.
.PP
For complete and current documentation, refer to the Info file `\|\c
.B g77\c
\&\|' or the manual
.I
Using and Porting GNU Fortran (for version 0.5.18)\c
\&.  Both are made from the Texinfo source file
.BR g77.texi .
.PP
If your system has the `\|\c
.B info\c
\&\|' command installed, the command `\|\c
.B info g77\c
\&\|' should work, unless
.B g77
has not been properly installed.
If your system lacks `\|\c
.B info\c
\&\|', or you wish to avoid using it for now,
the command `\|\c
.B more /usr/info/g77.info*\c
\&\|' should work, unless
.B g77
has not been properly installed.
.PP
If
.B g77
has not been properly installed, so that you
cannot easily access the Info file for it,
ask your system administrator, or the installer
of
.B g77
(if you know who that is) to fix the problem.
.SH DESCRIPTION
The C and F77 compilers are integrated;
.B g77
is a program to call
.B gcc with options to recognize F77.
.B gcc
processes input files
through one or more of four stages: preprocessing, compilation,
assembly, and linking.  This man page contains full descriptions for
.I only
F77 specific aspects of the compiler, though it also contains
summaries of some general-purpose options.  For a fuller explanation
of the compiler, see
.BR gcc ( 1 ).

For complete documentation on GNU Fortran, type
.BR info g77

F77 source files use the suffix `\|\c
.B .f\c
\&\|'; F77 files to be preprocessed by
.BR cpp ( 1 )
use the suffix `\|\c
.B .F\c
\&\|'.
.SH OPTIONS
There are many command-line options, including options to control
details of optimization, warnings, and code generation, which are
common to both
.B gcc
and
.B g77\c
\&.  For full information on all options, see
.BR gcc ( 1 ).

Options must be separate: `\|\c
.B \-dr\c
\&\|' is quite different from `\|\c
.B \-d \-r
\&\|'.

Most `\|\c
.B \-f\c
\&\|' and `\|\c
.B \-W\c
\&\|' options have two contrary forms:
.BI \-f name
and
.BI \-fno\- name\c
\& (or
.BI \-W name
and
.BI \-Wno\- name\c
\&). Only the non-default forms are shown here.

.TP
.B \-c
Compile or assemble the source files, but do not link.  The compiler
output is an object file corresponding to each source file.
.TP
.BI \-D macro
Define macro \c
.I macro\c
\& with the string `\|\c
.B 1\c
\&\|' as its definition.
.TP
.BI \-D macro = defn
Define macro \c
.I macro\c
\& as \c
.I defn\c
\&.
.TP
.BI \-\-driver= command
Specifies that 
.IR command ,
rather than 
.RB ` gcc ',
is to be invoked by 
.RB ` g77 '
to do its job.  Example: Within the gcc build directory after building
GNU Fortran (but without having to install it),
.nf
  ./g77 \-\-driver=./xgcc -B./ foo.f
.fi
.TP
.B \-E
Stop after the preprocessing stage; do not run the compiler proper.  The
output is preprocessed source code, which is sent to the
standard output.
.TP
.B \-g
Produce debugging information in the operating system's native format
(for DBX or SDB or DWARF).  GDB also can work with this debugging
information.  On most systems that use DBX format, `\|\c
.B \-g\c
\&\|' enables use
of extra debugging information that only GDB can use.

Unlike most other Fortran compilers, GNU Fortran allows you to use `\|\c
.B \-g\c
\&\|' with
`\|\c
.B \-O\c
\&\|'.  The shortcuts taken by optimized code may occasionally
produce surprising results: some variables you declared may not exist
at all; flow of control may briefly move where you did not expect it;
some statements may not be executed because they compute constant
results or their values were already at hand; some statements may
execute in different places because they were moved out of loops.

Nevertheless it proves possible to debug optimized output.  This makes
it reasonable to use the optimizer for programs that might have bugs.
.TP
.BI "\-I" "dir"\c
\&
Append directory \c
.I dir\c
\& to the list of directories searched for include files.
.TP
.BI "\-L" "dir"\c
\&
Add directory \c
.I dir\c
\& to the list of directories to be searched
for `\|\c
.B \-l\c
\&\|'.
.TP
.BI \-l library\c
\&
Use the library named \c
.I library\c
\& when linking.
.TP
.B \-nostdinc
Do not search the standard system directories for header files.  Only
the directories you have specified with
.B \-I
options (and the current directory, if appropriate) are searched.
.TP
.B \-O
Optimize.  Optimizing compilation takes somewhat more time, and a lot
more memory for a large function.  See the GCC documentation for
further optimisation options.  Loop unrolling, in particular, may be
worth investigating for typical numerical Fortran programs.
.TP
.BI "\-o " file\c
\&
Place output in file \c
.I file\c
\&.
.TP
.B \-S
Stop after the stage of compilation proper; do not assemble.  The output
is an assembler code file for each non-assembler input
file specified.
.TP
.BI \-U macro
Undefine macro \c
.I macro\c
\&.
.TP
.B \-v
Print (on standard error output) the commands executed to run the
stages of compilation.  Also print the version number of the compiler
driver program and of the preprocessor and the compiler proper.  The
version numbers of g77 itself and the GCC distribution on which it is
based are distinct.  Use 
.RB ` \-\-driver=true '
to disable actual invocation of 
.RB ` gcc '
(since
.RB ` true '
is the name of a UNIX command that simply returns success status).
The command
.RB ` "gcc -v" '
is the appropriate one to determine the g77 and GCC version numbers;
it will produce an irrelevant error message from
.RB ` ld '.
.TP
.B \-Wall
Issue warnings for conditions which pertain to usage that we recommend
avoiding and that we believe is easy to avoid, even in conjunction
with macros.
.PP

.SH FILES
.ta \w'LIBDIR/g77\-include 'u
file.h    C header (preprocessor) file
.br
file.f    Fortran source file
.br
file.for  Fortran source file
.br
file.F    preprocessed Fortran source file
.br
file.fpp  preprocessed Fortran source file
.br
file.s    assembly language file
.br
file.o    object file
.br
a.out     link edited output
.br
\fITMPDIR\fR/cc\(**	temporary files
.br
\fILIBDIR\fR/cpp	preprocessor
.br
\fILIBDIR\fR/f771	compiler
.br
\fILIBDIR\fR/libf2c.a	Fortran run-time library
.br
\fILIBDIR\fR/libgcc.a	GCC subroutine library
.br
/lib/crt[01n].o	start-up routine
.br
/lib/libc.a	standard C library, see
.IR intro (3)
.br
/usr/include	standard directory for
.B #include
files
.br
\fILIBDIR\fR/include	standard gcc directory for
.B #include
files
.I LIBDIR
is usually
.B /usr/local/lib/\c
.IR machine / version .
.br
.I TMPDIR
comes from the environment variable
.B TMPDIR
(default
.B /usr/tmp
if available, else
.B /tmp\c
\&).
.SH "SEE ALSO"
gcc(1), cpp(1), as(1), ld(1), gdb(1), adb(1), dbx(1), sdb(1).
.br
.RB "`\|" g77 "\|', `\|" gcc "\|', `\|" cpp \|',
.RB `\| as \|', `\| ld \|',
and
.RB `\| gdb \|'
entries in
.B info\c
\&.
.br
.I
Using and Porting GNU Fortran (for version 0.5.18)\c
, James Craig Burley;
.I
Using and Porting GNU CC (for version 2.0)\c
, Richard M. Stallman;
.I
The C Preprocessor\c
, Richard M. Stallman;
.I
Debugging with GDB: the GNU Source-Level Debugger\c
, Richard M. Stallman and Roland H. Pesch;
.I
Using as: the GNU Assembler\c
, Dean Elsner, Jay Fenlason & friends;
.I
gld: the GNU linker\c
, Steve Chamberlain and Roland Pesch.

.SH BUGS
For instructions on how to report bugs, see the file
.B DOC
in the g77 distribution.

.SH COPYING
Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
.PP
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
are preserved on all copies.
.PP
Permission is granted to copy and distribute modified versions of this
manual under the conditions for verbatim copying, provided that the
entire resulting derived work is distributed under the terms of a
permission notice identical to this one.
.PP
Permission is granted to copy and distribute translations of this
manual into another language, under the above conditions for modified
versions, except that this permission notice may be included in
translations approved by the Free Software Foundation instead of in
the original English.
.SH AUTHORS
See the GNU CC Manual for the contributors to GNU CC.
See the GNU Fortran Manual for the contributors to
GNU Fortran.