Skip to content

Commit b3f56fd

Browse files
authored
Merge pull request #29238 from charris/backport29215
CI: Add support for building NumPy with LLVM for Win-ARM64
2 parents 18d157a + b20d754 commit b3f56fd

File tree

3 files changed

+97
-4
lines changed

3 files changed

+97
-4
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Build Dependencies(Win-ARM64)
2+
description: "Setup LLVM for Win-ARM64 builds"
3+
4+
runs:
5+
using: "composite"
6+
steps:
7+
- name: Install LLVM with checksum verification
8+
shell: pwsh
9+
run: |
10+
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
11+
$expectedHash = "92f69a1134e32e54b07d51c6e24d9594852f6476f32c3d70471ae00fffc2d462"
12+
$fileHash = (Get-FileHash -Path "LLVM-woa64.exe" -Algorithm SHA256).Hash
13+
if ($fileHash -ne $expectedHash) {
14+
Write-Error "Checksum verification failed. The downloaded file may be corrupted or tampered with."
15+
exit 1
16+
}
17+
Start-Process -FilePath ".\LLVM-woa64.exe" -ArgumentList "/S" -Wait
18+
echo "C:\Program Files\LLVM\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
19+
echo "CC=clang-cl" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
20+
echo "CXX=clang-cl" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
21+
echo "FC=flang-new" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
22+

.github/workflows/wheels.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,9 @@ jobs:
125125
with:
126126
architecture: 'x86'
127127

128-
- name: Setup MSVC arm64
128+
- name: Setup LLVM for Windows ARM64
129129
if: ${{ matrix.buildplat[1] == 'win_arm64' }}
130-
uses: bus1/cabuild/action/msdevshell@e22aba57d6e74891d059d66501b6b5aed8123c4d # v1
131-
with:
132-
architecture: 'arm64'
130+
uses: ./.github/windows_arm64_steps
133131

134132
- name: pkg-config-for-win
135133
run: |

.github/workflows/windows.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,79 @@ jobs:
8585
run: |
8686
spin test -- --timeout=600 --durations=10
8787
88+
python64bit_openblas_winarm64:
89+
name: arm64, LPARM64 OpenBLAS
90+
runs-on: windows-11-arm
91+
# To enable this job on a fork, comment out:
92+
if: github.repository == 'numpy/numpy'
93+
strategy:
94+
fail-fast: false
95+
matrix:
96+
compiler-pyversion:
97+
- ["MSVC", "3.11"]
98+
- ["Clang-cl", "3.14t-dev"]
99+
100+
steps:
101+
- name: Checkout
102+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
103+
with:
104+
submodules: recursive
105+
fetch-tags: true
106+
persist-credentials: false
107+
108+
- name: Setup Python
109+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
110+
with:
111+
python-version: ${{ matrix.compiler-pyversion[1] }}
112+
architecture: arm64
113+
114+
- name: Setup MSVC
115+
if: matrix.compiler-pyversion[0] == 'MSVC'
116+
uses: bus1/cabuild/action/msdevshell@e22aba57d6e74891d059d66501b6b5aed8123c4d # v1
117+
with:
118+
architecture: arm64
119+
120+
- name: Install build dependencies from PyPI
121+
run: |
122+
pip install -r requirements/build_requirements.txt
123+
124+
- name: Install pkg-config
125+
run: |
126+
choco install -y --stoponfirstfailure --checksum 6004DF17818F5A6DBF19CB335CC92702 pkgconfiglite
127+
echo "PKG_CONFIG_PATH=${{ github.workspace }}/.openblas" >> $env:GITHUB_ENV
128+
129+
- name: Install Clang-cl
130+
if: matrix.compiler-pyversion[0] == 'Clang-cl'
131+
uses: ./.github/windows_arm64_steps
132+
133+
- name: Install NumPy (MSVC)
134+
if: matrix.compiler-pyversion[0] == 'MSVC'
135+
run: |
136+
pip install -r requirements/ci_requirements.txt
137+
spin build --with-scipy-openblas=32 -j2 -- --vsenv
138+
139+
- name: Install NumPy (Clang-cl)
140+
if: matrix.compiler-pyversion[0] == 'Clang-cl'
141+
run: |
142+
"[binaries]","c = 'clang-cl'","cpp = 'clang-cl'","ar = 'llvm-lib'","c_ld = 'lld-link'","cpp_ld = 'lld-link'" | Out-File $PWD/clang-cl-arm64.ini -Encoding ascii
143+
pip install -r requirements/ci_requirements.txt
144+
spin build --with-scipy-openblas=32 -j2 -- --vsenv --native-file=$PWD/clang-cl-arm64.ini
145+
146+
- name: Meson Log
147+
shell: bash
148+
if: ${{ failure() }}
149+
run: |
150+
cat build/meson-logs/meson-log.txt
151+
152+
- name: Install test dependencies
153+
run: |
154+
python -m pip install -r requirements/test_requirements.txt
155+
python -m pip install threadpoolctl
156+
157+
- name: Run test suite
158+
run: |
159+
spin test -- --timeout=600 --durations=10
160+
88161
msvc_python_no_openblas:
89162
name: MSVC, ${{ matrix.architecture }} Python , no BLAS
90163
runs-on: ${{ matrix.os }}

0 commit comments

Comments
 (0)