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

ID 767253
Date 9/08/2022
Public

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

Document Table of Contents

Supported Environment Variables

You can customize your system environment by specifying paths where the compiler searches for certain files such as libraries, include files, configuration files, and certain settings.

Compiler Compile-Time Environment Variables

The following table shows the compile-time environment variables that affect the compiler:

Compile-Time Environment Variable

Description

CL (Windows)

_CL_ (Windows)

Define the files and options you use most often with the CL variable. Note: You cannot set the CL environment variable to a string that contains an equal sign. You can use the pound sign instead. In the following example, the pound sign (#) is used as a substitute for an equal sign in the assigned string: SET CL=/Dtest#100

ICXCFG

Specifies the configuration file for customizing compilations when invoking the compiler using icx. Used instead of the default configuration file.

ICPXCFG

Specifies the configuration file for customizing compilations when invoking the compiler using icpx. Used instead of the default configuration file.

__INTEL_PRE_CFLAGS

__INTEL_POST_CFLAGS

Specifies a set of compiler options to add to the compile line.

This is an extension to the facility already provided in the compiler configuration file icx.cfg.

NOTE:
By default, a configuration file named icx.cfg (Windows, Linux), or icpx.cfg (Linux) is used. This file is in the same directory as the compiler executable. To use another configuration file in another location, you can use the ICXCFG (Windows, Linux), ICPXCFG (Linux) environment variable to assign the directory and file name for the configuration file.

You can insert command line options in the prefix position using __INTEL_PRE_CFLAGS , or in the suffix position using __INTEL_POST_CFLAGS. The command line is built as follows:

Syntax:icx <PRE flags> <flags from configuration file> <flags from the compiler invocation> <POST flags>

NOTE:
The driver issues a warning that the compiler is overriding an option because of an environment variable, but only when you include the option /W5 (Windows) or -w3 (Linux).

PATH

Specifies the directories the system searches for binary executable files.

NOTE:
On Windows, this also affects the search for Dynamic Link Libraries (DLLs).

NOTE:
INTEL_ROOT is an environment variable that is reserved for the Intel® Compiler. Its use is not supported.

Compiler Runtime Environment Variables

The following table summarizes compiler environment variables that are recognized at runtime.

Runtime Environment Variable

Description

GNU extensions (recognized by the Intel OpenMP* compatibility library)

GOMP_CPU_AFFINITY (Linux)

GNU extension recognized by the Intel OpenMP compatibility library. Specifies a list of OS processor IDs.

You must set this environment variable before the first parallel region or before certain API calls including omp_get_max_threads(), omp_get_num_procs() and any affinity API calls. For detailed information on this environment variable, see Thread Affinity Interface.

Default: Affinity is disabled

GOMP_STACKSIZE (Linux)

GNU extension recognized by the Intel OpenMP compatibility library. Same as OMP_STACKSIZE.KMP_STACKSIZE overrides GOMP_STACKSIZE, which overrides OMP_STACKSIZE.

Default: See the description for OMP_STACKSIZE.

OpenMP Environment Variables (OMP_) and Extensions (KMP_)

OMP_CANCELLATION

Activates cancellation of the innermost enclosing region of the type specified. If set to TRUE, the effects of the cancel construct and of cancellation points are enabled and cancellation is activated. If set to FALSE, cancellation is disabled and the cancel construct and cancellation points are effectively ignored.

NOTE:

Internal barrier code will work differently depending on whether the cancellation is enabled. Barrier code should repeatedly check the global flag to figure out if the cancellation had been triggered. If a thread observes the cancellation it should leave the barrier prematurely with the return value 1 (may wake up other threads). Otherwise, it should leave the barrier with the return value 0.

Enables (TRUE) or disables (FALSE) cancellation of the innermost enclosing region of the type specified.

Default: FALSE

Example: OMP_CANCELLATION=TRUE

The following table summarizes CPU environment variables that are recognized at runtime.

Runtime configuration

Default value

Description

CL_CONFIG_CPU_FORCE_PRIVATE_MEM_SIZE

32KB

Forces CL_DEVICE_PRIVATE_MEM_SIZE for the CPU device to be the given value. The value must include the unit; for example: 8MB, 8192KB, 8388608B.

NOTE:
You must compile your host application with sufficient stack size.

CL_CONFIG_CPU_FORCE_LOCAL_MEM_SIZE

32KB

Forces CL_DEVICE_LOCAL_MEM_SIZE for CPU device to be the given value. The value needs to be set with size including units, examples: 8MB, 8192KB, 8388608B.

NOTE:
You must compile your host application with sufficient stack size. Our recommendation is to set the stack size equal to twice the local memory size to cover possible application and OpenCL Runtime overheads.

CL_CONFIG_CPU_EXPENSIVE_MEM_OPT

0

A bitmap indicating enabled expensive memory optimizations. These optimizations may lead to more JIT compilation time, but give some performance benefit.

NOTE:
Currently, only the least significant bit is available.

Available bits:

  • 0: OpenCL address space alias analysis

CL_CONFIG_CPU_STREAMING_ALWAYS

False

Controls whether non-temporal instructions are used.


See Also