The way to download, compile, install and run KDevelop depends on how you want to download it and where do you want to install it to. So follow the step by step instructions below.
Make sure to install the required KDE development packages, see KDevelop4/requirements for a list of requirements. In particular make sure to install KDE4 kdelibs development packages. At least following packages are required:
In Fedora 13: kdelibs-devel kdebase-workspace-devel
In Ubuntu 11.04: cmake gcc g++ kdelibs5-dev zlib1g-dev kdebase-workspace-dev
WARNING: You have to remove all KDevelop packages provided by your distribution. If you don't do that, binary compatibility issues will eventually lead to crashes and undefined behavior. To make sure, you can search for KDevelop libraries with this command:
find /usr/ -type f -name "*kdev*.so*"
If no results are returned, you should be on the safe side.
cd $HOME/src tar xvjf kdevplatform.tar.bz2 tar xvjf kdevelop.tar.bz2
git clone git://anongit.kde.org/kdevplatform $HOME/src/kdevplatform git clone git://anongit.kde.org/kdevelop $HOME/src/kdevelop
Please note that this branch will depend on MovingRange in Kate, meaning KDE 4.5 and above. This can be updated by doing sudo yum update kdelibs or equivalent.
cd $HOME/src/kdevplatform ; git checkout -b 1.2 origin/1.2 cd $HOME/src/kdevelop ; git checkout -b 4.2 origin/4.2
You can do a system install of KDevelop in the default path (/usr/local), which needs root privileges, or you can install it locally for your user only. The instructions for both are slightly different; first we'll explain the local install.
In both cases you need set the KDEDIRS environment variable to point to the installation directory of both KDE4 and KDevPlatform.
This will tell KDE core components where to search for plugins and other data related to KDE apps and contains just a list of paths (aka prefixes) where KDE libraries and/or applications have been installed.
Assuming that you have the KDE4 libraries installed in /usr (these are often from packages and installed in /usr or /opt/kde and is distro specific, if unsure ask your distro where it is), you'll have to append it to the KDEDIRS below.
The following commands give instructions to install in $HOME/kdevelop4; you can of course replace it with something else. You don't need root permissions to install KDevelop this way.
First, compile and install KDevPlatform:
mkdir -p $HOME/src/kdevplatform/build cd $HOME/src/kdevplatform/build cmake -DCMAKE_INSTALL_PREFIX=$HOME/kdevelop4 ../ make make install
Then compile KDevelop, telling it to use the just-installed KDevPlatform:
mkdir -p $HOME/src/kdevelop/build cd $HOME/src/kdevelop/build cmake -DCMAKE_PREFIX_PATH=$HOME/kdevelop4 -DCMAKE_INSTALL_PREFIX=$HOME/kdevelop4 ../ make make install
Before running KDevelop, you need set the KDEDIRS environment variable. Assuming that you want to install KDevelop4 into $HOME/kdevelop4 then you need to run the following:
export KDEDIRS=$HOME/kdevelop4:/$KDEDIRS kbuildsycoca4
Note that this will set the KDEDIRS variable only for that shell (so launching kdevelop from desktop launcher will fail). A good solution is to add to a small script to $HOME/.kde/env that sets the KDEDIRS variable to proper. For example you may call it $HOME/.kde/env/kdedirs.sh and it could contain:
#!/bin/bash export KDEDIRS=/usr/local/:$KDEDIRS
And it needs to have execution permissions.
First, compile and install KDevPlatform:
mkdir -p $HOME/src/kdevplatform/build cd $HOME/src/kdevplatform/build cmake ../ make sudo make install
Then compile KDevelop:
mkdir -p $HOME/src/kdevelop/build cd $HOME/src/kdevelop/build cmake ../ make sudo make install
Before running it, you need to set KDEDIRS properly as in local installation but with path as /usr/local/.
If you need extra functionality, you can get and install additional plugins for KDevelop4 at KDevelop4/Compiling/Plugins.
(If you want to ease it, you can add $HOME/kdevelop4/bin/ to your $PATH env variable).
If you find any compile problems with KDevelop4 please report them on our developer mailing-list. If you find problems while using KDevelop4 use, the bugzilla bug database which is only for bugs (not for compilation issues).
If you find bugs that cause program to crash and you are going to make bug report out of it, please re-compile the program with debug symbols. This is done with options
passed to cmake in configuration step. Also be sure to update kdevelop and kdevplatform to newest version, your bug might be already fixed.
If you got the sources from the git repository on step 2. then you can update by issuing the following commands:
cd $HOME/src/kdevelop/build && sudo make uninstall cd $HOME/src/kdevplatform/build && sudo make uninstall cd $HOME/src/kdevplatform && git pull cd $HOME/src/kdevplatform/build && make && sudo make install cd $HOME/src/kdevelop && git pull cd $HOME/src/kdevelop/build && make && sudo make install kbuildsycoca4
cd $HOME/src/kdevelop/build && make uninstall cd $HOME/src/kdevplatform/build && make uninstall cd $HOME/src/kdevplatform && git pull cd $HOME/src/kdevplatform/build && make && make install cd $HOME/src/kdevelop && git pull cd $HOME/src/kdevelop/build && make && make install kbuildsycoca4
You can also see here the latest changes in the KDevelop projects.