TerraLib and TerraView Wiki Page

This is an old revision of the document!


Tutorial de Build e Instalação da TerraLib/TerraView

TODO: introdução TerraLib/TerraView

Source Code Instructions

In the root directory of TerraLib codebase (the source code tree) there are some text files explaining the details of the codebase:

  • BRANCHES-AND-TAGS: Notes on how to switch to the right branch to work on or the right tag to get the source code.
  • BUILD-INSTRUCTIONS: Notes on how to compile and install TerraLib for each platform.
  • CHANGELOG: List of changes in TerraLib source code. Not available yet!
  • DEPENDENCIES: The list of third-party library you must install before building TerraLib.
  • LICENSE: Licence statement in plain txt format.
  • README: Contains instructions about how to build and how is organized TerraLib plataform source code.

If you want to build TerraLib from source, first take a look at the section Dependencies and read the right tip for automatically building the dependencies in your platform.

Source Code Organization

  • build/cmake: Contains the CMake scripts with commands, macros and functions used to build the environment for compiling libraries and executables in different platforms using the CMake tool.
  • examples: Some examples on how to use TerraLib API.
  • install: Bash scripts for helping building and installing TerraLib.
  • |licenses: Copyright notices of third-party libraries used by TerraLib. Not available yet!
  • resources: Fonts, images, sql, and xml files among other resources of general use.
  • share: XML Schema (.xsd), JSON files, plugin manifest files, translations files and OGC specifications that is shared and installed with TerraLib.
  • src: Contains the source code of TerraLib and TerraView.
  • unittest: TODO.

Dependencies

The file named DEPENDENCIES in the root of TerraLib source tree contains the official list of third-party libraries and tools that you must install before building TerraLib from source.

If you want to build yourself TerraLib/TerraView then you need to install some third-party libraries. Below we show the list of third-party libraries dependencies and its versions:

  • Boost (Mandatory): TerraMA² is built on top of Boost libraries. You will need to have them installed in order to build TerraMA2. Make sure to have at least version 1.54.0 installed. If you prefer to install from source, download it from: http://www.boost.org.
  • Qt (Mandatory): Make sure you have an installed Qt version 5.2.1 or later. Linux users may use any package manager to perform an easy installation. Mac OS X can use package managers such as Homebrew (http://brew.sh) or MacPorts (http://www.macports.org) in order to have an easy installation. If you prefer to install from source, download it from: http://qt-project.org/downloads.

Bash script for building all dependencies on Linux Ubuntu 14.04

We have prepared a special bash script for building and installing the dependencies on Linux Ubuntu 14.04. This script can be found in TerraLib source tree under install folder. Follow the steps below:

  • Download the third-party libraries package used by the development team: terralib-3rdparty-linux-ubuntu-14.04.tar.gz.
  • Copy the script install-3rdparty-linux-ubuntu-14.04.sh to the same folder you have downloaded the terralib-3rdparty-linux-ubuntu-14.04.tar.gz package.
  • Open the shell command line and call the script install-3rdparty-linux-ubuntu-14.04.sh setting the target to install all the stuffs from these third-party libraries and tools:
$ TERRALIB_DEPENDENCIES_DIR="/home/user/mylibs" ./install-3rdparty-linux-ubuntu-14.04.sh

Note: Don't choose as target location a system folder such as /usr or /usr/local. Try some user specifiic folder. The best suggestion is to replace the folder named user by your user name.

Bash script for building all dependencies on Mac OS X

We have prepared a special bash script for building and installing the dependencies on Mac OS X. This script can be found in TerraLib source tree under install folder. Follow the steps below:

$ export PATH=$PATH:/Users/user/Qt5.4.1/5.4/clang_64/bin:/Applications/CMake.app/Contents/bin
  • In the shell command line, call the script install-3rdparty-macosx-yosemite.sh (or the El-Capitan one) setting the target to install all the stuffs from these third-party libraries and tools:
$ TERRALIB_DEPENDENCIES_DIR="/Users/user/mylibs" ./install-3rdparty-macosx-yosemite.sh

Note: Don't choose as target location a system folder such as /usr/ or /usr/local. Try some user specifiic folder. The best suggestion is to replace the folder named *user* by your user name.