Changes between Version 3 and Version 4 of DevEnvironment


Ignore:
Timestamp:
04/27/11 10:55:40 (3 years ago)
Author:
matija
Comment:

Prefinal draft.

Legend:

Unmodified
Added
Removed
Modified
  • DevEnvironment

    v3 v4  
    1 This page is a work in progress and should be finished in a day or two. 
     1This page is a work in progress and should be finished in an hour or two. 
    22 
    33= Setting up Development Environment = 
     
    1616* `eclipse` will be your IDE, and one of its plugins we will install needs `libsvn-java` to work, 
    1717* `make`, `g++`, `python-dev`, `python-numpy`, `python-matplotlib` and `python-imaging` are needed to build and use the Orange scripting environment, and 
    18 * `python-qwt5-qt4` is needed in order for the Orange Canvas (GUI) to work. 
     18* `python-qwt5-qt4` is needed in order for the Orange Canvas (GUI) to work, 
     19* `python-sphinx` and `dvipng` are needed to build the HTML documentation. 
     20 
     21Beware that Sphinx has to be at least of version 1.0; Ubuntu 10.10 and older contain older versions of Sphinx, so you should '''not''' install the one from apt repository, but find another way, such as `easy_install`. 
    1922 
    2023This is the command to install all those packages in one shot: 
    2124{{{ 
    22 sudo apt-get install eclipse libsvn-java make g++ python-dev python-numpy python-matplotlib python-imaging python-qwt5-qt4 
     25sudo apt-get install eclipse libsvn-java make g++ python-dev python-numpy python-matplotlib python-imaging python-qwt5-qt4 python-sphinx dvipng 
     26}}} 
     27 
     28If you wish to use Orange for network analysis, you also need a recent version of networkx; you can install it with: 
     29{{{ 
     30sudo apt-get install python-setuptools 
     31sudo easy_install networkx 
    2332}}} 
    2433 
     
    3746 
    3847Under project properties, C/C++ Build->Environment, add the following environmental variables: 
    39  * `ORANGE_LIBDIR=.` 
     48 * `ORANGE_LIBDIR=${ProjDirPath}` 
    4049 * `COMPILEOPTIONS=-ggdb` 
    4150 * `LINKOPTIONS=-ggdb` 
     51 
     52(If you intend to invoke `make` on the commandline, you can add those properties into the `Makefile` and `makefile.defs`.) 
    4253 
    4354To accelerate the compilation process on a multi-processor or multi-core machine, you may instruct Eclipse to use parallel build (`-j` switch to the `make`): go to project properties for `source` project and under C/C++ Build->Behaviour check "Use parallel build". Manually enter a desired parallel jobs count; do NOT use "optimal jobs number": Eclipse likes to run all possible compilations at once and you'll probably run out of RAM. 
     
    4556For both `orange` and `testing`, select Pydev->Pydev Project. Later in this guide it will be assumed you used the directory name for project name (ie. `orange` and `testing`). Uncheck the "Create default 'src' folder" checkbox. Configure the interpreter if Eclipse requests so; you may use the Auto Config button with default settings. Select `source` as a referenced project of `orange`, and `orange` of `testing`. 
    4657 
     58=== Path Settings === 
     59 
     60To be able to run Orange, you need to add some directories to the `PYTHONPATH`. Here, we will assume you only have one version of Orange on your system and you want to use it from within Eclipse and also outside it. If you have more than one version of Orange, we'll assume you also know the best way to deal with your paths. 
     61 
     62Open a terminal and go to your workspace directory (which contains at least `orange` and `source` directories). Now invoke the following: 
     63{{{ 
     64( echo -e "$PWD/source\n$PWD/orange\n$PWD/orange/OrangeCanvas\n$PWD/orange/OrangeWidgets" && find $PWD/orange/OrangeWidgets -maxdepth 1 -type d -regex '[^\.].*' ) | sudo tee `python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"`/orange.pth 
     65}}} 
     66 
     67You will need to provide your password, because sudo is used to write to a system directory. You may dissect the command to figure out what it does; it basically puts some paths in your workspace to a file `orange.pth` in python's `dist-packages` directory. 
     68 
    4769=== Enabling Running and Debugging === 
    4870 
    49 TODO 
     71For debugging, you need to set up two debug configurations: one for Python and one for C++. That of course means you won't be able to debug both types of code at once. Choose Run->Debug Configurations and set up the following two configurations. 
     72 
     73Add a new "Python Run" configuration, name it `orange-python`, select `orange` as the project and `OrangeCanvas/orngCanvas.pyw` as the main module. Click apply. 
     74 
     75Now add a new "C/C++ Application" configuration, name it orange, select `source` as the project and `/usr/bin/python` as the C/C++ Application. In the Arguments tab, type `${workspace_loc}/orange/OrangeCanvas/orngCanvas.pyw` as program arguments.  Debugger should be set to "gdb Debugger" and "Stop on startup" '''not''' checked. You may now apply the configuration.