gchers / fbleau

A tool for estimating a system's information leakage via Machine Learning
MIT License
10 stars 2 forks source link

Maturin compilation issue #12

Closed gchers closed 2 years ago

gchers commented 3 years ago

maturin build --cargo-extra-args="--features python-module" fails with error:

error[E0308]: mismatched types=========> ] 83/84: fbleau   
   --> src/python_module.rs:103:13                                                                                                                                                                                
    |                                              
103 |             train_x,                                                                                                                                                                                        
    |             ^^^^^^^ expected struct `ArrayBase`, found struct `ndarray::ArrayBase`
    |                             
    = note: expected struct `ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>`
               found struct `ndarray::ArrayBase<ndarray::data_repr::OwnedRepr<f64>, ndarray::dimension::dim::Dim<[usize; 2]>>`
    = note: perhaps two different versions of crate `ndarray` are being used?

error[E0308]: mismatched types=========> ] 83/84: fbleau
   --> src/python_module.rs:104:13
    |                             
104 |             train_y, 
    |             ^^^^^^^ expected struct `ArrayBase`, found struct `ndarray::ArrayBase`
    |                               
    = note: expected struct `ArrayBase<OwnedRepr<usize>, Dim<[usize; 1]>>`
               found struct `ndarray::ArrayBase<ndarray::data_repr::OwnedRepr<usize>, ndarray::dimension::dim::Dim<[usize; 1]>>`
    = note: perhaps two different versions of crate `ndarray` are being used?

error[E0308]: mismatched types=========> ] 83/84: fbleau                                          
   --> src/python_module.rs:105:13       
    |
105 |             test_x,
    |             ^^^^^^ expected struct `ArrayBase`, found struct `ndarray::ArrayBase`
    |                             
    = note: expected struct `ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>`
               found struct `ndarray::ArrayBase<ndarray::data_repr::OwnedRepr<f64>, ndarray::dimension::dim::Dim<[usize; 2]>>`
    = note: perhaps two different versions of crate `ndarray` are being used?

error[E0308]: mismatched types=========> ] 83/84: fbleau
   --> src/python_module.rs:106:13
    |                                                         
106 |             test_y,                                                                                                                                                                                         
    |             ^^^^^^ expected struct `ArrayBase`, found struct `ndarray::ArrayBase`
    |
    = note: expected struct `ArrayBase<OwnedRepr<usize>, Dim<[usize; 1]>>`
               found struct `ndarray::ArrayBase<ndarray::data_repr::OwnedRepr<usize>, ndarray::dimension::dim::Dim<[usize; 1]>>`
    = note: perhaps two different versions of crate `ndarray` are being used?

error: aborting due to 4 previous errors ] 83/84: fbleau

For more information about this error, try `rustc --explain E0308`.

error: could not compile `fbleau`

Probably due to this issue: https://githubmemory.com/repo/PyO3/rust-numpy/issues/188.

Quick fix: use dependency ndarray = "0.15" in Cargo.toml.