| pktools 2.6.7 Processing Kernel for geospatial data

installation_linux

# Installation on Linux

## Installation for Debian Linux (via repository)

A binary package of pktools for Debian is maintained by Francesco Paolo Lovergine and available in the repository. You can install it using the advanced package tool (apt):

sudo apt-get install pktools

The version in the repository might not be the latest available (please check the packages overview). The latest version of pktools can always be installed via the installation script or from the source code using a manual installation.

## Installation for Ubuntu (Debian based) Linux distributions (from source code via automatic script)

Users working with Debian based distributions (e.g., Ubuntu) can download install_pktools.sh. This script will automatically download the latest release of pktools and dependencies. You need an internet connection when running the script (as root or sudo):

sudo bash install_pktools.sh

## Manual installation for (all Linux distributions)

For a manual installation, download the latest release from Savannah

Optionally: check the release md5sum to ensure originality.

md5sum pktools-latest.tar.gz

The result should be identical to the content of the corresponding md5 file you downloaded.

Unpack the tar zip file

tar xzvf pktools-latest.tar.gz
cd pktools-*

You can install pktools via

- cmake (linux, windows, Mac OS)

Notice that "autotools" (configure, make, make install) is deprecated from version 2.6.7, please use cmake instead

### Required dependences

packages to install before pktools

- g++
- make
- libgdal-dev (see also http://trac.osgeo.org/gdal/wiki/BuildingOnUnix)
- libgsl0-dev (see also http://www.gnu.org/software/gsl/)
- libarmadillo-dev (see also http://arma.sourceforge.net/download.html)

Example on how to install required packages in Debian based system (using apt-get):

- sudo apt-get install g++ make libgdal-dev libgsl0-dev libarmadillo-dev

### Optional dependences

To enable program pkoptsvm

Install additional package

- libnlopt-dev (see also http://ab-initio.mit.edu/wiki/index.php/NLopt#Download_and_installation )

Example on how to install required packages in Debian based system (using apt-get):

sudo apt-get install libnlopt-dev

Note: currently, the repository seems not to include this package anymore and manual installation is required (see also http://ab-initio.mit.edu/wiki/index.php/NLopt#Download_and_installation)

- Install pktools with with extra configuration option –enable-nlopt:

./configure --enable-nlopt
make
sudo make install
sudo ldconfig

To enable programs pkann and pkfsann

Install package

- libfann-dev (see also http://leenissen.dk/fann/wp/download/)

Example on how to install required packages in Debian based system (using apt-get):

sudo apt-get install libfann-dev

Install pktools with extra cmake option -DBUILD_WITH_FANN=ON

mkdir build
cd build
cmake -DBUILD_WITH_FANN=ON ..
make
sudo make install

To enable program pklas2img

Install additional packages:

- libboost-dev (see also http://www.boost.org/)
- liblas1 (from Mateusz Loskot, see also http://www.liblas.org/tutorial/cpp.html)
- liblas-dev
- python-liblas
- liblas2
- liblas-c2
- liblas-c-dev

Example on how to install required packages in Debian based system (using apt-get):

- first add the following two lines to /etc/apt/sources.list (replace <codename> with what you get from lsb_release -c)

deb http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu <codename> main
deb-src http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu <codename> main

- then install extra packages:

sudo apt-get install libboost-dev liblas-dev liblas-c-dev liblas1 liblas2 liblas-c2 python-liblas

Or install manually as explained in http://www.liblas.org/compilation.html#using-unix-makefiles-on-linux

! Note that if you want support for compressed las format (LAZ), you need to install laszip first (http://www.laszip.org) and install liblas manually

- Install pktools with with extra cmake option -DBUILD_WITH_LIBLAS=ON

mkdir build
cd build
cmake -DBUILD_WITH_LIBLAS=ON ..
make
sudo make install
\subsection Troubleshooting cmake in Linux (installed version is not 2.8)
If your system does not have CMake version 2.8, or your repository has an older version, you can manually install the latest version of CMake (for instance version 3.2.2):
\code
wget http://www.cmake.org/files/v3.2/cmake-3.2.2.tar.gz
tar xf cmake-3.2.2.tar.gz
cd cmake-3.2.2
./configure
make
make install

In order to have ccmake look for the newly installed version in /usr/local/bin, I had to (on a Debian/Ubuntu based system):

sudo apt-get install libncurses5-dev
\code
Then reconfigure/compile/install cmake and restart the shell