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

ID 766895
Date 12/16/2022
Public

A newer version of this document is available. Customers should click here to go to the newest version.

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 system wide installation and ~/intel/oneapi/ when installed as a private installation. Note that system wide installation requires root or sudo privileges.

For system wide installations:

. /opt/intel/oneapi/setvars.sh

For private installations:

. ~/intel/oneapi/setvars.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