Installation

There are two ways to build and install the GPSTk python bindings on your system:

  1. Install using the GPSTk script. This method requires CMake, SWIG, and a C++ compiler. The generation of the documentation and the the docstrings requires Doxygen. However, the process is completely automated and allows developers of GPSTk and users who wish to work with either C++ or Python or both should use this option.
  2. Clone the git repo and use CMake and your system’s local build tool. This requires CMake, SWIG and a C++ compiler. To generate the docstrings, this also requires Doxygen and you must also run several included python scripts. This option allows for manual debugging of issues within the script.

Installing with Script

The default install location is ~/.local/lib/python2.7/site-packages/ , which is a source that python will automatically search for packages on a Linux system.

A Windows user would typically use C:\Python27\Lib\site-packages\ instead.

First clone to the GIT repository to your home directory (or wherever you want)



Building and Installing Using the Developer Script (script_gpstk.sh)

The script allows for the build/installation of the C++ library, the Python library, and/or Doxygen documentation and docstrings.

To build and install the GPS Toolkit, please execute the following commands: Navigate to your local GPSTk repository

i.e. cd ~/git/gpstk

Run the build/installation script with the appropriate options:

usage: ./script_gpstk.sh [-h] [-c] [-d] [-p] [-b] [-i] [-o] [-t] [-v] [-l <path>] [-r <path>] [-s <path>]

OPTIONS:
    -h - Help
    -c - Build_cpp, Build C++ files and libraries
    -d - Build_doxygen, Build Doxygen files
    -p - Build_python, Build Python files and libraries with SWIG bindings (autobuilds Doxygen)
    -b - Clean_build, Removes any previous build files for specified build
    -i - Clean_install, Removes any previous installations in current install location
    -o - Core_only, Only builds core library code base
    -t - Test_switch, initialize test framework
    -v - Graphviz, generate dependency graph (.DOT and .PDF files)
    -l - python_install, default = ~/.local/lib/pythonX.X/site-packages, change Python library installation location (If no Python directory
         specified, /python directory will be created at specified location)
    -r - gpstk_root, default = ~/git/gpstk/dev, path to GPSTK top-level CMakeLists.txt file (and source tree)
    -s - gpstk_install, default = ~/git/gpstk/install, path to GPSTk install, e.g. ~/opt/gpstk, to contain ./bin, ./lib, and ./include
Example:
./script_gpstk.sh -c -d -p -b -i -l ~/git/gpstk/install -s ~/git/gpstk/install

For this example, the script does the following:

  • Removes previous build/install folders
  • Builds the new C++ build/install folders
  • Builds the new Doxygen files
  • Builds the new Python build/install folders
  • python_install set to custom path at ~/git/gpstk/install/python
  • gpstk_root remains at ~/git/gpstk/dev
  • gpstk_install set to custom path at ~/git/gpstk/install
  • Determines number of system cores and sets -j variable accordingly
  • Builds and Installs code (make & make install)
  • Provides List of installed applications and header files


Building and Installing Using the C++ Script (script_gpstk_cpp.sh)

The script installs the C++ library and/or the Doxygen documentation only.

To build and install the GPS Toolkit, please execute the following commands: Navigate to your local GPSTk repository

i.e. cd ~/git/gpstk

Run the build/installation script with the appropriate options:

usage: ./script_gpstk_cpp.sh [-h] [-d] [-b] [-i] [-o] [-t] [-v] [-r <path>] [-s <path>]

OPTIONS:
    -h - Help
    -d - Build_doxygen, Build Doxygen files
    -b - Clean_build, Removes any previous build files
    -i - Clean_install, Removes any previous installations in current install location
    -o - Core_only, Only builds core library code base
    -t - Test_switch, initialize test framework
    -v - Graphviz, generate dependency graph (.DOT and .PDF files)
    -r - gpstk_root, default = ~/git/gpstk/dev, path to GPSTK top-level CMakeLists.txt file (and source tree)
    -s - gpstk_install, default = ~/git/gpstk/install, path to GPSTk install, e.g. ~/opt/gpstk, to contain ./bin, ./lib, and ./include
Example:
./script_gpstk_cpp.sh -d -b -i -s ~/git/gpstk/install

For this example, the script does the following:

  • Removes previous build/install folders
  • Builds the new C++ build/install folders
  • Builds the new Doxygen files
  • gpstk_root remains at ~/git/gpstk/dev
  • gpstk_install set to custom path at ~/git/gpstk/install
  • Determines number of system cores and sets -j variable accordingly
  • Builds and Installs code (make & make install)
  • Provides List of installed applications and header files


Building and Installing Using the Python Script (script_gpstk_python.sh)

The script installs the Python library and/or the Doxygen documentation and docstrings only.

To build and install the GPS Toolkit, please execute the following commands:

Navigate to your local GPSTk repository
i.e. cd ~/git/gpstk

Run the build/installation script with the appropriate options:

usage: ./script_gpstk_python.sh [-h] [-d] [-b] [-r <path>] [-l <path>]

OPTIONS:
    -h - Help
    -d - Build_doxygen, Build Doxygen files
    -b - Clean_build, Removes any previous build files
    -r - gpstk_root, default = ~/git/gpstk/dev, path to GPSTK top-level CMakeLists.txt file (and source tree)
    -l - python_install, default = ~/.local/lib/pythonX.X/site-packages, Python install directory (If no Python
         directory specified, /python directory will be created at specified location)
Example:
./script_gpstk_cpp.sh -d -b -l ~/git/gpstk/install

For this example, the script does the following:

  • Removes previous build/install folders
  • Builds the new Python build/install folders
  • Builds the new Doxygen files
  • gpstk_root remains at ~/git/gpstk/dev
  • python_install set to custom path at ~/git/gpstk/install/python
  • Determines number of system cores and sets -j variable accordingly
  • Builds and Installs code (make & make install)
  • Provides List of installed applications and header files


The Python HTML documentation can be built/viewed with Sphinx by:

cd ~/<GIT_LOCATION>/gpstk/python/bindings/swig/sphinx
make html
firefox _build/html/index.html

Installing with CMake [developer build]

This example places the gpstk directory in the home folder and builds to ~/.local/lib/python2.7/site-packages/ , which is a source that python will automatically search for packages on a Linux system.

A Windows user would typically use C:\Python27\Lib\site-packages\ instead.

First clone to the GIT repository to your home directory (or wherever you want), then:

cd ~/<GIT_LOCATION>/gpstk/dev
doxygen
cd ../python/bindings/swig
python docstring_generator.py
[ -d build ] || mkdir build
cd build
cmake ..
make -j$num_cores
cd ../bin
python gpstk_builder.py  ~/.local/lib/python2.7/site-packages/

You can also run gpstk_builder.py (the final command above) without any arguments to build to the system default.

On a Debian-based Linux distro, this will be /usr/local/lib/python2.7/dist-packages

For example:

sudo python gpstk_builder.py

Note that this would require root privileges.

Additionally, the html documentation can be built/viewed with sphinx by:

cd ~/<GIT_LOCATION>/gpstk/python/bindings/swig/sphinx
make html
firefox _build/html/index.html

Installing Using Binaries

At this point in time, no pre-compiled binaries are provided yet.