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

From KDE TechBase
m (Add link back to compiling kdelibs)
m (Reverted edits by KennethMartinez (talk) to last revision by AnneW)
 
(215 intermediate revisions by 30 users not shown)
Line 1: Line 1:
{{Template:I18n/Language Navigation Bar|Getting_Started/Build/KDE4}}
__NOINDEX__
{{warning|This page is yet to be reviewed for changes required by the migration to Git.  Information and commands on this page may no longer be valid and should be used with care. Please see the [[Development/Git|KDE Git hub page]] for more details. }}
 
 


{{TutorialBrowser|
{{TutorialBrowser|
Line 5: Line 8:
series=Getting Started|
series=Getting Started|


name=Building KDE4 From Source|
name=Building KDE4 From Source/Requirements|


pre=[[../|KDE SVN Quickstart Guide]]|
pre=[[Getting_Started|Getting Started]]|


next=[[../|KDE SVN Quickstart Guide]]|
next=[[Getting_Started/Build/Qt|Qt]]|
|
|
}}
}}


== Introduction ==


== D-Bus ==
This page details the software requirements that need to be installed on your system before you can start building KDE Software.  For most of these requirements it is preferable to use your distribution supplied packages, however in some case you will need to build some requirements yourself and this page will also explain how to do so.
QtDBus and KDE are known to work with D-Bus versions 0.62, as well as 0.92 and upwards. Versions 0.60 and 0.61 may work too but are not tested. Versions 0.90 and 0.91 are known not to work. We recommend using post-1.0 release versions (at least 0.94), so consider upgrading if you haven't done so.


You may skip this section if you have a recent D-Bus version or if you don't want to upgrade. You probably want to skip building the bindings until/unless you know you will be building HAL (see below).
=== Required Steps ===


Before running these steps in the recipe, make sure your X11 headers and libraries are available. The configure script run on line 5 of the following instructions should output:
You need to have completed the following steps:
Building X11 code:        yes
* Set up your [[../Environment|Build Environment]]
* Selected your [[../Recipes|Build Recipes]]


=== The Recipe ===
== Definitions ==


