Closed 53175ddd closed 6 months ago
rustup done
クロスコンパイラ導入 done
cc 入れろと言われたので実行 多分ユーティリティインストール前にやったほうがいい
sudo apt install gcc -y
cargo install flip-link elf2uf2-rs probe-run
すべての作業の前にやるべきコマンド
sudo apt update && sudo apt upgrade -y
sudo apt install pkg-config -y
これをユーティリティインストール前にしたほうがよさそう
thread 'main' panicked at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libudev-sys-0.1.4/build.rs:38:41:
called `Result::unwrap()` on an `Err` value: "\npkg-config exited with status code 1\n> PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 pkg-config --libs --cflags libudev\n\nThe system library `libudev` required by crate `libudev-sys` was not found.\nThe file `libudev.pc` needs to be installed and the PKG_CONFIG_PATH environment variable must contain its parent directory.\nThe PKG_CONFIG_PATH environment variable is not set.\n\nHINT: if you have installed the library, try setting PKG_CONFIG_PATH to the directory containing `libudev.pc`.\n"
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: failed to compile `elf2uf2-rs v2.0.0`, intermediate artifacts can be found at `/tmp/cargo-installww3Md6`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
error: failed to compile `probe-run v0.3.11`, intermediate artifacts can be found at `/tmp/cargo-installr2YJ1X`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
Summary Successfully installed flip-link! Failed to install elf2uf2-rs, probe-run (see error(s) above).
error: some crates failed to install
環境変数の設定
export ACLOCAL_PATH=/usr/local/share/aclocal/:$ACLOCAL_PATH
export PKG_CONFIG_PATH=/usr/lib/pkgconfig
上記,pkg-config
インストール後に実行
この辺でパソコンを再起動
.bashrc に下記追記
export ACLOCAL_PATH=/usr/local/share/aclocal/:$ACLOCAL_PATH
export PKG_CONFIG_PATH=/usr/lib/pkgconfig
一時中断
sudo apt install libudev-dev
ここまでやってようやく通った
cargo install flip-link elf2uf2-rs probe-run
完了