-
Notifications
You must be signed in to change notification settings - Fork 12
Installation
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:
For python version <=3.11 (release version of titanlib)
pip install titanlib
pip install numpy==1.26.3For python version 3.12, 3.11 or 3.10 (pre-release version of titanlib)
pip install titanlib==0.3.4.dev3
pip install numpy==1.26.3To check that the installation worked, run the following in python:
import titanlib
print(titanlib.version())Either download the source code from the latest release or the newest development version, unzip the file and navigate into the extracted folder; or clone the repo from github.
- Boost >= 1.59
- GNU Scientific Library
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
sudo apt-get install doxygen
The dependencies can alternatively be installed in a conda environment. To do so, use the deps.yml file contained in titanlib and type:
conda env create --file=deps.ymlThis will create a conda environment named condatitanlib. Then activate this conda environment using:
conda activate condatitanlibThe command to quit this environment is:
conda deactivatemkdir build
cd build
cmake ..If you don't have sudo rights or want to install the library in a different directory, you can add the following argument to the cmake command :
-DCMAKE_INSTALL_PREFIX=your_directory_hereReplace your_directory_here with the desired installation path.
Use the cmake command with:
-DBUILD_R=OFFDebug or release compilations options are available. The option changes the compilations flags. Use the cmake command with:
-DCMAKE_BUILD_TYPE=RELEASE -B ./releaseor
-DCMAKE_BUILD_TYPE=BEBUG -B ./debug
-B creates the build repertory (if using this command mkdir command is not needed):
Then continue the installation from the chosen build repertory. For instance with ./release as build repertory:
cd ./releasesudo make installThis will install the library in /usr/local/lib/libtitanlib.so or in your chosen repertory if -DCMAKE_INSTALL_PREFIX was used as cmake option.
Installation is tested for instance with Python 3.10.4.
make install-python-user -j 8This 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.
It is possible to compile in parallel using the option -j N, where N is the number of workers (see https://docs.python.org/3/library/compileall.html).
make build-rCurrently, the R package is not installed centrally, but instead is placed in build/swig/R/titanlib.R where you also have titanlib.so.
Copyright © 2019-2023 Norwegian Meteorological Institute