azmyrajab / polars_ols

Polars least squares extension - enables fast linear model polar expressions
MIT License
113 stars 10 forks source link

Build issue - pulp - mismatched types #30

Closed tmct closed 2 months ago

tmct commented 3 months ago

Hi,

What version of the rust nightly toolchain may be used to successfully compile polars-ols?

I have tried two versions, and they both exhibit this error in compilation:

error[E0308]: mismatched types
    --> /opt/cargo/registry/src/basic.artifactory.c3.zone-bd7a4d0d4fcf8bb0/pulp-0.18.10/src/core_arch/mod.rs:44:62
     |
44   |                   unsafe { arch::$func $(::<$($generic,)*>)?($($arg,)*) }
     |                            -----------                         ^^^^ expected `*mut i32`, found `*mut i64`
     |                            |
     |                            arguments to this function are incorrect
     |
    ::: /opt/cargo/registry/src/basic.artifactory.c3.zone-bd7a4d0d4fcf8bb0/pulp-0.18.10/src/core_arch/x86/avx512f.rs:5:5
     |
5    | /     delegate! {
6    | |         fn _mm512_abs_epi32(a: __m512i) -> __m512i;
7    | |         fn _mm512_mask_abs_epi32(src: __m512i, k: __mmask16, a: __m512i) -> __m512i;
8    | |         fn _mm512_maskz_abs_epi32(k: __mmask16, a: __m512i) -> __m512i;
...    |
3423 | |         fn _mm_comi_round_sd<const IMM5: i32, const SAE: i32>(a: __m128d, b: __m128d) -> i32;
3424 | |     }
     | |_____- in this macro invocation
     |
     = note: expected raw pointer `*mut i32`
                found raw pointer `*mut i64`
note: function defined here
    --> /rustc/636d7ff91b9847d6d43c7bbe023568828f6e3246/library/core/src/../../stdarch/crates/core_arch/src/x86/avx512f.rs:29051:15
     = note: this error originates in the macro `delegate` (in Nightly builds, run with -Z macro-backtrace for more info)

Versions tried:

(It's possible that something else is wrong with my setup, sorry...)

Thanks Tom

azmyrajab commented 3 months ago

Hi Tom,

Are you using maturin develop to build? If you provide me with commands and versions you are using Ill try to take a look at this and the other issue you raised this weekend

best, Azmy

tmct commented 3 months ago

Hi Azmy,

I was only trying cargo build, I will have to try maturin develop in the morning and let you know, thanks!

Tom

azmyrajab commented 2 months ago

Hi @tmct - upgraded to the latest rust and bumped the pulp version and CI tests now pass on all platforms

You may have been right in noting that modern rust didn't play well with an old version of pulp on some platforms with cargo; in any case this should now be resolved.

In case in case you are still interested in building the library / making contributions etc.: recommend taking a look at the MakeFile. It should have a clean set of steps to reproduce a polars ols build and test run. You can then use maturin develop --release after making any source changes which you would like to test out