Installation

Instructions

From local VHC copy

First you need to obtain the source VHC code with

svn checkout svn://luna.mpe.mpg.de/vhc

or

svn checkout svn://luna.mpe.mpg.de/vhc/trunk vhc

if only the trunk is desired.

Once this command has finished you can install VHC using pip

pip install /path/to/vhc

or

cd /path/to/vhc
pip install .

where /path/to/vhc is the base VHC directory containing the setup.py file. Besides installing the package and its dependences, it also create the vhc executable.

The above command installs VHC in a system directory, so might be necessary to use superuser powers, a.k.a. sudo, to succeed. It is possible to install the software in the user directorys, usually $HOME/.local/lib/pythonX.X/site-packages and $HOME/.local/bin adding the option --user. In this case, you might want to add the latter to the PATH in order to have easy access to the vhc executable.

An other option is to use a virtual environment [2]: in this case VHC will be installed inside the environment with the above command. vhc is installed inside the virtual environment bin directory.

pip takes care of installing VHC dependances, except for ltl, cure and pyhetdex [1]. Instructions on how to install the first two can found below. If you don’t have pyhetdex already installed, you can install it following this instructions, or you can install it on the fly. To do this create or edit the file requirements.txt (a working copy is distributed with the VHC source code) one of the following line

/path/to/pyhetdex

or, if you want to pull it directly from the svn repository,

svn+svn://luna.mpe.mpg.de/pyhetdex/trunk#egg=pyhetdex

Then run

pip install -r requirements.txt /path/to/vhc

From online svn repository

It is also possible to install VHC directly from the svn repository with

pip install svn+svn://luna.mpe.mpg.de/vhc/trunk#egg=vhc

Except for fetching the code for you, it works exactly as before.

If you want to install a specific commit or from a different branch or tag, you can do it issuing one of the following commands

pip install svn+svn://luna.mpe.mpg.de/vhc/trunk@5#egg=vhc
pip install svn+svn://luna.mpe.mpg.de/vhc/tag/v0.0.0#egg=vhc

Other ways

Once you obtained the source code as in From local VHC copy, you can install the code also using the good old

cd /path/to/vhc
python setup.py build
python setup.py install

We do not recommend this method, as you have to deal with dependences yourself.

Note

  • At the moment vhc is under active development, so we suggest to follow the instructions in Development

  • If the installation gets interrupted with an error like:

    ImportError: No module named 'numpy'
    

    run pip install numpy and then retry VHC installation

Dependances

Mandatory dependences

vhc_config
pyhetdex
ltl
cure
jinja2
six

vhc_config contains all the configuration and files needed to run vhc (see VHC configuration). cure is a C++ code that provides utilities that are executed in subprocesses by most of the VHC checks. cure depends on ltl.

Install ltl and cure

Check out and compile ltl:

cd /path/to/project
svn checkout svn://luna.mpe.mpg.de/ltl/trunk ltl
cd ltl
./bootstrap
./configure
make
cd ..

Check out and compile cure:

svn checkout svn://luna.mpe.mpg.de/cure/trunk cure
cd cure
make install

This will install the binaries into bin directory. If you don’t have OpenGL libraries installed, run:

make install HAVE_OPENGL=no

as last step. You can use make -j N to speed up the build process using N cores.

After it is installed, you might want to:

export CUREBIN=/path/to/project/cure/bin

Optional dependences

  • testing:

    pytest
    pytest-cov
    pyhetdex
    mock  # only for python 2.7
    
  • documentation:

    sphinx
    numpydoc
    alabaster
    pyhetdex
    
  • automatic documentation build:

    sphinx-autobuild
    

Development

If you develop pyhetdex and/or VHC we suggest to checkout both svn repositories and to install them in “editable” mode and to install all the optional dependances:

cd /path/to/vhc
pip install -e .[all]

It is possible to install also the pyhetdex software in editable mode adding -e in the requirements.txt file before the url or path, e.g.:

~> cat requirements.txt
-e /path/to/pyhetdex

and adding the options -r requirements.txt in the pip call.

You can also use [not recommended]

python setup.py develop

See Contribute to VHC for more information.

Footnotes

[1]We will try to automatize also the pyhetdex installation via pip
[2]Maybe with the help of virtualenvwrapper