Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

OSGEO-India: FOSS4G 2012- First National Conference "OPEN SOURCE GEOSPATIAL RESOURCES TO

SPEARHEAD DEVELOPMENT AND GROWTH 25-27TH OCTOBER 2012, @ IIIT HYDERABAD

PORTING QGIS TO ARM BASED SINGLE


BOARD COMPUTER: BEAGLEBOARD-XM
SAURABH SHANDILYA SHANTANU SHARMA
ELECTRONICS & COMMUNICATION DEPT. ELECTRONICS & COMMUNICATION DEPT.
DELHI TECHNOLOGICALUNIVERSITY DELHI TECHNOLOGICALUNIVERSITY
DELHI, INDIA DELHI, INDIA
SAURABHSHANDILYA.1991@GMAIL.COM SHANTANU.785@GMAIL.COM

Abstract--Using Beagleboard-XM, QGIS porting is done existing applications. In this paper, porting of linux
with the intention to make QGIS available for ARM distribution Ubuntu to Beagleboard-Xm is done and then
architectures too on Linux distributions like Ubuntu. For QGIS (QUANTUM GEOGRAPHIC SYSTEM) is also
every new CPU architecture, the OS has already been installed on the board. .
customized, compiled and burnt into the core .With the The work was much harder than than it would be now, since at
coming of age of Linux as an embedded OS all this has the time the Linux kernel was still very Intel-centric. In fact,
changed quite significantly. Being in Open Source domain, modern Linux Distributions come with a handy reference
Linux kernel and full distributions can be freely downloaded example called asm-generic that shows all of the header files
and compiled for any system architecture and this includes and kernel interfaces that a new architecture port should
ARM based systems also. This paper describes the details of provide. Once the kernel has been ported to a given
porting of Linux distributions like Ubuntu to Beagle-board architecture, it is necessary to implement support for a specific
and then compiling QGIS for the same. The mobile devices platform based upon that architecture. Quantum-GIS is a user
are ubiqitious now. Professionals, developers use such friendly Open-source Geographic Information System licensed
objects in day to day purposes. When working on site/field under GNU GPL. QGIS is an official project of the Open
use of bulky hardware devices like computers and laptops is Source Geospatial Foundation. It runs of Linux, Unix, Mac
somewhat uncomfortable. Thus integrating the softwares OSX, Windows, and Android and supports vector, raster, and
like QGIS with the latest mobile tablets like devices is database formats and functionalities.
supposed to increase the comfort and productivity. Porting
of QGIS on such tablets supporting linux will make great
improvement and development in the realm.

Index Terms: ARM, Ubuntu, Linux, QGIS, QT , Beagleboard-XM

I. INTRODUCTION
ARM based development boards are the ideal platform for
accelerating the development and reducing the risk of new
SoC designs. The combination of ASIC and FPGA
technology in ARM boards delivers an optimal solution in
terms of speed, accuracy, flexibility and cost. Based on ARM,
very complex machines like Beagleboard-XM are developed
and meant to support varied tasks such as memory
management, process management and peripheral interfaces.
For seamless integration of these functional modules an OS
has to be ported on these ARM based CPUs and then the
applications are easily accessed. This enables the developers
Fig. 1
and users to port the OS themselves. The complete open-
The latest release is 1.8.0. Quantum GIS is written in C++,
source package is meant to improve the portability of the
and uses the QT library. Quantum GIS allows integration of
open-source applications to myriad devices. Linux kernel and
plugins developed using either C++ or Python. In addition to
distributions has been available for the ARM architecture for
Qt, required dependencies of Quantum GIS include GEOS and
many years now. The ARM Linux port has made life a bit
Sqlite, GDAL, GRASS GIS, POSTGIS, PostgreGLare also
easier for people who run (or want to run) Linux on their
recommended, as they provide access to additional data
embedded devices and explore the vast portability of the
formats. Quantum GIS can also be used as a graphical user

1|P age
http://osgeo.in/foss4g2012
OSGEO-India: FOSS4G 2012- First National Conference "OPEN SOURCE GEOSPATIAL RESOURCES TO
SPEARHEAD DEVELOPMENT AND GROWTH 25-27TH OCTOBER 2012, @ IIIT HYDERABAD

