autumnai / leaf-examples

Examples for the Hacker's Machine Learning Framework Leaf
78 stars 17 forks source link

Cannot compile on OS X #9

Open ArsalanDotMe opened 8 years ago

ArsalanDotMe commented 8 years ago

I'm running the latest OSX with CUDA and cudnn installed.

I have to use the git repo of collenchyma as dependency because the latest version includes a fix for linking OpenCL on OS X. Rest of the configuration is default.

When I run cargo build, I get the following errors:

Compiling leaf-examples v0.1.0 (file:///Users/arsalanahmad/Code/rust/leaf-examples)
src/main.rs:166:22: 166:41 error: the trait `collenchyma::backend::IBackend` is not implemented for the type `co::backend::Backend<co::frameworks::cuda::Cuda>` [E0277]
src/main.rs:166     let mut solver = Solver::from_config(backend.clone(), backend.clone(), &solver_cfg);
                                     ^~~~~~~~~~~~~~~~~~~
src/main.rs:166:22: 166:41 help: run `rustc --explain E0277` to see a detailed explanation
src/main.rs:166:22: 166:41 note: required by `leaf::solver::Solver<SolverB, B>::from_config`
src/main.rs:166:22: 166:41 error: the trait `coblas::plugin::Gemm<f32>` is not implemented for the type `co::backend::Backend<co::frameworks::cuda::Cuda>` [E0277]
src/main.rs:166     let mut solver = Solver::from_config(backend.clone(), backend.clone(), &solver_cfg);
                                     ^~~~~~~~~~~~~~~~~~~
src/main.rs:166:22: 166:41 help: run `rustc --explain E0277` to see a detailed explanation
src/main.rs:166:22: 166:41 note: required by `leaf::solver::Solver<SolverB, B>::from_config`
src/main.rs:166:22: 166:41 error: the trait `collenchyma_nn::plugin::Sigmoid<f32>` is not implemented for the type `co::backend::Backend<co::frameworks::cuda::Cuda>` [E0277]
src/main.rs:166     let mut solver = Solver::from_config(backend.clone(), backend.clone(), &solver_cfg);
                                     ^~~~~~~~~~~~~~~~~~~
src/main.rs:166:22: 166:41 help: run `rustc --explain E0277` to see a detailed explanation
src/main.rs:166:22: 166:41 note: required by `leaf::solver::Solver<SolverB, B>::from_config`
src/main.rs:166:22: 166:41 error: the trait `collenchyma_nn::plugin::SigmoidPointwise<f32>` is not implemented for the type `co::backend::Backend<co::frameworks::cuda::Cuda>` [E0277]
src/main.rs:166     let mut solver = Solver::from_config(backend.clone(), backend.clone(), &solver_cfg);
                                     ^~~~~~~~~~~~~~~~~~~
src/main.rs:166:22: 166:41 help: run `rustc --explain E0277` to see a detailed explanation
src/main.rs:166:22: 166:41 note: required by `leaf::solver::Solver<SolverB, B>::from_config`
src/main.rs:166:22: 166:41 error: the trait `collenchyma_nn::plugin::Relu<f32>` is not implemented for the type `co::backend::Backend<co::frameworks::cuda::Cuda>` [E0277]
src/main.rs:166     let mut solver = Solver::from_config(backend.clone(), backend.clone(), &solver_cfg);
                                     ^~~~~~~~~~~~~~~~~~~
src/main.rs:166:22: 166:41 help: run `rustc --explain E0277` to see a detailed explanation
src/main.rs:166:22: 166:41 note: required by `leaf::solver::Solver<SolverB, B>::from_config`
src/main.rs:166:22: 166:41 error: the trait `collenchyma_nn::plugin::ReluPointwise<f32>` is not implemented for the type `co::backend::Backend<co::frameworks::cuda::Cuda>` [E0277]
src/main.rs:166     let mut solver = Solver::from_config(backend.clone(), backend.clone(), &solver_cfg);
                                     ^~~~~~~~~~~~~~~~~~~
src/main.rs:166:22: 166:41 help: run `rustc --explain E0277` to see a detailed explanation
src/main.rs:166:22: 166:41 note: required by `leaf::solver::Solver<SolverB, B>::from_config`
src/main.rs:166:22: 166:41 error: the trait `collenchyma_nn::plugin::Convolution<f32>` is not implemented for the type `co::backend::Backend<co::frameworks::cuda::Cuda>` [E0277]
src/main.rs:166     let mut solver = Solver::from_config(backend.clone(), backend.clone(), &solver_cfg);
                                     ^~~~~~~~~~~~~~~~~~~
src/main.rs:166:22: 166:41 help: run `rustc --explain E0277` to see a detailed explanation
src/main.rs:166:22: 166:41 note: required by `leaf::solver::Solver<SolverB, B>::from_config`
src/main.rs:166:22: 166:41 error: the trait `collenchyma_nn::plugin::Softmax<f32>` is not implemented for the type `co::backend::Backend<co::frameworks::cuda::Cuda>` [E0277]
src/main.rs:166     let mut solver = Solver::from_config(backend.clone(), backend.clone(), &solver_cfg);
                                     ^~~~~~~~~~~~~~~~~~~
src/main.rs:166:22: 166:41 help: run `rustc --explain E0277` to see a detailed explanation
src/main.rs:166:22: 166:41 note: required by `leaf::solver::Solver<SolverB, B>::from_config`
src/main.rs:166:22: 166:41 error: the trait `collenchyma_nn::plugin::LogSoftmax<f32>` is not implemented for the type `co::backend::Backend<co::frameworks::cuda::Cuda>` [E0277]
src/main.rs:166     let mut solver = Solver::from_config(backend.clone(), backend.clone(), &solver_cfg);
                                     ^~~~~~~~~~~~~~~~~~~
src/main.rs:166:22: 166:41 help: run `rustc --explain E0277` to see a detailed explanation
src/main.rs:166:22: 166:41 note: required by `leaf::solver::Solver<SolverB, B>::from_config`
src/main.rs:166:22: 166:41 error: the trait `collenchyma_nn::plugin::Pooling<f32>` is not implemented for the type `co::backend::Backend<co::frameworks::cuda::Cuda>` [E0277]
src/main.rs:166     let mut solver = Solver::from_config(backend.clone(), backend.clone(), &solver_cfg);
                                     ^~~~~~~~~~~~~~~~~~~
src/main.rs:166:22: 166:41 help: run `rustc --explain E0277` to see a detailed explanation
src/main.rs:166:22: 166:41 note: required by `leaf::solver::Solver<SolverB, B>::from_config`
src/main.rs:166:22: 166:88 error: the trait `collenchyma::backend::IBackend` is not implemented for the type `co::backend::Backend<co::frameworks::cuda::Cuda>` [E0277]
src/main.rs:166     let mut solver = Solver::from_config(backend.clone(), backend.clone(), &solver_cfg);
                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/main.rs:166:22: 166:88 help: run `rustc --explain E0277` to see a detailed explanation
src/main.rs:166:22: 166:88 note: required by `leaf::solver::Solver`
src/main.rs:166:22: 166:88 error: the trait `coblas::plugin::Copy<f32>` is not implemented for the type `co::backend::Backend<co::frameworks::cuda::Cuda>` [E0277]
src/main.rs:166     let mut solver = Solver::from_config(backend.clone(), backend.clone(), &solver_cfg);
                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/main.rs:166:22: 166:88 help: run `rustc --explain E0277` to see a detailed explanation
src/main.rs:166:22: 166:88 note: required by `leaf::solver::Solver`
src/main.rs:166:22: 166:88 error: the trait `coblas::plugin::Dot<f32>` is not implemented for the type `co::backend::Backend<co::frameworks::cuda::Cuda>` [E0277]
src/main.rs:166     let mut solver = Solver::from_config(backend.clone(), backend.clone(), &solver_cfg);
                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/main.rs:166:22: 166:88 help: run `rustc --explain E0277` to see a detailed explanation
src/main.rs:166:22: 166:88 note: required by `leaf::solver::Solver`
src/main.rs:166:22: 166:88 error: the trait `coblas::plugin::Axpy<f32>` is not implemented for the type `co::backend::Backend<co::frameworks::cuda::Cuda>` [E0277]
src/main.rs:166     let mut solver = Solver::from_config(backend.clone(), backend.clone(), &solver_cfg);
                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/main.rs:166:22: 166:88 help: run `rustc --explain E0277` to see a detailed explanation
src/main.rs:166:22: 166:88 note: required by `leaf::solver::Solver`
src/main.rs:166:22: 166:88 error: the trait `coblas::plugin::Scal<f32>` is not implemented for the type `co::backend::Backend<co::frameworks::cuda::Cuda>` [E0277]
src/main.rs:166     let mut solver = Solver::from_config(backend.clone(), backend.clone(), &solver_cfg);
                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/main.rs:166:22: 166:88 help: run `rustc --explain E0277` to see a detailed explanation
src/main.rs:166:22: 166:88 note: required by `leaf::solver::Solver`
src/main.rs:185:32: 185:40 error: mismatched types:
 expected `&mut collenchyma::tensor::SharedTensor<f32>`,
    found `&mut std::sync::rwlock::RwLockWriteGuard<'_, co::tensor::SharedTensor<f32>>`
(expected struct `collenchyma::tensor::SharedTensor`,
    found struct `std::sync::rwlock::RwLockWriteGuard`) [E0308]
src/main.rs:185             write_batch_sample(&mut inp, &input, batch_n);
                                               ^~~~~~~~
src/main.rs:185:32: 185:40 help: run `rustc --explain E0308` to see a detailed explanation
src/main.rs:186:32: 186:42 error: mismatched types:
 expected `&mut collenchyma::tensor::SharedTensor<f32>`,
    found `&mut std::sync::rwlock::RwLockWriteGuard<'_, co::tensor::SharedTensor<f32>>`
(expected struct `collenchyma::tensor::SharedTensor`,
    found struct `std::sync::rwlock::RwLockWriteGuard`) [E0308]
src/main.rs:186             write_batch_sample(&mut label, &[label_val], batch_n);
                                               ^~~~~~~~~~
src/main.rs:186:32: 186:42 help: run `rustc --explain E0308` to see a detailed explanation
src/main.rs:191:34: 191:87 warning: the trait `collenchyma::backend::IBackend` is not implemented for the type `co::backend::Backend<co::frameworks::cuda::Cuda>` [E0277]
src/main.rs:191         let infered_out = solver.train_minibatch(inp_lock.clone(), label_lock.clone());
                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/main.rs:191:34: 191:87 help: run `rustc --explain E0277` to see a detailed explanation
src/main.rs:191:34: 191:87 note: this warning results from recent bug fixes and clarifications; it will become a HARD ERROR in the next release. See RFC 1214 for details.
src/main.rs:191         let infered_out = solver.train_minibatch(inp_lock.clone(), label_lock.clone());
                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/main.rs:191:34: 191:87 note: required by `leaf::solver::Solver`
src/main.rs:191:34: 191:87 warning: the trait `coblas::plugin::Copy<f32>` is not implemented for the type `co::backend::Backend<co::frameworks::cuda::Cuda>` [E0277]
src/main.rs:191         let infered_out = solver.train_minibatch(inp_lock.clone(), label_lock.clone());
                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/main.rs:191:34: 191:87 help: run `rustc --explain E0277` to see a detailed explanation
src/main.rs:191:34: 191:87 note: this warning results from recent bug fixes and clarifications; it will become a HARD ERROR in the next release. See RFC 1214 for details.
src/main.rs:191         let infered_out = solver.train_minibatch(inp_lock.clone(), label_lock.clone());
                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/main.rs:191:34: 191:87 note: required by `leaf::solver::Solver`
src/main.rs:191:34: 191:87 warning: the trait `coblas::plugin::Dot<f32>` is not implemented for the type `co::backend::Backend<co::frameworks::cuda::Cuda>` [E0277]
src/main.rs:191         let infered_out = solver.train_minibatch(inp_lock.clone(), label_lock.clone());
                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/main.rs:191:34: 191:87 help: run `rustc --explain E0277` to see a detailed explanation
src/main.rs:191:34: 191:87 note: this warning results from recent bug fixes and clarifications; it will become a HARD ERROR in the next release. See RFC 1214 for details.
src/main.rs:191         let infered_out = solver.train_minibatch(inp_lock.clone(), label_lock.clone());
                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/main.rs:191:34: 191:87 note: required by `leaf::solver::Solver`
src/main.rs:191:34: 191:87 warning: the trait `coblas::plugin::Gemm<f32>` is not implemented for the type `co::backend::Backend<co::frameworks::cuda::Cuda>` [E0277]
src/main.rs:191         let infered_out = solver.train_minibatch(inp_lock.clone(), label_lock.clone());
                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/main.rs:191:34: 191:87 help: run `rustc --explain E0277` to see a detailed explanation
src/main.rs:191:34: 191:87 note: this warning results from recent bug fixes and clarifications; it will become a HARD ERROR in the next release. See RFC 1214 for details.
src/main.rs:191         let infered_out = solver.train_minibatch(inp_lock.clone(), label_lock.clone());
                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/main.rs:191:34: 191:87 note: required by `leaf::solver::Solver`
src/main.rs:191:34: 191:87 warning: the trait `collenchyma_nn::plugin::Sigmoid<f32>` is not implemented for the type `co::backend::Backend<co::frameworks::cuda::Cuda>` [E0277]
src/main.rs:191         let infered_out = solver.train_minibatch(inp_lock.clone(), label_lock.clone());
                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/main.rs:191:34: 191:87 help: run `rustc --explain E0277` to see a detailed explanation
src/main.rs:191:34: 191:87 note: this warning results from recent bug fixes and clarifications; it will become a HARD ERROR in the next release. See RFC 1214 for details.
src/main.rs:191         let infered_out = solver.train_minibatch(inp_lock.clone(), label_lock.clone());
                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/main.rs:191:34: 191:87 note: required by `leaf::solver::Solver`
src/main.rs:191:34: 191:87 warning: the trait `collenchyma_nn::plugin::SigmoidPointwise<f32>` is not implemented for the type `co::backend::Backend<co::frameworks::cuda::Cuda>` [E0277]
src/main.rs:191         let infered_out = solver.train_minibatch(inp_lock.clone(), label_lock.clone());
                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/main.rs:191:34: 191:87 help: run `rustc --explain E0277` to see a detailed explanation
src/main.rs:191:34: 191:87 note: this warning results from recent bug fixes and clarifications; it will become a HARD ERROR in the next release. See RFC 1214 for details.
src/main.rs:191         let infered_out = solver.train_minibatch(inp_lock.clone(), label_lock.clone());
                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/main.rs:191:34: 191:87 note: required by `leaf::solver::Solver`
src/main.rs:191:34: 191:87 warning: the trait `collenchyma_nn::plugin::Relu<f32>` is not implemented for the type `co::backend::Backend<co::frameworks::cuda::Cuda>` [E0277]
src/main.rs:191         let infered_out = solver.train_minibatch(inp_lock.clone(), label_lock.clone());
                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/main.rs:191:34: 191:87 help: run `rustc --explain E0277` to see a detailed explanation
src/main.rs:191:34: 191:87 note: this warning results from recent bug fixes and clarifications; it will become a HARD ERROR in the next release. See RFC 1214 for details.
src/main.rs:191         let infered_out = solver.train_minibatch(inp_lock.clone(), label_lock.clone());
                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/main.rs:191:34: 191:87 note: required by `leaf::solver::Solver`
src/main.rs:191:34: 191:87 warning: the trait `collenchyma_nn::plugin::ReluPointwise<f32>` is not implemented for the type `co::backend::Backend<co::frameworks::cuda::Cuda>` [E0277]
src/main.rs:191         let infered_out = solver.train_minibatch(inp_lock.clone(), label_lock.clone());
                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/main.rs:191:34: 191:87 help: run `rustc --explain E0277` to see a detailed explanation
src/main.rs:191:34: 191:87 note: this warning results from recent bug fixes and clarifications; it will become a HARD ERROR in the next release. See RFC 1214 for details.
src/main.rs:191         let infered_out = solver.train_minibatch(inp_lock.clone(), label_lock.clone());
                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/main.rs:191:34: 191:87 note: required by `leaf::solver::Solver`
src/main.rs:191:34: 191:87 warning: the trait `collenchyma_nn::plugin::Convolution<f32>` is not implemented for the type `co::backend::Backend<co::frameworks::cuda::Cuda>` [E0277]
src/main.rs:191         let infered_out = solver.train_minibatch(inp_lock.clone(), label_lock.clone());
                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/main.rs:191:34: 191:87 help: run `rustc --explain E0277` to see a detailed explanation
src/main.rs:191:34: 191:87 note: this warning results from recent bug fixes and clarifications; it will become a HARD ERROR in the next release. See RFC 1214 for details.
src/main.rs:191         let infered_out = solver.train_minibatch(inp_lock.clone(), label_lock.clone());
                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/main.rs:191:34: 191:87 note: required by `leaf::solver::Solver`
src/main.rs:191:34: 191:87 warning: the trait `collenchyma_nn::plugin::Softmax<f32>` is not implemented for the type `co::backend::Backend<co::frameworks::cuda::Cuda>` [E0277]
src/main.rs:191         let infered_out = solver.train_minibatch(inp_lock.clone(), label_lock.clone());
                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/main.rs:191:34: 191:87 help: run `rustc --explain E0277` to see a detailed explanation
src/main.rs:191:34: 191:87 note: this warning results from recent bug fixes and clarifications; it will become a HARD ERROR in the next release. See RFC 1214 for details.
src/main.rs:191         let infered_out = solver.train_minibatch(inp_lock.clone(), label_lock.clone());
                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/main.rs:191:34: 191:87 note: required by `leaf::solver::Solver`
src/main.rs:191:34: 191:87 warning: the trait `collenchyma_nn::plugin::LogSoftmax<f32>` is not implemented for the type `co::backend::Backend<co::frameworks::cuda::Cuda>` [E0277]
src/main.rs:191         let infered_out = solver.train_minibatch(inp_lock.clone(), label_lock.clone());
                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/main.rs:191:34: 191:87 help: run `rustc --explain E0277` to see a detailed explanation
src/main.rs:191:34: 191:87 note: this warning results from recent bug fixes and clarifications; it will become a HARD ERROR in the next release. See RFC 1214 for details.
src/main.rs:191         let infered_out = solver.train_minibatch(inp_lock.clone(), label_lock.clone());
                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/main.rs:191:34: 191:87 note: required by `leaf::solver::Solver`
src/main.rs:191:34: 191:87 warning: the trait `collenchyma_nn::plugin::Pooling<f32>` is not implemented for the type `co::backend::Backend<co::frameworks::cuda::Cuda>` [E0277]
src/main.rs:191         let infered_out = solver.train_minibatch(inp_lock.clone(), label_lock.clone());
                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/main.rs:191:34: 191:87 help: run `rustc --explain E0277` to see a detailed explanation
src/main.rs:191:34: 191:87 note: this warning results from recent bug fixes and clarifications; it will become a HARD ERROR in the next release. See RFC 1214 for details.
src/main.rs:191         let infered_out = solver.train_minibatch(inp_lock.clone(), label_lock.clone());
                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/main.rs:191:34: 191:87 note: required by `leaf::solver::Solver`
src/main.rs:191:34: 191:87 warning: the trait `coblas::plugin::Axpy<f32>` is not implemented for the type `co::backend::Backend<co::frameworks::cuda::Cuda>` [E0277]
src/main.rs:191         let infered_out = solver.train_minibatch(inp_lock.clone(), label_lock.clone());
                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/main.rs:191:34: 191:87 help: run `rustc --explain E0277` to see a detailed explanation
src/main.rs:191:34: 191:87 note: this warning results from recent bug fixes and clarifications; it will become a HARD ERROR in the next release. See RFC 1214 for details.
src/main.rs:191         let infered_out = solver.train_minibatch(inp_lock.clone(), label_lock.clone());
                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/main.rs:191:34: 191:87 note: required by `leaf::solver::Solver`
src/main.rs:191:34: 191:87 warning: the trait `coblas::plugin::Scal<f32>` is not implemented for the type `co::backend::Backend<co::frameworks::cuda::Cuda>` [E0277]
src/main.rs:191         let infered_out = solver.train_minibatch(inp_lock.clone(), label_lock.clone());
                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/main.rs:191:34: 191:87 help: run `rustc --explain E0277` to see a detailed explanation
src/main.rs:191:34: 191:87 note: this warning results from recent bug fixes and clarifications; it will become a HARD ERROR in the next release. See RFC 1214 for details.
src/main.rs:191         let infered_out = solver.train_minibatch(inp_lock.clone(), label_lock.clone());
                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/main.rs:191:34: 191:87 note: required by `leaf::solver::Solver`
src/main.rs:191:50: 191:66 error: mismatched types:
 expected `alloc::arc::Arc<std::sync::rwlock::RwLock<collenchyma::tensor::SharedTensor<f32>>>`,
    found `alloc::arc::Arc<std::sync::rwlock::RwLock<co::tensor::SharedTensor<f32>>>`
(expected struct `collenchyma::tensor::SharedTensor`,
    found struct `co::tensor::SharedTensor`) [E0308]
src/main.rs:191         let infered_out = solver.train_minibatch(inp_lock.clone(), label_lock.clone());
                                                                 ^~~~~~~~~~~~~~~~
src/main.rs:191:50: 191:66 help: run `rustc --explain E0308` to see a detailed explanation
src/main.rs:191:68: 191:86 error: mismatched types:
 expected `alloc::arc::Arc<std::sync::rwlock::RwLock<collenchyma::tensor::SharedTensor<f32>>>`,
    found `alloc::arc::Arc<std::sync::rwlock::RwLock<co::tensor::SharedTensor<f32>>>`
(expected struct `collenchyma::tensor::SharedTensor`,
    found struct `co::tensor::SharedTensor`) [E0308]
src/main.rs:191         let infered_out = solver.train_minibatch(inp_lock.clone(), label_lock.clone());
                                                                                   ^~~~~~~~~~~~~~~~~~
src/main.rs:191:68: 191:86 help: run `rustc --explain E0308` to see a detailed explanation
error: aborting due to 19 previous errors
Could not compile `leaf-examples`.

What could be wrong?

hobofan commented 8 years ago

The problem has to do with the way Cargo compiles dependencies, and isn't too obvious.

I am guessing that you replaced the collenchyma dependency in Cargo.toml with a link to the Github repository? This actually results in two different collenchyma libraries to be built, since Leaf still depends on the collenchyma version from crates.io.

You can override the collenchyma dependency for project-wide. For this you have to clone collenchyma locally and add a .cargo/config file to your project root containing:

path = ["/path/to/your/collenchyma/clone"]

See the Cargo documentation for more reference.

There is also an issue to make those overrides not require a clone of the repository, making them more painless: https://github.com/rust-lang/cargo/issues/1481

I hope that gets it working for you :)

