Installation¶
Hermipy comes with a C++ component that needs to be compiled before the module can be used. To compile it, the following dependencies are required:
- The Boost library, including the Boost Python and Boost Numpy components;
- The CMake cross-platform build system.
With the dependencies present, the C++ component can be compiled by running the following command from the root directory of the repository:
$ python setup.py build
The module can then be installed:
$ python setup.py install --prefix ~/.local
To install globally, prepend sudo to this command and omit the prefix.
In addition to the two dependencies above,
at runtime the module depends on the following python packages:
- NumPy and SciPy, for efficient scientific computing routines;
- SymPy, for symbolic calculations;
- matplotlib, for plots and visualization.
Once installed, tests can be run and the test coverage can be calculated with the following command:
$ python -m unittest discover -v tests
$ coverage run --source=hermipy -m unittest discover -v tests
A package automating the installation for users of the Arch Linux distribution is available on the Arch User Repository, under the name python-hermipy-git. For users of other Linux distributions, a guix package is included in the pkgs directory, enabling the reproducible build of the C++ component at the core of Hermipy. Currently, the Boost package provided by guix does not include a shared library file for Boost NumPy; therefore, a statically-linked version of Boost NumPy is distributed with Hermipy in cpp/boost, on which guix relies to build the C++ component. With the guix package manager available, buliding and testing the package can be achieved via the following commands:
$ mkdir $HOME/hermipy && cd $HOME/hermipy
$ wget https://raw.githubusercontent.com/urbainvaes/hermipy/master/pkgs/hermipy.scm
$ export GUIX_PACKAGE_PATH=$HOME/hermipy
$ guix package --install python-hermipy
$ # Update PYTHONPATH