Note: This step-by-step tutorial assumes that you already have a Linux distribution (Debian, Ubuntu...) installed on your WSL environment.
sudo apt update
curl -Lo- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | sudo gpg --dearmor -o /usr/share/keyrings/oneapi-archive-keyring.gpg
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
sudo apt update
# For Intel fortran compiler + mkl:
sudo apt install intel-oneapi-compiler-fortran intel-oneapi-mkl intel-oneapi-mkl-devel -y
# For Intel MKL only:
sudo apt install intel-oneapi-mkl
# For Intel c++ compiler only:
sudo apt install intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic
# To install (almost) everything:
#sudo apt install intel-hpckit
# if using zsh
vi ~/.zshrc
# if using bash
vi ~/.bashrc
Add the following line at the bottom:
source /opt/intel/oneapi/setvars.sh &> /dev/null
tee > /tmp/oneAPI.repo << EOF
[oneAPI]
name=Intel® oneAPI repository
baseurl=https://yum.repos.intel.com/oneapi
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://yum.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
EOF
sudo mv /tmp/oneAPI.repo /etc/yum.repos.d
sudo dnf check-update
sudo dnf install intel-oneapi-compiler-fortran intel-oneapi-mkl intel-oneapi-mkl-devel