Skip to content

Commit

Permalink
fix: Setting target arch for Linux/Windows to skylake
Browse files Browse the repository at this point in the history
  • Loading branch information
mwiewior committed Jan 13, 2025
1 parent aa460de commit a53005f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/publish_to_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ permissions:

# Make sure CI fails on all warnings, including Clippy lints
env:
RUSTFLAGS: "-Dwarnings -Ctarget-cpu=native"

POETRY_VERSION: 1.8.4

jobs:
Expand Down Expand Up @@ -74,10 +74,11 @@ jobs:
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}

args: --release --out dist --find-interpreter
sccache: 'true'
manylinux: auto
env:
RUSTFLAGS: "-Dwarnings -Ctarget-cpu=skylake"

- name: Upload wheels
uses: actions/upload-artifact@v4
Expand All @@ -101,12 +102,11 @@ jobs:
- name: Build wheels
uses: PyO3/maturin-action@v1
with:

target: ${{ matrix.target }}

args: --release --out dist --find-interpreter
sccache: 'true'

env:
RUSTFLAGS: "-Dwarnings -Ctarget-cpu=skylake"
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -138,7 +138,7 @@ jobs:
name: wheels-macos-${{ matrix.target }}
path: dist
env:
RUSTFLAGS: "-Clink-arg=-undefined -Clink-arg=dynamic_lookup"
RUSTFLAGS: "-Dwarnings -Clink-arg=-undefined -Clink-arg=dynamic_lookup -Ctarget-cpu=native"

sdist:
runs-on: ubuntu-latest
Expand Down
7 changes: 2 additions & 5 deletions docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,15 @@
pip install polars-bio
```
There are binary versions for Linux (x86_64), MacOS (x86_64 and arm64) and Windows (x86_64).
!!! Note
In case of Xeon processors, you are advised to build the package from source to avoid `Illegal instruction (core dumped)` errors.

In case of other platforms (or errors indicating incompatibilites between Python's ABI), it is fairly easy to build polars-bio from source with [maturin](https://github.com/PyO3/maturin):
```shell
RUSTFLAGS="-Ctarget-cpu=native" maturin build --release -m Cargo.toml
```
and you should see the following output:
```shell
Compiling polars_bio v0.2.11 (/Users/mwiewior/research/git/polars-bio)
Compiling polars_bio v0.5.2 (/Users/mwiewior/research/git/polars-bio)
Finished `release` profile [optimized] target(s) in 1m 25s
📦 Built wheel for abi3 Python ≥ 3.8 to /Users/mwiewior/research/git/polars-bio/target/wheels/polars_bio-0.2.11-cp38-abi3-macosx_11_0_arm64.whl
📦 Built wheel for abi3 Python ≥ 3.8 to /Users/mwiewior/research/git/polars-bio/target/wheels/polars_bio-0.5.2-cp38-abi3-macosx_11_0_arm64.whl
```
and finally install the package with pip:
```bash
Expand Down

0 comments on commit a53005f

Please sign in to comment.