Installation
We recommend working with a conda environment.
You can install libMobility’s latest release through the conda-forge channel:
$ conda install -c conda-forge libmobility
Compilation from source
If you want to compile the library from source, you can clone the repository with:
$ git clone https://github.com/stochasticHydroTools/libMobility
Getting dependencies
The file environment.yml contains the necessary dependencies to compile and use the library.
You can create the environment with:
$ conda env create -f environment.yml
Then, activate the environment with:
$ conda activate libmobility
Hint
At the moment we offer several installation methods: via pip, conda or building from source. We recommend using pip or conda first, resorting to building from source only if the other methods do not work for you.
Building from source
CMake is used for compilation under the hood. After installing the dependencies you can compile and install everything with:
$ mkdir build && cd build
$ cmake -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX ..
$ make all install
It is advisable to install the library in the conda environment, so that the python bindings are available. The environment variable $CONDA_PREFIX is set to the root of the conda environment.
After compilation, the python bindings will be available in the conda environment under the name libMobility. See Usage for more information.
The following variables are available to customize the compilation process:
DOUBLEPRECISION: If this variable is defined, libMobility is compiled in double precision (single by default).
Alternative: Installing via pip
After installing the dependencies, you can install the library with pip. Go to the root of the repository and run:
$ pip install .
Alternative: Building a conda package
Building the conda package only requires the conda-build package (dependencies will be fetched automatically). You can install it with:
$ conda install conda-build
You can build a conda package with the following command from the root of the repository:
$ conda build devtools/conda-build
This will build and test the package, which you can install in any environment with:
$ conda install --use-local libMobility
Conda will automatically install all the dependencies needed to run the library.