User Guide

  • 2022.2
  • 04/11/2022
  • Public Content

Set the oneAPI Environment by Manually Running Setvars

Using Visual Studio Code* with Intel® oneAPI Toolkits
The oneAPI Environment can be automatically run using the VS Code
Environment and Launch Configurator for Intel oneAPI Toolkits
extension. For more information on extensions that work with Intel® oneAPI Toolkits, see Using the Environment Set up and Launch Configuration Extension.
As an alternative, you can manually run setvars:
  1. Navigate to the install directory and source
    setvars.sh
    .
    source <install_dir>/setvars.sh
    The command above assumes you installed to the default folder. If you customized the installation folder,
    setvars.sh
    is in your custom folder. See here for more information on setvars.sh.
  2. Launch VS Code:
    code
To run
setvars
for Windows*:
  1. From a terminal window, run
    setvars.bat
    .
    "C:\Program Files (x86)\Intel\oneAPI\setvars.bat"
    The command above assumes you installed to the default folder. If you customized the installation folder,
    setvars.bat
    is in your custom folder.
  2. From the same terminal window, launch VS Code:
    "C:\Users\<username>\AppData\Local\Programs\Microsoft VS Code\Code.exe"
    For Windows PowerShell* users, execute this command: .. code-block:: bash
    cmd.exe “/K” ‘“C:Program Files (x86)InteloneAPIsetvars.bat” && powershell’ code

Product and Performance Information

1

Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.