2.3 Compiling a Program Using the kfort Driver

The kfort command invokes a driver program that automatically calls KAP, the Fortran compiler, and the linker.

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

The kfort command specifies the linker qualifiers /lpthread and /non_shared by default. The /non_shared qualifier causes the image to be linked with archive libraries instead of with shared libraries, often resulting in faster execution at run time. To override the /non_shared default, specify /call_shared on the command line, for example:

kfort /call_shared myprog.f

The kfort driver accepts either Fortran or Fortran 77 source input. The exception is the Fortran compiler rejects comment lines beginning with C as syntax errors. Like the fort command, the kfort command assumes by default that source files with an extension of .f90 are free format, and source files with an extension of .f , .for , or .FOR are fixed format. You can override these defaults by using a format-related qualifier with either the KAP preprocessor or with the Fortran compiler. The format-related compiler qualifiers are /free and /fixed . The corresponding KAP preprocessor qualifiers are /freeformat and /nofreeformat . Table 2-1 lists combinations of qualifiers and file extensions and the resulting assumption KAP makes about the format of the source file.

Table 2-1 kfort Assumed Source Format Based on Qualifiers and File Extensions

Qualifiers
 
Source File Extension
 
KAP  F90  .f90  .f,.for,.FOR 
default  default  free  fixed 
/freeformat  default  free  free 
/nofreeformat  default  fixed  fixed 
default  /free  free  free 
default  /fixed  fixed  fixed 
/freeformat  /fixed  KAP issues error message 
/nofreeformat  /free  KAP issues error message 

For more information about the /[no]freeformat qualifier, see Section 5.3.7. For more information about the /free and /fixed qualifiers, see the Compaq Fortran User Manual for OpenVMS Alpha Systems.


Previous Page | Next Page | Contents | Index |
Command-Line Qualifiers

Copyright © Digital Equipment Corporation. 1999. All Rights Reserved.