Get Started with the Intel® oneAPI Base Toolkit and Intel oneAPI HPC Toolkit for macOS*

Configure Your CPU System

Intel® oneAPI Base Toolkit and Intel® oneAPI HPC Toolkit

Set Environment Variables for CLI Development

For working at a Command Line Interface (CLI), the tools in the oneAPI toolkits are configured via environment variables. Set up your CLI environment by sourcing the setvars script:

Option 1: Source setvars.sh once per session

Source setvars.sh every time you open a new terminal window:

You can find the setvars.sh script in the root folder of your oneAPI installation, which is typically /opt/intel/oneapi/ for sudo or root users and ~/intel/oneapi/ when installed as a normal user.

For root or sudo installations:

. /opt/intel/oneapi/setvars.sh

For normal user installations:

. ~/intel/oneapi/setvars.sh

Option 2: One time setup for setvars.sh

To have the environment automatically set up for your projects, include the command source <install_dir>/setvars.sh in a startup script where it will be invoked automatically (replace <install_dir> with the path to your oneAPI install location). The default installation locations are /opt/intel/oneapi/ for sudo or root users and ~/intel/oneapi/ when installed as a normal user.

For example, you can add the source <install_dir>/setvars.sh command to your ~/.bashrc or ~/.bashrc_profile or ~/.profile file. To make the settings permanent for all accounts on your system, create a one-line .sh script in your system's /etc/profile.d folder that sources setvars.sh (for more details, see Ubuntu documentation on Environment Variables).

The setvars.sh script can also be managed using a configuration file. For more details, see Using a Configuration File to Manage Setvars.sh.

For Visual Studio Code Users, Install the Sample Browser Extension

You can browse and download samples in Visual Studio Code using the Sample Browser extension:

  1. From Visual Studio Code, click on the Extensions logo in the left navigation.

  2. Locate the extension titled Sample Browser for Intel oneAPI Toolkits, or visit https://marketplace.visualstudio.com/publishers/intel-corporation to browse available extensions.
  3. Click Install.
  4. After the extension installs, close VS Code. The directions in the Build and Run a Sample section will show you how to launch VS Code so that the environment variable are set correctly.

Next Step

Run a sample project using one of these methods: