If you have all dependencies installed on your system, building and installing / updating PyTango can be as simple as:
easy_install -U PyTango
If you managed to run this line, the quick tour can guide you through the first steps on using PyTango.
Don’t be scared by the graph. Probably most of the packages are already installed. The current PyTango version has four major dependencies:
python (>= 2.4) (http://www.python.org/)
omniORB (http://omniorb.sourceforge.net/)
Tango (>= 7.1.0) (http://www.tango-controls.org/) (really recommended 7.1.1)
if python >= 2.6.3 then: boost-python >= 1.41 else: boost-python >= 1.33 We strongly recommend always using >= 1.41
plus two optional dependencies (activated by default) on:
Note
For the provided windows binary, numpy is MANDATORY!
The latest binaries for PyTango can be found at: http://www.tango-controls.org/download under the tango bindings section.
The PyTango team does not provide a precompiled binary for Linux since this would mean having to provide 12 different binaries: one for each major python version (2.4, 2.5, 2.6, 2.7, 3.0 and 3.1) times 2 for both 32bits and 64bits.
PyTango team provides a binary PyTango distributable for Windows XP/Vista 32bits for usage with python 2.6.
The binary comes with its’s own boost-python, omniORB and Tango DLLs
version | Includes the following DLLs |
---|---|
7.1.0 |
|
7.1.0 rc1 |
|
The binary was compiled with numpy dependency therefore you need to have numpy installed in order to use PyTango.
Since PyTango 7 the build system used to compile PyTango is the standard python distutils.
Besides the binaries for the four dependencies mentioned above, you also need the development files for the respective libraries.
PyTango has a dependency on the boost python library (>= 1.33). This means that the shared library file libboost-python.so must be accessible to the compilation command.
Note
If you use python >= 2.6.3 you MUST install boost python >= 1.41
Most linux distributions today provide a boost python package.
Furthermore, in order to be able to build PyTango, you also need the include headers of boost python. They are normaly provided by a package called boost_python-dev.
If, for some reason, you need to compile and install boost python, here is a quick recipie:
Download latest boost tar.gz file and extract it
Download latest bjam (most linux distributions have a bjam package. If not, sourceforge provides a binary for many platforms)
build and/or install:
Simple build: in the root directory where you extracted boost type:
bjam --with-python toolset=gcc variant=release threading=multi link=shared
this will produce in bin.v2/libs/python/build/gcc-<gcc_ver>/release/threading-multi a file called libboost_python-gcc<gcc_ver>-mt-<boost_ver>.so.<boost_python_ver>
Install (you may need administrator permissions to do so):
bjam --with-python toolset=gcc variant=release threading=multi link=shared install
Install in a different directory (<install_dir>):
bjam --with-python toolset=gcc variant=release threading=multi link=shared install --prefix=<install_dir>
The second step is to make sure the three/four libraries (omniORB, tango, boost python and/or numpy) are accessible to the compilation command. So, for example, if you installed:
boost python under /home/homer/local
omniORB under /home/homer/local1
tango under /home/homer/local2
numpy under /usr/lib/python2.6/site-packages/numpy
you must export the three environment variables:
export BOOST_ROOT=/home/homer/local
export OMNI_ROOT=/home/homer/local1
export TANGO_ROOT=/home/homer/local2
# in openSUSE 11.1 this is the default base location for the include files
export NUMPY_ROOT=/usr/lib/python2.6/site-packages/numpy/core
(for numpy this is the default base location for the include files. This is distribution dependent. For example, ubuntu places a numpy directory under /usr/include, so exporting NUMPY_ROOT is not necessary for this distribution)
For the libraries that were installed in the default system directory (/usr or /usr/local) the above lines are not necessary.
Finally:
python setup.py build
sudo python setup.py install
This will install PyTango in the system python installation directory and, since version 7.1.2, it will also install Spock as an IPython extension.
Or if you whish to install in a different directory:
python setup.py build
python setup.py install --prefix=/home/homer/local --ipython-local
(This will try to install Spock as an IPython profile to the local user, since probably there is no permission to write into the IPython extension directory)
Or if you wish to use your own private python distribution:
/home/homer/bin/python setup.py build
/home/homer/bin/python setup.py install
For the last case above don’t forget that boost python should have also been previously compiled with this private python distribution.
If you have IPython installed, the best way to test your PyTango installation is by starting the new PyTango CLI called Spock by typing on the command line:
$ ipython -p spock
then, in spock type:
Spock <homer:10000> [1]: PyTango.Release.version
Result [1]: '7.1.2'
(if you are wondering, Spock automaticaly does import PyTango for you!)
If you don’t have IPython installed, to test the installation start a python console and type:
>>> import PyTango
>>> print PyTango.Release.version
7.1.2