Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Intel oneAPI GitHub Actions with MKL and MPI (C, C++, Fortran) and CMake
jobs:
linux-intel-oneapi:
runs-on: ubuntu-latest
env:
CC: icx
CXX: icpx
FC: ifort
steps:
- name: Intel Apt repository
timeout-minutes: 1
run: |
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
echo "deb https://apt.repos.intel.com/oneapi 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/setvars.sh
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
@scivision

This comment has been minimized.

Copy link
Owner Author

@scivision scivision commented Aug 13, 2021

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

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