Install Intel oneAPI C++ and Fortran compiler

Intel oneAPI is a cross-platform toolset that covers several programming languages including C, C++, Fortran and Python. Intel oneAPI replaces Intel Parallel Studio. Intel oneAPI including the Fortran compiler is free-to-use and no login is required to download oneAPI.

Refer to the oneAPI install guide to download the oneAPI Fortran compiler for Linux or Windows. oneAPI for MacOS is a distinct install procedure. We suggest using the “online installer” download, which is a small download. The “online” installer can be copied over SSH to your HPC user account for example and installed from the Terminal.

Windows requires Visual Studio Community to be installed first–IDE integration is optional and we don’t use it.

Install the oneAPI Base Toolkit with options:

  • Math Kernel Library (oneMKL)
  • (optional) GDB debugger

Install the oneAPI HPC toolkit with options:

  • Intel MPI library
  • Intel C++ compiler
  • Intel Fortran compiler


There are slightly distinct usage patterns to access Intel oneAPI compilers on Windows vs. Mac/Linux.

On Windows a Start menu shortcut for a oneAPI command prompt is installed. CMake should just find the Intel compiler when in the oneAPI command prompt. To use PowerShell on Windows with oneAPI, create a script “~/oneapi.ps1” containing:


cmd.exe /c '"%PROGRAMFILES(X86)%\Intel\oneAPI\setvars.bat" && pwsh'

Each time to use Intel oneAPI on Linux:

source /opt/intel/oneapi/


Some HPC systems have a too-old GCC version defaulting for Intel oneAPI. This can cause problems with C++ stdlib or other linking problems. Set environment variable CXXFLAGS for Intel GCC toolchain like: If needed, add to the custom “” like:

export CXXFLAGS=--gcc-toolchain=/opt/rh/gcc-toolset-12/root/usr/

which can be determined like:

scl enable gcc-toolset-12 "which g++"