User:Iamcalvo

Jump to: navigation, search

Contents

KDE4 trunk tips:

WARNING! I'm not a shell scripting master nor have a degree in English Language: all corrections, additions, etc. are very welcome!

distcc

If you have some spare computers and want to save time compiling here it is how to compile KDE4 with distcc:

  1. install distcc.
  2. read the manpage.
  3. edit your ~/.distcc/hosts.
  4. set up distccd on other computers, if not accessing by ssh.
  5. add this to your ~/.bashrc: export CC='distcc gcc' export CXX='distcc g++' and edit cmakekde function raising make's -j parameter. example: nice make -j6 VERBOSE=1 && \
  6. you must remove CMakeCache.txt file from the build directory of any previously compiled module, else it won't use distcc, even if you manually set CC and CXX variables to make, to CMakeCache.txt or rerun cmake. The reason is that cmake can't switch compilers after the first run, see http://www.cmake.org/Wiki/CMake_Useful_Variables. This means you have to recompile all the module again, but will be faster than ever!

Xephyr

Using Xephyr to try KDE4 is great, but it's always complaining about DISPLAYs. Add this function to your ~/.bashrc and forget those DISPLAY headaches: function startxephyr { export OLDDISPLAY=$DISPLAY

if test -n "$1"; then

               Xephyr $* &
               # This assumes the display to use is the first argument

export DISPLAY=$1 else Xephyr :2 -fullscreen & export DISPLAY=:2

       fi

startkde

export DISPLAY=$OLDDISPLAY } This is very similar to the method described in http://techbase.kde.org/Getting_Started/Set_up_KDE_4_for_development#Nested_KDE_4_session.

CCMake

Sometimes a module doesn't compile because of an application or maybe you want to tweak the compilation options to suit your needs. You can do this by setting some CMake variables. The easiest way to do it is CCMake, a NCurses frontend to CMake. Hmmm, but cmakekde was sooo handy, i can't stop using it... let's ccmake it!

  1. Change this in your .bashrc: function cmakekde { to function _cmakekde { and cmake $srcFolder -DCMAKE_INSTALL_PREFIX=$KDEDIR \ to $cmakecommand $srcFolder -DCMAKE_INSTALL_PREFIX=$KDEDIR \
  2. add this to your ~/.bashrc: function cmakekde { export cmakecommand=cmake; _cmakekde $*; } function ccmakekde { export cmakecommand=ccmake; _cmakekde $*; }

Now you can easily tweak your compilations with ccmakekde!

That's all for now folks!


This page was last modified on 18 September 2007, at 01:33. This page has been accessed 494 times. Content is available under Creative Commons License SA 3.0 as well as the GNU Free Documentation License 1.2.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V.Legal