(Must delete the old CMakeCache.txt before any changes to CMAKE_LIBRARY_PATH and CMAKE_INCLUDE_PATH is used) |
|||
(30 intermediate revisions by 15 users not shown) | |||
Line 1: | Line 1: | ||
− | + | ||
{{TutorialBrowser| | {{TutorialBrowser| | ||
Line 7: | Line 7: | ||
name=Building KDE4 From Source/Troubleshooting| | name=Building KDE4 From Source/Troubleshooting| | ||
− | pre=[[../|KDE | + | pre=[[../|Build KDE]]| |
− | next=[[../|KDE | + | next=[[../|Build KDE]]| |
| | | | ||
}} | }} | ||
+ | |||
+ | NOTE: This information should mostly be moved to the pages describing how to build the packages for easier reference. Only generic solutions, or solutions that are take too much space should live here. | ||
This page contains some troubleshooting tips for issues you may encounter while building kde4 from source. | This page contains some troubleshooting tips for issues you may encounter while building kde4 from source. | ||
Many of the issues listed here may be out of date. | Many of the issues listed here may be out of date. | ||
+ | |||
+ | == Methodology == | ||
+ | |||
+ | You can hit problems building KDE in any of the build steps. | ||
+ | |||
+ | When configuring KDE using CMake you may see messages about missing requirements that you need to fix. Fix the missing requirements then try configure again. You may sometimes need to delete the CMakeCache.txt file in the build directory. | ||
+ | |||
+ | If you have a problem compiling a KDE program it error may not be in the most recent output, you need to first find the exact place where the error occured by scrolling back. If it is hard to find the error message in a long output, instead of using: | ||
+ | |||
+ | make -j''n'' | ||
+ | |||
+ | use a simple | ||
+ | |||
+ | make | ||
+ | |||
+ | to stop the compile output as soon as the first error message is found. | ||
+ | |||
+ | If you do not understand the error message, use | ||
+ | |||
+ | make VERBOSE=1 | ||
+ | |||
+ | to see the compile or link command that actually failed. | ||
+ | |||
+ | When using the [[../kdesrc-build|kdesrc-build]] script you can view the kdesrc-build log files to find the build output. | ||
== Issues building kdelibs == | == Issues building kdelibs == | ||
− | If you have problems compiling kdelibs, first make sure the software in the [[Getting_Started/Build/ | + | If you have problems compiling kdelibs, first make sure the software in the [[Getting_Started/Build/Requirements|Required Software]] section above is installed and works. If you install additional software, it may be necessary to remove {{path|~/kde/src/KDE/kdelibs/CMakeCache.txt}} before trying the build again. In particular, pay attention to the requirement of kdesupport (such as the components for automoc, strigi, phonon, etc). |
Other possible hints include: | Other possible hints include: | ||
Line 38: | Line 64: | ||
* Here you need the libungif library, otherwise you will get an error message like "<tt>Could NOT find GIF</tt>". | * Here you need the libungif library, otherwise you will get an error message like "<tt>Could NOT find GIF</tt>". | ||
* Qt-4.3 upgrade: if you get a link error in kjsembed talking about QScriptEngine, edit CMakeCache.txt in kdelibs and remove the lines that talk about QT_QTUITOOLS_LIBRARY, then type make again (that static library has a new dependency, and the cmake code that adds it needs to run). | * Qt-4.3 upgrade: if you get a link error in kjsembed talking about QScriptEngine, edit CMakeCache.txt in kdelibs and remove the lines that talk about QT_QTUITOOLS_LIBRARY, then type make again (that static library has a new dependency, and the cmake code that adds it needs to run). | ||
− | * if you get < | + | * if you get <syntaxhighlight lang="text">CMake Error: KDE Requires Qt to be built with SSL support |
− | </ | + | </syntaxhighlight>, install openssl-devel, remove CMakeCache.txt and re-compile QT. |
− | * if you get < | + | * if you get <syntaxhighlight lang="text">kdelibs/kimgio/ico.cpp:188: undefined reference to `QImage::jumpTable()'</syntaxhighlight> it means you compiled Qt without Qt3 support(no, linking to a true Qt3 install won't work) |
− | * if none of the errors above match yours, you might just try a quick'n'dirty < | + | * if none of the errors above match yours, you might just try a quick'n'dirty <syntaxhighlight lang="text">make clean</syntaxhighlight> in kdelibs. |
− | * if you get "The PCRE regular expression library has not been found >=4.5 " then watch out | + | * if you get "The PCRE regular expression library has not been found >=4.5 " then watch out [[../Distributions/Debian|Recommended packages or |
remove ../.. build/kdelibs | remove ../.. build/kdelibs | ||
cs KDE/kdelibs | cs KDE/kdelibs | ||
Line 53: | Line 79: | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== Issues building kdebase == | == Issues building kdebase == | ||
If you have troubles compiling kdebase: | If you have troubles compiling kdebase: | ||
+ | * Due to a bug in building kdelibs, if you do not build your own copy of kdesupport/polkit-qt then you will get install errors in kdebase: | ||
+ | <pre> | ||
+ | -- Installing: /usr/share/polkit-1/actions/org.kde.kcontrol.kcmremotewidgets.policy | ||
+ | CMake Error at plasma/remotewidgetshelper/cmake_install.cmake:54 (FILE): | ||
+ | file INSTALL cannot copy file | ||
+ | "/home/kde-devel/kde/build/kde-runtime/plasma/remotewidgetshelper/org.kde.kcontrol.kcmremotewidgets.policy" | ||
+ | to "/usr/share/polkit-1/actions/org.kde.kcontrol.kcmremotewidgets.policy". | ||
+ | </pre> | ||
+ | To resolve this issue either install kdesupport/polkit-qt and rebuild kdelibs and kdebase (remember to remove the CMakeCache.txt), or pass an extra parm to cmake for -DKDE4_AUTH_POLICY_FILES_INSTALL_DIR=$KDEDIR/share/polkit-1/actions | ||
* XINE is needed to compile kdebase-runtime | * XINE is needed to compile kdebase-runtime | ||
* Make sure you have the <tt>libxss headers</tt> installed. (Usually you got undefined references on xscreensaver objects if you do not have those headers) | * Make sure you have the <tt>libxss headers</tt> installed. (Usually you got undefined references on xscreensaver objects if you do not have those headers) | ||
Line 100: | Line 115: | ||
Make sure you have clucene installed and clucene-devel. If necessary, get the source from sourceforge and compile it. If you have SUSE and an x64 installation, you need to make cmake aware your library path is /usr/lib64, not /usr/lib. Do this with | Make sure you have clucene installed and clucene-devel. If necessary, get the source from sourceforge and compile it. If you have SUSE and an x64 installation, you need to make cmake aware your library path is /usr/lib64, not /usr/lib. Do this with | ||
cmake -DLIB_SUFFIX=64 . | cmake -DLIB_SUFFIX=64 . | ||
+ | make sure it has been set by calling | ||
+ | ccmake . | ||
* If you get an error saying your soprano libraries are too old, but you've installed them under kdesupport, check to see if your build is using your system libraries instead. If so, then set: | * If you get an error saying your soprano libraries are too old, but you've installed them under kdesupport, check to see if your build is using your system libraries instead. If so, then set: | ||
CMAKE_LIBRARY_PATH=/home/kde-devel/kde/lib:$CMAKE_LIBRARY_PATH | CMAKE_LIBRARY_PATH=/home/kde-devel/kde/lib:$CMAKE_LIBRARY_PATH | ||
CMAKE_INCLUDE_PATH=/home/kde-devel/kde/include:$CMAKE_INCLUDE_PATH | CMAKE_INCLUDE_PATH=/home/kde-devel/kde/include:$CMAKE_INCLUDE_PATH | ||
− | and delete the CMakeCache.txt in your build directory. | + | and delete the CMakeCache.txt in your build directory. |
+ | |||
+ | * If you get such error: | ||
+ | CMake Error at workspace/plasma/scriptengines/python/cmake_install.cmake:68 | ||
+ | (FILE): | ||
+ | file INSTALL cannot copy file | ||
+ | |||
+ | "[...]/kde/source/kdebase/workspace/plasma/scriptengines/python/plasmascript.py" | ||
+ | to "/usr/lib/python2.6/site-packages/PyKDE4/plasmascript.py". | ||
+ | Call Stack (most recent call first): | ||
+ | workspace/plasma/scriptengines/cmake_install.cmake:40 (INCLUDE) | ||
+ | workspace/plasma/cmake_install.cmake:43 (INCLUDE) | ||
+ | workspace/cmake_install.cmake:62 (INCLUDE) | ||
+ | cmake_install.cmake:39 (INCLUDE) | ||
+ | |||
+ | try to set: -DPYTHON_SITE_PACKAGES_DIR=~/.local/lib/python2.6/site-packages (check that this path corresponds to something in your system, you might have a different version of python) | ||
+ | as a parameter for cmake (or cmakekde) | ||
+ | |||
+ | |||
+ | *After any error you get, be sure to delete CMakeCache.txt, so that it forces cmake to reprocess it, instead of just reading the file and not seeing changes. | ||
+ | |||
+ | *If you encounter an error somewhere along the lines of using an older version of automoc 4, and thus not being able to compile. Since this is included in kdesupport, be sure you have this built. If it still does not work after this, open your ~/.bashrc file and add the line 'export CMAKE_PREFIX_PATH=$KDEDIR'. Be sure that it is added after the declaration of $KDEDIR (something I had overlooked :D ). | ||
+ | |||
+ | == Issues building kdepimlibs == | ||
+ | If you have trouble compiling kdepimlibs: | ||
+ | * the cmakekde command may require a later version of the gpgme library. This is available from the project's web site: http://www.gnupg.org/download/index.html - please note that the build of gpgme also requires libgpg-error, also available from the same location. Both libraries are installed by the "./configure", "make" and "sudo make install" sequence, with the gpgme library configured with the additional "--with-gpg-error-prefix" parameter. You may need to overwrite your existing "/usr/bin/gpgme-config" file with the newer version for the kdepimlibs to pick up the new install. | ||
+ | * if cmake complains about missing akonadi headers, (CMake Error: Could not find Akonadi includes. or something similiar), then you lack the akonadi package which can be found in the kdesupport module. Since the kdesupport as a whole is quite large it is recommended that you selectively download the packages you need instead of fetching the entire kdesupport module.Akonadi relies on automoc, so we have to install it prior to building akonadi. The Automoc module can also be found in kdesupport. | ||
+ | |||
+ | === The Recipe for Automoc === | ||
+ | cd | ||
+ | cs | ||
+ | mkdir kdesupport && cd kdesupport | ||
+ | git clone git://anongit.kde.org/automoc | ||
+ | cd automoc | ||
+ | cmakekde | ||
+ | |||
+ | === The Recipe for Akonadi === | ||
+ | cd | ||
+ | cs | ||
+ | cd kdesupport | ||
+ | git clone git://anongit.kde.org/akonadi | ||
+ | cd akonadi | ||
+ | cmakekde | ||
+ | |||
+ | == Issues building kdebindings == | ||
+ | |||
+ | === Installing python bindings === | ||
+ | |||
+ | If you are building and installing packages as a dedicated user, you may find that the installation of the python bindings fails because it can't install the necessary files in some system-wide directories. To resolve this, execute the following code as root: | ||
+ | |||
+ | KDE_DEVEL_USER=kde-devel | ||
+ | mkdir -p /usr/share/sip/PyKDE4 | ||
+ | for dir in /usr/lib/python*; do | ||
+ | mkdir -p $dir/site-packages/PyKDE4 | ||
+ | done | ||
+ | chown $KDE_DEVEL_USER /usr/share/sip/PyKDE4 \ | ||
+ | /usr/lib/python*/site-packages/PyKDE4 | ||
+ | |||
+ | |||
+ | Note: You may need to change /usr/lib to /usr/lib64 | ||
+ | |||
+ | Note: I had to use "dist-packages" instead of "site-packages" in the above | ||
+ | |||
+ | This will allow your development user to install the files it needs to, without giving it unnecessary access to your system. | ||
== Running programs == | == Running programs == | ||
Line 130: | Line 210: | ||
=== Locked sessions === | === Locked sessions === | ||
− | When installing KDE 4 as a user, one | + | When installing KDE 4 as a user, one may be not able to unlock a locked session, depending on the system configuration. |
− | + | ||
− | + | ||
− | + | ||
− | + | If the problem are insufficient permissions of the kcheckpass binary, the fix is to run this: | |
+ | <syntaxhighlight lang="text"> | ||
+ | chown root.root $KDEDIR/lib/kde4/libexec/kcheckpass | ||
+ | chmod 4755 $KDEDIR/lib/kde4/libexec/kcheckpass | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | Alternatively, if KDE is built with PAM (libpam-dev is installed while configuring kdebase), the problem may be a missing PAM service definition ("kde" by default) in the /etc/pam.d/ folder. The simplest fix is running "make install" in kdebase/workspace/ as root. Alternatively, one can copy the "login" service and possibly adjust it. | ||
For example for RH/Fedora based distros: | For example for RH/Fedora based distros: | ||
− | < | + | <syntaxhighlight lang="text"> |
− | + | #%PAM-1.0 | |
− | + | auth include system-auth | |
− | + | account include system-auth | |
− | + | password include system-auth | |
− | + | session include system-auth | |
− | </ | + | </syntaxhighlight> |
− | while for debian/Kubuntu | + | while for debian/Kubuntu: |
− | < | + | <syntaxhighlight lang="text"> |
# Standard Un*x authentication. | # Standard Un*x authentication. | ||
@include common-auth | @include common-auth | ||
Line 153: | Line 236: | ||
@include common-session | @include common-session | ||
@include common-password | @include common-password | ||
− | </ | + | </syntaxhighlight> |
+ | |||
+ | ==Some other common problems== | ||
+ | |||
+ | ===Can't find X includes=== | ||
+ | X headers like '''X.h''' are missing. They usually reside in '''/usr/include/X11/''' or similar. Your distribution may contain them in a seperate package like '''X-devel'''. If the files are simply installed in a non-standard directory see '''configure --help'''. | ||
+ | |||
+ | ===cannot find -lXext=== | ||
+ | When using SuSE, install xdevel from SuSE's "X" Series in YaST. On Caldera, Mandrake and Redhat the package is named XFree86-devel. | ||
+ | |||
+ | ===configure in kdesupport gives: Header string not found=== | ||
+ | Install libstdc++-devel. | ||
+ | |||
+ | ===Qt [....] not found.=== | ||
+ | Do you have the currently required Qt library installed ? See "How to get the latest sources". Make sure that QTDIR is pointing to the correct location. | ||
+ | |||
+ | |||
+ | === Solaris === | ||
+ | If you are using Solaris 2.6 and want to compile KDE as a normal user, please see [http://developer.kde.org/build/solariscompile.html this document] first. | ||
+ | |||
+ | ===(Solaris) ANSI C++ forbids declaration `XSetTransientForHint' with no type=== | ||
+ | Well it's not new but better put it somewhere. Solaris X headers are buggy. They declare functions with no return type (assuming it defaults to int). You can get around by setting '''CXXFLAGS="-fpermissive"''' before '''./configure''' to let g++ be okay with that. | ||
+ | |||
+ | ===(BSD) Shared libraries are not correctly built, konqueror crashes with "Undefined symbol __eh_rtime_match"=== | ||
+ | Set '''LIBS="-lgcc -lstdc++ -Wl,-export-dynamic"''' while running configure, for all modules. | ||
+ | |||
+ | === 'Gslice' crash messages after KDE has been built with --enable-fast-malloc=full === | ||
+ | If you are using a recent version of Glib (version >= 2.9.1) and have built kdelibs using the configure option '''--enable-fast-malloc=full''', you are likely to see aRts related crashes which output an error message on the terminal: | ||
+ | |||
+ | ***MEMORY-ERROR***: [xxxx]: GSlice: failed to allocate 248 bytes (alignment: 256): Invalid argument | ||
+ | |||
+ | This is due to a clash in the way that arts/kdelibs and Glib handle memory allocation. There are two alternative solutions to this: one is to not use --'''enable-fast-malloc=full'''; the other is to set an environment variable for the KDE session | ||
+ | |||
+ | G_SLICE=always-malloc |
NOTE: This information should mostly be moved to the pages describing how to build the packages for easier reference. Only generic solutions, or solutions that are take too much space should live here.
This page contains some troubleshooting tips for issues you may encounter while building kde4 from source.
Many of the issues listed here may be out of date.
You can hit problems building KDE in any of the build steps.
When configuring KDE using CMake you may see messages about missing requirements that you need to fix. Fix the missing requirements then try configure again. You may sometimes need to delete the CMakeCache.txt file in the build directory.
If you have a problem compiling a KDE program it error may not be in the most recent output, you need to first find the exact place where the error occured by scrolling back. If it is hard to find the error message in a long output, instead of using:
make -jn
use a simple
make
to stop the compile output as soon as the first error message is found.
If you do not understand the error message, use
make VERBOSE=1
to see the compile or link command that actually failed.
When using the kdesrc-build script you can view the kdesrc-build log files to find the build output.
If you have problems compiling kdelibs, first make sure the software in the Required Software section above is installed and works. If you install additional software, it may be necessary to remove ~/kde/src/KDE/kdelibs/CMakeCache.txt before trying the build again. In particular, pay attention to the requirement of kdesupport (such as the components for automoc, strigi, phonon, etc).
Other possible hints include:
If cmakekde still gives the same error then try this
cd cmake -DCMAKE_INSTALL_PREFIX=$KDEDIR \ -DCMAKE_BUILD_TYPE=debugfull \ -DKDE4_BUILD_TESTS=ON \ ~/kde/src/KDE/kdelibs make make install
update-alternatives --config qmake
CMake Error: KDE Requires Qt to be built with SSL support
kdelibs/kimgio/ico.cpp:188: undefined reference to `QImage::jumpTable()'
make clean
remove ../.. build/kdelibs cs KDE/kdelibs cmakekde
/Depot/Temp/kdelibs-4.0.2/kdecore/kde-config.cpp:197: undefined reference to `KConfigGroup::readPathEntry(char const*, QString const&) const' and kde-config.cpp:66: undefined reference to `ki18n(char const*)'? Seems to happen with some localization stuff
If you have troubles compiling kdebase:
-- Installing: /usr/share/polkit-1/actions/org.kde.kcontrol.kcmremotewidgets.policy CMake Error at plasma/remotewidgetshelper/cmake_install.cmake:54 (FILE): file INSTALL cannot copy file "/home/kde-devel/kde/build/kde-runtime/plasma/remotewidgetshelper/org.kde.kcontrol.kcmremotewidgets.policy" to "/usr/share/polkit-1/actions/org.kde.kcontrol.kcmremotewidgets.policy".
To resolve this issue either install kdesupport/polkit-qt and rebuild kdelibs and kdebase (remember to remove the CMakeCache.txt), or pass an extra parm to cmake for -DKDE4_AUTH_POLICY_FILES_INSTALL_DIR=$KDEDIR/share/polkit-1/actions
Please set the following variables: CLUCENE_LIBRARY_DIR (ADVANCED)
Make sure you have clucene installed and clucene-devel. If necessary, get the source from sourceforge and compile it. If you have SUSE and an x64 installation, you need to make cmake aware your library path is /usr/lib64, not /usr/lib. Do this with
cmake -DLIB_SUFFIX=64 .
make sure it has been set by calling
ccmake .
CMAKE_LIBRARY_PATH=/home/kde-devel/kde/lib:$CMAKE_LIBRARY_PATH CMAKE_INCLUDE_PATH=/home/kde-devel/kde/include:$CMAKE_INCLUDE_PATH
and delete the CMakeCache.txt in your build directory.
CMake Error at workspace/plasma/scriptengines/python/cmake_install.cmake:68 (FILE):
file INSTALL cannot copy file
"[...]/kde/source/kdebase/workspace/plasma/scriptengines/python/plasmascript.py"
to "/usr/lib/python2.6/site-packages/PyKDE4/plasmascript.py".
Call Stack (most recent call first):
workspace/plasma/scriptengines/cmake_install.cmake:40 (INCLUDE) workspace/plasma/cmake_install.cmake:43 (INCLUDE) workspace/cmake_install.cmake:62 (INCLUDE) cmake_install.cmake:39 (INCLUDE)
try to set: -DPYTHON_SITE_PACKAGES_DIR=~/.local/lib/python2.6/site-packages (check that this path corresponds to something in your system, you might have a different version of python) as a parameter for cmake (or cmakekde)
If you have trouble compiling kdepimlibs:
cd cs mkdir kdesupport && cd kdesupport git clone git://anongit.kde.org/automoc cd automoc cmakekde
cd cs cd kdesupport git clone git://anongit.kde.org/akonadi cd akonadi cmakekde
If you are building and installing packages as a dedicated user, you may find that the installation of the python bindings fails because it can't install the necessary files in some system-wide directories. To resolve this, execute the following code as root:
KDE_DEVEL_USER=kde-devel mkdir -p /usr/share/sip/PyKDE4 for dir in /usr/lib/python*; do mkdir -p $dir/site-packages/PyKDE4 done chown $KDE_DEVEL_USER /usr/share/sip/PyKDE4 \ /usr/lib/python*/site-packages/PyKDE4
Note: You may need to change /usr/lib to /usr/lib64
Note: I had to use "dist-packages" instead of "site-packages" in the above
This will allow your development user to install the files it needs to, without giving it unnecessary access to your system.
KUniqueApplication: Cannot find the D-Bus session server
make sure you can access the display, e.g. type
xclock
then a clock must appear on the screen. If it does and the error persists, start your shell using
dbus-launch xterm
and start your program in there.
Error: standard icon theme "oxygen" not found! ASSERT: "!isEmpty()" in file /home/kde-devel/qt-copy/include/QtCore/../../src/corelib/tools/qlist.h, line 245 Aborted (core dumped)
You need to install kdebase - see above. It is enough to install the "runtime" directory from kdebase.
What can happen over time, after some svn up commands, is that some of the tools used in the KDE build chain change their output format. For example, kcfg files are read by kconfig_compiler to produce configuration dialogs. CMake cannot detect those changes, and the compilation might fail. A workaround is to always force a re-generation of all such files:
find $KDE_SRC/KDE/kdebase -name "*.kcfg" | xargs touch
The same applies to ui files as produced by Qt designer.
When installing KDE 4 as a user, one may be not able to unlock a locked session, depending on the system configuration.
If the problem are insufficient permissions of the kcheckpass binary, the fix is to run this:
chown root.root $KDEDIR/lib/kde4/libexec/kcheckpass
chmod 4755 $KDEDIR/lib/kde4/libexec/kcheckpass
Alternatively, if KDE is built with PAM (libpam-dev is installed while configuring kdebase), the problem may be a missing PAM service definition ("kde" by default) in the /etc/pam.d/ folder. The simplest fix is running "make install" in kdebase/workspace/ as root. Alternatively, one can copy the "login" service and possibly adjust it.
For example for RH/Fedora based distros:
#%PAM-1.0
auth include system-auth
account include system-auth
password include system-auth
session include system-auth
while for debian/Kubuntu:
# Standard Un*x authentication.
@include common-auth
@include common-account
@include common-session
@include common-password
X headers like X.h are missing. They usually reside in /usr/include/X11/ or similar. Your distribution may contain them in a seperate package like X-devel. If the files are simply installed in a non-standard directory see configure --help.
When using SuSE, install xdevel from SuSE's "X" Series in YaST. On Caldera, Mandrake and Redhat the package is named XFree86-devel.
Install libstdc++-devel.
Do you have the currently required Qt library installed ? See "How to get the latest sources". Make sure that QTDIR is pointing to the correct location.
If you are using Solaris 2.6 and want to compile KDE as a normal user, please see this document first.
Well it's not new but better put it somewhere. Solaris X headers are buggy. They declare functions with no return type (assuming it defaults to int). You can get around by setting CXXFLAGS="-fpermissive" before ./configure to let g++ be okay with that.
Set LIBS="-lgcc -lstdc++ -Wl,-export-dynamic" while running configure, for all modules.
If you are using a recent version of Glib (version >= 2.9.1) and have built kdelibs using the configure option --enable-fast-malloc=full, you are likely to see aRts related crashes which output an error message on the terminal:
***MEMORY-ERROR***: [xxxx]: GSlice: failed to allocate 248 bytes (alignment: 256): Invalid argument
This is due to a clash in the way that arts/kdelibs and Glib handle memory allocation. There are two alternative solutions to this: one is to not use --enable-fast-malloc=full; the other is to set an environment variable for the KDE session
G_SLICE=always-malloc