padenot / bela-sys

Rust bindings for the Bela platform

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

error: linker `arm-bela-linux-gnueabihf-gcc` not found

chaosprint opened this issue · comments

Following the instructions in README.md, when compiling with:

cargo build --target=armv7-unknown-linux-gnueabihf --example tone

We get:

error: linker `arm-bela-linux-gnueabihf-gcc` not found
  |
  = note: No such file or directory (os error 2)

error: aborting due to previous error

error: could not compile `bela-sys`.

What's your host OS ?

You might want to run this command in the exact same shell that was used to run the script, AND/OR set the PATH variable in your .bashrc or .zshrc. The setup script really is for a one-off run all in the same shell. For subsequent runs, you might want to put this linker somewhere on your computer (I used ~/local/arm-bela-linux-gnueabihf/), and have that in PATH. If you're doing rust work on Bela, you'll need this linker all the time anyways.

I'll add a warning message that explains this.

What's your host OS ?

macOS 10.15.5 Catalina

You might want to run this command in the exact same shell that was used to run the script, AND/OR set the PATH variable in your .bashrc or .zshrc. The setup script really is for a one-off run all in the same shell. For subsequent runs, you might want to put this linker somewhere on your computer (I used ~/local/arm-bela-linux-gnueabihf/), and have that in PATH. If you're doing rust work on Bela, you'll need this linker all the time anyways.

I did run the code at the same shell, but still got the error.
Then I set the PATH in .zshrc. It seems to work for the linker but I got some new errors:

  = note: /Users/chaosprint/Dev/bela-sys/arm-bela-linux-gnueabihf/bin/../lib/gcc/arm-bela-linux-gnueabihf/6.3.1/../../../../arm-bela-linux-gnueabihf/bin/ld: cannot find -lNE10
          /Users/chaosprint/Dev/bela-sys/arm-bela-linux-gnueabihf/bin/../lib/gcc/arm-bela-linux-gnueabihf/6.3.1/../../../../arm-bela-linux-gnueabihf/bin/ld: cannot find -lasound
          /Users/chaosprint/Dev/bela-sys/arm-bela-linux-gnueabihf/bin/../lib/gcc/arm-bela-linux-gnueabihf/6.3.1/../../../../arm-bela-linux-gnueabihf/bin/ld: cannot find -lcobalt
          /Users/chaosprint/Dev/bela-sys/arm-bela-linux-gnueabihf/bin/../lib/gcc/arm-bela-linux-gnueabihf/6.3.1/../../../../arm-bela-linux-gnueabihf/bin/ld: cannot find -lmodechk
          collect2: error: ld returned 1 exit status
          

error: aborting due to previous error

error: could not compile `bela-sys`.

Then I manually ran:

  scp root@bela.local:/usr/local/lib/libprussdrv.so lib
  scp root@bela.local:/usr/local/lib/libseasocks.so lib
  scp root@bela.local:/usr/local/lib/libseasocks.so.1.4.2 lib
  scp root@bela.local:/usr/lib/arm-linux-gnueabihf/libasound.so.2 lib/libasound.so
  scp root@bela.local:/usr/lib/libNE10.so.10 lib/libNE10.so
  scp root@bela.local:/usr/xenomai/lib/libmodechk.so lib
  scp root@bela.local:/usr/xenomai/lib/libcobalt.so lib
  scp root@bela.local:/lib/arm-linux-gnueabihf/librt.so.1 lib

Then everything works fine, except for a warning:

warning: use of deprecated item 'std::mem::uninitialized': use `mem::MaybeUninit` instead
  --> examples/tone.rs:31:42
   |
31 |     let mut settings: BelaInitSettings = mem::uninitialized();
   |                                          ^^^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(deprecated)]` on by default

    Finished dev [unoptimized + debuginfo] target(s) in 1.87s

So, it's mainly a macOS related issue after all.

I'll add a warning message that explains this.

Many thanks!