-
Notifications
You must be signed in to change notification settings - Fork 9
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:
pip install titanlib
To check that the installation worked, run the following in python:
import titanlib
print(titanlib.version())
Either download the source code from the latest release, 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.yml
This will create a conda environment named condatitanlib. Then activate this conda environment using:
conda activate condatitanlib
The command to quit this environment is:
conda deactivate
mkdir 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_here
Replace your_directory_here with the desired installation path.
Use the cmake command with:
-DBUILD_R=OFF
Debug or release compilations options are available. The option changes the compilations flags. Use the cmake command with:
-DCMAKE_BUILD_TYPE=RELEASE -B ./release
or
-DCMAKE_BUILD_TYPE=BEBUG -B ./debug
-B creates the build repertory (so step 3 and 4 can be done in once):
Then continue the installation from the chosen build repertory.
sudo make install
This 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 8
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.
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-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
.
Copyright © 2019-2023 Norwegian Meteorological Institute