Development Reference Guides


Specify the Location of Compiler Components

Before you invoke the compiler, you may need to set certain environment variables that define the location of compiler-related components. The
Intel® oneAPI
includes environment configuration scripts to configure your build and development environment variables:
  • On Linux*, the file is a shell script called
  • On Windows*, the file is a batch file called
The following information is operating system dependent.
Intel oneAPI
is designed and tested only for use on 64-bit Linux and Windows operating systems, 32-bit operating systems are not supported. Additionally, the macOS* operating system is not supported by the compiler.


Set the environment variables before using the compiler by sourcing the shell script
. Depending on the shell, you can use the
command or a
(dot) to source the shell script, according to the following rule for a
source /<install-dir>/ <arg1> <arg2> … <argn> . /<install-dir>/ <arg1> <arg2> … <argn> # examples: (assuming <install-dir> is /opt/intel/oneapi) prompt> source /opt/intel/oneapi/ intel64 prompt> . /opt/intel/oneapi/ intel64
source /<install-dir>/ --help
for more setvars usage information.
The compiler environment script file accepts an optional target architecture argument
  • intel64
    : Generate code and use libraries for Intel® 64 architecture-based targets.
  • ia32
    : Generate code and use libraries for IA-32 architecture-based targets.
If you want the
script to run automatically in all of your terminal sessions, add the source
command to your startup file. For example, inside your
entry for Intel® 64 architecture targets:
# set environment vars for Intel® oneAPI DPC++/C++ Compiler source <install-dir>/ intel64
If the proper environment variables are not set, errors similar to the following may appear when attempting to execute a compiled program:
# for C++ ./a.out: error while loading shared libraries: cannot open shared object file: No such file or directory
# for DPC++ ./a.out: error while loading shared libraries: cannot open shared object file: No such file or directory


Under normal circumstances, you do not need to run the setvars.bat batch file. The terminal shortcuts in the Windows
Intel oneAPI command prompt for <target architecture> for Visual Studio <year>
, set these variables automatically.
For additional information, see Using the Command Line on Windows.
You need to run the setvars batch file if a command line is opened without using one of the provided
Command Prompt
menu items in the
menu, or if you want to use the compiler from a script of your own.
The setvars batch file inserts DLL directories used by the compiler and libraries at the beginning of the existing
. Because these directories appear first, they are searched before any directories that were part of the original
provided by Windows (and other applications). This is especially important if the original
includes directories with files that have the same names as those added by the compiler and libraries.
The setvars batch file takes multiple optional arguments; the following two arguments are recognized for compiler and library initialization:
<install-dir>\setvars.bat [<arg1>] [<arg2>]
is optional and can be one of the following:
  • intel64
    : Generate code and use libraries for Intel® 64 architecture (host and target).
  • ia32
    : Generate code and use libraries for IA-32 architecture (host and target).
With the
by default.
is optional. If specified, it is one of the following:
  • vs2022
    : Microsoft Visual Studio* 2022
  • vs2019
    : Microsoft Visual Studio 2019
  • vs2017
    : Microsoft Visual Studio 2017
    Support for Microsoft Visual Studio 2017 is deprecated as of the Intel® oneAPI 2022.1 release, and will be removed in a future release.
is not specified, the script uses the
argument by default. If
is not specified, the script uses the highest installed version of Microsoft Visual Studio detected during the installation procedure.

Product and Performance Information


Performance varies by use, configuration and other factors. Learn more at