Installation Guide
As with all software and your particular configuration installation can be very simple or complicated with everything in-between.
Binary Release
Currently, there is only a binary release for Mac OSX (see the Mac OSX specific guide). Although, in the future more binary releases will be made.
Building from Source
This is the most common way of getting SPDLib but is a little more involved. Where you have root permissions and can install the software in their default locations the following in structures should 'just' work.
Compiler Flags
If you decide to optimise the compiler flags for your system then you must make sure that you still include the -DNDEBUG preprocessor variable otherwise the interpolation algorithms which use CGAL will run extremely slowly - if at all!
Pitfalls
When compiling libLAS with geotiff support be sure that GDAL and libLAS use the same geotiff library installation. By default GDAL using an internal build and if this is different to the version libLAS uses then a runtime linking error can be caused. The easiest and best solution is to install libgeotiff independently and then link both libLAS and GDAL (using –with-geotiff=$GEOTIFF_ROOT) to this installed version.
Pre-requesits
- Boost - http://www.boost.org
- HDF5 - At least version 1.8 http://www.hdfgroup.org
- GDAL/OGR - http://www.gdal.org
- LibLAS - At least version 1.6 http://www.liblas.org
- Xerces-C - At least version 3.1.1 http://xerces.apache.org/xerces-c
- Proj4 - http://trac.osgeo.org/proj
- CGAL - http://www.cgal.org
To compile them from source (on UNIX) to their default locations the following process with recommended options can be followed.
Boost
sh ./bootstrap.sh --with-libraries=all --with-python=python sudo ./bjam installIf you want to use the python bindings for SPDLib then you need to set the –with-python option otherwise this is not required. More information on compiling boost is available from http://www.boost.org/doc/libs/1_46_1/more/getting_started/.
GSL
./configure make sudo make install
Proj4
./configure make sudo make install
HDF5
./configure --enable-cxx --prefix=/usr/local/ make sudo make install
When installing HDF5 you need to ensure that zlib is enabled (if not you will not be able to read or write compressed SPD/UPD files which is the default). You will know if zlib has be found and being used if the following message is given following configure:
I/O filters (external): deflate(zlib)
If it cannot be found it can be downloaded from here http://zlib.net and installed using the following commands:
zlib
./configure make sudo make install
Xerces-C
./configure make sudo make installMore information is available from http://xerces.apache.org/xerces-c/build-3.html.
GDAL/OGR - Minimum
./configure make sudo make installMore information is available from http://trac.osgeo.org/gdal/wiki/BuildHints. Although, it is recommend that you build GDAL/OGR with GEOS (http://trac.osgeo.org/geos/) support and with the following configure options.
GDAL/OGR -- Recommended
./configure --with-static-proj4=/usr/local/ --with-python make sudo make install
Read the pitfalls section regarding geotiff linking.
LibLAS
cmake CMakeLists.txt make sudo make installMore information is available from http://liblas.org/compilation.html. When installing liblas is it recommended that you also install laszip (http://laszip.org) which introduces support for compressed LAS files. You may also wish to install liblas with GDAL support option but this is not required for SPDLib.
Read the pitfalls section regarding geotiff linking.
CGAL
cmake CMakeLists.txt make sudo make installMore information is available from http://www.cgal.org/Manual/latest/doc_html/installation_manual/contents.html.