glued_cross_compiler

This is an old revision of the document!


Cross-compiling for the Raspberry Pi

Compiling DUNE directly on the Raspberry Pi is possible, but soon becomes tedious, as it takes a while. Luckily there is an alternative, cross-compiling. The Raspberry Pi has an available toolchain at GitHub, but it uses a too old version of the gcc compiler, and therefore it will not compile DUNE. The solution to this, is to use the cross-compiler environment that is made for LSTS Glued.

  • Install required packages
sudo apt-get install docker.io
  • Clone Glued from github
git clone https://github.com/LSTS/glued.git
  • Run docker shell for the build system
cd glued/docker && sudo make shell
  • Create build configuration for mariner-01
​ ./mkconfig.bash mariner-01
  • Compile system image for mariner-01
​./mksystem.bash lctr-rpi/mariner-01.bash
  • Create cross-compilation toolchain
./pktoolchain.bash lctr-rpi/mariner-01.bash
  • Leave docker enviroment
exit
  • Make directory for pibuild
mkdir $lststools/dune/buid-mariner && cd $lststools/dune/buid-mariner
  • Create makefiles with cmake
cmake -DCROSS=$lststools/glued/lctr-rpi/toolchain/bin/armv7-lsts-linux-gnueabihf-gcc ../source
  • Compile with make, add the -j4 for using more threads, add package to make a tar.gz2 archive that can easily be transferred to the Raspberry Pi
make -j4
  • glued_cross_compiler.1570435485.txt.gz
  • Last modified: 2022/09/19 11:33
  • (external edit)