Skip to content

Commit

Permalink
chore: Doc update for building (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
mwiewior authored Jan 12, 2025
1 parent 7220ad3 commit 309e98f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
11 changes: 10 additions & 1 deletion docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,13 @@

Short answer: Polars <= **1.17.1** is supported.

Longer answer: Since Polars has recently [upgraded py03 to 0.23.x](https://github.com/pola-rs/polars/pull/20111) any many other dependencies still rely on 0.22.x, we are currently limited to Polars <= 1.17.1. We are working on upgrading to the latest version of Polars.
Longer answer: Since Polars has recently [upgraded py03 to 0.23.x](https://github.com/pola-rs/polars/pull/20111) any many other dependencies still rely on 0.22.x, we are currently limited to Polars <= 1.17.1. We are working on upgrading to the latest version of Polars.

2. What to do if I get `Illegal instruction (core dumped)` when using polars-bio?
This error is likely due to the fact that the ABI of the polars-bio wheel package does not match the ABI of the Python interpreter.
To fix this, you can build the wheel package from source. See [Quickstart](quickstart.md) for more information.
```bash
#/var/log/syslog

polars-bio-intel kernel: [ 1611.175045] traps: python[8844] trap invalid opcode ip:709d3ec253cc sp:7ffcc28754e8 error:0 in polars_bio.abi3.so[709d36533000+9aab000]
```
19 changes: 16 additions & 3 deletions docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
pip install polars-bio
```
There are binary versions for Linux (x86_64), MacOS (x86_64 and arm64) and Windows (x86_64).
In case of other platforms, you can build polars-bio from source with [maturin](https://github.com/PyO3/maturin):
!!! 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
```
Expand All @@ -12,7 +15,17 @@ and you should see the following output:
Compiling polars_bio v0.2.11 (/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

```
and finally install the package with pip:
```bash
pip install /Users/mwiewior/research/git/polars-bio/target/wheels/polars_bio-0.2.11-cp38-abi3-macosx_11_0_arm64.whl
```

!!! tip
Python>=3.9, Rust compiler and Cargo are required to build the package from source. [rustup](https://rustup.rs/) is the recommended way to install Rust.
Required dependencies:

* Python>=3.9
* cmake,
* Rust compiler
* Cargo
are required to build the package from source. [rustup](https://rustup.rs/) is the recommended way to install Rust.

0 comments on commit 309e98f

Please sign in to comment.