1. Setup of the python-lwrsim packageΒΆ

This section describes how to setup the package.

Installation Requirements:

  • Python, tested with version 3.2
  • sundials, tested with version 2.4.0
  • python-sundials, use supplied 0.5 version with modified setup / layout
  • lwrmodels, tested with version 0.8
  • lwrsundialsmodels, tested with version 0.8
  • Cython, tested with version 0.15 (optional, only required if you want to recreate the dynsim.c files)

If you have the rights to install to the system you can just call:

python3 setup.py build
sudo python3 setup.py install

to install this package. Else, you can install to a different path, e.g. your home directory. Use one of distutils –prefix=$HOME (or similar), –home=~ (or similar) or –user setup / install options. In this case, setup the package with:

python3 setup.py build
python3 setup.py install --user

for example.

If you install with:

python3 setup.py build
python3 setup.py install --prefix=$HOME

you may have to set your PYTHONPATH environment variable before running Python to make Python find the installed package, e.g.:

export PYTHONPATH=$PYTHONPATH:$HOME/lib64/python3.2/site-packages

Note

If you install with –user and get an error indicating that –user cannot be combined with –prefix, call:

python3 setup.py install --user --prefix=""

instead. Some distributions set the prefix for the install command by default.

By default the setup script tries to guess where the dependencies can be found. It will look in the system include directories /usr/include and /usr/local/include and for the respective libraries in the lib and lib64 directories. If you use the –prefix=$HOME (or similar), –home=~ (or similar) or –user setup arguments, the setup script will look for include / lib directories there as well. Otherwise it is possible to specify the include / library directories manually. For this purpose, you can set the following environment variables:

Environment variables:
  • LWRMODELS_INCLUDE

    Where are the lwrmodels include files? Example: /usr/local/include/lwrmodels0.8 (should contain lwr4* subdirectories)

  • LWRMODELS_LIB

    Where are the lwrmodels library files? Example: /usr/local/lib/lwrmodels0.8 (should contain lwr4* subdirectories)

  • LWRSUNDIALSMODELS_INCLUDE

    Where are the lwrsundialsmodels include files? Example: /usr/local/include/lwrsundialsmodels0.8 (should contain lwr4* subdirectories)

  • LWRSUNDIALSMODELS_LIB

    Where are the lwrsundialsmodels library files? Example: /usr/local/lib/lwrsundialsmodels0.8 (should contain lwr4* subdirectories)

  • SUNDIALS_INCLUDE

    Where are the sundials include files? Example: /usr/local/include (should contain sundials subdirectory)

  • SUNDIALS_LIB

    Where are the sundials library files? Example: /usr/local/lib64 (should contain libsundials_ida.so* files)

  • PYTHON_SUNDIALS_INCLUDE

    Where are the python-sundials include files? Example: /usr/local/lib64/python3.2/site-packages/ (should contain sundials/sundials.pxd file) The setup script tries to import sundials and obtain the path by default.

Note

You should set none or both, the library and include variables. Otherwise it is not guaranteed that include files and libraries match.

Previous topic

Documentation of python-lwrsim

Next topic

2. Reference

This Page