HP Fortran Programmer's Guide (B3908-90031; September 2011)

An overview of HP Fortran
C preprocessor
Chapter 16
C preprocessor
HP Fortran source files can include directives that the C preprocessor (cpp) reads and expands before the
program is passed to the compiler. Among other things, cpp directives enable you to code parts of your
program for conditional compilation. By default, the f90 command passes source files ending in the.F
extension to the C preprocessor.
Table 1-2 lists and briefly describes the options for controlling the preprocessor, including the +cpp option,
which overrides the default behavior and passes all source files on the command line to the preprocessor. For
additional information, see “Using the C preprocessor” on page 90 and the cpp(1) man page.
Table 1-2 Options for controlling the C preprocessor
Option Function
+cpp={yes|no|default} Invoke the C preprocessor. +cpp=yes passes all source
files to the preprocessor. +cpp=default passes only files
ending in the .F extension. +cpp=no suppresses passing
any files. The default is +cpp=default.
+[no]cpp_keep Retain [discard] output from the C preprocessor. If the
source filename is file.f or file.F, output is stored in
file.i; if the source filename is file.f90, the output
filename is file.i90. The default, +nocpp_keep, is to
discard the output.
-Dname[=def] Define the symbol name to the preprocessor. If def is
specified, name is defined to that value.
-Idirectory Add directory to the list of directories searched for files
specified in include directives. The command line can have
multiple occurrences of this option, each specifying a
different directory.
-M Generate the make rule corresponding to the compilation,
the output is redirected to the stdout or user specified
file. The rule describes the dependencies of the source file,
containing the object file name for that source file, a colon,
and the names of all the included files.
-Uname Remove any initial definition of name, a reserved symbol
that is predefined by the preprocessor.