# download the key to system keyring; this and the following echo command are
# needed in order to install the Intel compilers
wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \
| gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null
# add signed entry to apt sources and configure the APT client to use Intel repository:
echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
# this update should get the Intel package info from the Intel repository
sudo apt -y update
# install the Intel compilers
sudo apt -y install intel-basekit intel-hpckit
sudo apt -y update
# add the Intel compiler file paths to various environment variables
source /opt/intel/oneapi/setvars.sh
# some of the libraries we install below need one or more of these variables
export CC=icc
export CXX=icpc
export FC=ifort
export F77=ifort
export F90=ifort
export MPIFC=mpiifort
export MPIF77=mpiifort
export MPIF90=mpiifort
export MPICC=mpiicc
export MPICXX=mpiicpc