| name: Foreign architectures | |
| on: [push, pull_request] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| multiarch: | |
| name: Multiarch build and test for ${{ matrix.arch }} with GCC 16 | |
| runs-on: ubuntu-26.04 | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| include: | |
| - arch: armv7 | |
| cxx_flags: -Wno-psabi | |
| compiler_tgt_cpu_arch: arm | |
| compiler_tgt_abi_suffix: eabihf | |
| cmake_flags: -DHWY_CMAKE_ARM7:BOOL=ON | |
| qemu_emulator: qemu-arm | |
| - arch: ppc64 | |
| cxx_flags: -mcpu=power9 -DHWY_COMPILE_ONLY_STATIC=1 | |
| compiler_tgt_cpu_arch: powerpc64 | |
| qemu_emulator: qemu-ppc64 | |
| - arch: ppc64le (Power8) | |
| cxx_flags: -mcpu=power8 -DHWY_DISABLED_TARGETS=0x1800000000000 | |
| compiler_tgt_cpu_arch: powerpc64le | |
| cmake_flags: -DHWY_ENABLE_CONTRIB=OFF | |
| qemu_emulator: qemu-ppc64le | |
| - arch: ppc64le (Power9) | |
| cxx_flags: -mcpu=power9 -DHWY_COMPILE_ONLY_STATIC=1 | |
| compiler_tgt_cpu_arch: powerpc64le | |
| cmake_flags: -DHWY_ENABLE_CONTRIB=OFF | |
| qemu_emulator: qemu-ppc64le | |
| - arch: ppc64le (Power10) | |
| cxx_flags: -mcpu=power10 -DHWY_COMPILE_ONLY_STATIC=1 | |
| compiler_tgt_cpu_arch: powerpc64le | |
| cmake_flags: -DHWY_ENABLE_CONTRIB=OFF | |
| qemu_emulator: qemu-ppc64le;-cpu;power10 | |
| - arch: loongarch64 | |
| compiler_tgt_cpu_arch: loongarch64 | |
| cmake_flags: -DHWY_ENABLE_CONTRIB=OFF | |
| qemu_emulator: qemu-loongarch64;-cpu;max | |
| - arch: s390x (Z14) | |
| cxx_flags: -march=z14 -mzvector -DHWY_COMPILE_ONLY_STATIC=1 | |
| compiler_tgt_cpu_arch: s390x | |
| cmake_flags: -DHWY_ENABLE_CONTRIB=OFF | |
| qemu_emulator: qemu-s390x | |
| - arch: s390x (Z15) | |
| cxx_flags: -march=z15 -mzvector -DHWY_COMPILE_ONLY_STATIC=1 | |
| compiler_tgt_cpu_arch: s390x | |
| cmake_flags: -DHWY_ENABLE_CONTRIB=OFF | |
| qemu_emulator: qemu-s390x | |
| - arch: riscv64 | |
| cxx_flags: -DHWY_COMPILE_ONLY_STATIC=1 | |
| compiler_tgt_cpu_arch: riscv64 | |
| qemu_emulator: qemu-riscv64;-cpu;max,v=true,vlen=256 | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@46b06cea07f9e64621fdf066ba77ac6915163d43 # v2.22.3 | |
| with: | |
| egress-policy: audit # cannot be block - runner does git checkout | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Install deps | |
| run: | | |
| sudo apt-get update && sudo apt-get install qemu-user \ | |
| "g++-16-${{ matrix.compiler_tgt_cpu_arch }}-linux-gnu${{ matrix.compiler_tgt_abi_suffix }}" | |
| - name: Build | |
| run: | | |
| export CMAKE_BUILD_PARALLEL_LEVEL=2 | |
| export CTEST_PARALLEL_LEVEL=2 | |
| CXXFLAGS="${{ matrix.cxx_flags }}" \ | |
| CC="${{ matrix.compiler_tgt_cpu_arch }}-linux-gnu${{ matrix.compiler_tgt_abi_suffix }}-gcc-16" \ | |
| CXX="${{ matrix.compiler_tgt_cpu_arch }}-linux-gnu${{ matrix.compiler_tgt_abi_suffix }}-g++-16" \ | |
| cmake -DHWY_WARNINGS_ARE_ERRORS=ON -DCMAKE_CXX_STANDARD=17 \ | |
| -DCMAKE_C_COMPILER_TARGET="${{ matrix.compiler_tgt_cpu_arch }}-linux-gnu${{ matrix.compiler_tgt_abi_suffix }}" \ | |
| -DCMAKE_CXX_COMPILER_TARGET="${{ matrix.compiler_tgt_cpu_arch }}-linux-gnu${{ matrix.compiler_tgt_abi_suffix }}" \ | |
| -DCMAKE_CROSSCOMPILING=true \ | |
| -DCMAKE_CROSSCOMPILING_EMULATOR="${{ matrix.qemu_emulator }};-L;/usr/${{ matrix.compiler_tgt_cpu_arch }}-linux-gnu${{ matrix.compiler_tgt_abi_suffix }}" \ | |
| -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_PROCESSOR="${{ matrix.compiler_tgt_cpu_arch }}" \ | |
| ${{ matrix.cmake_flags }} -B out . | |
| cmake --build out | |
| - name: Test | |
| continue-on-error: true | |
| run: ctest --test-dir out | |
| multiarch_clang22: | |
| name: Multiarch build and test for ${{ matrix.arch }} with Clang 22 | |
| runs-on: ubuntu-26.04 | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| include: | |
| - arch: armv7 | |
| cxx_flags: -Wno-psabi | |
| compiler_tgt_cpu_arch: arm | |
| compiler_tgt_abi_suffix: eabihf | |
| cmake_flags: -DHWY_CMAKE_ARM7:BOOL=ON | |
| qemu_emulator: qemu-arm | |
| - arch: ppc64 | |
| cxx_flags: -mcpu=power9 -mabi=ibmlongdouble -DHWY_COMPILE_ONLY_STATIC=1 | |
| compiler_tgt_cpu_arch: powerpc64 | |
| qemu_emulator: qemu-ppc64 | |
| - arch: ppc64le (Power8) | |
| cxx_flags: -mcpu=power8 -mabi=ibmlongdouble -DHWY_DISABLED_TARGETS=0x1800000000000 | |
| compiler_tgt_cpu_arch: powerpc64le | |
| cmake_flags: -DHWY_ENABLE_CONTRIB=OFF | |
| qemu_emulator: qemu-ppc64le | |
| - arch: ppc64le (Power9) | |
| cxx_flags: -mcpu=power9 -mabi=ibmlongdouble -DHWY_COMPILE_ONLY_STATIC=1 | |
| compiler_tgt_cpu_arch: powerpc64le | |
| cmake_flags: -DHWY_ENABLE_CONTRIB=OFF | |
| qemu_emulator: qemu-ppc64le | |
| - arch: ppc64le (Power10) | |
| cxx_flags: -mcpu=power10 -mabi=ibmlongdouble -DHWY_COMPILE_ONLY_STATIC=1 | |
| compiler_tgt_cpu_arch: powerpc64le | |
| cmake_flags: -DHWY_ENABLE_CONTRIB=OFF | |
| qemu_emulator: qemu-ppc64le;-cpu;power10 | |
| - arch: loongarch64 | |
| compiler_tgt_cpu_arch: loongarch64 | |
| cmake_flags: -DHWY_ENABLE_CONTRIB=OFF | |
| qemu_emulator: qemu-loongarch64;-cpu;max | |
| - arch: s390x (Z14) | |
| cxx_flags: -march=z14 -mzvector -DHWY_COMPILE_ONLY_STATIC=1 | |
| compiler_tgt_cpu_arch: s390x | |
| cmake_flags: -DHWY_ENABLE_CONTRIB=OFF | |
| qemu_emulator: qemu-s390x | |
| - arch: s390x (Z15) | |
| cxx_flags: -march=z15 -mzvector -DHWY_COMPILE_ONLY_STATIC=1 | |
| compiler_tgt_cpu_arch: s390x | |
| cmake_flags: -DHWY_ENABLE_CONTRIB=OFF | |
| qemu_emulator: qemu-s390x | |
| - arch: riscv64 | |
| cxx_flags: -DHWY_COMPILE_ONLY_STATIC=1 | |
| compiler_tgt_cpu_arch: riscv64 | |
| qemu_emulator: qemu-riscv64;-cpu;max,v=true,vlen=256 | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@46b06cea07f9e64621fdf066ba77ac6915163d43 # v2.22.3 | |
| with: | |
| egress-policy: audit # cannot be block - runner does git checkout | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Install deps | |
| run: | | |
| sudo apt-get update && sudo apt-get install qemu-user clang-22 \ | |
| "g++-${{ matrix.compiler_tgt_cpu_arch }}-linux-gnu${{ matrix.compiler_tgt_abi_suffix }}" | |
| - name: Build | |
| run: | | |
| export CMAKE_BUILD_PARALLEL_LEVEL=2 | |
| export CTEST_PARALLEL_LEVEL=2 | |
| CXXFLAGS="${{ matrix.cxx_flags }}" \ | |
| CC="clang-22" CXX="clang++-22" cmake -DHWY_WARNINGS_ARE_ERRORS=ON -DCMAKE_CXX_STANDARD=17 \ | |
| -DCMAKE_C_COMPILER_TARGET="${{ matrix.compiler_tgt_cpu_arch }}-linux-gnu${{ matrix.compiler_tgt_abi_suffix }}" \ | |
| -DCMAKE_CXX_COMPILER_TARGET="${{ matrix.compiler_tgt_cpu_arch }}-linux-gnu${{ matrix.compiler_tgt_abi_suffix }}" \ | |
| -DCMAKE_CROSSCOMPILING=true \ | |
| -DCMAKE_CROSSCOMPILING_EMULATOR="${{ matrix.qemu_emulator }};-L;/usr/${{ matrix.compiler_tgt_cpu_arch }}-linux-gnu${{ matrix.compiler_tgt_abi_suffix }}" \ | |
| -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_PROCESSOR="${{ matrix.compiler_tgt_cpu_arch }}" \ | |
| ${{ matrix.cmake_flags }} -B out . | |
| cmake --build out | |
| - name: Test | |
| continue-on-error: true | |
| run: ctest --test-dir out | |
| aarch64_cmake: | |
| name: Build and test ${{ matrix.name }} on AArch64 | |
| runs-on: ubuntu-26.04-arm | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| include: | |
| - name: Clang-22 | |
| extra_deps: clang-22 | |
| c_compiler: clang-22 | |
| cxx_compiler: clang++-22 | |
| cxx_standard: 17 | |
| - name: GCC-16 | |
| extra_deps: g++-16 | |
| c_compiler: gcc-16 | |
| cxx_compiler: g++-16 | |
| cxx_flags: -ftrapv | |
| cxx_standard: 17 | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@46b06cea07f9e64621fdf066ba77ac6915163d43 # v2.22.3 | |
| with: | |
| egress-policy: audit # cannot be block - runner does git checkout | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Install deps | |
| run: sudo apt-get update && sudo apt-get install ${{ matrix.extra_deps }} | |
| - name: Build | |
| run: | | |
| export CMAKE_BUILD_PARALLEL_LEVEL=2 | |
| export CTEST_PARALLEL_LEVEL=2 | |
| CXXFLAGS="${{ matrix.cxx_flags }}" CC=${{ matrix.c_compiler }} CXX=${{ matrix.cxx_compiler }} cmake -DHWY_WARNINGS_ARE_ERRORS=ON -DCMAKE_CXX_STANDARD=${{ matrix.cxx_standard }} ${{ matrix.extra_cmake_flags }} -B out . | |
| cmake --build out | |
| - name: Test | |
| continue-on-error: true | |
| run: ctest --test-dir out |