Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: build py-polars with arrow2 simd error #4273

Closed
gaoxinge opened this issue Aug 5, 2022 · 4 comments
Closed

Question: build py-polars with arrow2 simd error #4273

gaoxinge opened this issue Aug 5, 2022 · 4 comments

Comments

@gaoxinge
Copy link
Contributor

gaoxinge commented Aug 5, 2022

environement

  • os: windows
  • rust:
cargo 1.62.0 (a748cf5a3 2022-06-08)
release: 1.62.0
commit-hash: a748cf5a3e666bc2dcdf54f37adef8ef22196452
commit-date: 2022-06-08
host: x86_64-pc-windows-gnu
libgit2: 1.4.2 (sys:0.14.2 vendored)
libcurl: 7.80.0-DEV (sys:0.4.51+curl-7.80.0 vendored ssl:Schannel)
os: Windows 10.0.19043 (Windows 10 Home China) [64-bit]

question

I build py-polars from source code by following the command in https://github.com/pola-rs/polars#python-compile-polars-from-source, but with error:

error[E0432]: unresolved import `std::simd::SimdPartialEq`
 --> C:\Users\gaoxinge\.cargo\git\checkouts\arrow2-945af624853845da\fed029b\src\types\simd\packed.rs:4:5
  |
4 |     SimdPartialEq,
  |     ^^^^^^^^^^^^^ no `SimdPartialEq` in `simd`
...
@gaoxinge gaoxinge changed the title build py-polars with arrow2 simd error question: build py-polars with arrow2 simd error Aug 5, 2022
@gaoxinge gaoxinge changed the title question: build py-polars with arrow2 simd error Question: build py-polars with arrow2 simd error Aug 5, 2022
@ritchie46
Copy link
Member

You need to use latest nightly to compile SIMD.

@gaoxinge
Copy link
Contributor Author

gaoxinge commented Aug 7, 2022

Thx, I upgrade the rust to

cargo 1.64.0-nightly (4fd148c47 2022-08-03)
release: 1.64.0-nightly
commit-hash: 4fd148c47e733770c537efac5220744945d572ef
commit-date: 2022-08-03
host: x86_64-pc-windows-gnu
libgit2: 1.4.2 (sys:0.14.2 vendored)
libcurl: 7.83.1-DEV (sys:0.4.55+curl-7.83.1 vendored ssl:Schannel)
os: Windows 10.0.19043 (Windows 10 Home China) [64-bit]

And now it's ok to run maturin develop to build py-polars, but it fails to run

maturin develop --release -- -C codegen-units=16 -C lto=thin -C target-cpu=native

with link error

error: linking with `x86_64-w64-mingw32-gcc` failed: exit code: 1
  |
  = note: "x86_64-w64-mingw32-gcc" "..."
  = note: C:/gaoxinge/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\gaoxinge\github\polars\py-polars\target\release\deps\polars.
polars.0186173c-cgu.10.rcgu.o:polars.0186173c-cg:(.text+0x4043): undefined reference to `__imp__ZN11polars_core10PROCESS_ID17ha0408888220fd33aE'
...
          collect2.exe: error: ld returned 1 exit status

  = help: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
  = note: use the `-l` flag to specify native libraries to link
  = note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorustc-link-
libkindname)

@braaannigan
Copy link
Collaborator

Think I've got a related issue in #4339

@gaoxinge
Copy link
Contributor Author

gaoxinge commented Aug 12, 2022

@braaannigan You can run cargo --version --verbose command to check whether rust version is stable or nightly in your development directory right now.

If rust is stable in your development directory, you should change the version to nigthly, because simd feature is depend on it.

There have two ways to change the version to nightly:

  • use rustup default nightly to set default version to nigthly instead of stable
  • use rust-toolchain to explicitly declare the rust version in the development directory

I recommand to use second one. But now in the polars project, the rust-toolchain is only in py-polars directory, not in the root directory. So when you in root directory or polars directory, you should use first one to change the version to nightly by yourself.

To be convenient, I push a pr #4275 for this.

Except for rust version, you may also need to run command rustup update to upgrade your rust, if your rust is old.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants