FIX: Adding build-patch to disable Scalar FMA on SLEEF #8
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Test on Older CPUs (x86_64-v2) | |
| # This workflow tests numpy-quaddtype on older x86 CPUs using Intel SDE. | |
| # It ensures compatibility with x86_64-v2 baseline CPUs (e.g., Sandy Bridge) | |
| # that don't have AVX2/FMA support. | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| workflow_dispatch: | |
| jobs: | |
| test_old_cpu: | |
| name: Test on ${{ matrix.cpu[1] }} | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| cpu: | |
| - ['snb', 'Sandy Bridge (x86_64-v2)'] | |
| - ['hsw', 'Haswell (x86_64-v3)'] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| submodules: recursive | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.12" | |
| - name: Install Intel SDE | |
| run: | | |
| curl -o /tmp/sde.tar.xz https://downloadmirror.intel.com/859732/sde-external-9.58.0-2025-06-16-lin.tar.xz | |
| mkdir /tmp/sde && tar -xvf /tmp/sde.tar.xz -C /tmp/sde/ | |
| sudo mv /tmp/sde/* /opt/sde && sudo ln -s /opt/sde/sde64 /usr/bin/sde | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update -y | |
| sudo apt-get install -y cmake gcc g++ make git pkg-config | |
| - name: Install Python dependencies | |
| run: | | |
| pip install -U pip | |
| pip install numpy meson meson-python ninja pytest | |
| - name: Build numpy-quaddtype | |
| env: | |
| LDFLAGS: "-fopenmp" | |
| run: | | |
| # For Sandy Bridge (x86-64-v2), we need to disable FMA code paths | |
| # since FMA instructions are not available on that microarchitecture | |
| if [ "${{ matrix.cpu[0] }}" = "snb" ]; then | |
| pip install . --no-build-isolation -v -Csetup-args=-Ddisable_fma=true | |
| else | |
| pip install . --no-build-isolation -v | |
| fi | |
| - name: Test import on ${{ matrix.cpu[1] }} | |
| run: | | |
| echo "Testing basic import on ${{ matrix.cpu[1] }}..." | |
| sde -${{ matrix.cpu[0] }} -- python -c " | |
| import numpy as np | |
| print('NumPy version:', np.__version__) | |
| from numpy_quaddtype import QuadPrecDType | |
| print('QuadPrecDType imported successfully!') | |
| arr = np.zeros(3, dtype=QuadPrecDType()) | |
| print('Created quad array:', arr) | |
| print('SUCCESS: Works on ${{ matrix.cpu[1] }}!') | |
| " | |
| - name: Run tests on ${{ matrix.cpu[1] }} | |
| run: | | |
| pip install pytest mpmath | |
| sde -${{ matrix.cpu[0] }} -- python -m pytest tests/ -v --tb=short -v -s |