-qdirective

Category

Input control

Purpose

Specifies sequences of characters, known as trigger constants, that identify comment lines as compiler comment directives.

A compiler comment directive is a line that is not a Fortran statement but is recognized and acted on by the compiler.

Format

Read syntax diagramSkip visual syntax diagram
        .-nodirective--+-------------------+-.   
        |              '-=--directive_list-' |   
>>- -q--+-directive--+-------------------+---+-----------------><
                     '-=--directive_list-'       

@PROCESS:

@PROCESS DIRECTIVE[(directive_list)] | NODIRECTIVE[(directive_list)]

Defaults

The compiler recognizes the default trigger constant IBM*.

Specifying -qsmp implies -qdirective=smp\$:\$omp:ibmp, and, by default, the trigger constants SMP$, $OMP, and IBMP are also turned on. If you specify -qsmp=omp, the compiler ignores all trigger constants that you have specified up to that point and recognizes only the $OMP trigger constant. Specifying -qthreaded implies -qdirective=ibmt, and, by default, the trigger constant IBMT is also turned on.

Parameters

The -qnodirective option with no directive_list turns off all previously specified directive identifiers; with a directive_list, it turns off only the selected identifiers.

-qdirective with no directive_list turns on the default trigger constant IBM* if it has been turned off by a previous -qnodirective.

Usage

Note the following:
  • Multiple -qdirective and -qnodirective options are additive; that is, you can turn directive identifiers on and off again multiple times.
  • One or more directive_lists can be applied to a particular file or compilation unit; any comment line beginning with one of the strings in the directive_list is then considered to be a compiler comment directive.
  • The trigger constants are not case-sensitive.
  • The characters (, ), ', ", :, =, comma, and blank cannot be part of a trigger constant.
  • To avoid wildcard expansion in trigger constants that you might use with these options, you can enclose them in single quotation marks on the command line. For example:
    xlf95 -O3 -qhot -qcache=type=D:level=1 -qdirective='dbg*' -qnodirective='IBM*' directives.f
  • This option only affects Fortran directives that the XL Fortran compiler provides, not those that any preprocessors provide.
  • As the use of incorrect trigger constants can generate warning messages, error messages, or both, you should check the particular directive statement for the suitable associated trigger constant.

Examples

! This program is written in Fortran free source form.
PROGRAM DIRECTV
INTEGER A, B, C, D, E, F
A = 1 ! Begin in free source form.
B = 2
!OLDSTYLE SOURCEFORM(FIXED)
! Switch to fixed source form for this include file.
      INCLUDE 'set_c_and_d.inc'
!IBM* SOURCEFORM(FREE)
! Switch back to free source form.
E = 5
F = 6
END

For this example, compile with the option -qdirective=oldstyle to ensure that the compiler recognizes the SOURCEFORM directive before the INCLUDE line. After processing the include-file line, the program reverts back to free source form, after the SOURCEFORM(FREE) statement.