Table of Contents
TerraLib Developer's Guide - Third Party Dependencies
The file named DEPENDENCIES in the root of TerraLib source tree contains the up-to-date 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 versions1):
- CMake (Mandatory): The TerraLib build system relies on CMake. Please, download and install CMake version 3.11.
- Boost (Mandatory): TerraLib is built on top of Boost libraries. You will need to have them installed in order to build TerraLib. Make sure to have at least version 1.65 installed. If you prefer to install from source, download it from: http://www.boost.org.
- GEOS (Mandatory): GEOS is available from http://trac.osgeo.org/geos. Make sure to have at least version 3.7.1 installed.
- Proj4 (Mandatory): Proj4 is available from http://trac.osgeo.org/proj. Make sure to have at least version 6.1.2 installed.
- Qt (Optional): Make sure you have an installed Qt version 5.12.3. Linux users may use any package manager to perform an easy installation. Mac OS X can use package managers such as Homebrew or MacPorts in order to have an easy installation. If you prefer to install from source, download it from: http://qt-project.org/downloads.
- QtPropertyBrowser (Optional if Qt is not used): QtPropertyBrowser is a free and open source Qt component. We have been using a especial port of QtPropertyBrowser that you can find inside of our third-party packages sources.
You can extract the qtpropertybrowser.tar.gz files using:
$ tar xzvf qtpropertybrowser.tar.gz
Then, run qmake specifying the installation directory:
$ qmake "TERRALIB_DIR=install_dir"
Finally, run make and make install:
$ make $ make install
- Qwt (Optional if Qt is not used): Qwt is available from http://qwt.sourceforge.net. Make sure to have at least version 6.1.0 installed.
- GDAL (Optional): GDAL is available from http://www.gdal.org. Make sure to have at least version 3.0.1 installed.
- PostgreSQL libpq (Optional): libpq is available with PostgreSQL source from http://www.postgresql.org. Make sure to have at least libpq for PostgreSQL version 9.4.1 installed.
- Microsoft ADO .Net (Optional): This is available only for Microsoft Windows and it is installed in general under a folder such as:
C:\Program Files (x86)\Common Files\System\ado C:\Program Files (x86)\Common Files\System\Ole DB
- Xerces-c (Optional): Apache Xerces-C++ is available from http://xerces.apache.org/xerces-c. Make sure to have at least version 3.1.1 installed.
- Apache log4cxx (Optional): Apache log4cxx is available from http://logging.apache.org/log4cxx. Make sure to have at least version 0.10.0 installed.
- GNU Iconv (Optional): GNU Iconv is available from https://www.gnu.org/software/libiconv. Any recent version may be used.
- GNU gettext (Optional): GNU gettext is available from https://www.gnu.org/software/gettext. Any recent version may be used.
- Google Test and Google Mock (Optional): Google Test and Google Mock are available from https://github.com/google/googletest. Any recent version may be used.
- Python (Optional): Python is available from https://www.python.org/downloads. Use
python-3.6.6-amd64.exe
.
Third party dependencies binaries for Microsoft Visual C++ for Windows
For Microsoft Visual C++ users we have prepared a zip file containing all the third-party libraries in a binary format. You can download this package from http://www.dpi.inpe.br/terralib5-devel/3rdparty/bin.
To work with 'develop' branch take the zip from the root dir. To work with 'release-5.y' branch go to the correct subdirectory named 5.y and take the zip.
In that folder you will find all the third-party libraries for building a 64-bit version of Terralib with Qt5.12.3 support.
Microsoft Windows users that have downloaded one of the file 3rdparty zip must install the same version of Qt used to generate it, i.e., Qt5.13.3.
Also, the same lib Python version used to generate the zip must be installed in your environment. In this example python-3.6.6-amd64.exe
.
Automatic Build of Third-party Dependencies with Shell Scripts (Linux/MacOS/Windows)
We have prepared some special shell scripts for building and installing the dependencies on specific platforms. Check the source code structure and find the shell script files under install folder.
Linux Ubuntu 18.04 with Qt 5.12.7
The Linux Ubuntu bash script can be found in TerraLib source tree under install folder.
Follow these steps if you are working on 'develop' branch:
- Download the third-party libraries package used by the development team:
- Copy the script (from your local codebase folder) to the same folder you have downloaded the 3rdparty package:
- install-3rdparty-linux-generic.sh (use this script if terralib version is >= 5.5.2)
Follow these steps if you are working on 'release-5.y' branch:
- Download the source code of all third-party libraries from the correct subdirectory named 5.y:
- choose 5.y dir and download terralib-3rdparty-linux-ubuntu-18.04.tar.gz.
Copy the scripts (from your local codebase folder) to the same folder you have downloaded the 3rdparty package:
- install-3rdparty-linux-generic.sh (use this script if terralib version is >= 5.5.2)
Open the shell command line and call the script install-3rdparty-linux-generic.sh setting the target to install all the stuffs from these third-party libraries and tools:
:: Compile 3rdparty for terralib version >= 5.5.2 and generate them in TERRALIB_DEPENDENCIES_DIR using the script "install-3rdparty-linux-generic.sh" $> TERRALIB_DEPENDENCIES_DIR="/home/user/mylibs" PATH=/home/user/Qt/5.12.3/gcc_64/bin/:$PATH ./install-3rdparty-linux-generic.sh :: Sometimes it is necessary to add QT5_BASE_DIR variable before, in this case use the command below $> QT5_BASE_DIR="/home/user/Qt/" TERRALIB_DEPENDENCIES_DIR="/home/user/mylibs" PATH=/home/user/Qt/5.12.3/gcc_64/bin/:$PATH ./install-3rdparty-linux-generic.sh
Warning: Don't choose as target location a system folder such as /usr or /usr/local. Try some user specific folder. The best suggestion is to replace the folder named user by your user name.
Known issues related with Linux Ubuntu 18.04 with Qt 5.12.7
You might need to install the right version of some stuffs in order to get the 3rdparty generated. For example, if you get this error msg,“Cannot find a C++ compiler supporting C++11 on this system”:
- Download and compile CMake from https://cmake.org/download/ (the native one is not enough)
Others stuffs needed on Ubuntu because of cmake:
- sudo apt-get install build-essential
- sudo apt-get install build-essential
- sudo apt-get install zlib1g-dev
Others stuffs needed on Ubuntu in order to generate terralib 3rdparty:
- sudo apt-get install curl
- sudo apt-get install libcurl4-openssl-dev
- sudo apt-get install libssl-dev
- sudo apt-get install libreadline-dev
- sudo apt-get install bison flex
- sudo apt install libgl1-mesa-dev
Linux Ubuntu 18.04 and 16.04 (terralib version <= 5.5.1)
The Linux Ubuntu bash script can be found in TerraLib source tree under install folder.
Follow these steps if you are working on 'develop' branch:
- Download the third-party libraries package used by the development team:
- Copy one of the scripts (from your local codebase folder) to the same folder you have downloaded the 3rdparty package:
Follow these steps if you are working on 'release-5.y' branch:
- Download the source code of all third-party libraries from the correct subdirectory named 5.y:
- choose 5.y dir and download terralib-3rdparty-linux-ubuntu-18.04.tar.gz.
- choose 5.y dir and download terralib-3rdparty-linux-ubuntu-16.04.tar.gz.
Copy one of the scripts (from your local codebase folder) to the same folder you have downloaded the 3rdparty package:
Open the shell command line and call the script install-3rdparty-linux-ubuntu-18.04.sh (or the Ubuntu 16.04 one) setting the target to install all the stuffs from these third-party libraries and tools:
:: For terralib version < 5.5.2 use: $> TERRALIB_DEPENDENCIES_DIR="/home/user/mylibs" ./install-3rdparty-linux-ubuntu-18.04.sh $> TERRALIB_DEPENDENCIES_DIR="/home/user/mylibs" ./install-3rdparty-linux-ubuntu-16.04.sh
Warning: Don't choose as target location a system folder such as /usr or /usr/local. Try some user specific folder. The best suggestion is to replace the folder named user by your user name.
Mac OS X
The Mac OS X bash script can be found in TerraLib source tree under install folder.
Follow these steps if you are working on 'develop' branch:
- Copy the script 2) to the same folder you have downloaded the 3rdparty package:
Follow these steps if you are working on 'release-5.y' branch:
- Download the source code of all third-party libraries from the correct subdirectory named 5.y:
- choose 5.y dir and download terralib-3rdparty-macos-sierra.tar.gz.
- Copy the script 3) to the same folder you have downloaded the 3rdparty package:
Open the shell command line.
Make sure your Qt and CMake environment can be found in your PATH:
$ export PATH=$PATH:/usr/local/Cellar/autoconf/2.69/bin:/Users/user/Qt5.12.3/5.12.3/clang_64/bin:/Applications/CMake.app/Contents/bin or $ export PATH=$PATH:/Users/user/Qt5.12.3/5.4/clang_64/bin:/Applications/CMake.app/Contents/bin
In the shell command line, call the script install-3rdparty-macos-sierra.sh setting the target to install all the stuffs from these third-party libraries and tools:
$ TERRALIB_DEPENDENCIES_DIR="/Users/user/mylibs" ./install-3rdparty-macos-sierra.sh
Warning: Don't choose as target location a system folder such as /usr or /usr/local. Try some user specific folder. The best suggestion is to replace the folder named *user* by your user name.
Microsoft Windows with Visual C++ 2017
The Microsoft Windows with Visual C++ 2017 shell script can be found in TerraLib source tree under install folder.
Follow the steps according with the branch you are working on:
- develop branch: Download the source code of all third-party libraries used by the development team:
- release-5.5 branch: Download the source code of all third-party libraries from the correct subdirectory named 5.5:
- choose 5.5 dir and download terralib-3rdparty-msvc17.zip
- Unpack it in a folder like C:/my_win3rdparty. The tree structure will be:
C:/my_win3rdparty/terralib-3rdparty-msvc17/ C:/my_win3rdparty/build_all.bat C:/my_win3rdparty/build_all_x64.bat
- Open build_all_x64.bat and make sure TERRALIB_X64=1.
- Open build_all.bat file and change the two variables to reflect your environment, if necessary:
:: Where to install the third-parties (this folder will be referenced by CMAKE when building terralib5) set TERRALIB_DEPENDENCIES_DIR=C:\terralib5-3rdparty-msvc-2017-win64 :: Where is the TerraLib5 codebase (git clone) set TERRALIB5_CODEBASE_PATH=C:\MyDevel\terralib5
- Check if the other variables are reflecting your environment and change it when necessary
:: Where is cmake.exe set "CMAKE_FILEPATH=%PROGRAMFILES%\CMake\bin" :: Where is qmake.exe set "QMAKE_FILEPATH=C:\Qt\5.12.3\msvc2017_64\bin" :: Where is vcvars (visual studio 64 bits setting environment file (vcvars64.bat)) set "VCVARS_FILEPATH=%PROGRAMFILES(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build" :: Calling the script on TerraLib5 - is pointing to the batch file that will be called from here ( %TERRALIB5_CODEBASE_PATH%\install\install-3rdparty-msvc17.bat)
- Make sure your Qt and CMake environment can be found in your PATH (it is not necessary)
- Disable the hibernation option on
Control Panel\Power Options
- Run the C:/my_win3rdparty/build_all_x64.bat
- Check the dependencies generated at TERRALIB_DEPENDENCIES_DIR/lib
Warning:If you need to re-run the build_all.bat, remove the C:/my_win3rdparty/ and unzip the terralib-3rdparty-msvc17.zip file again because the script is not prepared to overwrite files generated under this folder and will crash.
Now that you have prepared the working environment, please, read the Build Instructions section.
Microsoft Windows with Visual C++ 2013
The Microsoft Windows with Visual C++ 2013 shell script can be found in TerraLib source tree under install folder.
Follow the steps according with the branch you are working on:
- develop branch: Download the source code of all third-party libraries used by the development team:
- release-5.y branch: Download the source code of all third-party libraries from the correct subdirectory named 5.y:
- choose 5.y dir and download terralib-3rdparty-msvc12.zip.
- Unpack it in a folder like C:/my_win3rdparty. The tree structure will be:
C:/my_win3rdparty/terralib-3rdparty-msvc12/ C:/my_win3rdparty/build_all.bat C:/my_win3rdparty/build_all_x64.bat
- Open build_all_x64.bat and make sure TERRALIB_X64=1.
- Open build_all.bat file and change the two variables to reflect your environment:
:: Where to install the third-parties (this folder will be referenced by CMAKE when building terralib5) set TERRALIB_DEPENDENCIES_DIR=C:\MyDevel\my-3rds :: Where is the TerraLib5 codebase (git clone) set TERRALIB5_CODEBASE_PATH=C:\MyDevel\terralib5
- Check if the other variables are reflecting your environment and change it when necessary
:: Where is cmake.exe :: Where is qmake.exe :: Where is win32.mak file of the system. :: Where is the visual studio 64 bits setting environment file (vcvars64.bat) :: Calling the script on TerraLib5 - is pointing to the batch file that will be called from here (%TERRALIB5_CODEBASE_PATH%\install\install-3rdparty.bat)
- Make sure your Qt and CMake environment can be found in your PATH (is is not necessary)
- Disable the hibernation option on
Control Panel\Power Options
- Run the C:/my_win3rdparty/build_all_x64.bat
- Check the dependencies generated at TERRALIB_DEPENDENCIES_DIR/lib
Warning:If you need to re-run the build_all.bat, remove the C:/my_win3rdparty/ and unzip the terralib-3rdparty-msvc12.zip file again because the script is not prepared to overwrite files generated under this folder and will crash.
Now that you have prepared the working environment, please, read the Build Instructions section.