The kfort
command invokes a driver program
that automatically calls KAP, the Digital Fortran compiler, and the
linker.
kfort
Because kfort
calls KAP and the Digital Fortran
compiler, you can substitute the kfort
command for
the Fortran command. For example, to use kfort
to
compile myprog.f
with the default KAP qualifier
settings, use the command:
kfort myprog.f
The kfort
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 in the current directory:
myprog_cmp.f
- the optimized source file
myprog.out
- the annotated source file
showing default KAP qualifier settings
myprog.obj
- the object file
myprog.exe
- an executable file
To cause KAP to generate an executable file with a name you
specify, use the /executable
qualifier as follows:
kfort /executable=my_prog
my_prog.exe
results.
kfort
inserts /executable
in front of
the first file name it sees. For example, the following command
line produces one executable named file_1.exe
.
kfort /fkapargs=(/conc/ur=1) file_1.f file_2.f file_3.f
To see a list of the KAP qualifiers and Digital Fortran compiler
qualifiers passed by kfort
, use the
/verbose
qualifier as follows:
kfort /fkapargs=(/verbose) myprog.f
An example of the output is as follows:
kapf /cmp=myprog_cmp.f myprog.f /natural KAP/Digital_VMS_F V3.1 k271625 970317 04-Apr-1997 13:16:07 0 errors in file myprog.f Issuing the compiler command: for/fast/optimize=(tune=host,level=5) myprog_cmp.f issuing link command: link /EXECUTABLE=myprog.exe myprog_cmp.obj
kfort
The /fkapargs
qualifier specifies one or more
KAP command qualifiers to the preprocessor. For example,
to use kfort
to optimize and compile the file
myprog.f
using KAP qualifiers for general
optimization, use the command:
kfort /fkapargs=(/optimize=5/roundoff=3/scalaropt=3/list=myprog_annotated.out) - myprog.f
The following files result:
myprog_cmp.f
- the optimized source file
myprog_annotated.out
- the annotated
source file renamed by the /list
qualifier
myprog.obj
- the object file
myprog.exe
- the executable file
For descriptions of all KAP command qualifier, see Chapter 4.
kfort
Any command-line qualifier that is valid for the Digital Fortran
compiler or the linker is valid for the kfort
command. You can specify compiler qualifiers and KAP qualifiers
on the same line, as follows:
kfort /fkapargs=(/optimize=5/roundoff=3/scalaropt=3)/nowarn myprog.f
The kfort
command specifies the Digital Fortran
compiler qualifiers /optimize=(tune=host,level=5)
, /natural
, and /fast
by default. To
override any of the individual compiler qualifiers encompassed
by /fast
, specify them on the kfort
command line. For example, the following command sets the
compiler qualifier /math_library=accurate
and
overrides the default /math_library=fast
set by
/fast
:
kfort /math_library=accurate myprog.f
For information about the /fast
compiler qualifier,
see the Digital Fortran User Manual.
The /optimize=(tune=host,level=5)
qualifier causes
the compiler to optimize to the host architecture. For example, if
you want to optimize for the ev5
architecture but are
compiling on an ev4
system, you should override the
default setting of the /tune
qualifier, as follows:
kfort /optimize=(tune=ev4,level=4) myprog.f