rust-ndarray / ndarray-examples

A collection of examples leveraging the ndarray ecosystem.
Apache License 2.0
16 stars 4 forks source link

Build seems to be failing #8

Closed govinda-kamath closed 2 years ago

govinda-kamath commented 2 years ago

Hello,

The build of the examples seem to be failing. It seems to complain that ndarray_linalg doesnt exist.

This is the full error message I see.

~/ndarray-examples$ cargo build
   Compiling linear_regression v0.1.0 (/path/to/ndarray-examples/linear_regression)
   Compiling k_means v0.1.0 (/path/to/ndarray-examples/k_means)
error[E0432]: unresolved import `ndarray_linalg`
 --> linear_regression/src/lib.rs:3:5
  |
3 | use ndarray_linalg::Solve;
  |     ^^^^^^^^^^^^^^ use of undeclared crate or module `ndarray_linalg`

error[E0599]: no method named `solve_into` found for struct `ArrayBase` in the current scope
  --> linear_regression/src/lib.rs:87:25
   |
87 |         linear_operator.solve_into(rhs).unwrap()
   |                         ^^^^^^^^^^ method not found in `ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>`

Some errors have detailed explanations: E0432, E0599.
For more information about an error, try `rustc --explain E0432`.
error: could not compile `linear_regression` due to 2 previous errors
warning: build failed, waiting for other jobs to finish...

Do you know what I should fix?

jturner314 commented 2 years ago

For the linear_regression example, you have to specify a backend. (See the README.md for details.)

govinda-kamath commented 2 years ago

Thanks!