Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Table of Contents Development environment General requirements • Base For C++ development For documentation generation For tests For GUI creation Linux specific requirements Windows specific requirements How to develop a package without installing it ? Pure Python and Python/C++ packages How to install a package without Root privileges it You have a Python environment version >= 2.6.0 : user site-package Python Virtual environment How to compile PyQT4 on Windows Development environment This document presents the software requirements to develop OpenAlea packages. The needed softwares/libraries are : edit 1-159 1266530686 documentation:package:development_e Edit 1/7 General requirements Base Python >= 2.5 OpenAlea.Deploy Subversion - or SVN Tortoise for windows For C++ development Scons > = 0.97 Boost.Python library. (Binaries for Windows are available here) * OpenAlea.SconsX For documentation generation Epydoc: easy_install epydoc Docutils Doxygen For tests Nose test: easy_install nose For GUI creation QT 4.3 PyQt >= 4.3 (QT 4.2 compatible) QScintilla 2 edit 160-1309 1266530686 documentation:package:development_e Edit Linux specific requirements 2/7 Install GCC and lib C++ Use distribution installation tools to get the different packages (urpmi, yum, apt-get) edit 1310-1471 1266530686 documentation:package:development_e Edit Windows specific requirements Mingw or visual C++ 8. Explorer integrated SVN client : SVN Tortoise OpenAlea provide developpers packages for windows (QT4, Scons, MinGW, Boost) . See Download/Install section. edit 1472-1846 1266530686 documentation:package:development_e Edit How to develop a package without installing it ? In normal installation OpenAlea packages are installed in the python site-packages directory. During development, to avoid to reinstall every time the packages, you can simulate a virtual installation of the packages. 3/7 edit 1847-2134 1266530686 documentation:package:development_e Edit Pure Python and Python/C++ packages If you use OpenAlea.Deploy>=0.4.1, you can use the setup.py develop command: python setup(-egg).py develop [--install-lib=~/my_site_package] This command simulate python installation without copying the python files. It must be executed only one time. The optional ?install-lib allows to specify a local site-package (you need to modify your PYTHONPATH accordingly). This option is usefull under unix system without Root privileges. Usage: When the developer changes the python code, the changes are automatically take into account. When the developer changes the c++ code, he must executes only the scons command scons IMPORTANT If your sources are in a src directory (which is usually the case), add in the setup.py package_dir = edit {'' : 'src' , ... } 2135-3027 1266530686 4/7 documentation:package:development_e Edit How to install a package without Root privileges it edit 3028-3092 1266530686 documentation:package:development_e Edit You have a Python environment version >= 2.6.0 : user site-package Starting with Python 2.6.0, it is possible to install Python packages in a user place (as opposed to system space needing administrator privileges). http://www.python.org/dev/peps/pep-0370/ Installation of packages without administrator privileges It is possible to add a command to all your setup.py commands: python multisetup [mode] --prefix=~/.local A better solution is to create a .pydistutils.cfg in your HOME directory. Add the lines: [install] prefix=~/.local And modify your .bashrc: export LD_LIBRARY_PATH=$HOME/.local/lib:$LD_LIBRARY_PATH export PATH=$HOME/.local/bin:$PATH You do not need to modify the PYTHONPATH, because you use the user site-package. For openalea (pure python) $ cd go/to/your/openaleadir $ python multisetup [mode] --prefix=/home/<user>/.local Once OpenAlea.Deploy is installed, set the directory where all the dynamic libraries will be installed: $ alea_config --install-dyn-lib=/home/<user>/.local/lib For vplants (binary+python) 5/7 For some projects that yield dynamic libraries, like vplants try this: $ cd go/to/your/vplantsdir $ python multisetup [mode] Where mode is ?install,develop,etc?? NOTE: the develop mode doesn't support ??install-dyn-lib? yet : http://gforge.inria.fr/tracker/index.php?func=detail&aid=9217&group_id=79&atid=3726 NOTE: there is an option to replace ?prefix : ?user. No openalea package supports it yet, and some from vplants either. http://gforge.inria.fr/tracker/index.php?func=detail&aid=9218&group_id=79&atid=3726 edit 3093-4827 1266530686 documentation:package:development_e Edit Python Virtual environment To avoid to have some version conflict between the installed packages and the developed packages, you can use a separate virtual python installation. This is possible with virtualenv. Virtual env can also be used when you want to install locally your python libraries. Install virtualenv $ easy_install virtualenv Create an environment $ virtualenv local_python Activate the environment $ source local_python/bin/activate edit 4828-5328 1266530686 6/7 documentation:package:development_e Edit How to compile PyQT4 on Windows Download lastest QT version. http://www.trolltech.com/developer/downloads/qt/windows Install QT with MinGW (in c:\MinGW) Download SIP And PyQt4 and unzip http://www.riverbankcomputing.co.uk/sip/download.php http://www.riverbankcomputing.co.uk/pyqt/download.php SIP In a console : > c:\python25\python configure.py -p win32-g++ > c:\MinGW\bin\mingw32-make > c:\MinGW\bin\mingw32-make install PyQt4: > c:\Qt.x.x\bin\qtvars.bat > c:\python25\python configure.py > c:\MinGW\bin\mingw32-make Add To PATH env c:\Qt\4.x.x\bin edit 5329- 1266530686 documentation:package:development_e Edit 7/7