Get Started with the Intel® oneAPI Base Toolkit for Linux*

ID 766893
Date 3/31/2023
Public

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

Configure Your FPGA System

NOTE:
If you are working with a CPU or GPU system, see Configure Your CPU or GPU System.

Install CMake*, pkg-config, and GNU* Dev Tools to Build Samples

Although the CMake and pkg-config build tools are not required by the oneAPI tools and toolkits, many oneAPI samples are provided as CMake projects and require CMake to build them. In some cases pkg-config is necessary to locate libraries needed to complete a build of the application.

The Intel compilers utilize the existing GNU build toolchains to provide a complete C/C++ development environment. If your distribution of Linux does not include the complete suite of GNU development tools, you need to install these tools.

To install CMake, pkg-config, and the GNU development tools on your Linux system, open a terminal session and enter the following commands:

Ubuntu*

sudo apt update
sudo apt -y install cmake pkg-config build-essential

Red Hat* and Fedora*

sudo yum update
sudo yum -y install cmake pkgconfig
sudo yum groupinstall "Development Tools"

SUSE*

sudo zypper update
sudo zypper --non-interactive install cmake pkg-config
sudo zypper --non-interactive install pattern devel_C_C++

Verify the installation by displaying the installation location with this command:

which cmake pkg-config make gcc g++

One or more of these locations will display:

/usr/bin/cmake

/usr/bin/pkg-config

/usr/bin/make

/usr/bin/gcc

/usr/bin/g++

For more information about CMake, refer to CMake.org. If you are unable to install CMake using your Linux distribution's standard package manager, see the CMake.org downloads page for additional installation options.

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 setvars.sh 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 Using a Configuration File to Manage Setvars.sh.. If you need to setup the environment in a non-POSIX shell, seeoneAPI Development Environment Setup for more configuration options.

Run a Sample Project

Run a sample project using the Command Line or using Eclipse*.