Unlike cached approach, this is simpler but takes much longer to setup on each run.
Intel APT repo is used.
# this method does not use Github Actions cache--good for infrequent simple runs | |
jobs: | |
linux-intel-oneapi: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
oneapi: [2025.1] | |
steps: | |
- name: Intel Apt repository | |
timeout-minutes: 5 | |
run: | | |
curl -sS -L 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 | |
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-get update -o Dir::Etc::sourcelist="sources.list.d/oneAPI.list" -o APT::Get::List-Cleanup="0" | |
- name: Install Intel oneAPI compilers | |
timeout-minutes: 5 | |
run: sudo apt-get install --no-install-recommends intel-oneapi-compiler-fortran-${{ matrix.oneapi}} intel-oneapi-compiler-dpcpp-cpp-${{ matrix.oneapi }} | |
- name: Setup Intel oneAPI environment | |
run: | | |
source /opt/intel/oneapi/${{ matrix.oneapi }}/oneapi-vars.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 |
changes to $GITHUB_ENV
persist across steps in a job per https://docs.github.com/en/actions/learn-github-actions/variables
On my Linux workstation, "ifx" is at /opt/intel/oneapi/compiler/2023.2.0/linux/bin/ifx
which is on your runner's PATH
Maybe it's a GA YAML syntax issue? Should that command be
${{ env.FC }} --version
Otherwise try temporarily commenting out that "Versions" step and see if CMake detects oneAPI as expected.
Sigh. Nope, unhappy:
https://github.com/Goddard-Fortran-Ecosystem/pFUnit/actions/runs/7051576623/job/19194785582
It's obviously seeing FC
as CMake tried to use ifx
but ifx
is just not in the path. It's like setvars.sh
isn't...setting all the vars.
Hi @mathomp4, I have exactly the same problem with ifort that you are reporting. Any ideas on how to solve it?
I found this, https://fortran-lang.discourse.group/t/oneapi-on-ubuntu23010/6878/21. It would seem like the problem is with oneAPI.
I found this, https://fortran-lang.discourse.group/t/oneapi-on-ubuntu23010/6878/21. It would seem like the problem is with oneAPI.
Ooh. Let me give that a try!
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.
So I just made my workflow file look like this gist:
https://github.com/Goddard-Fortran-Ecosystem/pFUnit/actions/runs/7048495483/workflow
(fixing the install for Intel MPI) but the run dies:
https://github.com/Goddard-Fortran-Ecosystem/pFUnit/actions/runs/7048495483/job/19184779771
I have:
and then:
and it's failing with: