g77.1 9.19 KB
Newer Older
Jeff Law committed
1
.\" Copyright (c) 1995, 1996, 1997, Free Software Foundation              -*-Text-*-
Jeff Law committed
2 3
.\" See section COPYING for conditions for redistribution
.\" FIXME: no info here on predefines.  Should there be?  extra for F77...
4
.TH G77 1 "1999-02-14" "GNU Tools" "GNU Tools"
Jeff Law committed
5 6 7 8 9 10
.de BP
.sp
.ti \-.2i
\(**
..
.SH NAME
11
g77 \- GNU project Fortran Compiler (v0.5.24)
Jeff Law committed
12 13 14 15 16
.SH SYNOPSIS
.RB g77 " [" \c
.IR option " | " "filename " ].\|.\|.
.SH WARNING
The information in this man page is an extract from the full
17
documentation of the GNU Fortran compiler (version 0.5.24),
18
and is limited to the meaning of some of the options.
Jeff Law committed
19 20 21 22 23
.PP
This man page is not up to date, since no 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.
24
.\" .PP
25 26
.\" The version of GNU Fortran documented by the Info file is 0.5.24,
.\" which includes substantial improvements and changes since 0.5.24,
27
.\" the version documented in this man page.
Jeff Law committed
28 29 30 31 32 33 34 35 36 37 38 39
.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
40
Using and Porting GNU Fortran (for version 0.5.24)\c
Jeff Law committed
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
\&.  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
72 73 74
.B gcc
with options to recognize programs written in Fortran (ANSI FORTRAN 77,
also called F77).
Jeff Law committed
75 76 77 78 79
.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
80
F77-specific aspects of the compiler, though it also contains
Jeff Law committed
81 82 83 84
summaries of some general-purpose options.  For a fuller explanation
of the compiler, see
.BR gcc ( 1 ).

85 86 87
For complete documentation on GNU Fortran, type `\|\c
.B info g77\c
\&\|'.
Jeff Law committed
88 89 90

F77 source files use the suffix `\|\c
.B .f\c
91
\&\|', `\|\c
92
.B .for\c
93 94
\&\|', or `\|\c
.B .FOR\c
Jeff Law committed
95 96 97 98
\&\|'; F77 files to be preprocessed by
.BR cpp ( 1 )
use the suffix `\|\c
.B .F\c
99
\&\|', `\|\c
100
.B .fpp\c
101 102
\&\|', or `\|\c
.B .FPP\c
103 104 105 106 107 108 109
\&\|'; Ratfor source files use the suffix `\|\c
.B .r\c
\&\|' (though
.B ratfor
itself is not supplied as part of
.B g77\c
\&).
Jeff Law committed
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
.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
.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
241
based are distinct.
Jeff Law committed
242 243 244 245 246 247 248 249 250 251 252 253 254 255 256
.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
257 258
file.FOR  Fortran source file
.br
Jeff Law committed
259 260 261 262
file.F    preprocessed Fortran source file
.br
file.fpp  preprocessed Fortran source file
.br
263 264
file.FPP  preprocessed Fortran source file
.br
265 266
file.r    Ratfor source file (ratfor not included)
.br
Jeff Law committed
267 268 269 270 271 272 273 274 275 276 277 278
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
279
\fILIBDIR\fR/libg2c.a	Fortran run-time library
Jeff Law committed
280 281 282 283 284 285 286 287 288 289 290 291 292 293
.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
294 295 296
.br
			files.
.sp
Jeff Law committed
297 298 299 300
.I LIBDIR
is usually
.B /usr/local/lib/\c
.IR machine / version .
301
.sp
Jeff Law committed
302 303 304 305 306 307 308 309 310 311 312
.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
313 314
.RB "`\|" g77 "\|', `\|" gcc "\|', `\|" cpp "\|',"
.RB "`\|" as "\|', `\|" ld "\|',"
Jeff Law committed
315
and
316
.RB "`\|" gdb "\|'"
Jeff Law committed
317 318 319 320 321
entries in
.B info\c
\&.
.br
.I
322
Using and Porting GNU Fortran (for version 0.5.24)\c
Jeff Law committed
323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340
, 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
341 342 343
For instructions on how to report bugs, type `\|\c
.B info g77 -n Bugs\c
\&\|'.
Jeff Law committed
344 345

.SH COPYING
346
Copyright (c) 1991-1998 Free Software Foundation, Inc.
Jeff Law committed
347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365
.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.