Installation

The Wasserstein package can be used as a header-only C++ template library or as a Python package that wraps the C++ code.

Python

Install via pip

Precompiled Python wheels are available for Linux, maxOS, and Windows via PyPI. The only strict dependency is NumPy, though Wurlitzer is also installed in order to redirect standard output into Jupyter notebooks in the demos. Simply run the following in a terminal to install Wasserstein:

pip3 install wasserstein

Install from Python source

The only reason to bother with the source code when using Wasserstein in Python is if one wants to develop some feature in the package. The Wasserstein source code can be obtained from GitHub. Running python3 setup.py swig (which requires the swig binary to be available on the path) will regenerate the Python wrapper code. Running python3 setup.py build_ext --inplace will compile the library, and pip3 install -e . will install a development version pointing to the current directory.

C++

The Wasserstein source code can be obtained from GitHub. Since the library is header-only, no compilation is required to install it. The provided install_wasserstein.sh script can be used (on a UNIX-like system, at least) to move the requisite header files to an appropriate location such as /usr/local/include. If your system does not have the Boost libraries (version 1.70.0 or newer is required to access the histogram package) available, set the second argument to true in order to use the provided Boost Histogram header files.

Try the following in order to move the Wasserstein header files to an installed location, in this case /usr/local/include:

git clone https://github.com/thaler-lab/Wasserstein
cd Wasserstein
chmod +x install_wasserstein.sh
./install_wasserstein /usr/local false