Skip to content

Blas\Lapack (#52)

Blas\Lapack (#52) #30

Workflow file for this run

name: Native Libraries
on:
push:
branches:
- main
- release/*
env:
PRIK_GFORTRAN_BINARY: gfortran-13
PRIK_GFORTRAN_PACKAGE: gfortran-13
jobs:
real-library-wrappers:
name: BLAS + LAPACK · Ubuntu 24.04 · Python 3.12
if: >-
${{
github.event_name != 'pull_request' ||
!contains(github.event.pull_request.labels.*.name, 'ignore-real-library-wrappers')
}}
runs-on: ubuntu-24.04
timeout-minutes: 120
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install test dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[qa]"
python -m pip install \
"numpy==2.5.1" \
"meson==1.11.2" \
"ninja==1.13.0" \
"scipy==1.18.0"
- name: Install pinned GFortran and LAPACK link dependencies
shell: bash
run: |
packages=(libblas-dev liblapack-dev)
if ! command -v "$PRIK_GFORTRAN_BINARY" >/dev/null 2>&1; then
packages+=("$PRIK_GFORTRAN_PACKAGE")
fi
sudo apt-get update
sudo apt-get install --yes "${packages[@]}"
compiler_dir="$RUNNER_TEMP/prik-gfortran"
mkdir -p "$compiler_dir"
ln -sf "$(command -v "$PRIK_GFORTRAN_BINARY")" "$compiler_dir/gfortran"
echo "$compiler_dir" >> "$GITHUB_PATH"
"$compiler_dir/gfortran" --version
- name: Restore compiled native library cache
uses: actions/cache@v4
with:
path: ${{ runner.temp }}/prik-real-library-native
key: real-libraries-${{ runner.os }}-gfortran13-${{ hashFiles('examples/blas/native/**', 'examples/lapack/native/**') }}
- name: Run BLAS example and CI full-surface audit
env:
PYTHONPATH: .
HYPOTHESIS_PROFILE: ci
PRIK_REAL_LIBRARY_NATIVE_CACHE_DIR: ${{ runner.temp }}/prik-real-library-native
run: |
source examples/blas/build_all.sh
python -m pytest -q examples/blas/tests examples/blas/ci/full_surface.py
- name: Report reviewed LAPACK inventory
env:
PYTHONPATH: .
run: |
python - <<'PY'
from examples.lapack.routine_inventory import (
EXPECTED_LAPACK_PROCEDURES,
EXPECTED_LAPACK_SOURCE_FILES,
F2PY_SCALAR_WRITEBACK_ROUTINES,
ROUTINE_GROUPS,
ROUTINES,
SCIPY_VERSION,
)
print(f"SciPy version: {SCIPY_VERSION}")
print(f"LAPACK implementation sources: {EXPECTED_LAPACK_SOURCE_FILES}")
print(f"Expected PRIK procedures: {EXPECTED_LAPACK_PROCEDURES}")
print(f"Selected float64 correctness routines: {len(ROUTINES)}")
print(f"f2py scalar writebacks: {len(F2PY_SCALAR_WRITEBACK_ROUTINES)}")
for family, routines in ROUTINE_GROUPS.items():
print(f" {family}: {len(routines)}")
PY
- name: Run LAPACK example and CI full-surface audit
env:
PYTHONPATH: .
HYPOTHESIS_PROFILE: ci
PRIK_REAL_LIBRARY_NATIVE_CACHE_DIR: ${{ runner.temp }}/prik-real-library-native
run: |
source examples/lapack/build_all.sh
python -m pytest -q examples/lapack/tests examples/lapack/ci/full_surface.py