interface to GRASS. Quantum GIS has a small file size 7. Ensure that Software Flow Control is also
compared to commercial GIS's and requires less RAM and off.
processing power; hence it can be used on older hardware or 8. Press Return to go back to the main menu.
running simultaneously with other applications where CPU 9. Choose Save Setup as dfl to use these
power may be limited. So, I used the Beagle-board for porting settings by default.
QGIS to a much more portable and standalone hardware. 10. Choose Exit to exit the setup section and
launch Mincom with these settings.
I. PORTING ON BEAGLE-BOARD On booting the board, the boot loader messages are thrown on
the serial line which are catched by the other Linux/windows
A. Beagleboard-XM Introduction
machine. The startup messages depend upon the distribution
The Beagleboard is a low power open source hardware and U-boot version of the Linux already present on the Board
single board computer produced by Texas Instruments. The on the SD-card.
Beagleboard is designed with open source 3530 System on Listing 1. Bootloader output
Chip (SoC). It has ARM cortex-A8 CPU at 1GHz and a DSP Texas Instruments X-Loader 1.5.0 (Mar 27 2011 - 17:37:56)
core for accelerated video and audio decoding and a few other 1. Beagleboard-XM
peripherals like USB, JTAG for other interaction with other
2. Reading boot sector
hardware, supporting 512 MB of RAM. The OS, programs and
3. Loading u-boot.bin from mmc
the libraries have to be loaded on the SD-card because the
board lacks the NAND flash support. 4. ...
5. U-Boot 2011.03-rc1-00000-g9a3cc57-dirty (Apr 01
2011 - 17:41:42)
6. ..
7. OMAP36XX/37XX-GP ES2.1, CPU-OPP2, L3-
165MHz, Max CPU Clock 1 Ghz
8. OMAP3 Beagle board + LPDDR/NAND
9. I2C: ready
10. DRAM: 512 MiB
11. NAND: 0 MiB
12. MMC: OMAP SD/MMC: 0
13. .
14. Verifying Checksum ... OK
15. Loading Kernel Image ... OK
16. OK
17. Starting kernel ...
18. Uncompressing
Keyboard-video-mouse (KVM) functionality, you need the Linux...........................................................................................
following items: ............................................... done, booting the kernel.
19. 0.000000] Linux version 2.6.32 (koen@dominion)
HDMI male-to-DVI-D male cable (gcc version 4.3.3 (GCC) ) #3 PREEMPT Thu Mar 17
Digital monitor 08:56:19 CET 2011
USB keyboard 20. 0.000000] CPU: ARMv7 Processor [413fc082]
USB mouse revision 2 (ARMv7), cr=10c53c7f.........
Setting up the console on Linux
To set up a serial console under Linux, use a terminal
emulation program such as minicom, as shown here: B. PORTING UBUNTU 11.10 ON BEAGLEBOARD-XM
1. Install minicom on your system. Download the Ubuntu for beagle-board from the
2. Launch into setup as root by running the given link and then extract it and save it to SD-card.
command $sudo minicom -s.
wget http://rcn-ee.net/deb/rootfs/oneiric/ubuntu-
3. Select Serial Port Setup, and then press
11.10-r12-minimal-armel-2012-07-29.tar.xz
Return.
4. Set the serial port by typing A to select tar xJf ubuntu-11.10-r12-minimal-armel-2012-07-
Serial Device, change to the /dev/ttyS0 29.tar.xz
directory, then press Return. cd ubuntu-11.10-r12-minimal-armel-2012-07-29
5. Ensure that communications settings (E) are
115200 8N1. sudo ./setup_sdcard.sh probe-mmc
6. Turn Hardware Flow Control off by OR
typing F.

2|P age
http://osgeo.in/foss4g2012
OSGEO-India: FOSS4G 2012- First National Conference "OPEN SOURCE GEOSPATIAL RESOURCES TO
SPEARHEAD DEVELOPMENT AND GROWTH 25-27TH OCTOBER 2012, @ IIIT HYDERABAD

sudo ./setup_sdcard.sh mmc /dev/sdX uboot


beagle_xm E. INSTALLING OTHER LIBRARIES & DEPENDENCIES
sudo apt-get update It requires quite a large number of dependencies so using the
package manager for downloading the dependencies.
sudo apt-get upgrade
$apt-get build-essential g++ subversion
The process of upgrade takes a lot of time. So a SD-card of at
least 4GB is recommended and 8 GB is preferable because From http://www.erdas.com. Download the ECW libraries
GUI is also installed which also takes lot of space along with and install them.
the libraries. Graphics User Interface is setup to get the output
$./configure
out of the HDMI port of the Beagle-board
$make
$ sudo apt-get install gdm xfce4 xserver-xorg-video- $make install
omap3 network-manager $svn checkout https://svn.osgeo.org/gdal/trunk/gdal
C. BOOTING UP THE ARM BOARD gdal
Booting is short for bootstrapping, which refers to the download and install the gdal libraries with
process by which a computer prepares itself to load an
operating system. Small, resource-constrained systems such as $./configure --without-grass with- mrsid=../Geo_DSDK-
the BeagleBoard use a slightly different, multi step process 7.0.0.2167 without-jp2mrsid
because of the constrained memory. The board boots up in
multi stages . The boot process on the ARM Board works like
this:
X-Loader -> U-Boot -> Kernel
D. REQUIRED BUILD TOOLS
Development of the libraries can be done in two
ways- Cross Compiling or Native Build. In cross-compiling,
the programs are compiled on the host system but they are
made to run on the target board. On Native Build, the
'configure' and 'make' process is done on the target board itself.
Here, all the configuration is done on the target board only.
Fig. 3 Ubuntu running on Beagle-board
QGIS, like a number of major projects (eg. KDE 4.0), uses
Cmake (http://www.cmake.org) for building from source. $make
Following a summary of the required dependencies for
building: Required build tools: $apt-get install apt-get install bison cmake doxygen
flex git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal1-
- CMake >= 2.6.2 dev libgeos-dev libgsl0-dev libpq-dev libproj-dev libqt4-dev
- Flex libqtwebkit-dev libqwt5-qt4-dev libspatialindex-dev
- Bison >= 2.4 libspatialite-dev libsqlite3-dev pkg-config
Required build deps:
$apt-get install pyqt4-dev-tools python python-dev python-qt4
- Qt >= 4.4.0 python-qt4-dev python-sip python-sip-dev txt2tags xauth
- Proj >= 4.4.x xfonts-base xvfb
- GEOS >= 3.0
- Sqlite3 >= 3.0.0 There may be a conflict between Qt3 tools and Qt4 tools if they
- GDAL/OGR >= 1.4.x, Qwt >= 5.0: are installed together. For example, qmake will point to the Qt3
Optional dependencies: version, not the Qt4. Ubuntu Qt4 and Qt3 packages are
designed to live alongside each other. Either un-install the
- for GRASS plugin - GRASS >= 6.0.0 (libraries compiled QT3 or use the alternatives for QT4 instead of QT3. GRASS
with exceptions support on Linux 32bit) support is not yet been added because of the error associated
- for georeferencer - GSL >= 1.8 with the present kernel. Download and configuring of the
- for postgis support and SPIT plugin - PostgreSQL >= 8.0.x dependencies and other programs is made much easier because
- for gps plugin - expat >= 1.95 and gpsbabel of the use of package-manger. The download of the
- for mapserver export and PyQGIS - Python >= 2.3 (2.5+ dependencies is approximately 400-500MB. It may take a long
preferred) time(upto hours) to download and then installing the
- for python support - SIP >= 4.8, PyQt >= must match Qt dependencies because of the slow speed of the internet
version connection and also because package-manger will further
- for qgis mapserver FastCGI download the remaining cyclic dependencies along with the
packages.

3|P age
http://osgeo.in/foss4g2012
OSGEO-India: FOSS4G 2012- First National Conference "OPEN SOURCE GEOSPATIAL RESOURCES TO
SPEARHEAD DEVELOPMENT AND GROWTH 25-27TH OCTOBER 2012, @ IIIT HYDERABAD

There is cooperation between the GRASS and (QGIS) projects. environment. Compiling from the source and building on
Recent versions of QGIS can be executed within the GRASS different architecure like ARM is a hard task. Common errors
environment, allowing QGIS to be used as a user-friendly in files like that of compiling the libraries and other
graphical interface to GRASS that more closely resembles dependencies from the source are highly problematic because
other graphical GIS software than does the shell-based GRASS of the ARM architecture. Cross compile toolchain is easily
interface. available which is of utter importance. Native build on the
board itself is a time consuming slow process.
After the installation of all the dependencies, QGIS is
configured and installed. QGIS is downloaded as follows:
$ git clone git://github.com/qgis/Quantum-GIS.git.
Conclusion:
Step into the directory of QGIS and then make another folder
to contain the noise of the build process and then doing the The paper discussed a generic environment build of Ubuntu
make and make install as normal installation process. 11.10 for ARM core on Beagleboard-XM. This generic build
of the QGIS has a limited functionality, a lot other
cd Quantum-GIS dependencies are needed like that of GRASS for further
mkdir build-folder working of the QGIS. For a full fledged embedded module this
is quite elementary without the support for various peripherals
cd build-folder like that of the 7' LCD and GPS device integration through
device drivers which are paramount to the module. Linux
ccmake ..
kernel though monolithic has an excellent modular approach
.When running ccmake (note the .. is required!), a menu will which enables the driver modules to be attached and detached
appear to configure various aspects of the build. If you do not at run time itself. This very much suits the embedded
have root access or do not want to overwrite existing QGIS environment which are always constrained or system memory
installs (by your package-manager for example), set the
CMAKE_INSTALL_PREFIX to somewhere you have write ACKNOWLEDGMENT
access to (usually use ${HOME}/apps). Now press 'c' to
configure, 'e' to dismiss any error messages that may appear. WE LIKE TO THANK TO OUR TEACHER, SIR ANIL, FOR
and 'g' to generate the make files. Note that sometimes 'c' needs
PROVIDING NECESSARY UNDERSTANDING AND KNOWLEDGE
to be pressed several times before the 'g' option becomes
TOWARDS CARRYING OUT THIS WORK. WE ACKNOWLEDGE HIS
available. After the 'g' generation is complete, press 'q' to exit
DILIGENT EFFORTS OF IN ASSISTING US TOWARDS
the ccmake interactive dialog. Now the build process may take
a little while to build, upto 15-20 minutes! IMPLEMENTATION OF THIS IDEA

$make REFERENCES
$make install [1] http://labs.qt.nokia.com/2009/09/10/cross-compiling-qtx11/
Challanges & Mistakes [2] http://elinux.org/BeagleBoardUbuntu
[3] http://packages.debian.org/stable
[4] http://qt.nokia.com/downloads/
[5] http://www.brianhensley.net/2012/03/beagleboard-xm-ubuntu-1110-
with-gui.html
[6] http://www.qgis.org/
[7] http://www.osgeo.org/
[8] http://www.ibm.com/developerworks/linux/library/l-beagle-board/
[9] M. Young, The Technical Writer's Handbook. Mill Valley, CA:
University Science, 1989.

AUTHORS PROFILE
Saurabh Shandilya, an undergraduate currently doing B.tech IIIrd year in
Elctronics & Communication Engineering. He is having immense
interest in in Embedded Systems 8-bit microcontrollers
8051/AVR/ARDUINO to 32 bit ARM based AM355x and LPC based
processors. Embedded Linux development and Device Drivers for the
real time systems is the primary area of interest to work upon.

Fig. 4 Example of Compile time error Shantanu Sharma, an undergraduate currently doing B.tech III year in
Electronics & Communication Engineering. Having immense interest in
Errors may occur because of the non-availibility of any of the Embedded Systems 8-bit microcontrollers 8051/AVR/ to 32 bit ARM
dependency. So, all the dependencies must be installed before LPC based processors. Embedded Linux development and Device
starting the build process for the QGIS. The biggest challange Drivers is the primary area of interest to work upon.
is simply because of the development in cross-architecture

4|P age
http://osgeo.in/foss4g2012
OSGEO-India: FOSS4G 2012- First National Conference "OPEN SOURCE GEOSPATIAL RESOURCES TO
SPEARHEAD DEVELOPMENT AND GROWTH 25-27TH OCTOBER 2012, @ IIIT HYDERABAD

5|P age
http://osgeo.in/foss4g2012

You might also like