Skip to content

Commit b7fa439

Browse files
author
birchkwok
committed
Add platform-specific BLAS backend configuration and update Linux build dependencies
- Configure BLAS backend per platform: Accelerate for macOS, OpenBLAS for Linux/Windows - Move blas-src from common dependencies to platform-specific target sections - Add libopenblas-dev to Linux CI build dependencies for ARM64/x86_64 cross-compilation support
1 parent 0c4672c commit b7fa439

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

.github/workflows/build-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ jobs:
112112
113113
# Install required packages
114114
sudo apt-get update
115-
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends build-essential pkg-config libssl-dev
115+
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends build-essential pkg-config libssl-dev libopenblas-dev
116116
117117
# Install ARM64 cross-compilation tools if target is ARM64
118118
if [[ "${{ matrix.target }}" == "aarch64-unknown-linux-gnu" ]]; then

Cargo.toml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ crate-type = ["cdylib"]
1111
pyo3 = { version = "0.25.0", features = ["extension-module"] }
1212
numpy = { version = "0.25.0", features = ["half"] }
1313
ndarray = { version = "0.16", features = ["blas"] }
14-
blas-src = { version = "0.10", features = ["accelerate"] }
1514
matrixmultiply = "0.3"
1615
num-complex = "0.4"
1716
tempfile = "3.8.1"
@@ -37,9 +36,16 @@ snap = "1.1"
3736

3837
lru = "0.12"
3938

39+
[target.'cfg(target_os = "macos")'.dependencies]
40+
blas-src = { version = "0.10", features = ["accelerate"] }
41+
4042
[target.'cfg(target_os = "linux")'.dependencies]
43+
blas-src = { version = "0.10", features = ["openblas"] }
4144
libc = "0.2"
42-
io-uring = { version = "0.6", optional = true }
45+
io-uring = { version = "0.6", optional = true }
46+
47+
[target.'cfg(target_os = "windows")'.dependencies]
48+
blas-src = { version = "0.10", features = ["openblas"] }
4349

4450

4551
[build-dependencies]

0 commit comments

Comments
 (0)