{{tip|Make sure you did set up your environment correctly as described [[Getting_Started/Build/KDE4#Setting_up_the_environment|above]]. This is necessary for the <tt>cs</tt> and <tt>cb</tt> functions to work.}}
The Build Requirements for each Module will be documented in a common table format as follows:


cs # [[Getting_Started/Increased_Productivity_in_KDE4_with_Scripts/.bashrc|'cs' is a bash function, click here to learn more]]
{| border="1" cellpadding="5" cellspacing="0"
wget http://dbus.freedesktop.org/releases/dbus/dbus-1.0.2.tar.gz
|+ '''Build Requirements'''
tar -xvzf dbus-1.0.2.tar.gz
|-
cd dbus-1.0.2/
! width="20%" style="background-color:#EFEFEF;" | Requirement
./configure --prefix=$DBUSDIR --localstatedir=/var
! width="15%" style="background-color:#EFEFEF;" | Stable Requires
make
! width="15%" style="background-color:#EFEFEF;" | Unstable Requires
sudo make install
! width="10%" style="background-color:#EFEFEF;" | Devel Pkgs?
sudo dbus-uuidgen --ensure
! width="40%" style="background-color:#EFEFEF;" | Details
|-
| [http://en.wikipedia.org/wiki/Foobar Foobar]
| style="background-color:#FF6666" | >= 2.0
| style="background-color:#66FF66" | >= 1.0
| Yes
| A library to enable KDE Software to foo your bar.
|}


cs # see above
The fields in this table are defined as follows:
wget http://dbus.freedesktop.org/releases/dbus-glib/dbus-glib-0.74.tar.gz
tar -xvzf dbus-glib-0.74.tar.gz
cd dbus-glib-0.74/
./configure --prefix=$DBUSDIR
make
sudo make install
cd
sudo chown -R kde-devel:kde-devel *


=== What's Happening ===  
{| border="1" cellpadding="5" cellspacing="0"
After changing into the source directory (line 1), D-Bus source code is downloaded from freedesktop.org (line 2) and unpacked (line 3). After going into the newly created D-Bus directory (line 4), the build is set up using the supplied {{path|configure}} script (line 5). After building (line 6) and installing (line 7) D-Bus, we use the <tt>dbus-uuidgen</tt> tool to install a machine identification file that allows the bus to start automatically when the desktop session starts (line 8).
|-
| width="30%" style="background-color:#EFEFEF;" | '''Requirement'''
| width="70%" | The project that KDE Software depends on, including a link to the Project home page.]
|-
| style="background-color:#EFEFEF;" | '''Stable Requires'''
| The version of the Project that the current Stable KDE Release requires.  The background color indicates if the requirement is optional (green) or mandatory (red). Stable is currently KDE Release 4.6.
|-
| style="background-color:#EFEFEF;" | '''Unstable Requires'''
| The version of the Project that the current Unstable development version requires.  The background color indicates if the requirement is optional (green) or mandatory (red).  Unstable is currently targeting KDE Release 4.7.
|-
| style="background-color:#EFEFEF;" | '''Devel Pkgs?'''
| If installing from distribution packages, whether you also need to install the -devel packages.
|-
| style="background-color:#EFEFEF;" | '''Details'''
| More information about the Project and the requirement
|}


Note that you need write access to {{path|/var}} for the last two steps. If your system does not have the sudo command, you can use the <tt>su</tt> command instead, e.g. <tt>su -c "make install"</tt>.
== System Prerequisites ==


The steps for building the glib bindings are similar to the above.
TODO: Complete updating this list


When these two packages are done building, we must fix the file ownership because 'sudo make install' has created root owned files and directories in ~kde-devel/kde.
All of these packages should be installed from your distribution.  If you cannot meet these requirements from your distribution, it is recommended to either update to a more recent distribution or to build KDE in a virtual machine.


=== Troubleshooting ===
Requirements as at 2011-03-02.
If you get the error:
"configure: error: DBus development libraries not found"
do this:
export PKG_CONFIG_PATH=/lib/pkgconfig/


== CMake ==
{| border="1" cellpadding="5" cellspacing="0"
Skip this if you have [http://cmake.org/ CMake] >=2.4.5 installed.  
|+ '''KDE Software Build Requirements'''
You should be able to directly use the binary packages available on the [http://www.cmake.org/HTML/Download.html CMake site]. There are also distribution specific packages available.
|-
 
! width="20%" style="background-color:#EFEFEF;" | Requirement
=== The Recipe ===
! width="15%" style="background-color:#EFEFEF;" | Stable Requires
<!--'cs' and 'cb' are NOT typos!-->
! width="15%" style="background-color:#EFEFEF;" | Unstable Requires
! width="10%" style="background-color:#EFEFEF;" | Devel Pkgs?
cs # [[Getting_Started/Increased_Productivity_in_KDE4_with_Scripts/.bashrc|'cs' is a bash function, click Here to learn more]]
! width="40%" style="background-color:#EFEFEF;" | Details
wget http://www.cmake.org/files/v2.4/cmake-2.4.6.tar.gz
|-
tar -zxf cmake-2.4.6.tar.gz
| GCC / G++
mkdir cmake-build
| style="background-color:#FF6666" | >= 4.2
cd cmake-build
| style="background-color:#FF6666" | >= 4.2
../cmake-2.4.6/bootstrap
| No
make
|
sudo make install
|-
 
| [http://git-scm.com/ Git]
=== What's Happening ===
| style="background-color:#66FF66" |
First, we go back to the <tt>kde-devel</tt> user's source directory (line 1), get the CMake sources (line 2) and unpack them (line 3). We create a directory to build CMake in (line 4) and go into it (line 5). We then run the CMake bootstrap script to set up the CMake build (line 6), then make (line 7) and install it (line 8) using the root user.
| style="background-color:#66FF66" |
 
| No
If your system does not have the <tt>sudo</tt> command, you can instead do <tt>su -c "make install"</tt>.
| Revision control software, required for development builds.
 
|-
== Qt ==
| [http://subversion.apache.org/ Subversion]
Next we need to get Qt4. KDE is guaranteed to build against any Qt 4.3. Qt 4.2 and earlier are not supported and will not work.
| style="background-color:#66FF66" |
 
| style="background-color:#66FF66" |
If your distribution has a recent version of Qt4, that should work. Most distros backport bugfixes, and some distros, like Debian or openSUSE, even use the patches from KDE svn. In other cases, using the recipe below will give you a more stable Qt than your distro. Refer to the distribution specific sections above for more information.  
| No
 
| Revision control software, required for development builds.
As for now Qt3 compatibility layer in Qt 4 is mandatory, so please <b>avoid</b> using "-no-qt3support" option when building Qt4 from sources.
|-
 
| [http://pkg-config.freedesktop.org/wiki/ pkg-config]
=== The Recipe ===
| >=
cd # Note: qt-copy lives in $HOME/qt-copy. See $QTDIR in [[Getting_Started/Increased_Productivity_in_KDE4_with_Scripts/.bashrc|<font color=red>.bashrc</font>]]
| >=
svn checkout svn://anonsvn.kde.org/home/kde/trunk/qt-copy
| No
cd qt-copy
|
./apply_patches
|-
./configure -nomake examples -nomake demos -qt-gif \
| [http://cmake.org/HTML/index.html CMake]
-no-exceptions -debug -fast -prefix $QTDIR
| style="background-color:#FF6666" | >= 2.6.4
make -j2
| style="background-color:#FF6666" | >= 2.6.4
 
| No
# if we don't install, we'll just clear obj files to
| Build configuration tool
# save disk space
|-
if [ $QTDIR = `pwd` ]; then \
| [http://www.freedesktop.org/wiki/Software/dbus DBus]
find . -name '*.o' -delete ; \
| style="background-color:#FF6666" | >= 1.4.0
else make install; fi;
| style="background-color:#FF6666" | >= 1.4.0
 
| Yes
=== What's Happening ===
| Also dbus-glib
We switch back to the <tt>kde-devel</tt> user's home directory (line 1) and download the source code using subversion (svn) from KDE's repository (line 2). After changing into the resulting {{path|qt-copy}} directory (line 3), we run a script that manages the patches that come with <tt>qt-copy</tt> (line 4).
|-
 
| [http://www.x.org/wiki/ X11]
Once the patches have been applied, we then set up the build using the <tt>configure</tt> script (line 5-6). The various command line options used are explained in the {{path|qt-copy/README.qt-copy}} file. Finally, we build the minimal requirements for KDE (line 7) and install (line 10) Qt. If install dir is the same as the current dir (line 8), then we just free some space (line 9) instead. If you want all the example and demo applications, you can either build them individually or simply do a <tt>make</tt> from the {{path|qt-copy}} directory.
| >=
 
| >=  
Note that the installation does not require root as it installs Qt locally into {{path|$QTDIR}}. Anyway, installation is only needed if {{path|$QTDIR}} differs from {{path|$HOME/qt-copy}}, which is not the case if you have exactly followed the instructions.
| Yes
 
|
=== Troubleshooting ===
|-
If you get "error: X11/Xlib.h: No such file or directory", install the devel package of <tt>xorg</tt> (the actual name may vary between operating systems, for example it is <tt>xorg-dev</tt> on Ubuntu based systems such as Kubuntu).  
| [http://www.mesa3d.org/ Mesa]
 
| >=
If you get an error in the configure step about missing defines, check the value of <tt>$QMAKESPEC</tt>.  Some distributions set this to point directly to the system-installed Qt.  If <tt>unset QMAKESPEC</tt> solves the problem, you probably want to add it to the <tt>~/.bashrc</tt> script.
| >=
 
| Yes
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.
| mesa-common-dev and libglu1-mesa-dev
 
|-
Try running any Qt program, like {{program|assistant}}. '''Note:''' You may need to run <tt>xhost +local:kde-devel</tt> as your regular kde3 user to run this application.  If it crashes in QSpanData::adjustSpanMethods, then your problem is the oxygen style. Try removing {{path|lib/kde4/plugins/styles/kstyle-oxygen.so}} and {{path|lib/kde4/plugins/styles/oxygen.so}} if they exist in the KDE install prefix.
| [http://www.ijg.org/ libjpeg]
 
| >=  
== HAL ==
| >=
 
| Yes
{{tip|You can use qdbusviewer to see if you have org.freedesktop.hal. If not, you might need a newer version of hal. If you have org.freedesktop.hal, you probably don't need to, and don't ''want'' to, roll your own HAL.}}
|
 
|-
If your system requires you to build a newer version of HAL, there's a decent chance you'll need to build other stuff as well, some of which may not be straight forward. Since this should only be required for older distros, instructions are on [[Getting_Started/Build/HAL| a separate page]].
| [http://www.libpng.org/pub/png/libpng.html libpng]
 
| >=
== kdesupport ==
| >=
 
| Yes
{{warning|Don't forget to read the [[Getting_Started/Build/KDE4#Setting_up_the_environment|Setting Up The Environment]] section first.}}
|
 
|-
There are several libraries that KDE applications rely on in the kdesupport module. This includes Strigi and Soprano for file metadata and search, QImageBlitz for image manipulation needed in kdebase, eigen for visual effects in applications such as Kalzium, taglib for music players and qca for some cryptographic needs.  
| [http://sourceforge.net/projects/giflib/ libungif]
 
| >=
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.
| >=
 
| Yes
Please remember that if you use openSUSE, you can install the needed packages from the KDE:KDE4 buildservice repository and do not have to bother with fiddling the details below. Skip to the kdelibs section.
|
|-
| [http://download.librdf.org/source/ librdf]
| >=
| >=
| Yes
|
|-
| [http://bzip.org/ libbz2]
| >=
| >=
| Yes
|
|-
| [http://xmlsoft.org/ libxml2]
| >=
| >=
| Yes
|  
|-
| [http://xmlsoft.org/xslt/ libxslt]
| >=
| >=  
| Yes
|
|-
| [http://boost.org/ Boost]
| >=
| >=
| Yes
|
|-
| [http://www.mysql.com/ libmysqlclient]
| >=
| >=
| Yes
|
|-
| [http://freedesktop.org/wiki/Software/shared-mime-info shared-mime-info]
| >=
| >=
| Yes
|
|-
| [http://sourceforge.net/projects/oscaf/files/ Shared-Desktop-Ontologies]
| >=
| >=
| No
|
|-
| [http://docbook.org/schemas/4x.html DocBook XML DTD's]
| >= 4.2
| >= 4.2
| No
| Required for the KDE documentation and help
|-
| [http://wiki.docbook.org/topic/DocBookXslStylesheets DocBook XSl Stylesheets]
| >= 4.2
| >= 4.2
| No
| Required for the KDE documentation and help
|}


=== The Recipe ===
=== Hardware Libraries ===
<!--'cs' and 'cb' are NOT typos!-->
HAL (Hardware Abstraction Layer) is required by KDE 4.5 and earlier for interfacing with your hardwareYour distribution supplied packages should be sufficient for this.   
cs # [[Getting_Started/Increased_Productivity_in_KDE4_with_Scripts/.bashrc|'cs' is a bash function, click here to learn more]]
  svn checkout svn://anonsvn.kde.org/home/kde/trunk/kdesupport/
cd kdesupport
  cmakekde


=== What's Happening ===
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.
We change to the base source directory (line 1). We download the sources in kdesupport using subversion (line 2), go into the new {{path|~/kde/src/kdesupport}} directory (line 3), and commence the build (line 4). This will leave us in the kdesupport build directory after the build is completed.


=== Troubleshooting ===
=== Distributions ===
If you get
  cmakekde: command not found
then you have to go manually into the kdesupport directory in ~ and execute the command cmakekde. if this still doesn't work, then something is wrong with your bashrc.


If you get
Many distributions provide shortcut meta-packages or install commands to simplify installing all the KDE requirementsCheck the [[Getting_Started/Build/Distributions|Distributions page]] first to see if your distribution provides a simple way to install the requirements.
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
== Shared-Desktop-Ontologies ==
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/ http://download.librdf.org/source/] and build it.
(Gentoo users: The ebuild for librdf is named dev-libs/redland)


If you get
The Ontologies are a shared resource required for the semantic desktop.
Fetching external item into 'kdesupport/admin'
Error validating server certificate for 'https://...'
see [http://techbase.kde.org/Getting_Started/Sources/Using_Subversion_with_KDE Using Subversion with KDE]


If you get
{| border="1" cellpadding="5" cellspacing="0"
FILE cannot create directory: /usr/lib[64]/qt4/plugins/crypto. Maybe need administrative privileges.
|+ '''KDE Software Build Requirements'''
|-
make: *** [install] Error 255
! width="20%" style="background-color:#EFEFEF;" | Requirement
take a second look in the .bashrc file described above, are paths correct?  ($QTDIR and $PATH are used to get the QT installation path)
! width="15%" style="background-color:#EFEFEF;" | Stable Requires
Alternatively, you may see this error if you decided to use a distribution installed version of qt4 and skipped the Qt install above.  Either install qt-copy as describe above, or "sudo make install". If you use "sudo make install", make sure that you change the ownership back to your user for some of the ~/kde subdirectories that were effected by using sudo (ie. "<tt>sudo chown -R kde-devel:kde-devel ~/kde</tt>").
! width="15%" style="background-color:#EFEFEF;" | Unstable Requires
! width="10%" style="background-color:#EFEFEF;" | Devel Pkgs?
! width="40%" style="background-color:#EFEFEF;" | Details
|-
| [http://sourceforge.net/projects/oscaf/ Shared-Desktop-Ontologies]
| >=
| >= 0.7
| No
|
|}


If you get a message related to
Your distribution packages should be sufficient for this package but some older distributions may not have them so you may need to build them yourself using either the Easy Recipe or Full Recipe.
  target libQtTest.so not found
you may need to recompile qt-copy. This time you should take out
  -nomake demos -nomake examples
from the configure command, so that Qt generates library QtTest.


To obtain the source you can either download a tarball from the website or use the following git command:


If you get
git clone git://oscaf.git.sourceforge.net/gitroot/oscaf/shared-desktop-ontologies
      "CMake Error: Could NOT find BZip2"
then
      sudo apt-get install libbz2-dev


== Next Step ==
== Next Step ==
Once all requirements have been installed it is time to install [[../#kdelibs|kdelibs]]
Once all requirements have been installed it is time to install [[Getting_Started/Build/Qt|Qt]]

Latest revision as of 15:53, 31 July 2012

Warning
This page is yet to be reviewed for changes required by the migration to Git. Information and commands on this page may no longer be valid and should be used with care. Please see the KDE Git hub page for more details.



Building KDE4 From Source/Requirements
Tutorial Series   Getting Started
Previous   Getting Started
What's Next   Qt
Further Reading   n/a

Introduction

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

Required Steps

You need to have completed the following steps:

  • Set up your [[../Environment|Build Environment]]
  • Selected your [[../Recipes|Build Recipes]]

Definitions

The Build Requirements for each Module will be documented in a common table format as follows:

Build Requirements
Requirement Stable Requires Unstable Requires Devel Pkgs? Details
Foobar >= 2.0 >= 1.0 Yes A library to enable KDE Software to foo your bar.

The fields in this table are defined as follows:

Requirement The project that KDE Software depends on, including a link to the Project home page.]
Stable Requires The version of the Project that the current Stable KDE Release requires. The background color indicates if the requirement is optional (green) or mandatory (red). Stable is currently KDE Release 4.6.
Unstable Requires The version of the Project that the current Unstable development version requires. The background color indicates if the requirement is optional (green) or mandatory (red). Unstable is currently targeting KDE Release 4.7.
Devel Pkgs? If installing from distribution packages, whether you also need to install the -devel packages.
Details More information about the Project and the requirement

System Prerequisites

TODO: Complete updating this list

All of these packages should be installed from your distribution. If you cannot meet these requirements from your distribution, it is recommended to either update to a more recent distribution or to build KDE in a virtual machine.

Requirements as at 2011-03-02.

KDE Software Build Requirements
Requirement Stable Requires Unstable Requires Devel Pkgs? Details
GCC / G++ >= 4.2 >= 4.2 No
Git No Revision control software, required for development builds.
Subversion No Revision control software, required for development builds.
pkg-config >= >= No
CMake >= 2.6.4 >= 2.6.4 No Build configuration tool
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
libbz2 >= >= Yes
libxml2 >= >= Yes
libxslt >= >= Yes
Boost >= >= Yes
libmysqlclient >= >= Yes
shared-mime-info >= >= Yes
Shared-Desktop-Ontologies >= >= No
DocBook XML DTD's >= 4.2 >= 4.2 No Required for the KDE documentation and help
DocBook XSl Stylesheets >= 4.2 >= 4.2 No Required for the KDE documentation and help

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.

Distributions

Many distributions provide shortcut meta-packages or install commands to simplify installing all the KDE requirements. Check the Distributions page first to see if your distribution provides a simple way to install the requirements.

Shared-Desktop-Ontologies

The Ontologies are a shared resource required for the semantic desktop.

KDE Software Build Requirements
Requirement Stable Requires Unstable Requires Devel Pkgs? Details
Shared-Desktop-Ontologies >= >= 0.7 No

Your distribution packages should be sufficient for this package but some older distributions may not have them so you may need to build them yourself using either the Easy Recipe or Full Recipe.

To obtain the source you can either download a tarball from the website or use the following git command:

git clone git://oscaf.git.sourceforge.net/gitroot/oscaf/shared-desktop-ontologies

Next Step

Once all requirements have been installed it is time to install Qt