ArsalanDotMe commented 8 years ago

Thanks for the tip. It does seem to have solved that problem but unfortunately now, I'm running into another error I can't make sense of. Have a look.

leaf-examples git:(master) ✗ cargo build --release --verbose
       Fresh winapi-build v0.1.1
       Fresh bitflags v0.3.3
       Fresh gcc v0.3.25
       Fresh strsim v0.3.0
       Fresh traitobject v0.0.1
       Fresh typeable v0.1.2
       Fresh pkg-config v0.3.7
       Fresh utf8-ranges v0.1.3
       Fresh language-tags v0.0.7
       Fresh byteorder v0.4.2
       Fresh winapi v0.2.5
       Fresh rustc-serialize v0.3.18
       Fresh libc v0.2.7
       Fresh libc v0.1.12
       Fresh httparse v1.1.1
       Fresh linear-map v0.0.4
       Fresh matches v0.1.2
       Fresh semver v0.1.20
       Fresh log v0.3.5
       Fresh num_cpus v0.2.11
       Fresh rand v0.3.14
       Fresh lazy_static v0.1.15
       Fresh rustc_version v0.1.7
       Fresh hpack v0.2.0
       Fresh regex-syntax v0.2.5
       Fresh openssl-sys v0.6.7
       Fresh cublas-sys v0.1.0
       Fresh uuid v0.1.18
       Fresh num v0.1.31
       Fresh solicit v0.4.4
       Fresh byteorder v0.3.13
       Fresh openssl v0.6.7
       Fresh cublas v0.2.0
       Fresh url v0.2.38
       Fresh rblas v0.0.11
       Fresh enum_primitive v0.1.0
       Fresh serde v0.6.15
       Fresh csv v0.14.3
       Fresh kernel32-sys v0.2.1
       Fresh memchr v0.1.10
       Fresh collenchyma v0.0.8 (file:///Users/arsalanahmad/Code/rust/collenchyma)
       Fresh unicase v1.3.0
       Fresh mime v0.1.3
       Fresh time v0.1.34
       Fresh aho-corasick v0.5.1
       Fresh collenchyma-blas v0.2.0
       Fresh collenchyma-nn v0.3.4
       Fresh timeit v0.1.2
       Fresh cookie v0.1.21
       Fresh regex v0.1.55
   Compiling leaf v0.2.0
     Running `rustc /Users/arsalanahmad/.cargo/registry/src/github.com-88ac128001ac3a9a/leaf-0.2.0/src/lib.rs --crate-name leaf --crate-type lib -C opt-level=3 -C metadata=1941b6714b37cdd8 -C extra-filename=-1941b6714b37cdd8 --out-dir /Users/arsalanahmad/Code/rust/leaf-examples/target/release/deps --emit=dep-info,link -L dependency=/Users/arsalanahmad/Code/rust/leaf-examples/target/release/deps -L dependency=/Users/arsalanahmad/Code/rust/leaf-examples/target/release/deps --extern timeit=/Users/arsalanahmad/Code/rust/leaf-examples/target/release/deps/libtimeit-32b1006bf5998cae.rlib --extern collenchyma_blas=/Users/arsalanahmad/Code/rust/leaf-examples/target/release/deps/libcollenchyma_blas-a8b9d5dd0a4541d1.rlib --extern log=/Users/arsalanahmad/Code/rust/leaf-examples/target/release/deps/liblog-0b1f2bad29d31333.rlib --extern rand=/Users/arsalanahmad/Code/rust/leaf-examples/target/release/deps/librand-6fab17fc670a2bc8.rlib --extern collenchyma_nn=/Users/arsalanahmad/Code/rust/leaf-examples/target/release/deps/libcollenchyma_nn-f77eb8f370d7400a.rlib --extern num=/Users/arsalanahmad/Code/rust/leaf-examples/target/release/deps/libnum-d3b232b2ec3de579.rlib --extern collenchyma=/Users/arsalanahmad/Code/rust/leaf-examples/target/release/deps/libcollenchyma-142dc51489da84d6.rlib --cap-lints allow`
       Fresh hyper v0.6.16
       Fresh docopt v0.6.78
       Fresh env_logger v0.3.2
/Users/arsalanahmad/.cargo/registry/src/github.com-88ac128001ac3a9a/leaf-0.2.0/src/util.rs:28:5: 38:6 error: non-exhaustive patterns: `&mut OpenCL(_)` not covered [E0004]
/Users/arsalanahmad/.cargo/registry/src/github.com-88ac128001ac3a9a/leaf-0.2.0/src/util.rs:28     match mem {
/Users/arsalanahmad/.cargo/registry/src/github.com-88ac128001ac3a9a/leaf-0.2.0/src/util.rs:29         &mut MemoryType::Native(ref mut mem) => {
/Users/arsalanahmad/.cargo/registry/src/github.com-88ac128001ac3a9a/leaf-0.2.0/src/util.rs:30             let mut mem_buffer = mem.as_mut_slice::<f32>();
/Users/arsalanahmad/.cargo/registry/src/github.com-88ac128001ac3a9a/leaf-0.2.0/src/util.rs:31             for (index, datum) in data.iter().enumerate() {
/Users/arsalanahmad/.cargo/registry/src/github.com-88ac128001ac3a9a/leaf-0.2.0/src/util.rs:32                 // mem_buffer[index + offset] = *datum;
/Users/arsalanahmad/.cargo/registry/src/github.com-88ac128001ac3a9a/leaf-0.2.0/src/util.rs:33                 mem_buffer[index + offset] = cast(*datum).unwrap();
                                                                                              ...
/Users/arsalanahmad/.cargo/registry/src/github.com-88ac128001ac3a9a/leaf-0.2.0/src/util.rs:28:5: 38:6 help: run `rustc --explain E0004` to see a detailed explanation
error: aborting due to previous error
Could not compile `leaf`.

Caused by:
  Process didn't exit successfully: `rustc /Users/arsalanahmad/.cargo/registry/src/github.com-88ac128001ac3a9a/leaf-0.2.0/src/lib.rs --crate-name leaf --crate-type lib -C opt-level=3 -C metadata=1941b6714b37cdd8 -C extra-filename=-1941b6714b37cdd8 --out-dir /Users/arsalanahmad/Code/rust/leaf-examples/target/release/deps --emit=dep-info,link -L dependency=/Users/arsalanahmad/Code/rust/leaf-examples/target/release/deps -L dependency=/Users/arsalanahmad/Code/rust/leaf-examples/target/release/deps --extern timeit=/Users/arsalanahmad/Code/rust/leaf-examples/target/release/deps/libtimeit-32b1006bf5998cae.rlib --extern collenchyma_blas=/Users/arsalanahmad/Code/rust/leaf-examples/target/release/deps/libcollenchyma_blas-a8b9d5dd0a4541d1.rlib --extern log=/Users/arsalanahmad/Code/rust/leaf-examples/target/release/deps/liblog-0b1f2bad29d31333.rlib --extern rand=/Users/arsalanahmad/Code/rust/leaf-examples/target/release/deps/librand-6fab17fc670a2bc8.rlib --extern collenchyma_nn=/Users/arsalanahmad/Code/rust/leaf-examples/target/release/deps/libcollenchyma_nn-f77eb8f370d7400a.rlib --extern num=/Users/arsalanahmad/Code/rust/leaf-examples/target/release/deps/libnum-d3b232b2ec3de579.rlib --extern collenchyma=/Users/arsalanahmad/Code/rust/leaf-examples/target/release/deps/libcollenchyma-142dc51489da84d6.rlib --cap-lints allow` (exit code: 101)

My Cargo.toml file is as follows:

[package]
authors = ["Michael Hirn <mj@autumnai.com>", "Maximilian Goisser <max@autumnai.com>"]
description = "Examples for the Machine Learning Framework 'Leaf'"
name = "leaf-examples"
version = "0.1.0"

[dependencies]
collenchyma = "0.0.8"
csv = "0.14"
docopt = "0.6.75"
env_logger = "0.3"
hyper = "0.6"
log = "0.3"
rustc-serialize = "0.3"

[dependencies.clippy]
optional = true
version = "0.0.23"

[dependencies.collenchyma-blas]
version = "0.2.0"

[dependencies.leaf]
default-features = false
version = "0.2.0"

[profile]

[profile.dev]
codegen-units = 2
debug = true
debug-assertions = true
lto = false
opt-level = 0
rpath = false