Skip to content

How to compile this thing

Florian Guggi edited this page Oct 31, 2022 · 1 revision

How to setup compilation

Compiling rust is fortunately quite simple. First install rustup (see rustup.rs for more info)

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

You now have rustup (installing/updating/modifying of the toolchain) and cargo (project manager) installed.

You can now cd into the STS1_EDU_Scheduler directory and use

  • cargo build to compile the thing (first time takes long)
  • cargo test compile and run all tests

Compiling for the Raspberry Pi

To compile for the compute module, there are two ways

With docker already installed

Install the cross tool

cargo install cross --git https://github.com/cross-rs/cross

Compile (make sure docker is running)

cross build --release --target armv7-unknown-linux-gnueabihf

The executable can be found in ./target/armv7-unknown-linux-gnueabihf/release/STS1_EDU_Scheduler

Without docker

Install the target

rustup add target armv7-unknown-linux-gnueabihf

Install the toolchain

sudo apt install gcc-arm-linux-gnueabihf

Compile

cargo build --release --target=armv7-unknown-linux-gnueabihf

The executable can be found in ./target/armv7-unknown-linux-gnueabihf/release/STS1_EDU_Scheduler