2.7 Compiling a Program Using kapf

Use the following command to execute KAP as a standalone preprocessor:

kapf [kap_switch_string] myprog.f -cmp=myprog.cmp.f

Precede switch names with a hyphen (-) and always use lowercase. You can use standard abbreviations for switch names. Switches can appear before or after the input file name. For example:

kapf -inm  myprog.f  -roundoff=2 -cmp=myprog.cmp.f

After preprocessing your program, give myprog.cmp.f to the compiler, as follows:

f77 -fast -tune host -non_shared myprog.cmp.f

The -fast switch sets the compiler optimization level to -O4 . If you override the -fast default and set the compiler optimization level to -O5 , you must also set the following KAP and compiler switches:


-unroll=1 - KAP switch
-notransform_loops - Digital Fortran compiler switch that turns off the compiler's loop transform capabilities

See Section 4.5.21 for more information about the -unroll switch.


Note
When you use kapf to process a file, you must set the Digital Fortran compiler and linker switches appropriately. For this reason, Digital recommends that you use kf77 whenever possible, as kf77 automatically sets the compiler and linker switches correctly.


Previous Page | Next Page | Contents | Index |
Command Line Switches