ci: test with (old) Intel compiler + (new) oneAPI compiler
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index e7b737c..ab73718 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -15,17 +15,22 @@ jobs:
fail-fast: false
matrix:
platform:
- - { name: Windows (mingw32), os: windows-latest, shell: 'msys2 {0}', msystem: mingw32, msys-env: mingw-w64-i686 }
- - { name: Windows (mingw64), os: windows-latest, shell: 'msys2 {0}', msystem: mingw64, msys-env: mingw-w64-x86_64 }
- - { name: Windows (clang32), os: windows-latest, shell: 'msys2 {0}', msystem: clang32, msys-env: mingw-w64-clang-i686 }
- - { name: Windows (clang64), os: windows-latest, shell: 'msys2 {0}', msystem: clang64, msys-env: mingw-w64-clang-x86_64 }
- - { name: Windows (ucrt64), os: windows-latest, shell: 'msys2 {0}', msystem: ucrt64, msys-env: mingw-w64-ucrt-x86_64 }
- - { name: Ubuntu 20.04 (CMake), os: ubuntu-20.04, shell: sh }
- - { name: Ubuntu 20.04 (autotools), os: ubuntu-20.04, shell: sh, autotools: true }
- - { name: Ubuntu 22.04 (CMake), os: ubuntu-22.04, shell: sh }
- - { name: Ubuntu 22.04 (autotools), os: ubuntu-22.04, shell: sh, autotools: true }
- - { name: MacOS (CMake), os: macos-latest, shell: sh, cmake: '-DCMAKE_OSX_ARCHITECTURES="x86_64;arm64"' }
- - { name: MacOS (autotools), os: macos-latest, shell: sh, autotools: true }
+ - { name: Windows (mingw32), os: windows-latest, shell: 'msys2 {0}', msystem: mingw32, msys-env: mingw-w64-i686 }
+ - { name: Windows (mingw64), os: windows-latest, shell: 'msys2 {0}', msystem: mingw64, msys-env: mingw-w64-x86_64 }
+ - { name: Windows (clang32), os: windows-latest, shell: 'msys2 {0}', msystem: clang32, msys-env: mingw-w64-clang-i686 }
+ - { name: Windows (clang64), os: windows-latest, shell: 'msys2 {0}', msystem: clang64, msys-env: mingw-w64-clang-x86_64 }
+ - { name: Windows (ucrt64), os: windows-latest, shell: 'msys2 {0}', msystem: ucrt64, msys-env: mingw-w64-ucrt-x86_64 }
+ - { name: Ubuntu 20.04 (CMake), os: ubuntu-20.04, shell: sh }
+ - { name: Ubuntu 20.04 (autotools), os: ubuntu-20.04, shell: sh, autotools: true }
+ - { name: Intel oneAPI (Ubuntu 20.04), os: ubuntu-20.04, shell: bash, artifact: 'SDL-ubuntu20.04-oneapi', intel: true,
+ source_cmd: 'source /opt/intel/oneapi/setvars.sh; export CC=icx; export CXX=icx;'}
+ - { name: Intel Compiler (Ubuntu 20.04), os: ubuntu-20.04, shell: bash, artifact: 'SDL-ubuntu20.04-icc', intel: true, cmake: '-DSDL_CLANG_TIDY=OFF',
+ source_cmd: 'source /opt/intel/oneapi/setvars.sh; export CC=icc; export CXX=icpc; export CFLAGS=-diag-disable=10441; export CXXFLAGS=-diag-disable=10441; '}
+
+ - { name: Ubuntu 22.04 (CMake), os: ubuntu-22.04, shell: sh }
+ - { name: Ubuntu 22.04 (autotools), os: ubuntu-22.04, shell: sh, autotools: true }
+ - { name: MacOS (CMake), os: macos-latest, shell: sh, cmake: '-DCMAKE_OSX_ARCHITECTURES="x86_64;arm64"' }
+ - { name: MacOS (autotools), os: macos-latest, shell: sh, autotools: true }
steps:
- name: Set up MSYS2
@@ -61,6 +66,19 @@ jobs:
brew install \
ninja \
pkg-config
+
+ - name: Setup Intel oneAPI
+ if: matrix.platform.intel
+ run: |
+ # Setup oneAPI repo
+ 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
+ sudo echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
+ sudo apt-get update -y
+
+ # Install oneAPI
+ sudo apt-get install -y intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic
+
- uses: actions/checkout@v3
- name: Check that versioning is consistent
# We only need to run this once: arbitrarily use the Linux/CMake build
@@ -69,6 +87,7 @@ jobs:
- name: Configure (CMake)
if: "! matrix.platform.autotools"
run: |
+ ${{ matrix.platform.source_cmd }}
cmake -S . -B build -G Ninja \
-DSDL_TESTS=ON \
-DSDL_WERROR=ON \
@@ -80,11 +99,13 @@ jobs:
- name: Build (CMake)
if: "! matrix.platform.autotools"
run: |
+ ${{ matrix.platform.source_cmd }}
cmake --build build/ --config Release --verbose --parallel
- name: Run build-time tests (CMake)
if: "! matrix.platform.autotools"
run: |
set -eu
+ ${{ matrix.platform.source_cmd }}
export SDL_TESTS_QUICK=1
ctest -VV --test-dir build/
if test "${{ runner.os }}" = "Linux"; then
@@ -102,6 +123,7 @@ jobs:
if: matrix.platform.autotools
run: |
set -eu
+ ${{ matrix.platform.source_cmd }}
rm -fr build-autotools
mkdir build-autotools
./autogen.sh
@@ -133,6 +155,7 @@ jobs:
if: matrix.platform.autotools
run: |
set -eu
+ ${{ matrix.platform.source_cmd }}
parallel="$(getconf _NPROCESSORS_ONLN)"
make -j"${parallel}" -C build-autotools V=1
if test "${{ runner.os }}" != "macOS" ; then
@@ -142,6 +165,7 @@ jobs:
if: ${{ matrix.platform.autotools && (runner.os != 'macOS') }}
run: |
set -eu
+ ${{ matrix.platform.source_cmd }}
curdir="$(pwd)"
parallel="$(getconf _NPROCESSORS_ONLN)"
export SDL_TESTS_QUICK=1
@@ -154,6 +178,7 @@ jobs:
if: matrix.platform.autotools
run: |
set -eu
+ ${{ matrix.platform.source_cmd }}
curdir="$(pwd)"
parallel="$(getconf _NPROCESSORS_ONLN)"
make -j"${parallel}" -C build-autotools install V=1
@@ -164,16 +189,19 @@ jobs:
echo "SDL2_DIR=$(pwd)/autotools_prefix" >> $GITHUB_ENV
- name: Verify CMake configuration files
run: |
+ ${{ matrix.platform.source_cmd }}
cmake -S cmake/test -B cmake_config_build -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }}
cmake --build cmake_config_build --verbose
- name: Verify sdl2-config
run: |
+ ${{ matrix.platform.source_cmd }}
export PATH=${{ env.SDL2_DIR }}/bin:$PATH
cmake/test/test_sdlconfig.sh
- name: Verify sdl2.pc
run: |
+ ${{ matrix.platform.source_cmd }}
export PKG_CONFIG_PATH=${{ env.SDL2_DIR }}/lib/pkgconfig
cmake/test/test_pkgconfig.sh
- name: Distcheck (Autotools)
@@ -192,6 +220,7 @@ jobs:
if: "runner.os == 'Linux' && matrix.platform.autotools"
run: |
set -eu
+ ${{ matrix.platform.source_cmd }}
parallel="$(getconf _NPROCESSORS_ONLN)"
sudo make -j"${parallel}" -C build-autotools install
sudo make -j"${parallel}" -C build-autotools/test install