Compilation Overview

Compilation Environment

You can customize the environment used during compilation using a combination of

You can also modify the compilation by adding additional include directories for the compiler to search during compilation. See Specify Compiler Files for more information.

Default Compiler Behavior

The Intel® oneAPI DPC++/C++ Compiler processes C/C++ and SYCL source files. Compilation can be divided into these major phases: :

By default, the compiler performs the first four phases of compilation and then invokes the linker to perform the linking phase. The default linkers are ld for Linux and link for Windows.

Default settings for the compiler include:

Customize the Compilation Process

The Intel® oneAPI DPC++/C++ Compiler provides multiple options to customize compilation.

Preprocessing

Several options are available to customize preprocessing. For example, you can:

You can optionally use your own preprocessor to generate a preprocessed file which can then be passed to the compiler.

For a detailed list of preprocessing options, see Preprocessor Options.

Compiling

Compiler options are not required to compile your program, but can be used to control different aspects of your application, such as:

For a detailed list of all compiler options, see Compiler Options.

Linking

You can perform the linking phase using the Intel compiler to invoke the linker (default) or by calling the linker directly.

Note

On Linux, calling the linker directly requires explicit understanding of which specific system and Intel libraries need to be linked in, as they will need to be passed directly to the linker.

To prevent default linking at compilation time, use the -c option. You must then explicitly pass along the generated object on the compilation command line and the compiler will create the final binary.

You can pass options to the linker for additional control of the linking phase. See Pass Options to the Linker for additional information.

See Also