Skip to content

Installation

Cristian Lussana edited this page Dec 4, 2023 · 9 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 titanlib

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

import titanlib
print(titanlib.version())

Full titanlib installation from source

1) Install 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 libgsl-dev libblas-dev
sudo apt install swig cmake

2) Download source code

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

3) Set up cmake installation

mkdir build
cd build
cmake ..

4) Install the C++ library

sudo make install

This will install the library in /usr/local/lib/libtitanlib.so. If you don't have sudo rights or want to install the library in a different directory, you can use the following cmake command:

cmake .. -DCMAKE_INSTALL_PREFIX=your_directory_here

Replace your_directory_here with the desired installation path.

5) Install the python bindings

make install-python-user

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

6) Install the R bindings

make build-r

Currently, the R package is not installed centrally, but instead is placed in build/swig/R/titanlib.R where you also have titanlib.so.