Skip to content
Thomas Nipen edited this page Oct 9, 2020 · 42 revisions

Installing the python bindings on Linux

The easiest is to install the latest release of the package using pip, which comes with precompiled binaries so no non-python dependencies are required:

pip install gridpp --user

To check that the installation worked, run the following in python:

import gridpp
print(gridpp.version())

Required dependencies

On Ubuntu Bionic, these can be installed like this:

sudo apt-get update
sudo apt-get install libboost-all-dev
sudo apt-get install libgsl0-dev libblas-dev
sudo apt-get install netcdf-bin libnetcdf-dev
sudo apt-get install libarmadillo6 libarmadillo-dev

Note that Ubuntu Xenial only has Armadillo 6.5 in its apt repository. In that case you need to install Armadillo 6.6 or later manually.

Full gridpp installation from source

  1. Either download the source code from the latest release, unzip the file and navigate into the extracted folder; or clone the repo from github.

  2. Install extra requirements

These are only required when installing from source

sudo apt install swig cmake
  1. Set up cmake installation
mkdir build
cd build
cmake ..
  1. Install the C++ library
sudo make install

This will install the library in /usr/local/lib/libgridpp.so and the gridpp command-line client in /usr/local/bin/gridpp. To specify a custom installation path, use the following in step 3:

cmake .. -DCMAKE_INSTALL_PREFIX=<custom path>
  1. Install the python bindings
make install-python-user

This installs the python bindings in ~/local/lib/python3.6/site-packages/gridpp.py. To install the python bindings system-wide, use sudo make install-python instead.

  1. Install the R bindings
make build-r

Currently, the R package is not installed centrally, but instead is placed in extras/SWIG/R/gridpp.R in the build directory.

Clone this wiki locally