Cross-Compilation Environment For Intel Edison

Intel EdisonWe were lucky to get one of those Intel Edison SoC + maker boards and compile some stuff for it.

Setting up the compilation environment can be difficult task for beginner. That’s why there is dev-launcher script that can help you compile stuff inside Eclipse. But if you want to cross-compile directly from the command line then in order to get up to speed you can use our activation script. What you have to do is first download the Dev Kit. In the archive you will have Eclipse IDE plus 2 complete environments for cross-compiling. Inside of the folder {path-to-uncomppressed-dev-kit}/devkit-x86/sysroots/i586-poky-linux/ you should create an executable activate.sh file with the following code:

#!/bin/bash

# Simple script to prepare the current environment for cross-compiling.
# @author: Slavey Karadzhov 


TOOLCHAIN=$(pushd $(dirname $(readlink -f $BASH_SOURCE)) > /dev/null; pwd; popd > /dev/null)
if ! echo $PATH | grep -q $TOOLCHAIN ; then
    export PATH="${TOOLCHAIN}/usr/bin:${PATH}"
fi

export AR="i586-poky-linux-ar"
export AS="i586-poky-linux-as"
export CXX="i586-poky-linux-g++ --sysroot=${TOOLCHAIN}"
export CC="i586-poky-linux-gcc --sysroot=${TOOLCHAIN}"
export LD="i586-poky-linux-ld --sysroot=${TOOLCHAIN}"
export NM="i586-poky-linux-nm"
export OBJDUMP="i586-poky-linux-objdump"
export RANLIB="i586-poky-linux-ranlib"
export READELF="i586-poky-linux-readelf"
export STRIP="i586-poky-linux-strip"

export LD_LIBRARY_PATH="${TOOLCHAIN}/usr/lib:${TOOLCHAIN}/usr/lib32:${LD_LIBRARY_PATH}"

After that activate the environment by calling:

source {path-to-uncomppressed-dev-kit}/devkit-x86/sysroots/i586-poky-linux/activate.sh

Make sure that you replace {path-to-uncomppressed-dev-kit} with the actual path on your computer.
After that you should be able to cross-compile your favorite application and run it on the Edison.

Post navigation


Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> 

Time limit is exhausted. Please reload CAPTCHA.

This site uses Akismet to reduce spam. Learn how your comment data is processed.