Skip to content

Commit db637ab

Browse files
authored
Merge pull request #249 from ffgan/rv64_cross_build
feat: build riscv64+glibc wheel
2 parents 7e85250 + b62e93d commit db637ab

File tree

5 files changed

+25
-16
lines changed

5 files changed

+25
-16
lines changed

.github/workflows/posix.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ jobs:
4747
- { os: ubuntu-24.04-arm, PLAT: s390x, INTERFACE64: '0', MB_ML_VER: '2014', MB_ML_LIBC: manylinux}
4848
- { os: ubuntu-24.04-arm, PLAT: s390x, INTERFACE64: '1', MB_ML_VER: '2014', MB_ML_LIBC: manylinux}
4949

50+
- { os: ubuntu-24.04-arm, PLAT: riscv64, INTERFACE64: '0', MB_ML_VER: '_2_39', MB_ML_LIBC: manylinux}
51+
- { os: ubuntu-24.04-arm, PLAT: riscv64, INTERFACE64: '1', MB_ML_VER: '_2_39', MB_ML_LIBC: manylinux}
52+
5053
env:
5154
NIGHTLY: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
5255
MB_ML_LIBC: ${{ matrix.MB_ML_LIBC }}
@@ -57,7 +60,7 @@ jobs:
5760
OS-NAME: ${{ matrix.os }}
5861

5962
steps:
60-
- uses: actions/checkout@v4.1.1
63+
- uses: actions/checkout@v6.0.1
6164
with:
6265
submodules: recursive
6366
fetch-depth: 0
@@ -73,8 +76,8 @@ jobs:
7376
xcode-version: '15.4'
7477

7578
- name: Set up QEMU
76-
if: matrix.PLAT == 'ppc64le' || matrix.PLAT == 's390x'
77-
uses: docker/setup-qemu-action@v3
79+
if: matrix.PLAT == 'ppc64le' || matrix.PLAT == 's390x' || matrix.PLAT == 'riscv64'
80+
uses: docker/setup-qemu-action@v3.7.0
7881
with:
7982
platforms: all
8083

@@ -89,7 +92,7 @@ jobs:
8992
# limit-access-to-actor: true
9093

9194
- name: Build and Test wheels
92-
uses: pypa/cibuildwheel@v3.3.0
95+
uses: pypa/cibuildwheel@v3.3.1
9396
timeout-minutes: 60
9497
with:
9598
output-dir: dist
@@ -107,15 +110,16 @@ jobs:
107110
CIBW_MUSLLINUX_PPC64LE_IMAGE: ${{ matrix.MB_ML_LIBC }}${{matrix.MB_ML_VER}}
108111
CIBW_MANYLINUX_S390X_IMAGE: ${{ matrix.MB_ML_LIBC }}${{matrix.MB_ML_VER}}
109112
CIBW_MUSLLINUX_S390X_IMAGE: ${{ matrix.MB_ML_LIBC }}${{matrix.MB_ML_VER}}
113+
CIBW_MANYLINUX_RISCV64_IMAGE: ${{ matrix.MB_ML_LIBC }}${{matrix.MB_ML_VER}}
110114

111115
- name: Upload wheels to artifacts
112-
uses: actions/upload-artifact@v4.3.0
116+
uses: actions/upload-artifact@v6.0.0
113117
with:
114118
name: wheels-${{ matrix.os }}-${{ matrix.PLAT }}-${{ matrix.INTERFACE64 }}-${{ matrix.MB_ML_LIBC }}-${{ matrix.MB_ML_VER }}
115119
path: dist/scipy_openblas*.whl
116120

117121

118-
- uses: conda-incubator/setup-miniconda@v3.2.0
122+
- uses: conda-incubator/setup-miniconda@v3.3.0
119123
with:
120124
channels: conda-forge
121125
channel-priority: true

.github/workflows/windows-arm.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ jobs:
3030

3131
steps:
3232

33-
- uses: actions/checkout@v4.1.1
33+
- uses: actions/checkout@v6.0.1
3434

