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

 

Specifies the configuration file for customizing compilations when invoking the compiler using .

 

Specifies the configuration file for customizing compilations when invoking the compiler using .

ICXCFG

Specifies a configuration file, which the compiler should use instead of the default configuration file.

PATH

Specifies the directories the system searches for binary executable files.

Note

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

TMP

TMPDIR

TEMP

Specifies the location for temporary files. If none of these are specified, or writeable, or found, the compiler stores temporary files in /tmp (Linux) or the current directory (Windows).

The compiler searches for these variables in the following order: TMP, TMPDIR, and TEMP.

Note

On Windows, these environment variables cannot be set from Visual Studio.

LD_LIBRARY_PATH (Linux)

Specifies the location for shared objects (.so files).

INCLUDE (Windows)

Specifies the directories for the source header files (include files).

LIB (Windows)

Specifies the directories for all libraries used by the compiler and linker.

GNU Environment Variables and Extensions

CPATH (Linux)

Specifies the path to include directory for C/C++ compilations.

C_INCLUDE_PATH (Linux)

Specifies path to include directory for C compilations.

CPLUS_INCLUDE_PATH (Linux)

Specifies path to include directory for C++ compilations.

DEPENDENCIES_OUTPUT (Linux)

Specifies how to output dependencies for make based on the non-system header files processed by the compiler. System header files are ignored in the dependency output.

GCC_EXEC_PREFIX (Linux)

Specifies alternative names for the linker (ld) and assembler (as).

GCCROOT (Linux)

Specifies the location of the GCC* binaries.

GXX_INCLUDE (Linux)

Specifies the location of the GCC headers. Set this variable to specify the locations of the GCC installed files.

GXX_ROOT (Linux)

Specifies the location of the GCC binaries. Set this variable to specify the locations of the GCC installed files.

LIBRARY_PATH (Linux)

Specifies the path for libraries to be used during the link phase.

SUNPRO_DEPENDENCIES (Linux)

This variable is the same as DEPENDENCIES_OUTPUT, except that system header files are not ignored.

Note

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