xref: /original-bsd/usr.bin/f77/f77.vax/f77.1 (revision 6ab384a1)
1.\" Copyright (c) 1990 Regents of the University of California.
2.\" All rights reserved.  The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
5.\"     @(#)f77.1	6.7 (Berkeley) 07/24/90
6.\"
7.Dd
8.Dt F77 1
9.Os BSD 4
10.Sh NAME
11.Nm f77
12.Nd Fortran 77 compiler
13.Sh SYNOPSIS
14.Nm f77
15.Op option
16\&...
17.Ar file ...
18.Sh DESCRIPTION
19.Nm F77
20is the UNIX Fortran 77 compiler.
21It accepts several types of arguments:
22.Pp
23Arguments whose names end with `.f' are taken to be
24Fortran 77 source programs;
25they are compiled, and
26each object program is left on the file in the current directory
27whose name is that of the source with `.o' substituted
28for `.f'.
29.Pp
30Arguments whose names end with `.F' are also taken to be Fortran 77 source
31programs; these are first processed by the C preprocessor before being
32compiled by
33.Nm f77 .
34.Pp
35Arguments whose names end with `.r' or `.e' are taken to be Ratfor
36or EFL source programs respectively; these are first transformed by the
37appropriate preprocessor, then compiled by
38.Nm f77 .
39.Pp
40Arguments whose names end with `.c' or `.s' are taken to be C or assembly
41source programs and are compiled or assembled, producing a `.o' file.
42.Pp
43The following options have the same meaning as in
44.Xr cc  1  .
45See
46.Xr ld  1
47for load-time options.
48.Tw Fl
49.Tp Fl c
50Suppress loading and produce `.o' files for each source
51file.
52.Tp Fl g
53Produce additional symbol table information for
54.Xr dbx  1
55and pass the
56.Fl lg
57flag to
58.Xr ld  1
59so that on abnormal terminations, the memory image is written
60to file
61.Pa core  .
62Incompatible with
63.Fl O  .
64.Tc Fl o
65.Ws
66.Ar output
67.Cx
68Name the final output file
69.Ar output
70instead of
71.Sq Pa a.out .
72.Tp Fl p
73Prepare object files for profiling, see
74.Xr prof  1  .
75.Tp Fl pg
76Causes the compiler to produce counting code in the manner of
77.Fl p ,
78but invokes a run-time recording mechanism that keeps more extensive
79statistics and produces a
80.Pa gmon.out
81file at normal termination. An execution profile can then be generated
82by use of
83.Xr gprof  1  .
84.Tp Fl w
85Suppress all warning messages.
86If the option is `\-w66', only Fortran 66 compatibility warnings are suppressed.
87.Tc Fl D
88.Ar name =def
89.Cx
90.Tc Fl D
91.Ar name
92.Cx
93Define the
94.Ar name
95to the C preprocessor, as if by `#define'. If no definition is given, the name
96is defined as "1". (`.F' suffix files only).
97.Tc Fl I
98.Ar dir
99.Cx
100`#include' files whose names do not begin with `/' are always sought
101first in the directory of the
102.Ar file
103argument, then in directories named in
104.Fl I
105options, then in directories on a standard list. (`.F' suffix files only).
106.Tp Fl O
107Invoke an
108object-code optimizer.
109Incompatible with
110.Fl g  .
111.Tp Fl S
112Compile the named programs, and leave the
113assembler-language output on corresponding files suffixed `.s'.
114(No `.o' is created.).
115.Pp
116The following options are peculiar to
117.Nm f77  .
118.Tp Fl d
119Used for debugging the compiler.
120.Tp Fl i2
121On machines which support short integers, make the default integer constants
122and variables short.
123.Fl i4
124is the standard value of this option). All logical quantities will be short.
125.Tp Fl q
126Suppress printing of file names and program unit names during compilation.
127.Tp Fl m
128Apply the M4 preprocessor to each `.r' file before transforming
129it with the Ratfor or EFL preprocessor.
130.Tp Fl onetrip
131.Tp Fl 1
132Compile DO loops that are performed at least once if reached.
133(Fortran 77 DO loops are not performed at all if the upper limit is smaller than the lower limit.)
134.Tp Fl r8
135Treat all floating point variables,
136constants, functions and intrinsics
137as double precision and all complex
138quantities as double complex.
139.Tp Fl u
140Make the default type of a variable `undefined' rather than using the default Fortran rules.
141.Tp Fl v
142Print the version number of the compiler, and the name of each pass as it
143executes.
144.Tp Fl C
145Compile code to check that subscripts are within declared array bounds.
146For multi-dimensional arrays, only the equivalent linear subscript is checked.
147.Tp Fl F
148Apply the C preprocessor to `.F' files, and the EFL, or Ratfor preprocessors
149to `.e' and `.r' files, put the
150result in the file with the suffix changed to `.f', but do not compile.
151.Tc Fl E
152.Ar x
153.Cx
154Use the string
155.Ar x
156as an EFL option in processing `.e' files.
157.Tc Fl R
158.Ar x
159.Cx
160Use the string
161.Ar x
162as a Ratfor option in processing `.r' files.
163.Tc Fl N
164.Op Cm qxscn
165.Ar nnn
166.Cx
167Make static tables in the compiler bigger. The compiler will complain
168if it overflows its tables and suggest you apply one or more of these
169flags. These flags have the following meanings:
170.Tw Ds
171.Tp Cm r q
172Maximum number of equivalenced variables. Default is 150.
173.Tp Cm x
174Maximum number of external names (common block names, subroutine and
175function names). Default is 200.
176.Tp Cm s
177Maximum number of statement numbers. Default is 401.
178.Tp Cm c
179Maximum depth of nesting for control statements (e.g. DO loops). Default is
18020.
181.Tp Ar n
182Maximum number of identifiers. Default is 1009.
183.Tp
184.Tp Fl U
185Do not convert upper case letters to lower case. The default is to convert
186Fortran programs to lower case except within character string constants.
187.Tp
188.Pp
189Other arguments
190are taken
191to be either loader option arguments, or F77-compatible
192object programs, typically produced by an earlier
193run,
194or perhaps libraries of F77-compatible routines.
195These programs, together with the results of any
196compilations specified, are loaded (in the order
197given) to produce an executable program with name
198.Sq Pa a.out .
199.Pp
200Programs compiled with
201.Nm f77
202produce memory dumps in file
203.Pa core
204upon abnormal termination if the
205.Sq Fl
206flag was specified during loading.
207If the environment variable
208.Ev f77_dump_flag
209is set to a value beginning with
210.Sq Ar y
211or
212.Sq Ar n  ,
213dumps for abnormal terminations are respectively forced or
214suppressed.
215.Sh FILES
216.Dw /usr/lib/libI77_p.a
217.Di L
218.Dp file.[fFresc]
219input file
220.Dp Pa file.o
221object file
222.Dp Pa a.out
223loaded output
224.Dp Pa /usr/lib/f77pass1
225compiler
226.Dp Pa /libexec/f1
227pass 2
228.Dp Pa /libexec/c2
229optional optimizer
230.Dp Pa /usr/bin/cpp
231C preprocessor
232.Dp Pa /usr/lib/libF77.a
233intrinsic function library
234.Dp Pa /usr/lib/libI77.a
235Fortran I/O library
236.Dp Pa /usr/lib/libU77.a
237UNIX interface library
238.Dp Pa /usr/lib/libm.a
239math library
240.Dp Pa /usr/lib/libc.a
241C library, see section 3
242.Dp Pa /usr/lib/libF77_p.a
243profiling intrinsic function library
244.Dp Pa /usr/lib/libI77_p.a
245profiling Fortran I/O library
246.Dp Pa /usr/lib/libU77_p.a
247profiling UNIX interface library
248.Dp Pa /usr/lib/libm_p.a
249profiling math library
250.Dp Pa /usr/lib/libc_p.a
251profiling C library, see section 3
252.Dp Pa mon.out
253file produced for analysis by
254.Xr prof 1 .
255.Dp Pa gmon.out
256file produced for analysis by
257.Xr gprof 1 .
258.Dp
259.Sh SEE ALSO
260.Xr fpr 1 ,
261.Xr fsplit 1 ,
262.Xr ld 1 ,
263.Xr ar 1 ,
264.Xr ranlib 1 ,
265.Xr dbx 1 ,
266.Xr intro 3f
267.Xr efl 1 ,
268.Xr ratfor 1 ,
269.Xr struct 1 ,
270.Xr prof 1 ,
271.Xr gprof 1 ,
272.Xr cc 1
273.br
274S. I. Feldman, P. J. Weinberger, J. Berkman,
275.Em A Portable Fortran 77 Compiler
276.br
277D. L. Wasley, J. Berkman,
278.Em Introduction to the f77 I/.Xr O Library
279.Sh DIAGNOSTICS
280The diagnostics produced by
281.Nm f77
282itself are intended to be
283self-explanatory.
284Occasional messages may be produced by the loader.
285.Sh HISTORY
286.Nm F77
287appeared in Version 7 AT&T Unix.
288.Sh BUGS
289Files longer than about 50,000 lines must be split up to be compiled.
290