3535
- name: Set up Python
36-
uses: actions/setup-python@v5
36+
uses: actions/setup-python@v6.2.0
3737
with:
3838
python-version: 3.12
3939
architecture: arm64
@@ -74,7 +74,7 @@ jobs:
7474
python -m scipy_openblas${env:INTERFACE_BITS}
7575
python -c "import scipy_openblas${env:INTERFACE_BITS}; print(scipy_openblas${env:INTERFACE_BITS}.get_pkg_config())"
7676
77-
- uses: actions/upload-artifact@v4.3.0
77+
- uses: actions/upload-artifact@v6.0.0
7878
with:
7979
name: wheels-${{ env.PLAT }}-${{ env.INTERFACE64 }}
8080
path: dist/scipy_openblas*.whl
@@ -85,6 +85,8 @@ jobs:
8585
Invoke-WebRequest https://static.rust-lang.org/rustup/dist/aarch64-pc-windows-msvc/rustup-init.exe -UseBasicParsing -Outfile rustup-init.exe
8686
.\rustup-init.exe -y
8787
$env:PATH="$env:PATH;$env:USERPROFILE\.cargo\bin"
88+
# cryptography dropped win-arm64 for 46.0.4, make sure we don't try to compile from source
89+
pip install --only-binary :all: cryptography
8890
pip install anaconda-client
8991
9092
- name: Upload

.github/workflows/windows.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131

3232
timeout-minutes: 90
3333
steps:
34-
- uses: actions/checkout@v4.1.1
34+
- uses: actions/checkout@v6.0.1
3535
- name: install-rtools
3636
run: |
3737
# rtools 42+ does not support 32 bits builds.
@@ -85,7 +85,7 @@ jobs:
8585
cp for_test\test*.exe builds
8686
8787
- name: Set up Python
88-
uses: actions/setup-python@v5
88+
uses: actions/setup-python@v6.2.0
8989
with:
9090
python-version: 3.9
9191
architecture: ${{ matrix.plat }}
@@ -141,12 +141,12 @@ jobs:
141141
fi
142142
143143
- name: Set up different Python
144-
uses: actions/setup-python@v5
144+
uses: actions/setup-python@v6.2.0
145145
with:
146146
python-version: 3.11
147147
architecture: ${{ matrix.plat }}
148148

149-
- uses: actions/upload-artifact@v4.3.0
149+
- uses: actions/upload-artifact@v6.0.0
150150
with:
151151
name: wheels-${{matrix.plat }}-${{ matrix.INTERFACE64 }}
152152
path: dist/scipy_openblas*.whl

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ build-backend = "setuptools.build_meta"
99
[project]
1010
name = "scipy-openblas64"
1111
# v0.3.31-22-g5ffbf38b
12-
version = "0.3.31.22.0"
12+
version = "0.3.31.22.1"
1313
requires-python = ">=3.7"
1414
description = "Provides OpenBLAS for python packaging"
1515
readme = "README.md"

tools/build_steps.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ function get_plat_tag {
6868
local mb_ml_ver=${MB_ML_VER:-1}
6969
local mb_ml_libc=${MB_ML_LIBC:-manylinux}
7070
case $plat in
71-
i686|x86_64|arm64|universal2|intel|aarch64|s390x|ppc64le|loongarch64) ;;
71+
i686|x86_64|arm64|universal2|intel|aarch64|s390x|ppc64le|loongarch64|riscv64) ;;
7272
*) echo Did not recognize plat $plat; return 1 ;;
7373
esac
7474
local uname=${2:-$(uname)}
@@ -153,6 +153,9 @@ function build_lib {
153153
Linux-loongarch64)
154154
local target="GENERIC"
155155
;;
156+
Linux-riscv64)
157+
local target="GENERIC"
158+
;;
156159
*) echo "Strange plat value $plat"; exit 1 ;;
157160
esac
158161
case $interface64 in
@@ -185,7 +188,7 @@ function build_lib {
185188
echo "the utest samin/damin have been temporarily disabled."
186189
echo "QEMU does not support the 'lper' /'lpdr' instructions used"
187190
fi
188-
if [ "$plat" == "loongarch64" ] || [ "$plat" == "ppc64le" ] || [ "$plat" == "s390x" ]; then
191+
if [ "$plat" == "loongarch64" ] || [ "$plat" == "ppc64le" ] || [ "$plat" == "s390x" ] || [ "$plat" == "riscv64" ]; then
189192
sed -i 's/CTEST(fork, safety)/CTEST_SKIP(fork, safety)/g' ./utest/test_fork.c
190193
sed -i 's/CTEST(fork, safety_after_fork_in_parent)/CTEST_SKIP(fork, safety_after_fork_in_parent)/g' ./utest/test_post_fork.c
191194
echo "QEMU has a race condition preventing fork tests to work as expected"

0 commit comments

Comments
 (0)