rust-ml/linfa

Crates.io version of linfa_kernel fails to compile.

ArvidHammarlund opened this issue · 1 comments

Is there anyone else who received similar error while trying to compile the crates.io version of Linfa_kernel? The problem doesn't exist while using the git cloned version of the crate. I'm using a Macbook M1, and if the problem exists for others it might be a good idea to do a new release? Either way, it seems that the SPRS feature is the cause of the problem.

❯ cargo c
    Checking linfa-kernel v0.6.1
error[E0599]: no method named `mul` found for reference `&CsMatBase<F, usize, Vec<usize>, Vec<usize>, Vec<F>>` in the current scope
  --> /Users/arvidhammarlund/.cargo/registry/src/index.crates.io-6f17d22bba15001f/linfa-kernel-0.6.1/src/inner.rs:64:14
   |
64 |         self.mul(rhs)
   |              ^^^ method not found in `&CsMatBase<F, usize, Vec<usize>, Vec<usize>, Vec<F>>`

error[E0599]: no method named `mul` found for reference `&CsMatBase<F, usize, &'a [usize], &'a [usize], &'a [F]>` in the current scope
   --> /Users/arvidhammarlund/.cargo/registry/src/index.crates.io-6f17d22bba15001f/linfa-kernel-0.6.1/src/inner.rs:109:14
    |
109 |         self.mul(rhs)
    |              ^^^ method not found in `&CsMatBase<F, usize, &[usize], &[usize], &[F]>`

For more information about this error, try `rustc --explain E0599`.
error: could not compile `linfa-kernel` (lib) due to 2 previous errors

This happens for me, too. One solution is to specify sprs = "=0.11.0" in your dependencies. See also sparsemat/sprs#330 and #307.