Skip to content

Commit 327c4b9

Browse files
committed
rebase on main
1 parent a15d431 commit 327c4b9

16 files changed

+356
-578
lines changed

.github/workflows/posix.yml

Lines changed: 0 additions & 121 deletions
This file was deleted.

.github/workflows/wheel.yml

Lines changed: 258 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,258 @@
1+
name: build-wheel
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
workflow_dispatch: null
9+
schedule:
10+
- cron: '0 0 * * 0'
11+
12+
env:
13+
OPENBLAS_COMMIT: "v0.3.30"
14+
MACOSX_DEPLOYMENT_TARGET: 10.9
15+
OPENBLAS_ROOT: "c:\\opt"
16+
# Preserve working directory for calls into bash
17+
# Without this, invoking bash will cd to the home directory
18+
CHERE_INVOKING: "yes"
19+
20+
jobs:
21+
build:
22+
runs-on: ${{ matrix.os }}
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
include:
27+
- { os: ubuntu-latest, PLAT: i686, INTERFACE64: '0', MB_ML_VER: '2014', MB_ML_LIBC: manylinux}
28+
29+
- { os: ubuntu-latest, PLAT: x86_64, INTERFACE64: '0', MB_ML_VER: '2014', MB_ML_LIBC: manylinux}
30+
- { os: ubuntu-latest, PLAT: x86_64, INTERFACE64: '1', MB_ML_VER: '2014', MB_ML_LIBC: manylinux}
31+
32+
- { os: macos-latest, PLAT: x86_64, INTERFACE64: '0', MB_ML_LIBC: macosx}
33+
- { os: macos-latest, PLAT: x86_64, INTERFACE64: '1', MB_ML_LIBC: macosx}
34+
35+
- { os: macos-latest, PLAT: arm64, INTERFACE64: '0', MB_ML_LIBC: macosx}
36+
- { os: macos-latest, PLAT: arm64, INTERFACE64: '1', MB_ML_LIBC: macosx}
37+
38+
- { os: ubuntu-latest, PLAT: x86_64, INTERFACE64: '0', MB_ML_VER: '_1_2', MB_ML_LIBC: musllinux}
39+
- { os: ubuntu-latest, PLAT: x86_64, INTERFACE64: '1', MB_ML_VER: '_1_2', MB_ML_LIBC: musllinux}
40+
41+
- { os: ubuntu-24.04-arm, PLAT: aarch64, INTERFACE64: '0', MB_ML_VER: '2014', MB_ML_LIBC: manylinux}
42+
- { os: ubuntu-24.04-arm, PLAT: aarch64, INTERFACE64: '1', MB_ML_VER: '2014', MB_ML_LIBC: manylinux}
43+
44+
- { os: ubuntu-24.04-arm, PLAT: aarch64, INTERFACE64: '0', MB_ML_VER: '_1_2', MB_ML_LIBC: musllinux}
45+
- { os: ubuntu-24.04-arm, PLAT: aarch64, INTERFACE64: '1', MB_ML_VER: '_1_2', MB_ML_LIBC: musllinux}
46+
47+
48+
- { os: windows-latest, PLAT: amd64, INTERFACE64: '1', MB_ML_LIBC: win}
49+
- { os: windows-latest, PLAT: amd64, INTERFACE64: '0', MB_ML_LIBC: win}
50+
- { os: windows-latest, PLAT: x86, INTERFACE64: '0', MB_ML_LIBC: win}
51+
52+
- { os: windows-11-arm, PLAT: arm64, INTERFACE64: '1', MB_ML_LIBC: win}
53+
- { os: windows-11-arm, PLAT: arm64, INTERFACE64: '0', MB_ML_LIBC: win}
54+
55+
env:
56+
NIGHTLY: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
57+
MB_ML_LIBC: ${{ matrix.MB_ML_LIBC }}
58+
MB_ML_VER: ${{ matrix.MB_ML_VER }}
59+
INTERFACE64: ${{ matrix.INTERFACE64 }}
60+
BUILD_DIR: ${{ github.workspace }}
61+
PLAT: ${{ matrix.PLAT }}
62+
OS-NAME: ${{ matrix.os }}
63+
64+
steps:
65+
- uses: actions/[email protected]
66+
with:
67+
submodules: recursive
68+
fetch-depth: 0
69+
70+
- uses: maxim-lobanov/[email protected]
71+
if: ${{ contains(matrix.os, 'macos') }}
72+
with:
73+
xcode-version: '16.0'
74+
75+
- name: Print some Environment variable
76+
run: |
77+
echo "PLAT: ${PLAT}"
78+
- name: install-rtools
79+
if: ${{ matrix.os == 'windows-latest' }}
80+
run: |
81+
# rtools 42+ does not support 32 bits builds.
82+
choco install -y rtools --no-progress --force --version=4.0.0.20220206
83+
84+
- name: Set env variables
85+
if: ${{ matrix.os == 'windows-latest' }}
86+
run: |
87+
echo "START_DIR=$PWD" >> $env:GITHUB_ENV
88+
# For interpretation of MSYSTEM, see:
89+
# https://sourceforge.net/p/msys2/discussion/general/thread/b7dfdac8/#3939
90+
if ( "${{ matrix.plat }}" -eq "x86") {
91+
echo "PLAT=i686" >> $env:GITHUB_ENV
92+
echo "WHEEL_PLAT=win32" >> $env:GITHUB_ENV
93+
echo "MSYSTEM=MINGW32" >> $env:GITHUB_ENV
94+
# No ucrt on 32-bits, so use _snprintf_c instead
95+
echo "LDFLAGS=-static -static-libgcc -Wl,--defsym,_quadmath_snprintf=__snprintf_c" >> $env:GITHUB_ENV
96+
echo "BUILD_BITS=32" >> $env:GITHUB_ENV
97+
} else {
98+
echo "PLAT=x86_64" >> $env:GITHUB_ENV
99+
echo "WHEEL_PLAT=win_amd64" >> $env:GITHUB_ENV
100+
echo "MSYSTEM=UCRT64" >> $env:GITHUB_ENV
101+
echo "LDFLAGS=-lucrt -static -static-libgcc -Wl,--defsym,quadmath_snprintf=snprintf" >> $env:GITHUB_ENV
102+
echo "BUILD_BITS=64" >> $env:GITHUB_ENV
103+
}
104+
if ( ${{ matrix.INTERFACE64 }} -eq "1" ) {
105+
echo "INTERFACE64=1" >> $env:GITHUB_ENV
106+
}
107+
$CIBW = "${{ github.workspace }}/.openblas"
108+
$CIBW = $CIBW.replace("\","/")
109+
echo "CIBW_ENVIRONMENT_WINDOWS=PKG_CONFIG_PATH=$CIBW" >> $env:GITHUB_ENV
110+
111+
- name: Debug
112+
if: ${{ matrix.os == 'windows-latest' }}
113+
run: |
114+
echo CIBW_ENVIRONMENT_WINDOWS=$env:CIBW_ENVIRONMENT_WINDOWS
115+
116+
- name: Setup visual studio
117+
if: ${{ matrix.os == 'windows-11-arm' }}
118+
uses: microsoft/setup-msbuild@v2
119+
120+
- name: Download, install 7zip.
121+
if: ${{ matrix.os == 'windows-11-arm' }}
122+
run: |
123+
Invoke-WebRequest https://www.7-zip.org/a/7z2409-arm64.exe -UseBasicParsing -OutFile 7z_arm.exe
124+
Start-Process -FilePath ".\7z_arm.exe" -ArgumentList "/S" -Wait
125+
echo "C:\Program Files\7-Zip" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
126+
127+
- name: Download and install LLVM installer
128+
if: ${{ matrix.os == 'windows-11-arm' }}
129+
run: |
130+
Invoke-WebRequest https://github.com/llvm/llvm-project/releases/download/llvmorg-19.1.5/LLVM-19.1.5-woa64.exe -UseBasicParsing -OutFile LLVM-woa64.exe
131+
Start-Process -FilePath ".\LLVM-woa64.exe" -ArgumentList "/S" -Wait
132+
echo "C:\Program Files\LLVM\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
133+
134+
- name: Update CMake for WoA
135+
if: ${{ matrix.os == 'windows-11-arm' }}
136+
run: |
137+
pip install cmake
138+
get-command cmake
139+
- name: Set env variables
140+
if: ${{ matrix.os == 'windows-11-arm' }}
141+
run: |
142+
if ( ${{ matrix.INTERFACE64 }} -eq "1" ) {
143+
echo "INTERFACE_BITS=64" >> $env:GITHUB_ENV
144+
} else {
145+
echo "INTERFACE_BITS=32" >> $env:GITHUB_ENV
146+
}
147+
148+
149+
# - name: Setup tmate session
150+
# if: ${{ failure() }}
151+
# uses: mxschmitt/action-tmate@v3
152+
# with:
153+
# limit-access-to-actor: true
154+
155+
- name: Build OpenBLAS for Windows
156+
if: ${{ matrix.os == 'windows-latest' }}
157+
run: |
158+
Set-Item -Path env:BASH_PATH -Value "c:\\rtools40\\usr\\bin\\bash.exe"
159+
# Build
160+
& $env:BASH_PATH -lc tools/build_openblas.sh
161+
162+
# Test
163+
& $env:BASH_PATH -lc tools/build_gfortran.sh
164+
echo "Static test"
165+
.\for_test\test.exe
166+
echo "Dynamic test"
167+
.\for_test\test_dyn.exe
168+
169+
# Copy
170+
cp for_test\test*.exe builds
171+
172+
bash tools/build_wheel_prepare_for_win.sh
173+
- name: Build OpenBLAS for Windows On ARM
174+
if: ${{ matrix.os == 'windows-11-arm' }}
175+
run: |
176+
Set-Item -Path env:BASH_PATH -Value "C:\\Program Files\\Git\\bin\\bash.exe"
177+
.\tools\build_steps_win_arm64.bat 64 ${env:INTERFACE_BITS}
178+
179+
- name: Set CIBW_BUILD
180+
shell: bash
181+
run: |
182+
if [[ "${{ matrix.os }}" == "windows-latest" && "${{matrix.PLAT}}" == "x86" ]]; then
183+
echo "CIBW_BUILD=cp39-${{ matrix.MB_ML_LIBC }}32" >> $GITHUB_ENV
184+
else
185+
echo "CIBW_BUILD=cp39-${{ matrix.MB_ML_LIBC }}_${{ matrix.PLAT }}" >> $GITHUB_ENV
186+
fi
187+
188+
- name: Build and Test wheels
189+
uses: pypa/[email protected]
190+
with:
191+
output-dir: dist
192+
env:
193+
CIBW_BUILD_VERBOSITY: 1
194+
195+
CIBW_MANYLINUX_I686_IMAGE: ${{ matrix.MB_ML_LIBC }}${{matrix.MB_ML_VER}}
196+
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.MB_ML_LIBC }}${{matrix.MB_ML_VER}}
197+
CIBW_MUSLLINUX_X86_64_IMAGE: ${{ matrix.MB_ML_LIBC }}${{matrix.MB_ML_VER}}
198+
CIBW_MANYLINUX_AARCH64_IMAGE: ${{ matrix.MB_ML_LIBC }}${{matrix.MB_ML_VER}}
199+
CIBW_MUSLLINUX_AARCH64_IMAGE: ${{ matrix.MB_ML_LIBC }}${{matrix.MB_ML_VER}}
200+
201+
- name: Upload wheels to artifacts
202+
if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'ubuntu-24.04-arm' || matrix.os == 'macos-latest' }}
203+
uses: actions/[email protected]
204+
with:
205+
name: wheels-${{ matrix.os }}-${{ matrix.PLAT }}-${{ matrix.INTERFACE64 }}-${{ matrix.MB_ML_LIBC }}-${{ matrix.MB_ML_VER }}
206+
path: dist/scipy_openblas*.whl
207+
208+
209+
- name: Upload openblas to artifacts
210+
if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'ubuntu-24.04-arm' || matrix.os == 'macos-latest' }}
211+
uses: actions/[email protected]
212+
with:
213+
name: openblas-${{ matrix.os }}-${{ matrix.PLAT }}-${{ matrix.INTERFACE64 }}-${{ matrix.MB_ML_LIBC }}-${{ matrix.MB_ML_VER }}
214+
path: dist/openblas*.tar.gz
215+
- name: Pack
216+
if: ${{ matrix.os == 'windows-11-arm' }}
217+
run: |
218+
cd local
219+
cp -r "scipy_openblas${env:INTERFACE_BITS}" $env:INTERFACE_BITS
220+
7z a ../builds/openblas-${env:PLAT}-${env:INTERFACE64}.zip -tzip $env:INTERFACE_BITS
221+
222+
- uses: actions/[email protected]
223+
if: ${{ matrix.os == 'windows-latest' || matrix.os == 'windows-11-arm' }}
224+
with:
225+
name: wheels-${{matrix.plat }}-${{ matrix.INTERFACE64 }}
226+
path: dist/scipy_openblas*.whl
227+
228+
- uses: actions/[email protected]
229+
if: ${{ matrix.os == 'windows-latest' || matrix.os == 'windows-11-arm' }}
230+
with:
231+
name: openblas-${{matrix.plat }}-${{ matrix.INTERFACE64 }}
232+
path: builds/openblas*.zip
233+
- name: Install Anaconda client
234+
if: ${{ matrix.os == 'windows-11-arm' }}
235+
run: |
236+
pip install anaconda-client
237+
238+
- uses: conda-incubator/[email protected]
239+
if: ${{ matrix.os != 'windows-11-arm' }}
240+
with:
241+
channels: conda-forge
242+
channel-priority: true
243+
activate-environment: upload
244+
miniforge-version: latest
245+
conda-remove-defaults: "true"
246+
- name: install anaconda client
247+
if: ${{ matrix.os != 'windows-11-arm' }}
248+
run: |
249+
conda install anaconda-client
250+
- name: Upload
251+
# see https://github.com/marketplace/actions/setup-miniconda for why
252+
# `-el {0}` is required.
253+
shell: bash -el {0}
254+
env:
255+
ANACONDA_SCIENTIFIC_PYTHON_UPLOAD: ${{ secrets.ANACONDA_SCIENTIFIC_PYTHON_UPLOAD }}
256+
run: |
257+
source tools/upload_to_anaconda_staging.sh
258+
upload_wheels

0 commit comments

Comments
 (0)