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

ID 766895
Date 11/07/2023
Public

Configure Your CPU System

Intel® oneAPI Base Toolkit and Intel® HPC Toolkit

Set Environment Variables for CLI Development

The Unified Directory Layout was implemented in 2024.0. If you have multiple toolkit versions installed, the Unified layout adds the ability to ensure your development environment contains the component versions that were released as part of that specific toolkit version.

The directory layout that was used prior to 2024.0 is still supported on new and existing installations. This prior layout is called the Component Directory Layout. Now you have the option to use the Component Directory Layout or the Unified Directory Layout.

Environment variables are set up with a script called setvars or oneapi-vars, depending on which layout you are using.

To understand more about the Unified Directory Layout, including how the environment is initialized and the advantages of using the layout, see Use the setvars and oneapi-vars Scripts with Linux *.

Set up your CLI environment:

Option 1: Source setvars.sh once per session

Source setvars.sh | oneapi-vars.sh every time you open a new terminal window:

Component Directory Layout

For system wide installations:

. /opt/intel/oneapi/setvars.sh

For private installations:

. ~/intel/oneapi/setvars.sh

Unified Directory Layout

For system wide installations:

. /opt/intel/oneapi/<toolkit-version>/oneapi-vars.sh

For private installations:

. ~/intel/oneapi/<toolkit-version>/oneapi-vars.sh

Option 2: One time setup for setvars.sh

Environment variables can be set up to automatically set using one of the methods below:

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 system wide installations and ~/intel/oneapi/ for private installations.

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).

NOTE:

The script can be managed using a configuration file, which is especially helpful if you need to initialize specific versions of libraries or the compiler, rather than defaulting to the "latest" version. For more details, see oneAPI Development Environment Setup for more configuration options.

Next Step

Run a sample project using Command Line