Linux - Building and Packaging (old)

Introduction

This page describes how to setup a build environment, using a Ubuntu 14.04.3 LTS 64 bit (Trusty Tahr). The same method can apply to others GNU/Linux dist like Debian or Fedora.


Since Qt5.6, Qt do not provides the Linux32 prebuild binaries or Linux32 Qt installer. See Linux32(i686) Qt5.6 issue part.

In this page
 

Setup a build environment

Install all tools, dependencies, compiler and more which are needed for building:

sudo apt-get install build-essential \
curl \
gdb \
wget \
debhelper \
p7zip-full \
unzip \
flex \
bison \
libsdl1.2-dev \
libudev-dev \
libusb-1.0-0-dev \
git-core \
git-doc \
gitk \
ccache \
cmake \
libzip-dev \
libpng-dev \
libjpeg-dev \
libtiff5-dev \
libcurl4-openssl-dev \
libgeos++-dev \
libgdal-dev

For x86_64 architecture you still need libc6 32bits compatible for ARM toolchain use or it fails silently!

sudo apt-get install libc6-i386

Linux32 (i686) - Qt5.6 issue

Qt5.6 is not available for download anymore, you can use the Qt5.6 packages that comes from you system:

sudo add-apt-repository ppa:librepilot/tools -y
sudo apt-get update -q
sudo apt-get install -y libudev-dev \
libusb-1.0-0-dev \
libsdl1.2-dev \
python \
libopenscenegraph-dev \
qt56-meta-minimal \
qt56svg \
qt56script \
qt56serialport \
qt56multimedia \
qt56translations \
qt56tools \
qt56quickcontrols

make  arm_sdk_install

source /opt/qt56/bin/qt56-env.sh
make opfw_resource
make gcs GCS_EXTRA_CONF=osg

./build/librepilot-gcs_release/bin/librepilot-gcs




Get the code using Git

Choose/create a dir where you want LibrePilot code:

mkdir -p ~/code
cd ~/code

Checkout code :

git clone https://bitbucket.org/librepilot/librepilot.git

Change current directory to ~/code/librepilot:

cd ~/code/librepilot

Now you can checkout code from remote Git server:

git checkout next

Dev Tools Installation

Install development libraries and tools, these will be downloaded and automatically installed using root Makefile:

make all_sdk_install

After you have run  make all_sdk_install, make sure you run the next two commands to make sure everything was installed.

make osg_install
make osgearth_install



Connecting your hardware

If you don't install a package previously you cannot access the hardware connected to Usb port as a normal user because access rights are missing.

Copy the udev rules file to the right place and add your current user to the plugdev group. May need a new terminal session to be taken in account.

sudo cp package/linux/45-uav.rules /etc/udev/rules.d/45-uav.rules
sudo udevadm control --reload-rules
sudo usermod -a -G plugdev your_username


Build - Run software locally

make opfw_resource
make gcs
./build/librepilot-gcs_release/bin/librepilot-gcs

Take also a look to the Make Basics page.


Build package

Build a .deb package:

Tip: set after make -j(numbers of cores/threads)

example: make -j4 package  ( for 4 cores/threads)

make package

Updating your local source of Librepilot

Go to the location where you have your source files ( if its the same as above it will be ~/code/librepilot )

The first command will get the new changes

The second command will rebuild 

git pull
make package