Skip to content
This repository has been archived by the owner on Jun 27, 2019. It is now read-only.

Building Soletta for Intel® Galileo and Intel® Galileo Gen2

Bruno Dilly edited this page Jun 16, 2016 · 3 revisions

Introduction

This page is intended to provide instructions about how to build and run Soletta™ Framework on the Intel® Galileo and Intel® Galileo Gen2 boards.

If instead you prefer to just use a pre-built image, please check this page.

Pre-requisites

Fetch Soletta project's source code

As the first step, you need to fetch Soletta framework's source code. It can be done by either cloning the git repository or downloading a tar.gz from a specific tag:

[host]$ git clone git://github.com/solettaproject/soletta

or for example v1_beta10:

[host]$ wget https://github.com/solettaproject/soletta/archive/v1_beta10.tar.gz

Then, inside the Soletta project's directory, be sure to run the following commands:

[host]$ git submodule init && git submodule update

This will make git fetch the source code of the submodules. It is needed to enable some features, like the JavaScript nodetype.

Compiling Soletta

Once the SDK is installed, it's time to setup a terminal to point to the right tools and paths needed to cross-compile Soletta.

[host]$ source <SDK_PATH>/environment-setup-i586-poky-linux-uclibc

If the official SDK is being used, follow the steps found here before proceed.

[host]$ export TARGETCC=$CC
[host]$ export TARGETAR=$AR
[host]$ unset PKG_CONFIG_PATH

Galileo Configuration

Now is necessary to change Soletta project's options to match Galileo restrictions. To access the configuration menu:

[host]$ make menuconfig

Because of the environment changes made by SDK, this may fail. If so, open a new terminal and make just this step on it.

Go to Core library --> Target platform: Ensure that linux-micro is selected.

Save the changes and exit the configuration menu.

Building

Now a simple make will build Soletta:

[host]$ make

You can use -j option to compile faster. Check make's manual for more info (man make).

Installing

Inside Soletta project's directory. First, install soletta in a temporary path:

[host]$ make install DESTDIR=<TMP_PATH>

Pack everything:

[host]$ cd <TMP_PATH>
[host]$ tar cvf soletta.tar *

Copy soletta.tar to Galileo root dir and connect to Galileo. Then:

[root@galileo]$ cd /
[root@galileo]$ tar xvf soletta.tar

And Soletta should be successfully installed!

Important: If you are using the official SDK and didn't boot from a SD card image, the installation won't persist if you turn off/reboot your board.

Running 'simple.fbp' sample

To make sure that the installation is ok, copy the sample found in <SOLETTA_SRC_DIR>/src/samples/flow/basics/simple.fbp to Galileo and try to execute:

[root@galileo]$ sol-fbp-runner simple.fbp

And check if the output is displayed without errors.

References

Appendix

Galileo's official SDK tricks

Unfortunately, a extra steps is needed in order to fulfil Soletta project's build requirements.

Soletta use several tools written in Python 3 during a pre-build stage and Galileo official SDK setup the environment to use Python 2.7.3 that won't work with Soletta tools. To fix this, we will modify PYTHONHOME so the Python installed in the host computer is used instead of the one provided by the SDK. We have two options for this: unset the environment variable after the SDK setup or remove the line that set the variable in the SDK setup script.

Option 1 - Unset the variable (The preferred way)

[host]$ unset PYTHONHOME

It's recommended to create either a function or script to reproduce this step after the SDK environment setup.

Option 2 - Modify 'PYTHONHOME' in the SDK setup script

Apply the following change to <SDK_INSTALL_PATH>/environment-setup-i586-poky-linux-uclibc

- export PYTHONHOME=<SDK_INSTALL_PATH>/sysroots/x86_64-pokysdk-linux/usr
Clone this wiki locally