The kf77
command invokes a driver program
that automatically calls KAP, the Digital Fortran compiler, and the
linker.
kf77
Because kf77
calls KAP and the Digital Fortran
compiler, you can substitute the kf77
command
for the Fortran command. For example, to use kf77
to compile myprog.f
with the default KAP switch
settings, use the command:
kf77 myprog.f
The kf77
command uses the KAP preprocessor on
myprog.f
, compiles the result with the Digital
Fortran compiler, links the object code into an executable image,
and produces the following files:
myprog.cmp.f
- the optimized source file
myprog.out
- the annotated source file
showing default KAP switch settings
a.out
- the executable file
To see a list of the KAP switches and Digital Fortran
compiler switches passed by kf77
, use the
-verbose
switch as follows:
kf77 myprog.f -v
An example of the output from -verbose
is as
follows:
kf77 -v myprog.f /usr/bin/kapf -cmp=./myprog.cmp.f myprog.f -tune=EV4 -natural KAP/Digital_UA_F 3.1 k271615 961104 28-Nov-1996 12:25:54 0 errors in file matmul.f /usr/bin/f77 -fast -v ./myprog.cmp.f -tune host -non_shared /usr/lib/cmplrs/fort/decfort -fast -tune host -non_shared -o /tmp/forAAAaafqva.o ./myprog.cmp.f /usr/bin/cc -v -non_shared /usr/lib/cmplrs/fort/for_main.o /tmp/forAAAaafqva.o -O4 myprog.o -lUfor \ -lfor -lFutil -lm_4sqrt -lm -lots -qlc_r /usr/lib/cmplrs/cc/ld -g0 -O4 -non_shared /usr/lib/cmplrs/cc/crt0.o /usr/lib/cmp lrs/fort/for_main.o \ /tmp/forAAAaafqva.o myprog.o -lUfor -lfor -lFutil -lm_4sqrt -lm \ -lots -qlc_r -lc
The final resource usage appears in C-shell format at the end.
kf77
The -fkapargs
switch specifies one or more
KAP command switches to the KAP preprocessor. For example,
to use kf77
to optimize and compile the file
myprog.f
using KAP switches for general
optimization, use the command:
kf77 -fkapargs='-optimize=5 -roundoff=3 -scalaropt=3 -list=myprog_annotated.lis' \ myprog.f
The following files result:
myprog.cmp.f
- the optimized source file
myprog_annotated.lis
- the annotated
source file renamed with the -list
switch
a.out
- the executable file
For descriptions of all KAP command switches, see Chapter 4.
kf77
Any command-line switch that is valid for the Fortran compiler
or the linker is valid for the kf77
command. You can
specify compiler switches and KAP switches on the same line. For
example, to optimize and compile the file myprog.f
using KAP switches for general optimization and to specify the
name of the executable file with the Digital Fortran compiler
switch, -o
, use the following command:
kf77 -fkapargs='-optimize=5 -roundoff=3 -scalaropt=3' -o=myprog.exe myprog.f
The following files result:
myprog.cmp.f
- the optimized source file
myprog.out
- the annotated source file
myprog.exe
- the executable file renamed
with the -o
switch
The kf77
command specifies the Digital Fortran
compiler switches -notransform_loops
, -
tune host
, and -fast
, by default. To
override any of the individual compiler switches encompassed
by -fast
, specify them on the kf77
command line. For example, the following command sets the
compiler switch -math_library accurate
and
overrides the default -math_library fast
set by
-fast
:
kf77 -math_library accurate myprog.f
For information about the -fast
compiler switch, see
the Digital Fortran User's Guide.
The kf77
command specifies the Digital UNIX
default linker switch -non_shared
. The
-non_shared
switch causes the image to be linked
with archive libraries instead of with shared libraries.
To override the -non_shared
default, specify
-call_shared
on the command line, for example:
kf77 -call_shared myprog.f