https://community.kde.org/api.php?action=feedcontributions&user=Cluelesscoder&feedformat=atomKDE Community Wiki - User contributions [en]2024-03-28T09:23:14ZUser contributionsMediaWiki 1.40.2https://community.kde.org/index.php?title=KDevelop/HowToCompile_v4&diff=52989KDevelop/HowToCompile v42013-01-21T23:34:14Z<p>Cluelesscoder: why hide the TOC? this is a really long page, so I'm re-enabling the TOC</p>
<hr />
<div><br />
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.<br />
So follow the step by step instructions below.<br />
<br />
'''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:<br />
<br />
<pre>find /usr/ -type f -name "*kdev*.so*"</pre><br />
<br />
If no results are returned, you should be on the safe side.<br />
<br />
== 1. Get the requirements ==<br />
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:<br />
<br />
In Fedora 13: kdelibs-devel kdebase-workspace-devel<br />
<br />
In Ubuntu 11.04: cmake gcc g++ kdelibs5-dev zlib1g-dev kdebase-workspace-dev<br />
<br />
In Debian: same as ubuntu, but you also need to compile at Grantlee in at least version 0.1.7, though I suggest to use the latest stable release. See http://downloads.grantlee.org/ and http://www.gitorious.org/grantlee/pages/Home<br />
<br />
When configuring kdevplatform, these packages are needed to remedy the following errors:<br />
kdelibs5-dev: ERROR: Could not find KDE4 kde4-config<br />
zlib1g-dev: Could NOT find ZLIB<br />
<br />
When configuring kdevelop, these packages are needed to remedy the following errors:<br />
<br />
Could NOT find KDE4Workspace<br />
<br />
== 2. Get the sources (assumes ''$HOME/src'' but you can replace it with something else) ==<br />
* By downloading it to ''$HOME/src''<br />
** download ''kdevplatform.tar.bz2'' and ''kdevelop.tar.bz2'' from http://download.kde.org/download.php?url=stable/kdevelop/4.1.2/src/<br />
** unpack them:<br />
cd $HOME/src<br />
tar xvjf kdevplatform.tar.bz2<br />
tar xvjf kdevelop.tar.bz2<br />
<br />
* '''Or''', by getting the latest master branch sources directly out of the Git server<br />
git clone git://anongit.kde.org/kdevplatform $HOME/src/kdevplatform<br />
git clone git://anongit.kde.org/kdevelop $HOME/src/kdevelop<br />
<br />
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.<br />
<br />
* '''Or''', by getting the latest 4.2-branch sources directly out of the Git server. First you need to do clone git reposity as above, and then tell git to use branch 1.2 for kdevplatform and branch 4.2 for kdevelop:<br />
cd $HOME/src/kdevplatform ; git checkout -b 1.2 origin/1.2<br />
cd $HOME/src/kdevelop ; git checkout -b 4.2 origin/4.2<br />
<br />
== 3. Configure and install ==<br />
<br />
You can do a system install of KDevelop in the default path (/usr/local), which needs root privileges,<br />
or you can install it locally for your user only.<br />
The instructions for both are slightly different;<br />
first we'll explain the local install.<br />
<br />
In both cases you need set the KDEDIRS environment variable to point to the installation directory of both KDE4 and KDevPlatform.<br />
<br />
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.<br />
<br />
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.<br />
<br />
=== Local installation ===<br />
<br />
The following commands give instructions to install in ''$HOME/kdevelop4'';<br />
you can of course replace it with something else.<br />
You don't need root permissions to install KDevelop this way.<br />
<br />
First, compile and install KDevPlatform:<br />
<br />
mkdir -p $HOME/src/kdevplatform/build<br />
cd $HOME/src/kdevplatform/build<br />
cmake -DCMAKE_INSTALL_PREFIX=$HOME/kdevelop4 ../<br />
make<br />
make install<br />
<br />
Then compile KDevelop, telling it to use the just-installed KDevPlatform:<br />
<br />
mkdir -p $HOME/src/kdevelop/build<br />
cd $HOME/src/kdevelop/build<br />
cmake -DCMAKE_PREFIX_PATH=$HOME/kdevelop4 -DCMAKE_INSTALL_PREFIX=$HOME/kdevelop4 ../<br />
make<br />
make install<br />
<br />
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:<br />
<br />
export KDEDIRS=$HOME/kdevelop4:$KDEDIRS<br />
kbuildsycoca4<br />
<br />
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:<br />
<br />
#!/bin/bash<br />
export KDEDIRS=/usr/local/:$KDEDIRS<br />
<br />
And it needs to have execution permissions. If you want to use it directly, you'll have to logout of your current KDE session and log in again, otherwise this script won't be sourced of course...<br />
<br />
=== System installation ===<br />
First, compile and install KDevPlatform:<br />
mkdir -p $HOME/src/kdevplatform/build<br />
cd $HOME/src/kdevplatform/build<br />
cmake ../<br />
make<br />
sudo make install<br />
<br />
Then compile KDevelop:<br />
<br />
mkdir -p $HOME/src/kdevelop/build<br />
cd $HOME/src/kdevelop/build<br />
cmake ../<br />
make<br />
sudo make install<br />
<br />
Before running it, you need to set KDEDIRS properly as in local installation but with path as /usr/local/.<br />
<br />
== 4. Get and install plugins (optional) ==<br />
<br />
If you need extra functionality, you can get and install additional plugins for KDevelop4. Stable plugins can be found in Extragear: https://projects.kde.org/projects/extragear/kdevelop/plugins . Experimental, potentially unstable or even broken plugins can be found in Playground: https://projects.kde.org/projects/playground/devtools/plugins .<br />
<br />
Many plugins you can find there (e.g. PHP, CSS, QMake, ...) require the KDevelop-PG-Qt parser generator. You can find that here: https://projects.kde.org/projects/extragear/kdevelop/utilities/kdevelop-pg-qt<br />
<br />
Check the sources out and compile the plugin using the same steps as above, e.g. for PHP:<br />
<br />
<pre><br />
mkdir -p $HOME/src/kdev-php/build<br />
cd $HOME/src/kdev-php/build<br />
cmake -DCMAKE_PREFIX_PATH=$HOME/kdevelop4 -DCMAKE_INSTALL_PREFIX=$HOME/kdevelop4 ../<br />
make<br />
make install<br />
</pre><br />
<br />
Make sure to run <code>kbuildsycoca4</code> after installation (see above)!<br />
<br />
== 5. Run KDevelop ==<br />
Just execute:<br />
$HOME/kdevelop4/bin/kdevelop<br />
<br />
(If you want to ease it, you can add $HOME/kdevelop4/bin/ to your $PATH env variable).<br />
<br />
== 6. Contact the development team, or report bugs or wishes ==<br />
If you find any compile problems with KDevelop4 please report them on our [http://www.kdevelop.org/index.html?filename=mailinglist.html developer mailing-list].<br />
If you find problems while using KDevelop4 use, the [http://bugs.kde.org/ bugzilla bug database] which is only for bugs ('''not''' for compilation issues).<br />
<br />
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<br />
<pre>-DCMAKE_BUILD_TYPE=debugfull</pre><br />
passed to cmake in configuration step. Also be sure to update kdevelop and kdevplatform to newest version, your bug might be already fixed.<br />
<br />
== 7. Keeping it up-to-date with the latest fixes ==<br />
If you got the sources from the git repository on step 2. then you can update by issuing the following commands:<br />
* with '''root permissions''' do this<br />
cd $HOME/src/kdevelop/build && sudo make uninstall<br />
cd $HOME/src/kdevplatform/build && sudo make uninstall<br />
cd $HOME/src/kdevplatform && git pull<br />
cd $HOME/src/kdevplatform/build && make && sudo make install<br />
cd $HOME/src/kdevelop && git pull<br />
cd $HOME/src/kdevelop/build && make && sudo make install<br />
kbuildsycoca4<br />
* '''Or''' if installed in local directory<br />
cd $HOME/src/kdevelop/build && make uninstall<br />
cd $HOME/src/kdevplatform/build && make uninstall<br />
cd $HOME/src/kdevplatform && git pull<br />
cd $HOME/src/kdevplatform/build && make && make install<br />
cd $HOME/src/kdevelop && git pull<br />
cd $HOME/src/kdevelop/build && make && make install<br />
kbuildsycoca4<br />
<br />
You can also see here [https://projects.kde.org/projects/extragear/kdevelop/ the latest changes] in the KDevelop projects.<br />
<br />
== 8. Troubleshooting ==<br />
* When running cmake on KDevelop, you get "Could NOT find KDE4Workspace". You need to install the kdebase-workspace-dev package.</div>Cluelesscoder