Skip to content

Remove -march=knl flag for GCC 15 compatibility #399

Remove -march=knl flag for GCC 15 compatibility

Remove -march=knl flag for GCC 15 compatibility #399

Workflow file for this run

name: tests
on:
push:
branches: [main]
paths-ignore:
- "*.md"
pull_request:
branches: ["*"]
paths-ignore:
- "*.md"
workflow_dispatch: # allows you to trigger manually
permissions: {}
# When this workflow is queued, automatically cancel any previous running
# or pending jobs from the same branch
concurrency:
group: tests-${{ github.ref }}
cancel-in-progress: true
env:
MODULE_NAME: 'blis'
RUN_MYPY: 'false'
jobs:
tests:
name: Test
strategy:
fail-fast: true
matrix:
os:
- ubuntu-latest # x64
- ubuntu-24.04-arm # ARM
- macos-15-intel # x64
- macos-latest # ARM
- windows-latest # x64
- windows-11-arm # ARM
python_version: ["3.10", "3.11", "3.12", "3.13", "3.13t", "3.14", "3.14t"]
cc: [''] # default: gcc on Linux; clang on Mac/Windows
numpy-runtime: [''] # default: latest version
include:
# Note: default compiler for Linux is gcc. cibuildwheel uses gcc.
# FIXME: clang crashes on ARM Linux
- os: ubuntu-latest
python_version: "3.10"
cc: clang
- os: ubuntu-latest
python_version: "3.14"
cc: clang
# Test oldest runtime version of NumPy.
# Note that we always use the latest available version for building.
- os: ubuntu-latest
python_version: "3.10"
numpy-runtime: "1.21.2"
- os: ubuntu-24.04-arm
python_version: "3.10"
numpy-runtime: "1.21.3"
- os: macos-15-intel
python_version: "3.10"
numpy-runtime: "1.21.3"
- os: macos-latest
python_version: "3.10"
numpy-runtime: "1.21.3"
- os: windows-latest
python_version: "3.10"
numpy-runtime: "1.21.3"
- os: windows-11-arm
python_version: "3.11"
numpy-runtime: "2.3.1"
exclude:
- os: windows-11-arm
python_version: "3.10"
runs-on: ${{ matrix.os }}
steps:
- name: Check out repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Configure Python version
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: ${{ matrix.python_version }}
# Install LLVM on Windows
- name: Install LLVM on Windows x64
if: matrix.os == 'windows-latest'
run: |
choco install llvm --version=18.1.8 -y --force
echo "C:\Program Files\LLVM\bin" >> $env:GITHUB_PATH
- name: Install LLVM on Windows ARM64
if: matrix.os == 'windows-11-arm'
shell: pwsh
run: |
Invoke-WebRequest https://github.com/llvm/llvm-project/releases/download/llvmorg-20.1.6/LLVM-20.1.6-woa64.exe -UseBasicParsing -OutFile LLVM-woa64.exe
Start-Process -FilePath ".\LLVM-woa64.exe" -ArgumentList "/S" -Wait
echo "C:\Program Files\LLVM\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "CC=clang-cl" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Install dependencies
run: |
python -m pip install -U build pip setuptools wheel
- name: Build wheel (Windows)
if: startsWith(matrix.os, 'windows')
run: |
dir "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build" /b
set "PATH=C:\Program Files\LLVM\bin;%PATH%"
set "AR=llvm-ar"
set "AS=llvm-as"
set "CC=clang"
set RANLIB=echo
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\vcvarsall.bat" amd64
clang --version
python -m build --wheel
shell: cmd
- name: Build wheel (Mac)
if: startsWith(matrix.os, 'macos')
run: |
clang --version
python -m build --wheel
- name: Build wheel (Linux / gcc)
if: startsWith(matrix.os, 'ubuntu') && matrix.cc == ''
run: |
gcc --version
python -m build --wheel
- name: Build wheel (Linux / clang)
if: startsWith(matrix.os, 'ubuntu') && matrix.cc == 'clang'
run: |
clang --version
CC=clang python -m build --wheel
# TODO: install mypy from requirements if reenabled
- name: Run mypy
shell: bash
if: env.RUN_MYPY == 'true'
run: |
python -m mypy $MODULE_NAME
- name: Uninstall all packages
run: |
python -m pip freeze > installed.txt
python -m pip uninstall -y -r installed.txt
- name: Install wheel
if: matrix.numpy-runtime == ''
shell: bash
run: |
python -m pip install dist/*.whl
- name: Install wheel with pinned NumPy
if: matrix.numpy-runtime != ''
shell: bash
run: |
python -m pip install numpy==${{ matrix.numpy-runtime }}
python -m pip install --no-deps dist/*.whl
- name: Delete source directory
shell: bash
run: |
rm -rf $MODULE_NAME
- name: Test import
shell: bash
run: |
python -c "import $MODULE_NAME" -Werror
- name: Install test requirements
run: python -m pip install -r requirements.txt
- name: Run tests
run: pytest
- name: Run pytest-run-parallel
if: endsWith(matrix.python_version, 't')
run: pytest --parallel-threads 4