Skip to content

Cross compiling for Yocto using a Toolchain SDK

Antonio Gutierrez edited this page Oct 26, 2015 · 2 revisions

The following should contain what you need to cross compile at least the C/C++ library using cmake and the Yocto toolchain.

OK so first things first you will need a toolchain that matches what is running on the Edison. Intel provides one from: https://software.intel.com/en-us/iot/hardware/edison/downloads Download the "SDK - Cross Compile Tools" and as you're using Debian x86_64 you want "Linux* 64-bit"

wget http://downloadmirror.intel.com/25028/eng/edison-sdk-linux64-ww25.5-15.zip
unzip edison-sdk-linux64-ww25.5-15.zip  
./poky-edison-glibc-x86_64-edison-image-core2-32-toolchain-1.7.2.sh

You will then be prompted where you want to install the SDK to, the default is /opt/poky-edison/1.7.2 and is what I will use for these instructions. After completion you should have everything you need to cross compile for the Edison Yocto distro.

The next step "sources" a script provided by the Yocto SDK which will add the compilers, sysroots to your running environment variables. This is tested under BASH and ZSH, other shells may work but no promises :)

source /opt/poky-edison/1.7.2/environment-setup-core2-32-poky-linux

So, now its time to compile mraa!

git clone https://github.com/intel-iot-devkit/mraa.git
cd mraa
mkdir build
cd build
cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchains/oe-sdk_cross.cmake ../
make

What should have happened now is that you used the included OE toolchain file in mraa to use the enviroment and sdk you set up in the previous steps. All going well you have now compiled mraa for edison

Clone this wiki locally