- EV3:
mkdir build
cd build
cmake .. -DEV3DEV_PLATFORM=EV3
make
- BrickPi:
mkdir build
cd build
cmake .. -DEV3DEV_PLATFORM=RPI
make
You have several options for compiling.
You can use a cross-compiling toolchain to create ARM compatible code. Note: You need a Linux toolchain, not a "bare-metal" toolchain. If it does not have "linux" in the name, it probably won't work.
Pros: Fastest option. Works on Windows and Mac without a virtual machine.
Cons: Only includes standard libraries - no Debian -dev
packages.
MentorGraphics toolchain (formerly known as CodeSourcery).
Brickstrap uses QEMU to create a virtual environment (not exactly a virtual machine) that can run the same ARM compatible code on a different type of computer.
Pros: Faster than running on the EV3 itself. Can install all Debian -dev
packages using apt-get
.
Cons: Slower than cross-compiler. Requires Linux (Ubuntu).
See this page for instructions.
It is possible to compile programs on the EV3 brick itself.
Pros: Easy to setup.
Cons: Really slow.
Just run sudo apt-get install build-essential
on the EV3 and you will have
everything you need.