Unlike cached approach, this is simpler but takes much longer to setup on each run.
Last active
January 8, 2024 04:33
-
-
Save scivision/d94bb10a01fa3b8ed0c9a93ee16318ba to your computer and use it in GitHub Desktop.
Intel oneAPI GitHub Actions with MKL and MPI (C, C++, Fortran) and CMake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this method does not use Github Actions cache--good for infrequent simple runs | |
jobs: | |
linux-intel-oneapi: | |
runs-on: ubuntu-latest | |
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 compilers | |
timeout-minutes: 5 | |
run: sudo apt-get install intel-oneapi-compiler-fortran intel-oneapi-compiler-dpcpp-cpp | |
# optional | |
- name: Install Intel MPI and MKL | |
timeout-minutes: 5 | |
run: intel-oneapi-mpi intel-oneapi-mpi-devel intel-oneapi-mkl | |
- name: Setup Intel oneAPI environment | |
run: | | |
source /opt/intel/oneapi/setvars.sh | |
printenv >> $GITHUB_ENV | |
- name: checkout project code | |
uses: actions/checkout@v4 | |
- name: CMake Configure | |
run: cmake -B build | |
- name: CMake build | |
run: cmake --build build | |
- name: CMake test | |
run: ctest --test-dir build |
Yep. That seems to have worked!
https://github.com/Goddard-Fortran-Ecosystem/pFUnit/actions/runs/7397692487/job/20125281071
Now to start bringing back all my other CI that I commented out! Thanks!
Good! I'll try to do the same in my ifort CIs.
Thanks I've corrected this example. I'm going to make it a repo so it will run in Github Actions.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ooh. Let me give that a try!