Skip to content

Instantly share code, notes, and snippets.

@fabriciorsf
Last active July 19, 2024 18:30
Show Gist options
  • Save fabriciorsf/f856dcb3a31217fd5dfc3b2910584079 to your computer and use it in GitHub Desktop.
Save fabriciorsf/f856dcb3a31217fd5dfc3b2910584079 to your computer and use it in GitHub Desktop.
#!/bin/bash
# https://www.intel.com/content/www/us/en/developer/articles/tool/oneapi-standalone-components.html
#### CONFIG REPO INTEL ONEAPI ####
# download the key to system keyring
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
#### INSTALL INTEL ONEAPI ####
sudo apt update
sudo apt -y install cmake pkg-config build-essential
sudo apt install -y intel-basekit
sudo apt install -y intel-hpckit
sudo apt install -y intel-renderkit
#sudo apt install -y intel-oneapi-runtime-libs
#### SET VARS ####
INTEL_FILE_PROFILE="/etc/profile.d/intel_oneapi.sh"
echo '# setting up Intel OneAPI environment vars"' | sudo tee ${INTEL_FILE_PROFILE}
echo 'export INTELROOT="/opt/intel"' | sudo tee --append ${INTEL_FILE_PROFILE}
echo 'export TOOLKIT_VERSION="2024.2"' | sudo tee --append ${INTEL_FILE_PROFILE}
echo 'export ONEAPI_ROOT="${INTELROOT}/oneapi"' | sudo tee --append ${INTEL_FILE_PROFILE}
echo 'ONEAPI_UDL="${ONEAPI_ROOT}/${TOOLKIT_VERSION}/"' | sudo tee --append ${INTEL_FILE_PROFILE}
echo '#export MKLROOT="${ONEAPI_ROOT}/mkl/latest"' | sudo tee --append ${INTEL_FILE_PROFILE}
echo '' | sudo tee --append ${INTEL_FILE_PROFILE}
echo '# setting environment for sh' | sudo tee --append ${INTEL_FILE_PROFILE}
echo '. ${ONEAPI_UDL}/oneapi-vars.sh' | sudo tee --append ${INTEL_FILE_PROFILE}
echo 'unset ONEAPI_UDL' | sudo tee --append ${INTEL_FILE_PROFILE}
echo '' | sudo tee --append ${INTEL_FILE_PROFILE}
source ${INTEL_FILE_PROFILE}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment