Installing Intel oneAPI Framework
Intel provides a streamlined installation process for the oneAPI Base Toolkit, which includes the compiler and all necessary frameworks for high-performance computing, including oneMKL for optimized matrix operations.
Installation Steps
-
Download the Installer Visit the Intel oneAPI Base Toolkit download page.
- Select the appropriate settings for your system (Linux/macOS/Windows).
- The website will generate a
.shinstallation script tailored to your configuration.
-
Run the Installer Execute the downloaded script with
sudoprivileges to ensure a system-wide installation:sudo ./your-downloaded-script.sh- Note: Without
sudo, the libraries will be installed locally (e.g.,/usr/local). My CMake configuration assumes a global installation (typically/opt/intel/oneapi). If you prefer a local install, you'll need to adjust the CMake paths accordingly.
- Note: Without
-
Verify Installation After installation, confirm the toolkit is available by running:
source /opt/intel/oneapi/setvars.sh icpx --version
You should see:
Intel(R) oneAPI DPC++/C++ Compiler <version>
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /opt/intel/oneapi/compiler/2025.3/bin/compiler
Configuration file: /opt/intel/oneapi/compiler/2025.3/bin/compiler/../icpx.cfg
Additional Step: Linux Only
The Intel oneAPI environment variables are not sourced automatically after installation. To simplify your workflow, you can add the following alias to your .bashrc or .zshrc file:
alias oneAPI='source /opt/intel/oneapi/setvars.sh --include-intel-llvm'
Usage
After adding the alias, reload your shell configuration:
source ~/.bashrc # or source ~/.zshrc
Now, you can enable the oneAPI environment anytime by running:
oneAPI
Alternative: Auto-Source on Shell Startup
If you prefer to source the environment variables automatically for every new shell session, add this line to your .bashrc or .zshrc:
source /opt/intel/oneapi/setvars.sh --include-intel-llvm > /dev/null