Intel® oneAPI Toolkits Installation Guide for Linux* OS
A newer version of this document is available. Customers should click here to go to the newest version.
Spack
This page provides general instructions on installing the Intel® oneAPI component packages via Spack. After installation, you can use the tools directly or use Spack to build packages with the tools.
To install a package, execute the following command:
spack install <package_name>
Example
The example below demonstrates how to set up Intel oneAPI compilers with Spack.
- Install the compilers package with the following command: - spack install intel-oneapi-compilers 
- Add the oneAPI compilers to the set of compilers that Spack can use: - spack compiler add `spack location -i intel-oneapi-compilers`/compiler/latest/bin - For 2023.x and earlier versions, use: - spack compiler add `spack location -i intel-oneapi-compilers`/compiler/latest/linux/bin/intel64 spack compiler add `spack location -i intel-oneapi-compilers`/compiler/latest/linux/bin - This adds the compilers to your compilers.yaml. 
- Verify that the compilers are available: - spack compiler add 
The intel-oneapi-compilers package includes two families of compilers:
- Intel: icc, iccpc, ifort - Intel’s classic compilers 
- oneAPI: icx, icpx, ifx - Intel’s new generation of compilers based on LLVM 
To build the patchelf Spack package with icc, use:
spack install patchelf%intel
To build with icx, use:
spack install patchelf%oneapi
In addition to compilers, oneAPI contains many libraries. The hdf5 package works with any compatible MPI implementation. To build hdf5 with Intel oneAPI MPI, use:
spack install hdf5 +mpi ^intel-oneapi-mpi
For more information, see Spack documentation.