================
Installing PyDIM
================

Requirements
------------

 - DIM. The package has been developed using the v16rXX, v17rXX and v18r0 DIM
   versions. It has not been tested with older versions but I believe it has
   good chances to work.
 - PyDIM has been tested with Python 2.3, 2.4 and 2.5.
 - The package has been developed on both 32 and 64 bits architectures.


How to install
--------------

 - Install DIM. I would suggest placing the DIM libraries and header files in
   `/usr/local/lib` and `/usr/local/include` respectively. Please make the necessary
   changes so that the run-time linker finds `libdim.so` (basically add an entry
   in `/etc/ld.so.conf` that points to the DIM library directory).
   Make sure that the DIM library is built using the *same* compiler and
   architecture as the Python installation you want to use.

 - Get the latest version of PyDIM from the CERN Gitlab service :

        https://gitlab.cern.ch/lhcb-online/pydim

 - Run the installation script::

        $ python setup.py install --user

 - If you want to build the documentation, you can execute the traditional make
   command::

        $ make doc

    The documentation will be available in the doc/api/html and in the doc/guide/.build folders

In the general case this should take care of building the library.

In case DIM libraries are not found, declare an environment variable named
`DIMDIR`, `DIMHOME` or `DIM`_HOME pointing to the main DIM installation directory,
i.e. the one that contains the sub-directories `dim` and the specific one for
your operating system, e.g. `linux`.


How to run
----------

 - Execute `setup/setup.sh`. This script tries to set up the `DIM_DNS_NODE`, add
   the `PyDIM/pydim` directory to your `PYTHONPATH`.
 - Execute some example from the tests directory. If they all run successful
   then the installation is OK.
