As I struggled several weeks to get KDevelop up and running for C++ / ROOT development because there are only few and mostly bad instructions I here present you with a short one. Hopefully it will help prevent the severe headaches I had. BEHOLD!!!
After having installed Ubuntu 10.10 (Maverick Meerkat) successfully (what shouldn’t be a problem as the installation procedure is smoother than ever before) the next step towards getting the development environment up and running is adding the right software sources for aptitude to find KDevelop. Nothing easier as that … open a terminal and execute
- sudo add-apt-repository ppa:kubuntu-ppa/backports
- sudo apt-get install kdevelop
Now KDevelop 4.2 should be installed on the system. To use the KDevelop build system also install cmake by executing
- sudo apt-get install cmake
To test if KDevelop is installed correctly enter
anywhere in the terminal.
The next step is to install ROOT.
Go to http://root.cern.ch/drupal/content/downloading-root and download the latest version (a link “ROOT x.xx/xx complete source tree for all systems”). To be able to compile ROOT the following dependencies have to be fulfilled.
To install those, if not already installed, execute
- sudo apt-get install (… followed by the expression after the numbers 1 to 8 )
Having provided all dependencies ROOT is ready to be built.
Enter the directory where ROOT was downloaded to and extract the archive by executing
- tar -xvf (… followed by the name of the file)
After changing into the newly generate directory named ./root, execute
- ./configure –prefix=/usr/local (do not cut and paste this)
followed by the command
- make -j x (where x is the number of CPU cores of the system +1, for best performance)
to actually build it.
Wait … wait … wait even more until the process has finished. Now its ready to be installed by executing
The only thing which is left now is to tell the compiler where to find the new libraries. To do so create the file libroot.conf in /etc/ld.so.conf.d by entering
- sudo nano /etc/ld.so.conf.d/libroot.conf
into the terminal and editing the content of the file to read
Save it by pressing <strg>+o then <enter> and leave the editor by hitting <strg>+x.
Next step is to register libroot.conf by entering
Now it should be possible to run ROOT. To test if everything is right to this point do
anywhere in the terminal. A pop up window should appear, indicating that ROOT is starting.
Leave it by entering
and hitting <enter> .
Now KDevelop has to be configured.
For the correct parameters execute
- root-config –cflags –glibs
and copy the results into the clipboard.
Open KDevelop again, create your project and compile it once to be able to access the advanced project configuration (else it won’t show up) .
Enter the project configuration by right clicking onto your project in the tree on the left side and hitting “Open Configuration”.
Now click “Show Advanced” and mark “Show Advanced Values”.
Scroll down to the entry which reads “CMAKE_CXX_FLAGS”, paste the values copied before into the field on the right and close the windows by clicking “OK”.
VOILA! KDevelop is ready to be used to create C++ / ROOT programmes.
To be able to debug the programme, launches have to be configured by clicking on “Run” and “Configure Launches”.
For “Project Target” choose your project.
It is also advised to configure “Dependencies” so that the programme is built upon debugging. Choose “Build” as the action and your project as the target. NOTHING else has to be done to enable debugging in KDevelop.