Changes between Version 13 and Version 14 of DevEnvironment


Ignore:
Timestamp:
02/10/12 12:18:04 (2 years ago)
Author:
matija
Comment:

Change paths after refactoring.

Legend:

Unmodified
Added
Removed
Modified
  • DevEnvironment

    v13 v14  
    5555To 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. 
    5656 
    57 Open a terminal and go to the directory where your clone of Orange repository resides (i.e. the directory that contains the `orange` and `source` subdirectories). Now invoke the following: 
     57Open a terminal and go to the directory where your clone of Orange repository resides (i.e. the directory that contains the `Orange` and `source` subdirectories). Now invoke the following: 
    5858{{{ 
    59 ( echo -e "$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 
     59( echo $PWD ; echo $PWD/Orange/orng ) | sudo tee `python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"`/orange.pth 
    6060}}} 
    6161 
    62 You 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 repository clone to a file `orange.pth` in python's `dist-packages` directory. 
     62You 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 two paths in your repository clone to a file `orange.pth` in python's `dist-packages` directory. 
    6363 
    6464=== Setting Up The Eclipse IDE === 
    6565 
    66 Next, you need to run Eclipse. As the workspace, choose the directory you used to clone our repository. (There are other possibilities; do it your own way if you know your way around.) Within Eclipse, install the needed plugins: CDT (C/C++ Development Tooling), PyDev (Python IDE for Eclipse) and MercurialEclipse (for Mercurial repository support). That is, choose Help->Install New Software... and add the following Update Sites: 
     66Next, you need to run Eclipse. As the workspace, choose some directory outside your local Orange repository. Within Eclipse, install the needed plugins: CDT (C/C++ Development Tooling), PyDev (Python IDE for Eclipse) and MercurialEclipse (for Mercurial repository support). That is, choose Help->Install New Software... and add the following Update Sites: 
    6767 * CDT Site: http://download.eclipse.org/tools/cdt/releases/helios 
    6868 * PyDev Site: http://pydev.org/updates/ 
     
    7373Now let's set up the projects in Eclipse. We'll set up two projects: `orange` for Python code and `source` for C++ code. 
    7474 
    75 Open the New Project dialog, select C/C++->C++ Project. Select Makefile project->Empty Project->Linux GCC for Project type and Toolchain. Use `source` as project name, disregarding the warning about project already existing. 
     75Open the New Project dialog, select C/C++->C++ Project. Select Makefile project->Empty Project->Linux GCC for Project type and Toolchain. Use `source` as project name, untick the "Use default location" checkbox and choose the `source` directory in your local Orange repository. Disregard the warning about project directory already existing. 
    7676 
    7777Under project properties ("Advanced settings..." button), C/C++ Build->Environment, add the following environmental variables: 
     
    8383To 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, for example the number of processor cores in your computer; do NOT use "optimal jobs number": Eclipse likes to run all possible compilations at once and you'll probably run out of RAM. 
    8484 
    85 Fire up the New Project dialog once more, select Pydev->Pydev Project and name the project `orange`. Use the "Add project directory to PYTHONPATH" option, and in no case the "Create 'src' folder and add it to PYTHONPATH". Configure the interpreter if Eclipse requests so; you may use the Auto Config button with default settings. Select `source` as a referenced project. 
     85Fire up the New Project dialog once more, select Pydev->Pydev Project and name the project `orange`. Change the project location to the location of your repository (which contains the `Orange` directory). Use the "Add project directory to PYTHONPATH" option, and in no case the "Create 'src' folder and add it to PYTHONPATH". Configure the interpreter if Eclipse requests so; you may use the Auto Config button with default settings. Select `source` as a referenced project. 
    8686 
    8787=== Enabling Running and Debugging === 
     
    8989For debugging, it's best to set up three debug configurations: one for Python code, one for C++ code with Orange Canvas being invoked and one without Canvas to debug in python scripting environment. Choose Run->Debug Configurations and set up the following configurations. 
    9090 
    91 Add a new "Python Run" configuration, name it `orange-canvas-python` (or otherwise, if you will), select `orange` as the project and select `OrangeCanvas/orngCanvas.pyw` as the main module. Click apply. 
     91Add a new "Python Run" configuration, name it `orange-canvas-python` (or otherwise, if you will), select `orange` as the project and select `Orange/OrangeCanvas/orngCanvas.pyw` as the main module. Click apply. 
    9292 
    9393Now add a new "C/C++ Application" configuration, name it `orange-cpp`, select `source` as the project and `/usr/bin/python` as the C/C++ Application. In the Debugger tab, uncheck the "Stop on startup at `main`". You may now apply the configuration. 
    9494 
    95 Now clone the last configuration, name it `orange-canvas-cpp` and add, in the Arguments tab, enter `${workspace_loc}/orange/OrangeCanvas/orngCanvas.pyw` as program arguments. 
     95Now clone the last configuration, name it `orange-canvas-cpp` and add, in the Arguments tab, enter `<path to your Orange repository>/Orange/OrangeCanvas/orngCanvas.pyw` as program arguments. 
    9696 
    9797You can now test those three configurations. Beware that without setting `-ggdb` flags (as described higher up in this document) you will not be able to debug C++ code. Note also that on the first run (and after heavy modifications of C++ code) it will take some time for your computer to build the C++ code of Orange.