E-Agle TRT cross-compile tool for Raspberry Pi
10K+
$ sudo apt install build-essential
$ sudo apt install cmake
$ sudo apt install libmongoc-dev
$ sudo apt install mosquitto-dev
$ sudo apt install mosquitto
$ sudo apt install mosquitto-clients
$ sudo apt install libmosquitto-dev
$ sudo apt install libmosquitto1
build a Docker container:
$ docker build . -t eagle-rpi
$ docker run -ti --rm -v$(pwd):/root/devel --name erpi eagle-rpi
root@4fedfaf5b5c7:~/devel#
The first command builds the container image. It takes time but you only have to do it once. It downloads about 500 Mb from the Internet, so you need a good downlink.
The switch -v$(pwd):/root/devel means that the current dir in the host machine is mounted on the /root/devel container. Consequently, you will see the workdir in the guiest container synchronized with your starting point in the host machine. In other words, you can use your editor on your PC/Mac, and run compilation commands within the container shell.
The latter will put you in the cross-compiling enviroment (CCE). You can close the CCE with the usual logout (CTRL-D). Any change within the CCE will be lost, due to the --rm switch (it means 'remove'). If you want to have a permanent CCE, remove the --rm switch, and only use once the command. After closing it, you can enter again with:
$ docker start erpi
$ docker attach erpi
root@4fedfaf5b5c7:~/devel#
Work in a terminal on the project root within CCE:
$ cmake -Bxbuild -H. -DCMAKE_TOOLCHAIN_FILE=/root/Toolchain-rpi.cmake
This will prepare an out-of-source build with cmake in the xbuild folder using the CMakeLists.txt found in the . directory.
Work in a terminal on the project root:
$ make -C xbuild
Work in a terminal on the project root within the CCE:
$ qemu-arm xbuild/cross-template
Assuming that you mounted the /usr/local dir of the raspberry to the install folder with the command (to be executed on the host machine, not on the CCE!):
$ sshfs [email protected]:/usr/local install
then you can build and install on the target system with one command from within the CCE:
$ make -Cxbuild install
# or:
$ cd xbuild
$ make install
Cross compilation (run from HOST shell):
$ ./cross cmake -Bxbuild -H. -DCROSS=ON
$ ./cross make -Cxbuild
$ .cross xbuild/cross-template
Version 0.0.1-3-gb0f4849§
Testing Mosquitto
MQTT: Cannot assign requested address
Testing BSON
Document:
{ "idx" : 1, "name" : "test" }
length: 30
Compilation for local host:
$ cmake -Bbuild -H.
$ make -Cbuild
$ build/cross-template
Version 0.0.1-3-gb0f4849§
Testing Mosquitto
Testing BSON
Document:
{ "idx" : 1, "name" : "test" }
length: 30
Content type
Image
Digest
Size
1.1 GB
Last updated
over 7 years ago
docker pull p4010/eagle-rpi