Archive:Getting Started/Build/Requirements: Difference between revisions

From KDE TechBase
Line 36: Line 36:


* pkg-config
* pkg-config
* development libraries and headers for X11, OpenGL (mesa-common-dev and libglu1-mesa-dev), libjpeg, libpng, libungif, [http://download.librdf.org/source/ librdf], libxml2 and libxslt
* the <tt>makeobj</tt> script, which is included in kdesdk. You can install it from kdesdk (kdesdk-scripts on Debian) or similar packages, or download at [http://websvn.kde.org/*checkout*/trunk/KDE/kdesdk/scripts/makeobj WebSVN]
* the <tt>makeobj</tt> script, which is included in kdesdk. You can install it from kdesdk (kdesdk-scripts on Debian) or similar packages, or download at [http://websvn.kde.org/*checkout*/trunk/KDE/kdesdk/scripts/makeobj WebSVN]
* the [http://freedesktop.org/wiki/Software/shared-mime-info shared-mime-info package], is the freedesktop MIME standard now used in KDE
* the [http://freedesktop.org/wiki/Software/shared-mime-info shared-mime-info package], is the freedesktop MIME standard now used in KDE
Line 82: Line 81:
| Yes
| Yes
| Also dbus-glib
| Also dbus-glib
|-
| [http://www.x.org/wiki/ X11]
| >=
| >=
| Yes
|
|-
| [http://www.mesa3d.org/ Mesa]
| >=
| >=
| Yes
| mesa-common-dev and libglu1-mesa-dev
|-
| [http://www.ijg.org/ libjpeg]
| >=
| >=
| Yes
|
|-
| [http://www.libpng.org/pub/png/libpng.html libpng]
| >=
| >=
| Yes
|
|-
| [http://sourceforge.net/projects/giflib/ libungif]
| >=
| >=
| Yes
|
|-
| [http://download.librdf.org/source/ librdf]
| >=
| >=
| Yes
|
|-
| [http://xmlsoft.org/ libxml2]
| >=
| >=
| Yes
|
|-
| [http://xmlsoft.org/xslt/ libxslt]
| >=
| >=
| Yes
|
|}
|}


Line 88: Line 135:


From KDE 4.6 onwards HAL has been deprecated in favor of uDisk, uPower and related projects, but all but the most recent distributions will still require HAL.
From KDE 4.6 onwards HAL has been deprecated in favor of uDisk, uPower and related projects, but all but the most recent distributions will still require HAL.
Some very old distributions may require you to compile a newer HAL, but this is likely to require many other packages to be upgraded and you are probably better off upgrading your distribution instead.


== Qt ==
== Qt ==

Revision as of 17:36, 2 March 2011


Getting_Started/Build/KDE4/Prerequisites


Building KDE4 From Source/Prerequisites
Tutorial Series   Getting Started
Previous   [[../|KDE SVN Quickstart Guide]]
What's Next   [[../|KDE SVN Quickstart Guide]]
Further Reading   n/a

Introduction

This page details the software requirements that need to be installed on your system before you can start building kdelibs and the KDE application. For most of these requirements it is preferable to use your distribution supplied packages, however in some case you may need to build some requirements yourself and this page will also explain how those requirements can be built.

Build Recipes

Two different recipes are provided for building KDE and its prerequisites.

The Easy Recipe relies on you setting up your environment according to the KDE recommendations. This will give you many shortcuts to save on typing. See Setting Up The Environment section to do this.

The Full Recipe is provided for those who wish to control their build environment or to see the full steps required and who don't mind lots of typing.

System Prerequisites

NOTE: This section needs a major update!

Some or all of these packages should be available for installation from your distribution. For ease of installation and upgrading it is a good idea to install distribution packages if a recent enough version is provided.

On most distributions you will also need to install the matching -devel packages for each piece of software.

Software required to build KDE4 includes:

  • pkg-config
  • the makeobj script, which is included in kdesdk. You can install it from kdesdk (kdesdk-scripts on Debian) or similar packages, or download at WebSVN
  • the shared-mime-info package, is the freedesktop MIME standard now used in KDE
  • the shared-desktop-ontologies package is required to build and run all Nepomuk semantic desktop/desktop search modules.
  • boost, used by kdebase; after build and/or install, in order to make cmake aware about its location (FindBoost), add the boost directory (which contains the include subdirectory) to CMAKE_INCLUDE_PATH or set a environment variable called BOOST_ROOT that points to the boost directory.
  • DocBook XML DTDs (v4.2) and related XSL stylesheets, used by KDE help system; their packages are available in most distributions

Requirements as at 2011-03-02, Stable Branch currently KDE Release 4.6, Master currently targeting KDE Release 4.7.

Package Stable Branch Requires Master Requires Devel Files Needed? Details
GCC / G++ >= 4.2 >= 4.2 No
Git No
SVN No
CMake >= 2.6.4 >= 2.6.4 No
DBus >= 1.4.0 >= 1.4.0 Yes Also dbus-glib
X11 >= >= Yes
Mesa >= >= Yes mesa-common-dev and libglu1-mesa-dev
libjpeg >= >= Yes
libpng >= >= Yes
libungif >= >= Yes
librdf >= >= Yes
libxml2 >= >= Yes
libxslt >= >= Yes

Hardware Libraries

HAL (Hardware Abstraction Layer) is required by KDE 4.5 and earlier for interfacing with your hardware. Your distribution supplied packages should be sufficient for this.

From KDE 4.6 onwards HAL has been deprecated in favor of uDisk, uPower and related projects, but all but the most recent distributions will still require HAL.

Qt

Requirements as at 2011-03-02, Stable Branch currently KDE Release 4.6, Master currently targeting KDE Release 4.7.

Package Stable Branch Requires Master Requires Devel Files Needed? Details
Qt >= 4.7.0 >= 4.7.0 Yes

Qt is the toolkit that all KDE is built upon. Most distributions package a recent enough Qt to build KDE, although you may need to add an extra repository to do so.

At some stage, KDE master may switch to relying on a development version of Qt, or may require patches to Qt for bug-fixes that have not yet been released by Qt. In this case you may need to build your own copy of Qt and it is recommended that you use the KDE clone qt-kde when this happens.

Building Qt can take a long time, so packages are preferred for a quick start.

Please see the qt-kde project page for further details. It is recommended to read README.qt-kde file for the necessary Qt configure options as well as currently known issues.

Note that you need to install Qt and Phonon from Qt and then later to install Phonon KDE from git at the same location. This will ensure you get sound in Qt-based applications as well as in KDE ones.

Easy Recipe

This recipe assumes you have set up the recommended KDE scripts, environment variables, and git configuration.

cd <your source directory>
git clone kde:qt-kde
./configure [copy/paste configure line from README.kde-qt replacing <installdir> with $QTDIR]
cmakekde

Full Recipe

This recipe assumes you are not using the recommended scripts and have properly set up your own environment.

cd <your source directory>
git clone git://anongit.kde.org/qt-kde
cd qt-kde
./configure [copy/paste configure line from README.kde-qt
nice make -j2 # use -j(X+1)' where X is your number of processor cores for faster compiles
make install

Troubleshooting

If ./configure produces errors about missing headers, run the following command before trying again: QTDIR=`pwd` bin/syncqt

Make sure which qmake delivers something out of $QTDIR, e.g. /home/kde-devel/qt-kde/bin/qmake

If you get "error: X11/Xlib.h: No such file or directory", install the devel package of xorg (the actual name may vary between operating systems, for example it is xorg-dev on Ubuntu based systems such as Kubuntu).

If you get an error in the configure step about missing defines, check the value of $QMAKESPEC. Some distributions set this to point directly to the system-installed Qt. If unset QMAKESPEC solves the problem, you probably want to add it to the ~/.bashrc script.

If you get an error ".pch/debug-shared/QtCore", this is because Qt-4.3 enables precompiled headers if your gcc supports it, but for some reason it doesn't work for you. If you use distcc, configure qt with -no-pch. If you use icecream, update to the latest icecream from svn trunk.

Try running any Qt program, like assistant.

Generating local API documentation

It's nice to have the Qt documentation locally for nice integration with KDevelop, and doing this is really quite easy (also shown in README.kde-qt):

cd $KDE_SRC/qt-kde
make docs
./config.status
make install

Note that it is necessary to do this only once, even if you rebuild Qt later.

DBusMenu

DBusMenu-Qt is a library providing a Qt implementation of the DBusMenu spec.

Please see the DBusMenu-Qt home page for more deatils.

You need json to build the tests.

Easy Recipe

This recipe assumes you have set up the recommended KDE scripts, environment variables, and git configuration.

cd <your source root directory>
git clone git://gitorious.org/dbusmenu/dbusmenu-qt.git
cd dbusmenu-qt
cmakekde

Full Recipe

This recipe assumes you are not using the recommended scripts and have properly set up your own environment.

cd <your source root directory>
git clone git://gitorious.org/dbusmenu/dbusmenu-qt.git
cd <your build root directory, or the module source dir>
mkdir <your module build dir>
cd <your module build dir>
cmake <path to your module source dir>
      \ -DCMAKE_INSTALL_PREFIX=$KDEDIR 
      \ -DCMAKE_BUILD_TYPE=debugfull
      \ -DKDE4_BUILD_TESTS=TRUE
nice make -j2 # for faster compiles use -j(X+1)' where X is your number of processor cores
make install

kdesupport

Requirements as at 2011-03-02, Stable Branch currently KDE Release 4.6, Master currently targeting KDE Release 4.7.

Package Stable Branch Requires Master Requires Devel Files Needed? Details
Automoc Yes

The kdesupport module contains a number of KDE developed and supported packages that the main KDE modules depend upon. Your distribution packages may be sufficient for these requirements when building a KDE stable branch, but master may sometimes require the latest versions of some of these to be built from source.

Most kdesupport packages have now migrated to Git as separate modules and must be built individually, although some are still left in svn and can be built as a single unit. The modules are listed below in a rough dependency order.

All the Git modules can be built using one of the the following recipes, except where noted.

Easy Recipe

This recipe assumes you have set up the recommended KDE scripts, environment variables, and git configuration.

cd <your source root directory>
git clone kde:<module>.git
cd <module>
cmakekde

Full Recipe

This recipe assumes you are not using the recommended scripts and have properly set up your own environment.

cd <your source root directory>
git clone git://anongit.kde.org/<module>.git
cd <your build root directory, or the module source dir>
mkdir <your module build dir>
cd <your module build dir>
cmake <path to your module source dir>
      \ -DCMAKE_INSTALL_PREFIX=$KDEDIR 
      \ -DCMAKE_BUILD_TYPE=debugfull
      \ -DKDE4_BUILD_TESTS=TRUE
nice make -j2 # for faster compiles use -j(X+1)' where X is your number of processor cores
make install

Automoc

Automoc is a tool to automate Qt moc file creation.

Please see the Automoc project page for details.

Automoc MUST be built first as other kdesupport modules depend on it.

Easy:  git clone kde:automoc.git
Full:  git clone git://anongit.kde.org/automoc.git

Attica

Attica is a library for accessing the Open Collaboration Services.

Please see the Attica project page for details.

Easy:  git clone kde:attica.git
Full:  git clone git://anongit.kde.org/attica.git

Polkit Qt

Polkit Qt is a library for accessing the PolKit authorization framework.

Please see the Polkit Qt project page for details.

It is recommended to have polkit >= 0.98 installed on your system, however Polkit-Qt-1 will build with any polkit-1 version.

Easy:  git clone kde:polkit-qt-1.git
Full:  git clone git://anongit.kde.org/polkit-qt-1.git

Strigi

Strigi is a library for indexing files.

Please see the Strigi project page for details.

Strigi itself has a few dependencies as well: you will need the libraries and headers for libz, libbz2, openssl (libcrypto or libssl), libclucene (>=0.9.16a but watch out: version 0.9.17 does not work), and either libxml2 or libexpat.

Easy:
  git clone kde:libstreamanalyzer 
  git clone kde:libstreams 
  git clone kde:strigi 
  git clone kde:strigiclient 
  git clone kde:strigidaemon 
  git clone kde:strigiutils 
Full:
  git clone git://anongit.kde.org/libstreamanalyzer 
  git clone git://anongit.kde.org/libstreams 
  git clone git://anongit.kde.org/strigi 
  git clone git://anongit.kde.org/strigiclient 
  git clone git://anongit.kde.org/strigidaemon 
  git clone git://anongit.kde.org/strigiutils

Soprano

Soprano is a library for storing RDF data for the Nepomuk semantic desktop.

Please see the Soprano project page for details.

Soprano must be built BEFORE Akonadi.

Easy:  git clone kde:soprano.git
Full:  git clone git://anongit.kde.org/soprano.git

Akonadi

Akonadi is a library for caching PIM data.

Please see the Akonadi project page for details.

Akonadi must be built AFTER Soprano.

Easy:  git clone kde:akonadi.git
Full:  git clone git://anongit.kde.org/akonadi.git

Cagibi

Cagibi is a cache/proxy daemon for SSDP, the discovery part of UPnP.

Please see the Cagibi project page for details.

Easy:  git clone kde:cagibi.git
Full:  git clone git://anongit.kde.org/cagibi.git

Phonon

Phonon is a sound system abstraction layer. This is usually packaged with Qt, but the Phonon version from Qt is not recent enough for KDE sound to work so you will need to build the required version yourself.

Please see the Phonon project page for details.

You need to install this Phonon in the same location as Phonon from Qt i.e. in $QTDIR and NOT in $KDEDIR.

Easy Recipe

This recipe assumes you have set up the recommended KDE scripts, environment variables, and git configuration.

cd <your source root directory>
git clone kde:phonon.git
cd phonon
cb
cmake $KDE_SRC/phonon
      \ -DCMAKE_INSTALL_PREFIX=$QTDIR 
      \ -DCMAKE_BUILD_TYPE=debugfull
      \ -DKDE4_BUILD_TESTS=TRUE
make
make install

Note that make install may require root access.

Full Recipe

This recipe assumes you are not using the recommended scripts and have properly set up your own environment.

cd <your source root directory>
git clone git://anongit.kde.org/phonon.git
cd <your build root directory, or the module source dir>
mkdir <your module build dir>
cd <your module build dir>
cmake <path to your module source dir>
      \ -DCMAKE_INSTALL_PREFIX=$QTDIR 
      \ -DCMAKE_BUILD_TYPE=debugfull
      \ -DKDE4_BUILD_TESTS=TRUE
make
make install

Backend

Building the main Phonon module is sufficient for building KDE. If you also want to play sound then you need to build a backend. Choose a suitable backend from those available below:

git clone git://anongit.kde.org/phonon-directshow.git
git clone git://anongit.kde.org/phonon-gstreamer.git
git clone git://anongit.kde.org/phonon-mmf.git
git clone git://anongit.kde.org/phonon-quicktime.git
git clone git://anongit.kde.org/phonon-waveout.git
git clone git://anongit.kde.org/phonon-xine.git

Troubleshooting

If you get an error like

designer: symbol lookup error: /path/to/kde/lib/kde4/plugins/phonon_backend/phonon_xine.so: undefined symbol: _ZN6Phonon12PulseSupport11getInstanceEv

while running Qt Designer you need to:

rm $QTDIR/lib/libphonon.so.4

kdesupport svn module

A number of kdesupport packages are still in svn:

  • oxygen-icons
  • taglib
  • taglib-extras
  • cpp2xml
  • qimageblitz - no longer required?
  • twine - for building kdebindings
  • emerge - for building kde on windows

These packages can be checked out and built together with a single recipe.

Note that QCA lives in kdesupport svn but is not built by default. It is recommended that you use your system QCA packages and only checkout the kdesupport svn version if you are going to develop QCA.

Easy Recipe

This recipe assumes you have set up the recommended KDE scripts, environment variables, and git configuration.

cd <your source root directory>
svn checkout svn://anonsvn.kde.org/home/kde/trunk/kdesupport/
cd kdesupport
cmakekde

Full Recipe

This recipe assumes you are not using the recommended scripts and have properly set up your own environment.

cd <your source root directory>
svn checkout svn://anonsvn.kde.org/home/kde/trunk/kdesupport/
cd <your build root directory, or the module source dir>
mkdir <your module build dir>
cd <your module build dir>
cmake <path to your module source dir>
      \ -DCMAKE_INSTALL_PREFIX=$KDEDIR 
      \ -DCMAKE_BUILD_TYPE=debugfull
      \ -DKDE4_BUILD_TESTS=TRUE
make 
make install

Troubleshooting

If you get

CMake Error: This project requires some variables to be set,
and cmake can not find them.
Please set the following variables:
LIBXML2_INCLUDE_DIR (ADVANCED)

you should install the development package for libxml2.

If you get

CMake Error: Could NOT find REDLAND

then you need librdf from the Redland. If your distribution does not provide the librdf package, you can download the source there: http://download.librdf.org/source/ and build it. (Gentoo users: The ebuild for librdf is named dev-libs/redland)

If you get a message related to

  target libQtTest.so not found

you may need to recompile qt-kde. This time you should take out

  -nomake demos -nomake examples

from the configure command, so that Qt generates library QtTest.

If you get

     CMake Error: Qt qmake not found!

Then:

     1) uncomment Qt section in .bashrc script (QTDIR, QT_PLUGINS_DIR,      
           PKG_CONFIG_PATH variable settings).
     2) source ~/.bashrc
     3) cd && cd qt-kde
     4) make confclean
     5) repeat steps for installing Qt (from ./configure line).
     6) retry building kdesupport

If you get

     "CMake Error: Could NOT find BZip2"

then

     sudo apt-get install libbz2-dev

or

     urpmi libbzip2_1-devel

If you get

     message that MySql support cannot be enabled

then

     you need to install corresponding devel package. (libmysqlclient-devel  for SuSe 11.1)


Shared-Desktop-Ontologies

Website: http://sourceforge.net/projects/oscaf/files/

The Recipe

cs # 'cs' is a bash function, click here to learn more
svn co https://oscaf.svn.sourceforge.net/svnroot/oscaf/trunk/ontologies
cd ontologies
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=$QTDIR -DCMAKE_BUILD_TYPE=debugfull 
make 
make install

Next Step

Once all requirements have been installed it is time to install [[../#kdelibs|kdelibs]]