Using the kdesrc-build script

Now you are ready to run the script. From a terminal window, log in to the user you are using to compile KDE and execute the script:

% kdesrc-build

Afterwards, you should see output similar to that in Example 2.4, “Example output of building a single module”:

Example 2.4. Example output of building a single module

% kdesrc-build kdelibs
Script started processing at Wed Dec 22 13:21:45 2010
<<<  Build Process  >>>
Building kdelibs (1/1)
        Waiting for source code update.
        Source update complete for kdelibs: 48 files affected.
        Checking for source conflicts...
        Build succeeded after 13 minutes, and 6 seconds.
        Installing kdelibs.
        Overall time for kdelibs was 13 minutes, and 53 seconds.

<<<  Build Done  >>>


Script finished processing at Wed Dec 22 13:35:38 2010
Your logs are saved in /home/kde-src/log-kdesrc-build/2010-12-22-01

At this point, kdesrc-build should start downloading the sources and compiling them. Depending on how many modules you are downloading, it is possible that kdesrc-build will not succeed the first time you compile KDE. Do not despair!

kdesrc-build logs the output of every command it runs. By default, the log files are kept in ~/kdesrc/log. To see what the caused an error for a module in the last kdesrc-build command, usually it is sufficient to look at ~/kdesrc/log/latest/module-name/error.log.


Perhaps the easiest way to find out what error caused a module to fail to build is to search backward with a case-insensitive search, starting from the end of the file looking for the word error. Once that is found, scroll up to make sure there are no other error messages nearby. The first error message in a group is usually the underlying problem.

In that file, you will see the error that caused the build to fail for that module. If the file says (at the bottom) that you are missing some packages, try installing the package (including any appropriate -dev packages) before trying to build that module again. Make sure that when you run kdesrc-build again to pass the --reconfigure option so that kdesrc-build forces the module to check for the missing packages again.

Or, if the error appears to be a build error (such as a syntax error, incorrect prototype, unknown type, or similar) then it is probably an error with the KDE source, which will hopefully be resolved within a few days. If it is not resolved within that time, feel free to mail the mailing list (subscription may be required first) in order to report the build failure.

You can find more common examples of things that can go wrong and their solutions, as well as general tips and strategies to build KDE in the Building KDE 4 from Source.

On the other hand, assuming everything went well, you should have a new KDE install on your computer, and now it is simply a matter of running it, described next in the section called “Setting the Environment to Run Your KDE Plasma Desktop”.


For more information about kdesrc-build's logging features, please see the section called “kdesrc-build's build logging”.