User Guide

  • 2021.2
  • 04/12/2021
  • Public Content

Using the Environment and Launch Configurator Extension

The Environment and Launch Configuration for Intel® oneAPI Toolkits Extension is a lightweight extension that provides control of the oneAPI development environment and makes it easier to configure oneAPI projects for build, run, and debug.
To install the extension:
  1. Open the Extension Marketplace in VS Code and search for
    oneAPI
    .
  2. Install the extension titled
    Environment and Launch Configurator for Intel oneAPI Toolkits
    .

Set oneAPI Environment

With this extension, you can set your environment from VS Code instead of running setvars:
  1. Press Ctrl+Shift+P ( or View -> Command Palette… ) to open the Command Palette.
  2. Type
    Intel oneAPI
    to view options of the installed extensions.
  3. Click on
    Intel oneAPI: Set oneAPI environment
    . All tasks, launches, and terminals created from VS Code will now contain the oneAPI environment.
Now that your environment is set, you may want to run a sample project locally, over SSH or in a container, or continue reading this page to learn more about the Environment and Launch Configurator Extension.
When you have completed working on your oneAPI project and want to remove the oneAPI environment, select open the Command Palette again and select
Unset oneAPI environment
.

Preparing Tasks

This extension enables the ability to prepare tasks from make or cmake files:
  1. Using the VS Code explorer, click
    File>Open Folder
    .
  2. Navigate to the folder where your project is located and click
    OK
    .
  3. Press
    Ctrl+Shift+P
    ( or View -> Command Palette… ) to open the Command Palette.
  4. Type
    Intel oneAPI
    and select
    Intel oneAPI: Generate tasks
    .
  5. Follow the prompts to add targets from your make/cmake oneAPI project.
  6. Run the target by selecting
    Terminal > Run task...
    .
  7. Select the task to run.

Prepare Launch Configuration

This extension enables the ability to prepare launch configurations for running and debugging projects created using Intel oneAPI toolkits:
  1. Using the VS Code explorer, click
    File>Open Folder
    .
  2. Navigate to the folder where your project is located and click
    OK
    .
  3. Press
    Ctrl+Shift+P
    ( or View -> Command Palette… ) to open the Command Palette.
  4. Type
    Intel oneAPI
    and select
    Intel oneAPI: Generate launch configurations
    .
  5. Follow the prompts to add launch configurations.
  6. Using the VS Code Explorer, open the C++ file for your project.
  7. The configuration is now available to debug and run using the gdb-oneapi debugger. To debug and run, click on the Run icon or press
    Ctrl+Shift+D
    .

How to Use IntelliSense for Code Developed with Intel oneAPI Toolkits

  1. Make sure that the C/C++ extension is already installed.
  2. Press Ctrl+Shift+P and click on C/C++ Edit Configurations (JSON) . As a result, a c_cpp_properties.json file will be created in .vscode folder.
  3. Edit the file so that it looks like in the example:
    { "configurations": [ { "name": "Linux", "includePath": [ "${workspaceFolder}/**", "/opt/intel/oneapi/**" ], "defines": [], "compilerPath": /opt/intel/oneapi/compiler/latest/linux/bin/dpcpp", "cStandard": "c17", "cppStandard": "c++17", "intelliSenseMode": "linux-clang-x64" } ], "version": 4 }
    If necessary, replace the path to the oneAPI components with the one that is relevant for your installation folder.

Product and Performance Information

1

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