Skip to content

Instantly share code, notes, and snippets.

@bgeneto
Last active January 11, 2024 23:56
Show Gist options
  • Save bgeneto/3a7fbebe1d9276dadedc704f7ac24ce8 to your computer and use it in GitHub Desktop.
Save bgeneto/3a7fbebe1d9276dadedc704f7ac24ce8 to your computer and use it in GitHub Desktop.
Install Intel Compilers on Windows via WSL2

Install Intel Compilers on Windows via WSL2

Note: This step-by-step tutorial assumes that you already have a Linux distribution (Debian, Ubuntu...) installed on your WSL environment.

Update your package repository inside WSL2

sudo apt update

Added Intel repositories

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

Install the desired software components

# 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

Configure Intel environment variables on WSL

# 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

Install Intel Compilers on Fedora Workstation via repo

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment