Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Intel oneAPI GitHub Actions with MKL and MPI (C, C++, Fortran) and CMake
runs-on: ubuntu-latest
CC: icx
CXX: icpx
FC: ifort
- name: Intel Apt repository
timeout-minutes: 1
run: |
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
echo "deb all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
sudo apt-get update
- name: Install Intel oneAPI
timeout-minutes: 5
run: sudo apt-get install intel-oneapi-compiler-fortran intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic intel-oneapi-mpi intel-oneapi-mpi-devel intel-oneapi-mkl ninja-build
- name: checkout project code
uses: actions/checkout@v2
- name: Setup Intel oneAPI environment
run: |
source /opt/intel/oneapi/
printenv >> $GITHUB_ENV
- name: CMake Configure
run: cmake -B build
- name: CMake build
run: cmake --build build
- name: CMake test
run: ctest --test-dir build
Copy link

scivision commented Aug 13, 2021

Set env: CC: etc workflow-wide so that ExternalProjects get the Intel compiler too

Copy link

Koushikphy commented Jun 26, 2022

Can you update this with caching the installation step?

Copy link

scivision commented Jun 26, 2022
This uses auxiliary scripts and cache still takes a couple minutes to setup. I didn't switch to cached in other projects as a result of not much time savings and additional setup hassle

Copy link

Koushikphy commented Jun 27, 2022

I was using the exact same Install Intel oneAPI step (without the ninja_build) and the apt installation takes almost 3 and half minutes, whereas the cache setup took 50 sec.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment