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

Unable to compile code #31

Closed
noammor opened this issue Jul 20, 2021 · 4 comments
Closed

Unable to compile code #31

noammor opened this issue Jul 20, 2021 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@noammor
Copy link

noammor commented Jul 20, 2021

I could not get the package to build using the latest versions of Rust and maturin.

Here is the build log:

   Compiling autocfg v1.0.1
   Compiling proc-macro2 v1.0.27
   Compiling unicode-xid v0.2.2
   Compiling libc v0.2.98
   Compiling syn v1.0.73
   Compiling cfg-if v1.0.0
   Compiling proc-macro-hack v0.5.19
   Compiling rawpointer v0.2.1
   Compiling getrandom v0.1.16
   Compiling inventory v0.1.10
   Compiling unindent v0.1.7
   Compiling smallvec v1.6.1
   Compiling scopeguard v1.1.0
   Compiling ppv-lite86 v0.2.10
   Compiling ndarray v0.14.0
   Compiling pyo3 v0.13.2
   Compiling blas-src v0.6.1
   Compiling either v1.6.1
   Compiling hashbrown v0.11.2
   Compiling cfg-if v0.1.10
   Compiling fast_ctc_decode v0.3.0 (/home/noam/code/fast-ctc-decode)
   Compiling instant v0.1.10
   Compiling matrixmultiply v0.3.1
   Compiling matrixmultiply v0.2.4
   Compiling lock_api v0.4.4
   Compiling num-traits v0.2.14
   Compiling num-integer v0.1.44
   Compiling indexmap v1.7.0
   Compiling itertools v0.9.0
   Compiling quote v1.0.9
   Compiling parking_lot_core v0.8.3
   Compiling cblas-sys v0.1.4
   Compiling rand_core v0.5.1
   Compiling parking_lot v0.11.1
   Compiling rand_chacha v0.2.2
   Compiling num-complex v0.3.1
   Compiling num-complex v0.4.0
   Compiling noisy_float v0.1.15
   Compiling paste-impl v0.1.18
   Compiling rand v0.7.3
   Compiling ndarray v0.15.3
   Compiling paste v0.1.18
   Compiling ndarray-stats v0.4.0
   Compiling pyo3-macros-backend v0.13.2
   Compiling ghost v0.1.2
   Compiling indoc-impl v0.3.6
   Compiling ctor v0.1.20
   Compiling inventory-impl v0.1.10
   Compiling pyo3-macros v0.13.2
   Compiling indoc v0.3.6
   Compiling numpy v0.13.2
error[E0554]: `#![feature]` may not be used on the stable release channel
 --> src/lib.rs:1:1
  |
1 | #![feature(static_nobundle)]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0554]: `#![feature]` may not be used on the stable release channel
 --> src/lib.rs:2:1
  |
2 | #![feature(test)] // benchmarking
  | ^^^^^^^^^^^^^^^^^

error[E0308]: mismatched types
   --> src/lib.rs:106:21
    |
106 |                     &network_output,
    |                     ^^^^^^^^^^^^^^^ expected struct `ArrayBase`, found struct `ndarray::ArrayBase`
    |
    = note: expected reference `&ArrayBase<_, Dim<[usize; 2]>>`
	       found reference `&ndarray::ArrayBase<ndarray::ViewRepr<&f32>, ndarray::dimension::dim::Dim<[usize; 2]>>`
    = note: perhaps two different versions of crate `ndarray` are being used?

error[E0308]: mismatched types
   --> src/lib.rs:143:21
    |
143 |                     &network_output,
    |                     ^^^^^^^^^^^^^^^ expected struct `ArrayBase`, found struct `ndarray::ArrayBase`
    |
    = note: expected reference `&ArrayBase<_, Dim<[usize; 3]>>`
	       found reference `&ndarray::ArrayBase<ndarray::ViewRepr<&f32>, ndarray::dimension::dim::Dim<[usize; 3]>>`
    = note: perhaps two different versions of crate `ndarray` are being used?

error[E0308]: mismatched types
   --> src/lib.rs:144:21
    |
144 |                     &init_state,
    |                     ^^^^^^^^^^^ expected struct `ArrayBase`, found struct `ndarray::ArrayBase`
    |
    = note: expected reference `&ArrayBase<_, Dim<[usize; 1]>>`
	       found reference `&ndarray::ArrayBase<ndarray::ViewRepr<&f32>, ndarray::dimension::dim::Dim<[usize; 1]>>`
    = note: perhaps two different versions of crate `ndarray` are being used?

error[E0308]: mismatched types
   --> src/lib.rs:179:21
    |
179 |                     &network_output,
    |                     ^^^^^^^^^^^^^^^ expected struct `ArrayBase`, found struct `ndarray::ArrayBase`
    |
    = note: expected reference `&ArrayBase<_, Dim<[usize; 3]>>`
	       found reference `&ndarray::ArrayBase<ndarray::ViewRepr<&f32>, ndarray::dimension::dim::Dim<[usize; 3]>>`
    = note: perhaps two different versions of crate `ndarray` are being used?

error[E0308]: mismatched types
   --> src/lib.rs:180:21
    |
180 |                     &init_state,
    |                     ^^^^^^^^^^^ expected struct `ArrayBase`, found struct `ndarray::ArrayBase`
    |
    = note: expected reference `&ArrayBase<_, Dim<[usize; 1]>>`
	       found reference `&ndarray::ArrayBase<ndarray::ViewRepr<&f32>, ndarray::dimension::dim::Dim<[usize; 1]>>`
    = note: perhaps two different versions of crate `ndarray` are being used?

error[E0308]: mismatched types
   --> src/lib.rs:255:21
    |
255 |                     &network_output,
    |                     ^^^^^^^^^^^^^^^ expected struct `ArrayBase`, found struct `ndarray::ArrayBase`
    |
    = note: expected reference `&ArrayBase<_, Dim<[usize; 2]>>`
	       found reference `&ndarray::ArrayBase<ndarray::ViewRepr<&f32>, ndarray::dimension::dim::Dim<[usize; 2]>>`
    = note: perhaps two different versions of crate `ndarray` are being used?

error[E0308]: `match` arms have incompatible types
   --> src/lib.rs:364:21
    |
356 |               let envelope_view = match envelope {
    |  _________________________________-
357 | |                 Some(env) => env.as_array(),
    | |                              -------------- this is found to be of type `ndarray::ArrayBase<ndarray::ViewRepr<&usize>, ndarray::dimension::dim::Dim<[usize; 2]>>`
358 | |                 None => {
359 | |                     default_envelope =
...   |
364 | |                     default_envelope.view()
    | |                     ^^^^^^^^^^^^^^^^^^^^^^^ expected struct `ndarray::ArrayBase`, found struct `ArrayBase`
365 | |                 }
366 | |             };
    | |_____________- `match` arms have incompatible types
    |
    = note: expected type `ndarray::ArrayBase<ndarray::ViewRepr<&usize>, ndarray::dimension::dim::Dim<[usize; 2]>>`
	     found struct `ArrayBase<ViewRepr<&usize>, Dim<[usize; 2]>>`
    = note: perhaps two different versions of crate `ndarray` are being used?

error[E0308]: mismatched types
   --> src/lib.rs:373:21
    |
373 |                     &network_output_1,
    |                     ^^^^^^^^^^^^^^^^^ expected struct `ArrayBase`, found struct `ndarray::ArrayBase`
    |
    = note: expected reference `&ArrayBase<_, Dim<[usize; 2]>>`
	       found reference `&ndarray::ArrayBase<ndarray::ViewRepr<&f32>, ndarray::dimension::dim::Dim<[usize; 2]>>`
    = note: perhaps two different versions of crate `ndarray` are being used?

error[E0308]: mismatched types
   --> src/lib.rs:374:21
    |
374 |                     &network_output_2,
    |                     ^^^^^^^^^^^^^^^^^ expected struct `ArrayBase`, found struct `ndarray::ArrayBase`
    |
    = note: expected reference `&ArrayBase<_, Dim<[usize; 2]>>`
	       found reference `&ndarray::ArrayBase<ndarray::ViewRepr<&f32>, ndarray::dimension::dim::Dim<[usize; 2]>>`
    = note: perhaps two different versions of crate `ndarray` are being used?

error[E0308]: `match` arms have incompatible types
   --> src/lib.rs:448:21
    |
440 |               let envelope_view = match envelope {
    |  _________________________________-
441 | |                 Some(env) => env.as_array(),
    | |                              -------------- this is found to be of type `ndarray::ArrayBase<ndarray::ViewRepr<&usize>, ndarray::dimension::dim::Dim<[usize; 2]>>`
442 | |                 None => {
443 | |                     default_envelope =
...   |
448 | |                     default_envelope.view()
    | |                     ^^^^^^^^^^^^^^^^^^^^^^^ expected struct `ndarray::ArrayBase`, found struct `ArrayBase`
449 | |                 }
450 | |             };
    | |_____________- `match` arms have incompatible types
    |
    = note: expected type `ndarray::ArrayBase<ndarray::ViewRepr<&usize>, ndarray::dimension::dim::Dim<[usize; 2]>>`
	     found struct `ArrayBase<ViewRepr<&usize>, Dim<[usize; 2]>>`
    = note: perhaps two different versions of crate `ndarray` are being used?

error[E0308]: mismatched types
   --> src/lib.rs:459:21
    |
459 |                     &network_output_1,
    |                     ^^^^^^^^^^^^^^^^^ expected struct `ArrayBase`, found struct `ndarray::ArrayBase`
    |
    = note: expected reference `&ArrayBase<_, Dim<[usize; 3]>>`
	       found reference `&ndarray::ArrayBase<ndarray::ViewRepr<&f32>, ndarray::dimension::dim::Dim<[usize; 3]>>`
    = note: perhaps two different versions of crate `ndarray` are being used?

error[E0308]: mismatched types
   --> src/lib.rs:460:21
    |
460 |                     &init_state_1,
    |                     ^^^^^^^^^^^^^ expected struct `ArrayBase`, found struct `ndarray::ArrayBase`
    |
    = note: expected reference `&ArrayBase<_, Dim<[usize; 1]>>`
	       found reference `&ndarray::ArrayBase<ndarray::ViewRepr<&f32>, ndarray::dimension::dim::Dim<[usize; 1]>>`
    = note: perhaps two different versions of crate `ndarray` are being used?

error[E0308]: mismatched types
   --> src/lib.rs:461:21
    |
461 |                     &network_output_2,
    |                     ^^^^^^^^^^^^^^^^^ expected struct `ArrayBase`, found struct `ndarray::ArrayBase`
    |
    = note: expected reference `&ArrayBase<_, Dim<[usize; 3]>>`
	       found reference `&ndarray::ArrayBase<ndarray::ViewRepr<&f32>, ndarray::dimension::dim::Dim<[usize; 3]>>`
    = note: perhaps two different versions of crate `ndarray` are being used?

error[E0308]: mismatched types
   --> src/lib.rs:462:21
    |
462 |                     &init_state_2,
    |                     ^^^^^^^^^^^^^ expected struct `ArrayBase`, found struct `ndarray::ArrayBase`
    |
    = note: expected reference `&ArrayBase<_, Dim<[usize; 1]>>`
	       found reference `&ndarray::ArrayBase<ndarray::ViewRepr<&f32>, ndarray::dimension::dim::Dim<[usize; 1]>>`
    = note: perhaps two different versions of crate `ndarray` are being used?

error: aborting due to 16 previous errors

Some errors have detailed explanations: E0308, E0554.
For more information about an error, try `rustc --explain E0308`.
error: could not compile `fast_ctc_decode`

To learn more, run the command again with --verbose.
@reddishtg
Copy link

Running into the same issue. Trying to compile for Apple's M1 because a package doesn't seem to exit.

@iiSeymour
Copy link
Member

These build issues are with the ndarray dependency. I am using nightly-2021-01-01 to build releases - see here.

@reddishtg
Copy link

When I tried changing to that nightly build I received an error about being able to get numpy v0.13.2 and a resolver was required.

I'm a real novice when it comes to Rust (and I know this is not what you are supposed to do), but I was able to get around it by editing the Cargo.lock once it was generated. In order to get it to work I changed the ndarray version requirement to 0.14.0 under numpy. It seems that numpy required a range from 0.13.0-0.15.0 and so 0.15.0 was being installed.

@iiSeymour iiSeymour self-assigned this Oct 28, 2021
@iiSeymour iiSeymour added the bug Something isn't working label Oct 28, 2021
@iiSeymour
Copy link
Member

Switched to stable rust 1.54.0 and fixed the build issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants