C++: Building ILWIS

From ILWIS
Jump to: navigation, search
Main Page Arrow.png Software development Arrow.png

Building ILWIS
Instructions on participating in building ILWIS

There are four products that can be build:

  • IlwisObjects
  • Python Interface
  • Ilwis4
  • Ilwis CommandLine

They are all build using the IlwisObjects framework. So, first we have to discuss how this is build.

Building IlwisObjects
IlwisObjects exists in the core (ilwiscore) and a number of extensions that augment the functionality of the core. The extensions are plugins that are optional parts of the framework. Though to be honest some extensions are almost mandatory but many are optional and can be added as needed.
So, we need to build first the core and then the extensions.
Ilwis is build using the QT framework. The current version is using QT 5.2.1 (an older version). You can download it from:

https://download.qt.io/archive/qt/5.2/5.2.1/

We are using the mingw version. This also means that all other libraries build must use the same compiler.
The sources of ilwis can be found on:

https://github.com/52North/IlwisCore
https://github.com/52North/IlwisConnectors

Ilwis is build using qtcreator. This not dependend on the version of qtcreator; the newest version will do fine even if the framework we are using is 2 years old. The .pro files you need are in the lists below:

  • Core
baseoperations.pro
commandlineclient.pro
core.pro
desktopclient.pro
featureoperations.pro
ilwisscript.pro
internalconnector.pro
projectionImplProj4.pro
propertyeditors.pro
pythonscript.pro
rasteroperations.pro
  • Connectors
gdalconnector.pro
gslconnector.pro
httpserver.pro
ilwis3connector.pro
opencvconnector.pro
postgresqlconnector.pro
pythonapi.pro
remotedataaccesshandler.pro
spreadsheetconnectors.pro
streamconnector.pro
wfsconnector.pro
workflowconnector.pro


Pre build phase
Ilwis relies on a few external libraries that needs to be pre build by the developer to be able to link and run Ilwis.
Ilwis expects a certain organization in folders as all the project files rely on this

Folder Organization

Root
  • externals
boost
geos
geos
eigen3
Eigen
opencv2
gsl
ods
gdal
python
  • IlwisConnectors
gdalconnector
resources
gslconnector
resources
httpserver
ilwis3connector
resources
opencvconnector
resources
postgresqlconnector
pythonapi
remotedataaccesshandler
spreadsheetconnector
resources
streamconnector
wfsconnector
workflowconnector
  • IlwisCore
baseoperations
commandlineclient
core
desktopclient
featureoperations
geodrawer
ilwiscoreui
ilwisscript
internalconnector
projectionimplproj4
pythonscript
rasteroperations
  • ilwisserver
  • output
<OS>debug
bin
resources
<all extension folders>
<OS>release
  • libraries
<OS>debug
resources
extensions
<all extension folders>
<OS>release
extensions
<all extension folders>
temp
<generated>

The external folders you have to organize yourself. The folder marked ilwis<name> are pulls from the github projects.
The libraries folder is more complex. Part of it will be generated, part of it needs to contain .lib or .a files that are pre generated before trying to build ilwis.

IlwisCore
The core relies on only one external pre-build binary. Geos( https://trac.osgeo.org/geos/). The build process should produces a library called libgeos.a. This should be placed in the <OS>debug and <OS>release folder of the libraries folder. The header files go into external/geos/geos. The dll must go to the bin output/<OS>(debug,release)/bin The other libraries that the core needs, are header only libraries are boost and eigen3 boost:
http://www.boost.org/(any version after 1.50 will do)
eigen3: http://eigen.tuxfamily.org/index.php?title=Main_Page(we use eigen3). They have to be installed in:

external/boost
external/eigen3


Extensions

Gdal
Gdal can be found at http://www.gdal.org/. The gdal we use is 1.11. Gdal is a base library with a limited set of default formats or can be extended with extra formats by linking other libraries against it. In the IlwisObjects binaries we deliver a number of extra formats are included like (a.o.) hdf and netcdf. Follow the build instructions on the gdal site and related library sites to generate the gdal version you need. The generated gdal and all the other dll's it needs should go to the extenions/gdalconnector folder in the output folder. It must be called "libgdal-1.dll" as this is the name ilwisobjects expects. We need the following subset of the header files:

cpl_config.h
cpl_error.h
cpl_port.h
cpl_vsi.h
gdal.h
gdal_version.h
ogr_api.h
ogr_core.h
ogr_spatialref.h
ogr_srs_api.h

and they should go to external/gdal

Opencv
Opencv can be found at http://opencv.org/ . As such we link against the 2.4.9 version but newer versions can be used but you have to change the names in the setup then. Building opencv will generate:

libopencv_core249.dll.a
libopencv_core249.dll
libopencv_imgproc249.dll.a
libopencv_imgproc249.dll

The .a files must go to libraries/<OS>(debug,release)/extensions/opencvconnector <be/> The .dll files must go to output/<OS>(debug,release)/bin/extensions/opencvconnector
The header files must go to external/opencv2

Gnu Scientific library
GSL can be found at https://www.gnu.org/software/gsl. Building the gsl library will generate

libgsl.la
libgsl.lai
libgsl.dll.a
libgsl-0.dll
libgslcblas-0.dll

The non .dll files must go to libraries/<OS>(debug,release)/extensions/gslconnector
The .dll files must go to output/<OS>(debug,release)/bin/extensions/gslconnector
The header files must go to external/gsl

Spreadsheets
Next three entries are for various spreadsheet formats

XLSX
The xlsx writer/reader can be found at https://github.com/dbzhang800/QtXlsxWriter. Note that you also need Quazip(see http://quazip.sourceforge.net/)for it. Building xlsxwriter will generate

libQt0Xlsx.a
Qt0Xlsx.dll

The generate quazip dll need also to be in this folder
The non .dll files must go to libraries/<OS>(debug,release)/extensions/spreadsheetconnector
The .dll files must go to output/<OS>(debug,release)/bin/extensions/spreadsheetconnector
The header files must go to external/xlsx

Quods
The ods (Opendocument) writer/reader can be found at https://github.com/f35f22fan/QOds. Note that you also need Quazip(see http://quazip.sourceforge.net/) for it. Building ods writer will generate

libQOds.a
QOds.dll

The generate quazip dll need also to be in this folder
The non .dll files must go to libraries/<OS>(debug,release)/extensions/spreadsheetconnector
The .dll files must go to output/<OS>(debug,release)/bin/extensions/spreadsheetconnector
The header files must go to external/ods

Freexl
The freexl (Opendocument) reader can be found at https://www.gaia-gis.it/fossil/freexl/index. N. Building xlsxwriter will generate

libfreexl.dll.a
libfreexl.a
libfreexl-1.dll

The non .dll files must go to libraries/<OS>(debug,release)/extensions/spreadsheetconnector
The .dll files must go to output/<OS>(debug,release)/bin/extensions/spreadsheetconnector

ANTLR 3.5
We are not going to build antlr but we need one lib that is statically linked in Ilwis.

libantlr.lib

You can find instruction on how to get this lib on http://www.antlr3.org/
it should reside in libraries/<OS>(debug,release)

Build phase
If all the prebuilds have been done correctly ilwiscore can be build as the first. Note that appart from geos non of the other libs is strictly needed

Building Ilwis4
The ilwis4 client for ilwisobjects needs two extra projects

ilwiscoreui.pro
geodrawer.pro

They are located in the core section. The ilwiscoreui has to be compiled before the geodrawer