How to use Kdevelop with CMSSW

Kdevelop is an Integrated Development Environment (IDE) in KDE: this is an application that integrates the C++ libraries you work with, like CMSSW, ROOT, etc such that you can program more easily and quickly. So for example, if you have a histogram TH1F object myhist declared in your code, the IDE will autocomplete the list of functions that you can call for myhist->. This is very handy: instead of going back and forth between your .cc file and countless headers and other .cc files (or the code's web) to get a list of the functions, you are automatically presented with a pull-down menu with all possible options. Awesome! Of course, you can also build, debug, and test your code within Kdevelop.

Here are the instructions on how to make Kdevelop (3.3.4) work with CMSSW running on SLC5. (The latest Kdevelop4 only works in KDE4).

  1. We assume you have a work area with some CMSSW release and a list of your packages. For example RecoJets/JetAnalyzers:
    • cd /scratch/username
    • scram project CMSSW CMSSW_3_3_5
    • cd CMSSW_3_3_5
    • eval `scram ru -sh`
    • cvs co -r V00-05-00 RecoJets/JetAnalyzers
    • scram b
  2. Now launch Kdevelop:
  3. In Project, open "Import Existing Project"
    • Directory: /scratch/username/CMSSW_3_3_5/src/RecoJets
    • Project Name: RecoJets, for example
    • Project Type: Generic C++ Application (Custom Makefiles)
    • And click on Create Project
  4. It will then prompt you with a warning: "This project does not contain any files yet. Populate it with all C/C++/Java files below the project source directory?"
    • Click on "Populate"
  5. Now you have created the project. Before you begin, you should enter information about additional libraries. Go to "Project > Project Options"
    • On the "C++ specific" category and "General" tab, change .cpp with .cc as "Implementation Suffix"
    • On the "Code Completion" tab, in the "Code Completion Databases" click on Add
      • Select the "Kdevelop Custom Directory PCS Importer", and click Next
      • Database name: ROOT
      • Directories to parse: /afs/ This ROOT path can be obtained by: echo $ROOTSYS in your terminal
      • Select the new ROOT directory, click on Add, and then Next. It will build the library. Be careful because kdevelop will use a lot of space in your home area to store all the information on this database. You might want to create a soft link for this directory: ~/.kde/share/apps/kdevcppsupport in a local scratch disk in the machine where you normally run Kdevelop.
  6. Now you can begin editing a file: In the "File selector" tab on the left you can navigate to open for example: RecoJets/JetAnalyzers/src/
  7. Now when you begin writing a new variable it will offer you a menu with the possibilities, and when you type -> it will also offer completion for all possible functions on that object!

Left to do is how to build within Kdevelop, for now you can still use the terminal.

-- AranGarciaBellido - 26-Jul-2010

Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r2 - 2010-07-27 - AranGarciaBellido
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Sandbox All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback