Install and manage Intel oneAPI compiler and component tools using environment modules
Just like HPC clusters, manage intel components using module load commands.
Intel has recently changed their business model. Their suite of compilers, debuggers, toolkits, and libraries are given free of cost for personal or academic use. In an earlier post, I explained how to install them on Ubuntu linux and activate all the softwares using a single source command.
In this post, I will show you how to manage these compilers, libraries, and debuggers using the environment modules. So just using “module load icc
” you could activate a single “icc
” compoment. All the dependent modules will also be loaded automatically, if you follow the these steps.
Pre-requisites
Make sure that you have the following packages already installed on your ubuntu machine.
- environment modules (i.e. the
module
command) - Intel oneapi basekit and/or hpckit (I am repeating the steps below)
Intel Repository Public Key
Get the Intel Repository public key and add it to your apt sources keyring so the packages will be trusted by ubuntu.
# use wget to fetch the Intel repository public key
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
# add to your apt sources keyring so that archives signed with this key will be trusted.
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
# remove the public key
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
Configure apt client to use Intel repository
echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
or
sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main"
Install all the packages or selected packages.
All basic compilers (Fortran, C, C++, and Python)
sudo apt install intel-basekit
HPC toolkits
sudo apt install intel-hpckit
IoT (internet of things) toolkits
sudo apt install intel-iotkit
AI (Artificial Intelligence) analytics toolkits
sudo apt install intel-aikit
Rendering toolkit
sudo apt install intel-renderkit
After Installation
After you have installed the oneAPI kits, they can be activated using the following command written in the ~/.bashrc
file.
Option 1: Activate all the components at once for all users (root access)
. /opt/intel/oneapi/setvars.sh
Option 2: Activate individual components using the environment modules
cd /opt/intel/oneapi/
- You will see a
modulefiles-setup.sh
file. If we execute this file using bash it will create a folder namedmodulefiles
in the same/opt/intel/oneapi/
folder. - Put the following line into your
$HOME/.bashrc
fileexport MODULEPATH=${MODULEPATH}:/opt/intel/oneapi/modulefiles
. $HOME/.bashrc
or close and reopen the terminal
- If you type
module avail
, you will see all the components of Intel oneapi available for use. - You can load or unload individual components using
module load icc
ormodule load compiler
etc. - You can create your own module file and put it in the
modulefiles folder
. Let us create a modulefile for intel python. - Copy the following content into a file
/opt/intel/oneapi/modulefiles/python/latest
#%Module1.0###################################################################
set min_tcl_ver 8.4
if { $tcl_version < $min_tcl_ver } {
puts stderr " "
puts stderr "ERROR: This modulefile requires tcl $min_tcl_ver or greater."
puts stderr "Your system reports that tclsh version $tcl_version is installed."
exit 1
}
proc ModulesHelp { } {
puts stderr "\tAdds Intel Python 3 to your PATH environment variable\n"
}
module-whatis "adds Intel Python 3 to your PATH environment variable"
prepend-path PATH /opt/intel/oneapi/intelpython/latest/bin
Check the installed packages using module avail
, check the loaded packages using module list
, unload packages using module unload packagename
Search content by categories