Installation

Easiest way to install chemreac (on linux) is by using conda:

$ conda install -c https://conda.anaconda.org/chemreac chemreac

and you’re done! To check if it’s installed you may run:

$ python -c "import chemreac"

which should exit silently. If you are not using the conda package manager you can still install chemreac from source. You will find the instructions for doing so below.

Building from source

Below you will find instructions for installation by building chemreac from source. You may also look in scripts/ folder for automated install scripts used on the continuous integration servers.

Prerequisites

  • C++ compiler with C++11 support (e.g. GCC >= 4.8)
  • Fortran compiler with ISO_C_BINDING support (Fortran 2003 standard) (e.g. gfortran)
  • LAPACK (provided by e.g. OpenBLAS)
  • Sundials 2.5
  • Python (2.7 or >=3.3)

In addition to python, the following python packages are required (versions indicate what is tested, they are found on PyPI and may be installed using pip):

  • argh>=0.25.0
  • numpy>=1.9.0
  • cython>=0.21.0
  • mako>=1.0.0
  • quantities>=0.10.1
  • pytest>=2.5.2
  • pytest-pep8>=1.0.6
  • scipy>=0.14.0
  • matplotlib>=1.4.0
  • periodictable>=1.4.1
  • future>=0.13.0
  • pycompilation>=0.4.0
  • pycodeexport>=0.1.0
  • sympy>=0.7.6

For rendering the documentation you also need:

to run all the tests you also need:

  • valgrind
  • graphviz
  • dot2tex

Building and installing

Once non-python prerequisites are in installed, you may procede e.g. as:

$ git clone https://github.com/chemreac/chemreac.git
$ cd chemreac
$ pip install --user --upgrade -r requirements.txt
$ python setup.py install --user
$ ./scripts/run_tests.sh

the above procedure works on Ubuntu 14.04 for example. See the Python docs for more information on how to install e.g. system wide.

To specify an alternative LAPACK lib, set the environment variable LLAPACK, e.g.:

$ LLAPACK=openblas python setup.py build_ext --inplace

Tests

If you have py.test installed you may run the test suite on the installed package:

$ py.test --pyargs chemreac

All tests should pass (or xfail). If they do not, please file an issue.

Note that you may need to modify $PYTHONPATH. For example: if you have only built the package inplace with build_ext --inplace, and you are standing in the root directory of the repository you may proceed as:

$ PYTHONPATH=`pwd`:$PYTHONPATH py.test --slow --veryslow

Before submitting a Pull Request you also want to pass --pep8 to py.test (it is done automatically by the ./scripts/run_tests.sh script but you need pytest-pep8 for it to work).