laanwj / k210-sdk-stuff

Kendryte K210 / MaixGo stuff
ISC License
141 stars 31 forks source link

error[E0463]: can't find crate for `core` #4

Closed dimitre closed 5 years ago

dimitre commented 5 years ago

I'm trying to run examples on Macos and it is giving me the following errors: already installed target using rustup target add riscv64gc-unknown-none-elf any ideas? thank you

  Compiling syn v0.15.39
error[E0463]: can't find crate for `core`
error[E0463]: can't find crate for `core`
  |
  = note: the `riscv64imac-unknown-none-elf` target may not be installed

  |
  = note: the `riscv64imac-unknown-none-elf` target may not be installed

error[E0463]: can't find crate for `core`
  |
  = note: the `riscv64imac-unknown-none-elf` target may not be installed

error[E0463]: can't find crate for `core`
error: aborting due to previous error

  |
For more information about this error, try `rustc --explain E0463`.
  = note: the `riscv64imac-unknown-none-elf` target may not be installed

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error[E0463]: can't find crate for `core`
  |
  = note: the `riscv64imac-unknown-none-elf` target may not be installed

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error[E0463]: can't find crate for `core`
  |
  = note: the `riscv64imac-unknown-none-elf` target may not be installed

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error: Could not compile `panic-halt`.
warning: build failed, waiting for other jobs to finish...
error: Could not compile `r0`.
warning: build failed, waiting for other jobs to finish...
error: Could not compile `void`.
warning: build failed, waiting for other jobs to finish...
error: Could not compile `nb`.
warning: build failed, waiting for other jobs to finish...
error: Could not compile `vcell`.
warning: build failed, waiting for other jobs to finish...
error: Could not compile `bit_field`.
warning: build failed, waiting for other jobs to finish...
error: build failed
laanwj commented 5 years ago

that's strange ! you're right that note: theriscv64imac-unknown-none-elftarget may not be installed is usually the consequence of not having done rustup target add riscv64gc-unknown-none-elf—the only thing I can think of is that you might have multiple toolchains installed rustup toolchain list and don't have the target for the specific toolchain you're using to build, it doesn't automatically install every target for every installed toolchain

dimitre commented 5 years ago

strange indeed. maybe something wrong here with my rust installation

rustup target add riscv64gc-unknown-none-elf
info: component 'rust-std' for target 'riscv64gc-unknown-none-elf' is up to date
autechre:~ z$ rustup toolchain list
stable-x86_64-apple-darwin (default)
autechre:~ z$ 
laanwj commented 5 years ago
user@riscv:~/maixgo/k210-sdk-stuff/rust/game-of-life$ rustup target list|grep -e '\(installed\|default\)'
riscv64gc-unknown-none-elf (installed)
x86_64-unknown-linux-gnu (default)

user@riscv:~/maixgo/k210-sdk-stuff/rust/game-of-life$ rustup toolchain list
stable-x86_64-unknown-linux-gnu
nightly-x86_64-unknown-linux-gnu (default)

user@riscv:~/maixgo/k210-sdk-stuff/rust/game-of-life$ cargo build --release
   Compiling semver-parser v0.7.0
   Compiling proc-macro2 v0.4.30
   Compiling unicode-xid v0.1.0
   Compiling syn v0.15.39
   Compiling rand_core v0.4.0
   Compiling riscv v0.5.3
   Compiling bit_field v0.9.0
   Compiling riscv-rt v0.6.0 (https://github.com/rust-embedded/riscv-rt.git?rev=e9bb7e0964aea781f1121cee82dd55098a4b43e8#e9bb7e09)
   Compiling r0 v0.2.2
   Compiling k210-pac v0.1.0 (/home/user/maixgo/k210-crates/k210-pac)
   Compiling libm v0.1.4
   Compiling void v1.0.2
   Compiling vcell v0.1.0
   Compiling nb v0.1.2
   Compiling k210-shared v0.1.0 (/home/user/maixgo/k210-sdk-stuff/rust/k210-shared)
   Compiling rand_core v0.3.1
   Compiling rand v0.5.6
   Compiling embedded-hal v0.2.3
   Compiling semver v0.9.0
   Compiling rustc_version v0.2.3
   Compiling bare-metal v0.2.4
   Compiling quote v0.6.12
   Compiling riscv-rt-macros v0.1.6 (https://github.com/rust-embedded/riscv-rt.git?rev=e9bb7e0964aea781f1121cee82dd55098a4b43e8#e9bb7e09)
   Compiling k210-hal v0.1.0 (https://github.com/riscv-rust/k210-hal.git?rev=b83e843c19a2f0bc4eb7f56322ae844818709298#b83e843c)
   Compiling game-of-life v0.1.0 (/home/user/maixgo/k210-sdk-stuff/rust/game-of-life)
    Finished release [optimized] target(s) in 53.39s

user@riscv:~/maixgo/k210-sdk-stuff/rust/game-of-life$ size ../target/riscv64gc-unknown-none-elf/release/game-of-life
   text    data     bss     dec     hex filename
  40194       0 6251240 6291434  5fffea ../target/riscv64gc-unknown-none-elf/release/game-of-life

note that I only test with nightly, so don't know for sure if stable works

dimitre commented 5 years ago

Thank you very much. Installing nightly here worked as a charm. will grab my Maix Bit now :)