Intel® oneAPI DPC++/C++ Compiler Developer Guide and Reference

ID 767253
Date 11/07/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

General Rules for Compiler Options

This section describes general rules for compiler options and it contains information about how we refer to compiler option names in descriptions.

  • Compiler options may be case sensitive, and may have different meanings depending on their case. For example, option c prevents linking, but option C places comments in preprocessed source output.

  • Options specified on the command line apply to all files named on the command line.

  • Options can take arguments in the form of file names, strings, letters, or numbers. If a string includes spaces, the string must be enclosed in quotation marks.

  • Compiler options can appear in any order.

  • Unless you specify certain options, the command line will both compile and link the files you specify.

  • You can abbreviate some option names, entering as many characters as are needed to uniquely identify the option.

  • Certain options accept one or more keyword arguments following the option name. For example, architecture option x option accepts several keywords.

  • To specify multiple keywords, you typically specify the option multiple times.

  • To disable an option, specify the negative form of the option if one exists.

  • If there are enabling and disabling versions of an option on the command line, the last one on the command line takes precedence.

  • Compiler options remain in effect for the whole compilation unless overridden by a compiler #pragma.

  • Linux

    You cannot combine options with a single dash. For example, this form is incorrect: -Ec; this form is correct: -E -c

  • Windows

    You cannot combine options with a single slash. For example: This form is incorrect: /Ec; this form is correct: /E /c

  • All compiler options must precede /link options, if any, on the command line.

  • Compiler options remain in effect for the whole compilation unless overridden by a compiler #pragma.

  • You can sometimes use a comma to separate keywords. For example, the following is valid:

    ifort /warn:usage,declarations test.f90
  • You can disable one or more optimization options by specifying option /Od last on the command line.

    NOTE:

    The /Od option is part of a mutually-exclusive group of options that includes /Od, /O1, /O2, /O3, and /Ox. The last of any of these options specified on the command line will override the previous options from this group.

How We Refer to Compiler Option Names in Descriptions

Within documentation, compiler option names that are very different are spelled out in full.

However, many compiler option names are very similar except for initial characters. For these options, we use the following shortcuts when referencing their names in descriptions:

  • No initial – or /

    This shortcut is used for option names that are the same for Linux and Windows except for the initial character.

    For example, Fa denotes:

    • Linux: -Fa

    • Windows: /Fa

  • [Q]option-name

    This shortcut is used for option names that only differ because the Windows form starts with a Q.

    For example, [Q]ipo denotes:

    • Linux: -ipo

    • Windows: /Qipo

  • [q or Q]option-name

    This shortcut is used for option names that only differ because the Linux form starts with a q and the Windows form starts with a Q.

    For example, [q or Q]opt-report denotes:

    • Linux: -qopt-report

    • Windows: /Qopt-report