Skip to content

Blas\Lapack

Blas\Lapack #22

Workflow file for this run

name: BLAS + LAPACK
on:
pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled]
push:
branches:
- main
- release/*
workflow_call:
env:
PRIK_GFORTRAN_BINARY: gfortran-13
PRIK_GFORTRAN_PACKAGE: gfortran-13
jobs:
real-library-wrappers:
name: 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 "scipy==1.18.0"
- name: Install pinned GFortran
shell: bash
run: |
if ! command -v "$PRIK_GFORTRAN_BINARY" >/dev/null 2>&1; then
sudo apt-get update
sudo apt-get install --yes "$PRIK_GFORTRAN_PACKAGE"
fi
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 complete BLAS correctness example
env:
PYTHONPATH: .
HYPOTHESIS_PROFILE: ci
run: python -m pytest -q examples/blas
- name: Report reviewed LAPACK inventory
env:
PYTHONPATH: .
run: |
python - <<'PY'
from examples.lapack.routine_inventory import (
EXPECTED_LAPACK_ROOT_PROCEDURES,
EXPECTED_LAPACK_SOURCE_FILES,
F2PY_NUMERICAL_LIMITATIONS,
ROUTINE_GROUPS,
ROUTINES,
SCIPY_VERSION,
)
print(f"SciPy version: {SCIPY_VERSION}")
print(f"LAPACK implementation sources: {EXPECTED_LAPACK_SOURCE_FILES}")
print(f"Expected PRIK root procedures: {EXPECTED_LAPACK_ROOT_PROCEDURES}")
print(f"Selected float64 correctness routines: {len(ROUTINES)}")
print(f"Raw-f2py numerical limitations: {len(F2PY_NUMERICAL_LIMITATIONS)}")
for family, routines in ROUTINE_GROUPS.items():
print(f" {family}: {len(routines)}")
PY
- name: Run SciPy-exposed LAPACK correctness example
env:
PYTHONPATH: .
HYPOTHESIS_PROFILE: ci
PRIK_REAL_LIBRARY_NATIVE_CACHE_DIR: ${{ runner.temp }}/prik-real-library-native
run: python -m pytest -q examples/lapack
- name: Run full BLAS and LAPACK wrapper tests
env:
PYTHONPATH: .
HYPOTHESIS_PROFILE: ci
PRIK_REAL_LIBRARY_NATIVE_CACHE_DIR: ${{ runner.temp }}/prik-real-library-native
run: |
python -m pytest -q --randomly-seed=1 \
"tests/fortran/building_shared_library/end_to_end/real_libraries/test_full_libraries.py::test_full_library_wrapper_imports_every_root_procedure_from_cached_shared_library[blas]" \
"tests/fortran/building_shared_library/end_to_end/real_libraries/test_full_libraries.py::test_full_library_wrapper_imports_every_root_procedure_from_cached_shared_library[lapack]"