HP Fortran Programmer's Guide (March 2010)

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.
-Uname Remove any initial definition of name, a reserved
symbol that is predefined by the preprocessor.