Skip to content

Conversation

@alphaville
Copy link
Owner

@alphaville alphaville commented May 6, 2025

This is work in progress

Main Changes

Firstly, each cargo package has its own .cargo/config.toml file with the following contents:

[target.x86_64-apple-darwin]
rustflags = [
  "-C", "link-arg=-undefined",
  "-C", "link-arg=dynamic_lookup",
]
[target.aarch64-apple-darwin]
rustflags = [
  "-C", "link-arg=-undefined",
  "-C", "link-arg=dynamic_lookup",
]

# This is for cross-compiling to ARM architecture (e.g., Raspberry Pi)
[target.arm-unknown-linux-gnueabihf]
linker="arm-linux-gnueabihf-gcc"

Then we can cross-compile with cargo build --target=arm-unknown-linux-gnueabihf.

Secondly, we now cross-compile for RPi on GitHub Actions (see test/test_raspberry_pi.py and ci.yml).

Lastly, I tested this on a Raspberry Pi and it works.

Other changes:

  • Updated website docs here
  • Updated min cmake version from 2.8 to 3.5
  • Updated auto-generated example C/C++ bindings

Associated Issues

We're still getting an error when cross-compiling with .with_build_python_bindings(), but we'll address it in a separate PR (see issue #369).

TODOs

  • Documentation
  • All tests must pass
  • Update CHANGELOG(s)
  • Update webpage documentation!
  • Bump versions (in CHANGELOG, Cargo.toml and VERSION)

@alphaville alphaville added bug Something isn't working docs improvement of documentation test Unit tests codegen Code generation raspberry pi Raspberry Pi target labels May 6, 2025
@alphaville alphaville self-assigned this May 6, 2025
@alphaville alphaville requested a review from korken89 May 6, 2025 22:38
@alphaville alphaville marked this pull request as ready for review May 6, 2025 22:38
@alphaville alphaville requested review from ruairimoran and removed request for korken89 May 6, 2025 22:47
Copy link
Collaborator

@ruairimoran ruairimoran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, some comments

@alphaville alphaville merged commit 31d57c7 into master May 8, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working codegen Code generation docs improvement of documentation raspberry pi Raspberry Pi target test Unit tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compilation for embedded target

3 participants