https://community.kde.org/api.php?action=feedcontributions&user=David2&feedformat=atomKDE Community Wiki - User contributions [en]2024-03-29T08:19:08ZUser contributionsMediaWiki 1.40.2https://community.kde.org/index.php?title=Krita/Sprint2020&diff=87349Krita/Sprint20202020-01-21T17:53:22Z<p>David2: Add D.Revoy to the table; early planing for the journey.</p>
<hr />
<div>= 2020 Krita Sprint =<br />
<br />
The 2020 Krita Sprint (or KritaCon) will be held in Rennes, France, in the venue of ActivDesign, 11, bis rue Jean le Hô, Rennes. The sprint will take place right after the [https://libregraphicsmeeting.org/2020/en/index.html Libre Graphics Meeting].<br />
<br />
<br />
= Blogs =<br />
<br />
= Dates = <br />
<br />
LGM: 26-29 May<br />
Sprint: 30 May to 5 June (that is the departure day, not a work day)<br />
<br />
== Reimbursements ==<br />
<br />
As soon as possible, go to:<br />
<br />
https://reimbursements.kde.org/<br />
<br />
* You only need to ask for reimbursment for your travel costs. Accomodation will be handled by Boudewijn.<br />
* KDE e.V. reimburses, not pre-imburses. If that is a problem, the Krita Foundation can help out.<br />
<br />
Use LGM for the reimbursement event.<br />
<br />
== Agenda==<br />
*<br />
<br />
==Attendance==<br />
<br />
Please put your name below if you're coming along with arrival and leave dates<br />
<br />
{| class="wikitable"<br />
|-<br />
! Name<br />
! Arrival<br />
! Leaving<br />
!EstimatedTravel Costs<br />
!tee size<br />
!Notes<br />
|-<br />
| Boudewijn Rempt<br />
| May 25<br />
| June 5<br />
| .<br />
| XL<br />
| Will travel by train<br />
|-<br />
|-<br />
| Kuntal Majumder<br />
| May 23<br />
| TBD<br />
| 700 EUR<br />
| XS<br />
| Will visit deventer first<br />
|-<br />
|-<br />
| Rebecca Breu<br />
| May 25<br />
| June 5<br />
| -<br />
| M<br />
| -<br />
|-<br />
| Wolthera<br />
| May 25<br />
| June 5<br />
| 50~<br />
| M<br />
| Will also visit deventer first.<br />
|-<br />
|-<br />
| David Revoy<br />
| May 28<br />
| May 31<br />
| 200 EUR<br />
| XXL<br />
| -<br />
|-<br />
}</div>David2https://community.kde.org/index.php?title=Krita/Sprint2019&diff=83090Krita/Sprint20192019-02-25T13:21:40Z<p>David2: adding my profile to the table</p>
<hr />
<div>= 2019 Krita Sprint =<br />
<br />
Proposed dates: August 6 to 9 (note: arriving a day early and leaving a day late is fine, there's room for flexibility, but these are the core dates).<br />
<br />
This is a general meet-up, not like the October 2018 sprint focused on only bug fixing.<br />
<br />
Location: Korte Assenstraat 11, Deventer<br />
<br />
== Reimbursements ==<br />
<br />
As soon as possible, go to:<br />
<br />
https://reimbursements.kde.org/<br />
<br />
* You only need to ask for reimbursment for your travel costs. Accomodation will be handled by Boudewijn.<br />
* KDE e.V. reimburses, not pre-imburses. If that is a problem, the Krita Foundation can help out.<br />
<br />
== Agenda==<br />
<br />
* Fundraising<br />
* Steam:<br />
==Attendance==<br />
<br />
Please put your name below if you're coming along with arrival and leave dates<br />
<br />
{| class="wikitable"<br />
|-<br />
! Name<br />
! Arrival<br />
! Leaving<br />
!EstimatedTravel Costs<br />
!Notes about diet<br />
|-<br />
| Boudewijn Rempt<br />
| <br />
| <br />
|<br />
|<br />
|-<br />
| Irina Rempt<br />
|<br />
|<br />
|<br />
|<br />
|-<br />
| Rebecca Breu<br />
| 5.8. evening<br />
| 9.8. <br />
| —<br />
| No cilantro<br />
|-<br />
| Jouni Pentikäinen<br />
|<br />
|<br />
|<br />
| No dairy or fish<br />
|-<br />
| Noemie Scherer<br />
|<br />
|<br />
|<br />
|<br />
|-<br />
| Agata Cacko<br />
|<br />
|<br />
|<br />
|<br />
|-<br />
| Wolthera van Hövell<br />
|asume me to be there for the full length<br />
|<br />
|50 euro<br />
|<br />
|-<br />
| Scott Petrovic<br />
|probably coming in a day early. and leaving day after<br />
|<br />
|<br />
|<br />
|-<br />
| David Revoy<br />
|6 Aug. (probably end afternoon)<br />
|9 Aug. (probably early)<br />
|300 euro<br />
|<br />
|}</div>David2https://community.kde.org/index.php?title=Krita/Sprint2018&diff=79684Krita/Sprint20182018-03-08T16:33:30Z<p>David2: add avaibilities</p>
<hr />
<div>= 2018 Krita Sprint =<br />
<br />
Proposed dates: 17 - 21 May (note: traveling home on Tuesday 22nd is fine)<br />
Location: Deventer<br />
<br />
== Agenda==<br />
<br />
<br />
* Fundraising<br />
* Resource Management<br />
<br />
<br />
==Attendance==<br />
<br />
Please put your name below if you're coming along with arrival and leave dates<br />
<br />
{| class="wikitable"<br />
|-<br />
! Name<br />
! Arrival<br />
! Leaving<br />
|-<br />
| Boudewijn Rempt<br />
| <br />
| <br />
|-<br />
| Irina Rempt<br />
|<br />
|<br />
|-<br />
| David Revoy<br />
| Friday 18<br />
| Monday 21<br />
|-<br />
| <br />
| <br />
| <br />
|-<br />
| <br />
| <br />
| <br />
|-<br />
| <br />
| <br />
| <br />
|-<br />
| <br />
| <br />
| <br />
|-<br />
| <br />
| <br />
| <br />
|}</div>David2https://community.kde.org/index.php?title=Krita/linuxbuild&diff=78432Krita/linuxbuild2017-09-08T23:19:14Z<p>David2: Ubuntu specific precious informations for 17.04 and up. Also , warning about Ubuntu L.T.S and its derivatives (Linux Mint/Elementary)</p>
<hr />
<div>== Preparation ==<br />
<br />
This guide explains how to build Krita from standard Qt 5 and KDE Frameworks 5 development packages provided with your favorite linux distribution. This should be straightforward, but for more detail you can look into the old instructions for [https://community.kde.org/Calligra/Building/3 building Calligra.]<br />
<br />
=== Debian/Ubuntu dependencies ===<br />
Here are the names of Krita's dependencies in the Debian repositories.<br />
<br />
sudo apt install extra-cmake-modules \<br />
libkf5archive-dev \<br />
libkf5completion-dev \<br />
libkf5config-dev \<br />
libkf5coreaddons-dev \<br />
libkf5guiaddons-dev \<br />
libkf5i18n-dev \<br />
libkf5itemmodels-dev \<br />
libkf5itemviews-dev \<br />
libkf5widgetsaddons-dev \<br />
libkf5windowsystem-dev \<br />
libkf5kiocore5 \<br />
libkf5crash-dev \<br />
libkf5kio-dev \<br />
qtbase5-dev \<br />
libqt5svg5-dev \<br />
libqt5multimedia5 \<br />
qtdeclarative5-dev \<br />
libqt5x11extras5-dev \<br />
libqt5opengl5-dev \<br />
libeigen3-dev \<br />
libxi-dev \<br />
libboost-all-dev \<br />
libopenexr-dev \<br />
vc-dev \<br />
libexiv2-dev \<br />
libgsl-dev \<br />
liblcms2-dev \<br />
libpoppler-qt5-dev \<br />
shared-mime-info \<br />
libraw-dev \<br />
libfftw3-dev \<br />
libpng-dev \<br />
libopencolorio-dev<br />
<br />
'''Notes: '''<br />
Ubuntu L.T.S and its derivatives (Linux Mint/Elementary) use too old packages to build Krita 4.x. If you want to compile Krita, use the short term support releases. You'll also need to compile with this flags during cmake:<br />
<br />
-DPYTHON_EXECUTABLE=/usr/bin/python3 -DPYQT_SIP_DIR_OVERRIDE=/usr/share/sip/PyQt5<br />
<br />
If you compile a custom version of library (eg. a more recent Qt version in /opt ), you can add the path to this type of flag to let Krita know about it.<br />
<br />
-DCMAKE_PREFIX_PATH=/opt/qt59<br />
<br />
=== Arch Linux dependencies ===<br />
<br />
Building Krita 3.x on Arch requires often to check the last PKGBUILD of official Arch Package.<br />
<br />
To do this, go to [[https://www.archlinux.org/packages/extra/i686/krita/]] and check the 'Source File' ( top-right ) and then open the PKGBUILD file [[https://git.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/krita]]. It will give you hint if you miss or need to add a library. At september 2016, the list look like this:<br />
<br />
sudo pacman -S --needed base-devel kio kitemmodels gsl libraw opencolorio exiv2 openexr fftw curl boost-libs hicolor-icon-theme extra-cmake-modules kdoctools python boost eigen vc poppler-qt5 poppler-qt5<br />
<br />
=== Fedora dependencies ===<br />
<br />
sudo dnf install -y extra-cmake-modules \ <br />
make cmake automake gcc gcc-c++ kernel-devel \<br />
kf5-karchive-devel \<br />
kf5-kcompletion-devel \<br />
kf5-kconfig-devel \<br />
kf5-kcoreaddons-devel \<br />
kf5-kguiaddons-devel \<br />
kf5-ki18n-devel \<br />
kf5-kitemmodels-devel \<br />
kf5-kitemviews-devel \<br />
kf5-kwidgetsaddons-devel \<br />
kf5-kwindowsystem-devel \<br />
kf5-kio-core \<br />
kf5-kcrash-devel \<br />
kf5-kio-devel \<br />
qt5-qtbase \<br />
qt5-qtbase-devel \<br />
qt5-qtsvg-devel \<br />
qt5-qtmultimedia qt5-qtmultimedia-devel \<br />
qt5-qtdeclarative-devel \<br />
qt5-qtx11extras-devel \<br />
eigen3-devel \<br />
libXi-devel \<br />
boost-* boost-*-devel \<br />
OpenEXR-libs OpenEXR-devel \<br />
exiv2-libs exiv2-devel libgexiv2 \<br />
gsl-devel \<br />
lcms2-devel \<br />
poppler-qt5-devel \<br />
shared-mime-info \<br />
LibRaw-devel \<br />
fftw-devel \<br />
libpng-devel \<br />
OpenColorIO-devel<br />
<br />
== Building Krita ==<br />
Once you have installed the dependencies, you are ready to clone the Krita repository.<br />
<br />
cd ~/kf5/src (Or, wherever you want to download the source code)<br />
git clone git://anongit.kde.org/krita<br />
<br />
<br />
=== CMake commands ===<br />
Krita's build system has diverged from the Calligra build system. For example, Krita does not use productsets any longer.<br />
<br />
Optimization level <tt>RelWithDebInfo</tt> is nearly always good enough for everyday debugging, and it can be used to paint with. Basically we have two build modes: for painters and for developers.<br />
<br />
<b>For painters:</b><br />
* disable unittests so the build becomes faster<br />
* disable safe asserts. it means when a not-too-serious problem arises, Krita will just dump a warning message into the console instead of crashing with an assert.<br />
<br />
cd ~/kf5/build/krita<br />
cmake ~/kf5/src/krita \ ## your source directory<br />
-DCMAKE_INSTALL_PREFIX=~/kf5/inst \ ## your installation directory<br />
-DCMAKE_BUILD_TYPE=RelWithDebInfo \<br />
-DBUILD_TESTING=FALSE \<br />
-DHIDE_SAFE_ASSERTS=TRUE<br />
make -j8 install<br />
<br />
<b>For developers:</b><br />
* enable unittests so you never break the builds<br />
* enable safe asserts. If a safe assert happens, it means there is a bug in Krita and should be fixed, ever though recovery procedure can workaround it.<br />
<br />
cd ~/kf5/build/krita<br />
cmake ~/kf5/src/krita \ ## your source directory<br />
-DCMAKE_INSTALL_PREFIX=~/kf5/inst \ ## your installation directory<br />
-DCMAKE_BUILD_TYPE=RelWithDebInfo \<br />
-DBUILD_TESTING=TRUE \<br />
-DHIDE_SAFE_ASSERTS=FALSE<br />
make -j8 install<br />
<br />
<br />
Remember that you can change build settings with <tt>cmake . -DNEW_SETTING</tt> or by using <tt>cmake-gui</tt> found in the package <tt>cmake-qt-gui</tt><br />
<br />
== Environment variables ==<br />
'''XDG_DATA_DIRS.''' You need only one environment variable to run Krita 3:<br />
export XDG_DATA_DIRS=~/kf5/inst/share:$XDG_DATA_DIRS<br />
<br />
'''KRITA_PLUGIN_PATH.''' Currently, running inside a debugger can be a bit fragile due to plugin loading. Krita's plugins are built in several different paths inside the source directory, and the installation process copies them into a single folder. However the debugger might accidentally not catch onto the plugin installation directory. (For example, if it thinks the plugin path is <tt>./build/krita/plugins/</tt> then it will miss the plugins contained in <tt>./build/plugins/</tt>. It may be possible in the future to fix this by altering Krita's codebase, but such large changes are not yet possible until the break with Calligra repo is more complete.) <br />
<br />
You can force Krita to look in a specific folder for plugins using the environment variable <tt>KRITA_PLUGIN_PATH</tt>. For example, using Kubuntu and installing Krita in ~/, I can use a debugger if I set the environment variable: <br />
export KRITA_PLUGIN_PATH="~/kf5/inst/lib/x86_64-linux-gnu"<br />
<br />
'''QT_MESSAGE_FORMAT''' and '''QT_LOGGING_RULES''' <br />
See <tt>main.cc</tt> and http://woboq.com/blog/nice-debug-output-with-qt.html<br />
<br />
== Troubleshooting ==<br />
# When '''building master and SIP''' you might want to add <tt>-DPYQT_SIP_DIR_OVERRIDE=/usr/share/sip/PyQt5/</tt> to make it find the files correctly. This is a bug in the current cmake files that will be fixed later.<br />
# '''WARNING''' cmake versions 3.1.3 - 3.2.3 have some problems with automoc so the unittests in krita will not be built. If you happen to have this version of cmake (e.g. Ubuntu 15.10) please build hewer cmake manually and call the binary directly from the build directory</div>David2https://community.kde.org/index.php?title=Krita/linuxbuild&diff=74025Krita/linuxbuild2016-09-14T14:46:14Z<p>David2: /* Arch Linux dependencies */</p>
<hr />
<div>== Preparation ==<br />
<br />
This guide explains how to build Krita from standard Qt 5 and KDE Frameworks 5 development packages provided with your favorite linux distribution. Building Krita is fundamentally [https://community.kde.org/Calligra/Building/3 similiar to building Calligra], but there are a few differences. I am too lazy to copy all of those instructions into this page, it would be nice if you did it though. <tt>=)</tt><br />
<br />
=== Debian/Ubuntu dependencies ===<br />
Here are the names of Krita's dependencies in the Debian repositories.<br />
<br />
sudo apt install extra-cmake-modules libkf5archive-dev libkf5completion-dev libkf5config-dev<br />
libkf5coreaddons-dev libkf5guiaddons-dev libkf5i18n-dev libkf5itemmodels-dev libkf5itemviews-dev<br />
libkf5widgetsaddons-dev libkf5windowsystem-dev libkf5kiocore5 qtbase5-dev libqt5svg5-dev<br />
qtdeclarative5-dev libqt5x11extras5-dev libqt5opengl5-dev libeigen3-dev libxi-dev libboost-all-dev<br />
libopenexr-dev vc-dev libexiv2-dev libgsl0-dev liblcms2-dev libpoppler-qt5-dev shared-mime-info <br />
libraw-dev libfftw3-dev libopencolorio-dev libcurl-dev libopenjpeg-dev<br />
<br />
=== Arch Linux dependencies ===<br />
<br />
Building Krita 3.x on Arch requires often to check the last PKGBUILD of official Arch Package.<br />
<br />
To do this, go to [[https://www.archlinux.org/packages/extra/i686/krita/]] and check the 'Source File' ( top-right ) and then open the PKGBUILD file [[https://git.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/krita]]. It will give you hint if you miss or need to add a library. At september 2016, the list look like this:<br />
<br />
sudo pacman -S base-devel kio kitemmodels gsl libraw opencolorio exiv2 openexr fftw curl boost-libs hicolor-icon-theme extra-cmake-modules kdoctools python boost eigen vc poppler-qt5 poppler-qt5<br />
<br />
== Building Krita ==<br />
Once you have installed the dependencies, you are ready to clone the Krita repository.<br />
<br />
cd ~/kf5/src (Or, wherever you want to download the source code)<br />
git clone git://anongit.kde.org/krita<br />
<br />
<br />
=== CMake commands ===<br />
Krita's build system has diverged from the Calligra build system. For example, Krita does not use productsets any longer.<br />
<br />
For your initial build of Krita, you probably don't want to run the tests, so we use <tt>-DBUILD_TESTING=OFF</tt>. Optimization level <tt>RelWithDebInfo</tt> is nearly always good enough for everyday debugging, and it can be used to paint with. This command will also create a directory <tt>~/kf5/</tt> for KDE Frameworks. The final installation directory for Krita will be <tt>~/kf5/inst/bin/krita</tt>.<br />
<br />
cd ~/kf5/build/krita<br />
cmake ~/kf5/src/krita -DCMAKE_INSTALL_PREFIX=~/kf5/inst -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_TESTING=OFF<br />
make -j8<br />
make install -j8<br />
<br />
<br />
Remember that you can change build settings with <tt>cmake . -DNEW_SETTING</tt> or by using <tt>cmake-gui</tt> found in the package <tt>cmake-qt-gui</tt><br />
<br />
== Environment variables ==<br />
'''XDG_DATA_DIRS.''' You need only one environment variable to run Krita 3:<br />
export XDG_DATA_DIRS=~/kf5/inst/share:$XDG_DATA_DIRS<br />
<br />
'''KRITA_PLUGIN_PATH.''' Currently, running inside a debugger can be a bit fragile due to plugin loading. Krita's plugins are built in several different paths inside the source directory, and the installation process copies them into a single folder. However the debugger might accidentally not catch onto the plugin installation directory. (For example, if it thinks the plugin path is <tt>./build/krita/plugins/</tt> then it will miss the plugins contained in <tt>./build/plugins/</tt>. It may be possible in the future to fix this by altering Krita's codebase, but such large changes are not yet possible until the break with Calligra repo is more complete.) <br />
<br />
You can force Krita to look in a specific folder for plugins using the environment variable <tt>KRITA_PLUGIN_PATH</tt>. For example, using Kubuntu and installing Krita in ~/, I can use a debugger if I set the environment variable: <br />
export KRITA_PLUGIN_PATH="~/kf5/inst/lib/x86_64-linux-gnu"<br />
<br />
'''QT_MESSAGE_FORMAT''' and '''QT_LOGGING_RULES''' <br />
See <tt>main.cc</tt> and http://woboq.com/blog/nice-debug-output-with-qt.html<br />
<br />
== Troubleshooting ==<br />
# '''WARNING''' cmake versions 3.1.3 - 3.2.3 have some problems with automoc so the unittests in krita will not be built. If you happen to have this version of cmake (e.g. Ubuntu 15.10) please build hewer cmake manually and call the binary directly from the build directory</div>David2https://community.kde.org/index.php?title=Krita/linuxbuild&diff=74024Krita/linuxbuild2016-09-14T14:44:38Z<p>David2: Arch Linux dependencies: cleanup qt4 dep, add method for user to find fresh info.</p>
<hr />
<div>== Preparation ==<br />
<br />
This guide explains how to build Krita from standard Qt 5 and KDE Frameworks 5 development packages provided with your favorite linux distribution. Building Krita is fundamentally [https://community.kde.org/Calligra/Building/3 similiar to building Calligra], but there are a few differences. I am too lazy to copy all of those instructions into this page, it would be nice if you did it though. <tt>=)</tt><br />
<br />
=== Debian/Ubuntu dependencies ===<br />
Here are the names of Krita's dependencies in the Debian repositories.<br />
<br />
sudo apt install extra-cmake-modules libkf5archive-dev libkf5completion-dev libkf5config-dev<br />
libkf5coreaddons-dev libkf5guiaddons-dev libkf5i18n-dev libkf5itemmodels-dev libkf5itemviews-dev<br />
libkf5widgetsaddons-dev libkf5windowsystem-dev libkf5kiocore5 qtbase5-dev libqt5svg5-dev<br />
qtdeclarative5-dev libqt5x11extras5-dev libqt5opengl5-dev libeigen3-dev libxi-dev libboost-all-dev<br />
libopenexr-dev vc-dev libexiv2-dev libgsl0-dev liblcms2-dev libpoppler-qt5-dev shared-mime-info <br />
libraw-dev libfftw3-dev libopencolorio-dev libcurl-dev libopenjpeg-dev<br />
<br />
=== Arch Linux dependencies ===<br />
<br />
Building Krita 3.x on Arch requires often to check the last PKGBUILD of official Arch Package.<br />
<br />
To do this, go to [[https://www.archlinux.org/packages/extra/i686/krita/]] and check the 'Source File' ( top-right ) and then open the PKGBUILD file [[https://git.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/krita]]. It will give you hint if you miss or need to add a library. At september 2016, the list look like this:<br />
<br />
Sudo pacman -S base-devel kio kitemmodels gsl libraw opencolorio exiv2 openexr fftw curl boost-libs hicolor-icon-theme extra-cmake-modules kdoctools python boost eigen vc poppler-qt5 poppler-qt5<br />
<br />
== Building Krita ==<br />
Once you have installed the dependencies, you are ready to clone the Krita repository.<br />
<br />
cd ~/kf5/src (Or, wherever you want to download the source code)<br />
git clone git://anongit.kde.org/krita<br />
<br />
<br />
=== CMake commands ===<br />
Krita's build system has diverged from the Calligra build system. For example, Krita does not use productsets any longer.<br />
<br />
For your initial build of Krita, you probably don't want to run the tests, so we use <tt>-DBUILD_TESTING=OFF</tt>. Optimization level <tt>RelWithDebInfo</tt> is nearly always good enough for everyday debugging, and it can be used to paint with. This command will also create a directory <tt>~/kf5/</tt> for KDE Frameworks. The final installation directory for Krita will be <tt>~/kf5/inst/bin/krita</tt>.<br />
<br />
cd ~/kf5/build/krita<br />
cmake ~/kf5/src/krita -DCMAKE_INSTALL_PREFIX=~/kf5/inst -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_TESTING=OFF<br />
make -j8<br />
make install -j8<br />
<br />
<br />
Remember that you can change build settings with <tt>cmake . -DNEW_SETTING</tt> or by using <tt>cmake-gui</tt> found in the package <tt>cmake-qt-gui</tt><br />
<br />
== Environment variables ==<br />
'''XDG_DATA_DIRS.''' You need only one environment variable to run Krita 3:<br />
export XDG_DATA_DIRS=~/kf5/inst/share:$XDG_DATA_DIRS<br />
<br />
'''KRITA_PLUGIN_PATH.''' Currently, running inside a debugger can be a bit fragile due to plugin loading. Krita's plugins are built in several different paths inside the source directory, and the installation process copies them into a single folder. However the debugger might accidentally not catch onto the plugin installation directory. (For example, if it thinks the plugin path is <tt>./build/krita/plugins/</tt> then it will miss the plugins contained in <tt>./build/plugins/</tt>. It may be possible in the future to fix this by altering Krita's codebase, but such large changes are not yet possible until the break with Calligra repo is more complete.) <br />
<br />
You can force Krita to look in a specific folder for plugins using the environment variable <tt>KRITA_PLUGIN_PATH</tt>. For example, using Kubuntu and installing Krita in ~/, I can use a debugger if I set the environment variable: <br />
export KRITA_PLUGIN_PATH="~/kf5/inst/lib/x86_64-linux-gnu"<br />
<br />
'''QT_MESSAGE_FORMAT''' and '''QT_LOGGING_RULES''' <br />
See <tt>main.cc</tt> and http://woboq.com/blog/nice-debug-output-with-qt.html<br />
<br />
== Troubleshooting ==<br />
# '''WARNING''' cmake versions 3.1.3 - 3.2.3 have some problems with automoc so the unittests in krita will not be built. If you happen to have this version of cmake (e.g. Ubuntu 15.10) please build hewer cmake manually and call the binary directly from the build directory</div>David2https://community.kde.org/index.php?title=Calligra/Building&diff=38427Calligra/Building2014-07-11T09:47:51Z<p>David2: more dep on 'buntu</p>
<hr />
<div>These instructions are for Unix and similar operating systems.<br><br />
For Windows, see the [[Calligra/Building_Calligra_on_Windows|building Calligra on Windows]] page.<br><br />
For OSX, see the [[Calligra/Building_Calligra_on_OSX|building Calligra on OSX]] page.<br />
<br />
= Preparation =<br />
{{Warning|First, to avoid conflicting copies of software, '''make sure you do not have other copy of Calligra or KOffice''' either installed through the package manager of your distribution or installed in any other way. Calligra and KOffice are mutually exclusive!}}<br />
<br />
{{Warning|Follow this guide as an ordinary user. Do not login as '''root'''!}}<br />
<br />
{{Warning|Some distributions (*Buntu, Arch) are now making Qt5 the defaulft! That does not work. Do not try to use Qt5, use Qt4.}}<br />
<br />
== Recommended Setup ==<br />
Here is recommendation of a directory structure:<br />
;$HOME/kde4/src/:source code<br />
;$HOME/kde4/build/calligra:directory that Calligra will be built in<br />
;$HOME/kde4/inst:directory that Calligra will be installed in<br />
<br />
The ''build'' directory is needed because you cannot (or should not) build Calligra inside the source directory; the source and build directory have to be separated. <br />
<br />
Create these directories with:<br />
<br />
mkdir -p ~/kde4/src; mkdir -p ~/kde4/build; mkdir -p ~/kde4/inst<br />
<br />
'''Advantages of this setup:'''<br />
*It is possible to have different builds (e.g. with different options out of the same source code)<br />
*[http://techbase.kde.org/Getting_Started/Increased_Productivity_in_KDE4_with_Scripts David Faure's scripts] can be used to make development easier. With those scripts "make" can be typed in the source directory and building will happen in the right (build) directory automatically. <br />
<br />
Also, check the [http://techbase.kde.org/Getting_Started/Build Techbase instructions on setting up a build environment]. That contains some useful scripts and functions.<br />
<br />
== Getting the Source Code ==<br />
There are two most useful options:<br />
#'''Get the source code for the latest stable version.'''<br />
#'''Get the source code for the current development version.''' Needed to test, check and give feedback about features that is in development and have not been released yet.<br />
<br />
If unsure pick the stable version.<br />
<br />
=== Latest Stable Version ===<br />
<br />
The latest stable Calligra version is '''{{Calligra/Stable}}'''.<br />
<br />
*'''Option 1: It can be downloaded as a single archive file''' from http://download.kde.org/stable/calligra-{{Calligra/Stable}}/calligra-{{Calligra/Stable}}.tar.xz. Right now it weights about 114 MiB. The source code has to be uncompressed using:<br />
<br />
<br />
tar xJf calligra-{{Calligra/Stable}}.tar.xz<br />
<br />
:Then ''calligra-{{Calligra/Stable}}'' will appear. You '''do not''' need to execute initrepo.sh in it, the code is ready to build. Please note there is a price for smaller download: to update the source code to a newer version, another .tar.xz should be downloaded. See the option 2 to see how to address this with one-time bigger updatable download.<br />
<br />
:When the source code is properly downloaded, the next step is to ensure that [[#Build_Requirements|build requirements]] are met and to [[#Build_Calligra|build Calligra]].<br />
<br />
*'''Option 2: Alternative download from the git repository''', what weights about 650MB. If you prefer, stable versions are also available on the git repository too. It is heavier but one-time download, the advantage is that lightweight updates can be obtained without a need for downloading entire source code again.<br />
<br />
:To get stable version x.y (currently {{Calligra/Stable}}) from git, first follow instructions for downloading [[#Development Version|the development version]] below, either the Option #1 (directly from git) or the Option #2 (download a repository tarball). Then you need to switch from the development version to stable version of the source code. To do so, in the main Calligra source code directory that has been downloaded, type:<br />
<br />
git checkout calligra/{{Calligra/StableBranch}}<br />
<br />
:''calligra/x.y'' is a notation for branches in the Calligra project. For the latest stable version {{Calligra/Stable}} the branch is called calligra/{{Calligra/StableBranch}} and contains code updates for current minor stable release '''{{Calligra/Stable}}''' plus updates for the next minor planned stable update (if there is any [[Schedules|planned]]).<br />
<br />
:When the source code is properly downloaded, the next step is to ensure that [[#Build_Requirements|build requirements]] are met and to [[#Build_Calligra|build Calligra]].<br />
<br />
=== Development Version ===<br />
<br />
The latest development version of Calligra is '''{{Calligra/Unstable}} {{Calligra/Stage}}'''; developers always refer to it as to '''master'''. Applications from ''Master'' should always compile and be reasonably stable. Calligra developers never place experimental features there. Once tested and released, ''Master'' becomes the new current stable version {{Calligra/UnstableBranch}}. <br />
<br />
''TODO: Here we should explain local branches, staging and always-release-ready Master, if we have that setup.''<br />
<br />
*'''Option 1: directly from git'''<br />
<br />
To retrieve the source code from Git you have to use the following setup:<br />
<br />
Add the following text to your ~/.gitconfig: <br />
<br />
<nowiki>[url "git://anongit.kde.org/"]</nowiki><br />
insteadOf = kde:<br />
[url "ssh://git@git.kde.org/"]<br />
pushInsteadOf = kde:<br />
<br />
Then execute<br />
<br />
$ git clone kde:calligra<br />
<br />
By using the kde: prefix, read access will automatically happen over Git, and authenticated SSH is only required for pushes.<br />
<br />
Note that pushing your changes will only work if you have a KDE developer identity. You can get a contributor account as explained on [http://techbase.kde.org/Contribute/Get_a_Contributor_Account the KDE Techbase].<br />
<br />
The $HOME/kde4/src/calligra directory will be created regardless of the way how the source code has been downloaded.<br />
<br />
*'''Option 2: download a repository tarball'''<br />
<br />
Go to https://projects.kde.org/projects/calligra/repository. Press the "Tarball" button. Copy the url text and paste it on your command line. It will look like:<br />
<br />
wget -c http://anongit.kde.org/calligra/calligra-latest.tar.gz<br />
<br />
Unpack and cd into directory, then run <br />
<br />
$ ./initrepo.sh<br />
<br />
From now on, you can run<br />
<br />
$ git pull<br />
<br />
to update, or if you have local changes:<br />
<br />
$ git rebase origin/master<br />
<br />
<br />
<br />
<br />
*'''Option 3: if beta or rc version was released''', the source code for the latest beta can be found on KDE's ftp [ftp://ftp.kde.org/pub/kde/unstable/calligra-latest/ calligra-latest]. Uncompress the code so that $HOME/kde4/src/calligra is created.<br />
<br />
=== Working with Multiple Versions ===<br />
You will often want to have more than one build environment in parallel, for example if you want to work on both stable and unstable branches at the same time or several ''feature'' branches.<br />
<br />
Recommended way is to use '''git-new-workdir''' tool. The solution is based on a single git repository clone multiplied to many separate source directories for each branch you wish to use, all without performing full clone (what consumes disk space and requires fetching each clone separately). It is explained in the Techbase article [http://techbase.kde.org/Development/Git/Configuration#Multiple_Work_Branches Multiple Work Branches] and you can find the script there.<br />
<br />
Example commands to have code for both Calligra ''{{Calligra/UnstableBranch}}.x'' and ''master'' versions:<br />
<br />
To get the ''master'' into <tt>$HOME/kde4/src/calligra</tt>:<br />
$ git clone kde:calligra<br />
<br />
Then, to get the Calligra ''{{Calligra/UnstableBranch}}.x'' into <tt>$HOME/kde4/src/calligra-{{Calligra/UnstableBranch}}</tt>:<br />
$ git-new-workdir $HOME/kde4/src/calligra $HOME/kde4/src/calligra-{{Calligra/UnstableBranch}} calligra/{{Calligra/UnstableBranch}}<br />
<br />
(which means ''git-new-workdir <original clone's directory> <new source directory> <branch name>'')<br />
<br />
= Build Requirements =<br />
This section provides information about '''hard''' (required) and '''optional''' software packages needed to build the Calligra software.<br />
<br />
== Required Dependencies ==<br />
<br />
{{Note|'''A note for developers:''' to add (or remove) a hard dependency, an explanation of the reason, and possibly a discussion must be posted in advance on calligra-devel@kde.org. The new dependency need to be packaged in the most widely used distributions (Debian, Fedora Core, OpenSuSE, (K)ubuntu). First try to make your new feature optional.}}<br />
<br />
Following are the general must-have dependencies for Calligra (unless you really need to do otherwise, just install relevant binary packages):<br />
* Qt 4.7.0 or newer<br />
*kdelibs and kdelibs development files<br />
**the minimal requirement is currently 4.3.0, that or any later release packaged in your distribution is OK<br />
**On opensuse the development package is called libkde4-devel; on Ubuntu and Debian it is called kdelibs5-dev. (TODO: add info for other distributions)<br />
**Calligra should also build fine with either kdelibs from ''git'' repository (see [http://techbase.kde.org/Getting_Started/Build/KDE4 techbase] for an explanation on how to compile kdelibs from svn), needed for parts of Calligra build with the Mobile Frameworks Profile of the KDE platform (Calligra Words, Calligra Sheets, Calligra Stage, krita)<br />
* kdebase/runtime 4.3 or newer<br />
* cmake 2.6.2 or newer<br />
* lcms 2.4 or newer<br />
* libpng development package (libpng14-devel on opensuse, libpng-dev on Ubuntu/Debian)<br />
** development packages for other libraries may be needed; on ubuntu/Debian these can be installed using 'apt-get build-dep kdelibs5'<br />
<br />
For Calligra Sheets:<br />
* libeigen 3.0<br />
<br />
For Krita:<br />
* libeigen 3.0<br />
* libexiv2 >= 0.16<br />
<br />
For Stage:<br />
* boost<br />
<br />
For Kexi:<br />
* sqlite3 and sqlite3-devel packages (package names can differ on various distributions), version >= 3.7.10<br />
* icu, libicu and libicu-devel (unicode support)<br />
<br />
== Optional Dependencies ==<br />
<br />
All optional dependencies are logged at the end of the cmake run, so it is easy to figure out what is missing. The buildsystem also reports what component will not be built because given missing dependency.<br />
<br />
For users who want to use Krita it is also recommended to install the [http://code.compeng.uni-frankfurt.de/projects/vc Vc library]. It is optional, but makes the performance much higher.<br />
<br />
== Distribution Specific Instructions ==<br />
<br />
=== Debian-based Distributions ===<br />
On '''Debian''', '''Ubuntu''' and '''Kubuntu''', all the dependencies used for the packages can be installed by running :<br />
<pre style="white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap; white-space:pre-wrap; word-wrap:break-word">sudo apt-get build-dep calligra</pre><br />
Note you'll need to activate 'software sources' in your repositories. <br />
<br />
Additionnal more or less mandatory librairies for Ubuntu and derivatives :<br />
<pre style="white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap; white-space:pre-wrap; word-wrap:break-word">sudo apt-get install libeigen3-dev libxi-dev phonon-backend-gstreamer kdelibs5-dev libboost-dev exiv2</pre><br />
<br />
For a better appearance on non-KDE desktop environment :<br />
<pre style="white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap; white-space:pre-wrap; word-wrap:break-word">sudo apt-get install kde-style-oxygen</pre><br />
<br />
On '''Linux Mint''' , you'll need to activate the software sources repositories manually. ( Search for 'Software Sources' in your menu then open it, On the tab 'Linux Mint Software' , check to activate 'Source code', On the tab 'Other Software' check to activate 'Ubuntu **.** <name> (source code) then close the windows to finish )''<br />
<br />
=== OpenSuSE ===<br />
All the dependencies used for building Calligra can be installed by running:<br />
<br />
zypper si -d calligra<br />
<br />
''( Note : enable in 'Yast' > 'Software Repository' the sources packages )''<br />
<br />
=== Fedora ===<br />
All the dependencies used for building Calligra can be installed by running:<br />
yum-builddep calligra<br />
<br />
=== Arch Linux & Manjaro ===<br />
All the dependencies used for building Calligra can be installed by running:<br />
<br />
<pre style="white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap; white-space:pre-wrap; word-wrap:break-word">sudo pacman -Sy automoc4 git cmake make kdepimlibs eigen freetds kdegraphics-okular libgsf libwpd libwpg libwps pstoedit glew gsl cmake automoc4 boost libkdcraw libpqxx fftw lcms2 vc</pre><br />
<br />
''( Note : Manual installation of some packages may be needed, since the package manager (pacman) may miss certain packages during installation. Use pacman -S <package_name> to install missing package.)''<br />
<br />
=== Chakra ===<br />
All the dependencies used for building Calligra can be installed by running:<br />
<br />
<pre style="white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap; white-space:pre-wrap; word-wrap:break-word">sudo pacman -S kdelibs kdepimlibs eigen freetds kdegraphics-okular kdeedu-marble xbase libgsf libwpd libwpg libwps libvisio pstoedit glew gsl cmake automoc4 libspnav libqtgtl boost libkdcraw libpqxx fftw opengtl docbook-xsl create-resources lcms2 qrencode libdmtx</pre><br />
<br />
= Build Calligra =<br />
{{Note|It is '''not''' possible to build Calligra in the source directory. Set up your directories as described in the [[#Recommended_setup|Recommended setup]] section above}}<br />
<br />
Type:<br />
mkdir -p $HOME/kde4/build/calligra<br />
mkdir -p $HOME/kde4/inst<br />
cd $HOME/kde4/build/calligra<br />
<br />
Then, type this command:<br />
<br />
cmake -DCMAKE_INSTALL_PREFIX=$HOME/kde4/inst $HOME/kde4/src/calligra \<br />
-DCMAKE_BUILD_TYPE=RelWithDebInfo<br />
<br />
'''Note:''' if version of your Qt framework if exactly 4.8.0 or 4.8.1 add an extra parameter to the above command [[/Qt 4.8.0 and 4.8.1 patch/|as explained here]].<br />
<br />
(''cmakekde'' tool can be used as explained on [http://techbase.kde.org/Getting_Started/Build/KDE4 the build instructions for KDE4])<br />
<br />
Then type:<br />
make<br />
<br />
Then type this command to install the software:<br />
make install<br />
<br />
'''But first read the advice below''' regarding speeding up the build process and adding extra debugging capabilities.<br />
<br />
Please follow the [[Calligra/Building#Running_Calligra_Applications|Running Calligra Applications]] instructions before trying to run an application.<br />
<br />
==Speed up==<br />
'''Recommended: Taking advantage of multi-core processors.''' On dual-core machines compilation can be '''greatly speed up''' with the <tt>-j</tt> parameter of the <tt>make</tt> program. For example whenever you are invoking <tt>make</tt>, for dual-core processor try to invoke:<br />
make -j3<br />
Similarly, for quad-core processor:<br />
make -j5<br />
<br />
Generaly for ''N-core'' processor use the <tt>-jN+1</tt> parameter.<br />
<br />
'''Recommended: Faster linking on Linux.''' [http://en.wikipedia.org/wiki/Linker_%28computing%29 Linking] can take noticeable time in large software such as Calligra. On Linux [http://en.wikipedia.org/wiki/Gold_%28linker%29 Gold linker] can be used to speed up this task. If you're building for Linux, install the Gold linker package and add the following to your <tt>cmake</tt> command:<br />
-DCMAKE_C_FLAGS=-fuse-linker-plugin -DCMAKE_CXX_FLAGS=-fuse-linker-plugin<br />
<br />
(you can set the <tt>CMAKE_C_FLAGS</tt> adn <tt>CMAKE_CXX_FLAGS</tt> variables in your {build dir}/CMakeCache.txt file either using text editor or the <tt>ccmake</tt> tool)<br />
<br />
==Debugging options==<br />
'''Recommended for accurate debugging:''' The default debug setting is <tt>RelWithDebInfo</tt> which is suitable only for obtaining backtraces. If you are developing or debugging an application by setting breakpoints, watchpoints, using step by step command accurately in your debugger, if you rely on assertions, debug and warning messages, you can replace <tt>-DCMAKE_BUILD_TYPE=RelWithDebInfo</tt> with:<br />
-DCMAKE_BUILD_TYPE=DebugFull<br />
<br />
Using <tt>DebugFull</tt> results in a slower code. That can be acceptable in most cases during testing and development given the machine is fast enough. It is not intended for production releases of the software unless you know what you're doing.<br />
<br />
'''Special case for Krita:''' If you are working on Krita, always use the <tt>KritaDevs</tt> option by setting:<br />
-DCMAKE_BUILD_TYPE=KritaDevs<br />
<br />
= Updating and Rebuilding =<br />
If the source code has been cloned using Git, it is possible to update the source code with newly added changes and build again. Usually only changing parts will be built, so this operation would be faster than building the source code from scratch.<br />
<br />
Type:<br />
cd $HOME/kde4/src/calligra<br />
git pull --rebase<br />
cd $HOME/kde4/build/calligra<br />
make<br />
make install<br />
<br />
(note that you can always append the <tt>-jN</tt> option to the <tt>make</tt> command to speed up the build as explained earlier in the [[#Speed_up|Speed up]] section.<br />
<br />
= Building Selected Applications =<br />
== Using Product Sets ==<br />
By default, the build system tries to build all applications. The recommended way to change this is to specify a different product set by setting the <tt>PRODUCTSET</tt> CMake variable. The following table illustrates the predefined product sets.<br />
<br />
{| class="wikitable" style="margin: 1em auto; text-align: center;"<br />
! rowspan="2" width="100"| Application<br />
! colspan="5" | Product Set<br />
|-<br />
!width="100"| DESKTOP<br />
!width="100"| CREATIVE<br />
!width="100"| ACTIVE<br />
!width="100"| OSX<br />
!width="100"| ALL<br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Active<br />
| <br />
| <br />
| X<br />
| <br />
| X<br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Author<br />
| X<br />
| <br />
| <br />
| X<br />
| X<br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Braindump<br />
| X<br />
| <br />
| <br />
| X<br />
| X<br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Flow<br />
| X<br />
| <br />
| <br />
| X<br />
| X<br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Karbon<br />
| X<br />
| X<br />
| <br />
| X<br />
| X<br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Kexi<br />
| X<br />
| <br />
| <br />
|<br />
| X<br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Krita<br />
| X<br />
| X<br />
| <br />
| X<br />
| X<br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Plan<br />
| X<br />
| <br />
| <br />
| <br />
| X<br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Sheets<br />
| X<br />
| <br />
| <br />
| X<br />
| X<br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Stage<br />
| X<br />
| <br />
| <br />
| X<br />
| X<br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Words<br />
| X<br />
| <br />
| <br />
| X<br />
| X<br />
|-<br />
|}<br />
<br />
For example, to build the <tt>CREATIVE</tt> product set, pass<br />
<br />
-DPRODUCTSET=CREATIVE<br />
<br />
on the CMake command line.<br />
<br />
{{note|The set of included plugins, import/export filters and extra tools may differ between product sets. Consult the product set definitions in the <tt>cmake/productsets</tt> directory of the Calligra sources for detailed information about what is included in each product set.}}<br />
<br />
== Specific Product Sets ==<br />
For convenience, specific cases have been covered by extra product sets.<br />
<br />
{| class="wikitable" style="margin: 1em auto; text-align: center;"<br />
! rowspan="2" width="100"| Application<br />
! colspan="5" | Product Set<br />
|-<br />
!width="100"| KEXI<br />
!width="100"| KEXI+SHEETS<br />
!width="100"| KRITA<br />
!width="100"| <br />
!width="100"| <br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Active<br />
| <br />
| <br />
| <br />
| <br />
| <br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Author<br />
| <br />
| <br />
| <br />
| <br />
| <br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Braindump<br />
| <br />
| <br />
| <br />
| <br />
| <br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Flow<br />
| <br />
| <br />
| <br />
| <br />
| <br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Karbon<br />
| <br />
| <br />
| <br />
| <br />
| <br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Kexi<br />
| X<br />
| X<br />
| <br />
| <br />
| <br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Krita<br />
| <br />
| <br />
| X<br />
| <br />
| <br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Plan<br />
| <br />
| <br />
| <br />
| <br />
| <br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Sheets<br />
| <br />
| X<br />
| <br />
| <br />
| <br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Stage<br />
| <br />
| <br />
| <br />
| <br />
| <br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Words<br />
| <br />
| <br />
| <br />
| <br />
| <br />
|-<br />
|}<br />
<br />
== Fine-grained Selection ==<br />
Advanced users and developers wishing to design completely own productsets can do so. How to do that is described in the file [https://projects.kde.org/projects/calligra/repository/revisions/master/entry/cmake/productsets/README README] in the <tt> cmake/productsets </tt> directory of the Calligra sources. Creating own productsets is the recommended solution for this wish.<br />
<br />
Alternatively, though not recommended, instead of designing completely own productsets, it is also possible to disabe products from a selected pre-defined productset. One does so by setting the corresponding <tt>BUILD_{application}</tt> variable to <tt>OFF</tt>. For example, to disable compilation of Krita and Karbon, you can pass<br />
<br />
-DBUILD_krita=OFF -DBUILD_karbon=OFF<br />
<br />
on the CMake command line. You can also do this using the <tt>ccmake</tt> tool included with CMake, which you may run ''after'' the initial CMake run but ''before'' you run <tt>make</tt>.<br />
<br />
{{note|Many components should '''not''' be disabled using <tt>BUILD_{something}</tt>. Set these variables with caution!}}<br />
<br />
= Running Calligra Applications =<br />
After you installed them, there are two options to now make the Calligra applications available for running.<br />
<br />
== Running from Command Line ==<br />
If you have installed Calligra in a different prefix than KDElibs (which is recommended in this document), you have to set the environment variables as folows. '''These are example values reflecting the the recommended directory structure''':<br />
<br />
export KDEDIRS=$HOME/kde4/inst:$KDEDIRS<br />
export PATH=$HOME/kde4/inst/bin:$PATH<br />
export KDEHOME=$HOME/kde4/.kde<br />
export KDETMP=/tmp/kdedev-$USER<br />
export KDEVARTMP=/var/tmp/kdedev-$USER<br />
export KDESYCOCA=$KDEVARTMP/ksycoca<br />
<br />
Make sure temporary directories exist:<br />
mkdir -p $KDETMP<br />
mkdir -p $KDEVARTMP<br />
<br />
{{note|It is important to set KDEHOME to a directory different of $HOME/.kde, and if the directory does not exist, it will be created automatically.}}<br />
<br />
Then in this special environment you need to register all the Calligra internal plugins, by executing:<br />
<br />
kbuildsycoca4<br />
<br />
== Running from Menus or Desktop Icons ==<br />
Instead of using ''KDEDIRS'', you can add these lines to $HOME/.kde/share/config/kdeglobals file using text editor:<br />
<br />
[Directories]<br />
prefixes=/path/to/install<br />
<br />
And then you need to register all the Calligra internal plugins to the system, by executing:<br />
<br />
kbuildsycoca4<br />
<br />
The advantage of this is that KDE will always look for the services where Calligra is installed. <br />
For example for the recommended directory structure:<br />
<br />
[Directories]<br />
prefixes=$HOME/kde4/inst<br />
<br />
= Executing Unit Tests =<br />
1. To be able to execute unit tests, you need to explicitly enable them in the build configuration. To do so, set the KDE4_BUILD_TESTS variable to "ON", either by issuing the command in the build directory:<br />
<br />
cd $HOME/kde4/build/calligra<br />
cmake -DKDE4_BUILD_TESTS=ON .<br />
<br />
Or you can run <code>ccmake .</code> in the buld directory and set KDE4_BUILD_TESTS to "on".<br />
<br />
2. Then run the test by executing:<br />
<br />
make test<br />
<br />
or run a test app individually in the tests directories.<br />
<br />
3. Note: It is recommended to execute<br />
<br />
make install<br />
<br />
before running tests.<br />
<br />
= CMake Build Options =<br />
When you enter your build directory, you can type "ccmake ." to see many build options, e.g. you can turn off compilation of apps you don't want - you can save time when compiling.<br />
<br />
Here is list for Krita related options:<br />
* HAVE_MEMORY_LEAK_TRACKER [On/Off] - You can turn on compilation of the tool in krita which detects memory leak. If you want to help debug Krita memory usage, it is useful. Otherwise you just slow down your Krita.<br />
* HAVE_BACKTRACE_SUPPORT [On/Off] - It is related to the memory leak tool. If you activate, you will be able to see code path which leads to memory leak.<br />
<br />
= Resources =<br />
*[[../Developer Info|Useful hints for who wants to hack on Calligra]]<br />
*[http://wiki.opengtl.org/libraries:developers-resources Opengtl debugging, or turning it off]<br />
*[http://winkde.org/pub/kde/ports/win32/dashboard/ Status of Calligra build on Windows (msvc 2008, mingw)]<br />
<br />
= Possible Issues =<br />
<br />
If you get errors when running an application like:<br />
<br />
krita(8565)/calligra (lib komain) KoPluginLoader::load: Loading plugin "Animation Tool" failed, <br />
"Cannot load library /home/michael/kde4/inst/lib/kde4/kpresentertoolanimation.so: <br />
(/home/michael/kde4/inst/lib/libkopageapp.so.7: undefined symbol:<br />
_ZN28KoShapeContainerDefaultModel3addEP7KoShape)" ( 1 ) <br />
<br />
or crashes when starting an application, then you very likely have a version of Calligra installed through your package manager. '''As emphasized earlier in this document, you can only have one version of Calligra, and you should uninstall your packaged Calligra'''.<br />
<br />
See also:<br />
*[[/Nightly Builds/]]<br />
*[[/Developing With KDevelop/]]<br />
*[[/Developing With QtCreator/]]<br />
*[http://techbase.kde.org/Projects/KDE_on_Windows Pages about compiling KDE software for Windows]<br />
*[http://techbase.kde.org/Getting_Started/Build/KDE4/Mac_OS_X Pages about compiling KDE software for Mac OS X]<br />
*[https://wiki.kubuntu.org/CompilingKoffice2 Community HOWTO dedicated to building for Kubuntu]<br />
*[http://community.kde.org/Sysadmin/GitKdeOrgManual kde's git infrastructure manual]<br />
*[http://techbase.kde.org/Development/Tutorials/Git KDE and Git for developers]<br />
*[http://git.or.cz/course/svn.html git crash course]<br />
*[http://community.kde.org/Calligra/Building_Calligra_on_Windows Bulding Calligra on Windows]<br />
<br />
Note: if you want to build FreOffice using the Nokia Qt SDK, please check out the [http://techbase.kde.org/index.php?title=User:Kumarafaque&oldid=54703 build instructions on techbase].</div>David2https://community.kde.org/index.php?title=Calligra/Building&diff=38267Calligra/Building2014-06-27T21:12:50Z<p>David2: outdated link, pointed to a 2011 script, no longer working since 2 years</p>
<hr />
<div>These instructions are for Unix and similar operating systems.<br><br />
For Windows, see the [[Calligra/Building_Calligra_on_Windows|building Calligra on Windows]] page.<br><br />
For OSX, see the [[Calligra/Building_Calligra_on_OSX|building Calligra on OSX]] page.<br />
<br />
= Preparation =<br />
{{Warning|First, to avoid conflicting copies of software, '''make sure you do not have other copy of Calligra or KOffice''' either installed through the package manager of your distribution or installed in any other way. Calligra and KOffice are mutually exclusive!}}<br />
<br />
{{Warning|Follow this guide as an ordinary user. Do not login as '''root'''!}}<br />
<br />
{{Warning|Some distributions (*Buntu, Arch) are now making Qt5 the defaulft! That does not work. Do not try to use Qt5, use Qt4.}}<br />
<br />
== Recommended Setup ==<br />
Here is recommendation of a directory structure:<br />
;$HOME/kde4/src/:source code<br />
;$HOME/kde4/build/calligra:directory that Calligra will be built in<br />
;$HOME/kde4/inst:directory that Calligra will be installed in<br />
<br />
The ''build'' directory is needed because you cannot (or should not) build Calligra inside the source directory; the source and build directory have to be separated. <br />
<br />
Create these directories with:<br />
<br />
mkdir -p ~/kde4/src; mkdir -p ~/kde4/build; mkdir -p ~/kde4/inst<br />
<br />
'''Advantages of this setup:'''<br />
*It is possible to have different builds (e.g. with different options out of the same source code)<br />
*[http://techbase.kde.org/Getting_Started/Increased_Productivity_in_KDE4_with_Scripts David Faure's scripts] can be used to make development easier. With those scripts "make" can be typed in the source directory and building will happen in the right (build) directory automatically. <br />
<br />
Also, check the [http://techbase.kde.org/Getting_Started/Build Techbase instructions on setting up a build environment]. That contains some useful scripts and functions.<br />
<br />
== Getting the Source Code ==<br />
There are two most useful options:<br />
#'''Get the source code for the latest stable version.'''<br />
#'''Get the source code for the current development version.''' Needed to test, check and give feedback about features that is in development and have not been released yet.<br />
<br />
If unsure pick the stable version.<br />
<br />
=== Latest Stable Version ===<br />
<br />
The latest stable Calligra version is '''{{Calligra/Stable}}'''.<br />
<br />
*'''Option 1: It can be downloaded as a single archive file''' from http://download.kde.org/stable/calligra-{{Calligra/Stable}}/calligra-{{Calligra/Stable}}.tar.xz. Right now it weights about 114 MiB. The source code has to be uncompressed using:<br />
<br />
<br />
tar xJf calligra-{{Calligra/Stable}}.tar.xz<br />
<br />
:Then ''calligra-{{Calligra/Stable}}'' will appear. You '''do not''' need to execute initrepo.sh in it, the code is ready to build. Please note there is a price for smaller download: to update the source code to a newer version, another .tar.xz should be downloaded. See the option 2 to see how to address this with one-time bigger updatable download.<br />
<br />
:When the source code is properly downloaded, the next step is to ensure that [[#Build_Requirements|build requirements]] are met and to [[#Build_Calligra|build Calligra]].<br />
<br />
*'''Option 2: Alternative download from the git repository''', what weights about 650MB. If you prefer, stable versions are also available on the git repository too. It is heavier but one-time download, the advantage is that lightweight updates can be obtained without a need for downloading entire source code again.<br />
<br />
:To get stable version x.y (currently {{Calligra/Stable}}) from git, first follow instructions for downloading [[#Development Version|the development version]] below, either the Option #1 (directly from git) or the Option #2 (download a repository tarball). Then you need to switch from the development version to stable version of the source code. To do so, in the main Calligra source code directory that has been downloaded, type:<br />
<br />
git checkout calligra/{{Calligra/StableBranch}}<br />
<br />
:''calligra/x.y'' is a notation for branches in the Calligra project. For the latest stable version {{Calligra/Stable}} the branch is called calligra/{{Calligra/StableBranch}} and contains code updates for current minor stable release '''{{Calligra/Stable}}''' plus updates for the next minor planned stable update (if there is any [[Schedules|planned]]).<br />
<br />
:When the source code is properly downloaded, the next step is to ensure that [[#Build_Requirements|build requirements]] are met and to [[#Build_Calligra|build Calligra]].<br />
<br />
=== Development Version ===<br />
<br />
The latest development version of Calligra is '''{{Calligra/Unstable}} {{Calligra/Stage}}'''; developers always refer to it as to '''master'''. Applications from ''Master'' should always compile and be reasonably stable. Calligra developers never place experimental features there. Once tested and released, ''Master'' becomes the new current stable version {{Calligra/UnstableBranch}}. <br />
<br />
''TODO: Here we should explain local branches, staging and always-release-ready Master, if we have that setup.''<br />
<br />
*'''Option 1: directly from git'''<br />
<br />
To retrieve the source code from Git you have to use the following setup:<br />
<br />
Add the following text to your ~/.gitconfig: <br />
<br />
<nowiki>[url "git://anongit.kde.org/"]</nowiki><br />
insteadOf = kde:<br />
[url "ssh://git@git.kde.org/"]<br />
pushInsteadOf = kde:<br />
<br />
Then execute<br />
<br />
$ git clone kde:calligra<br />
<br />
By using the kde: prefix, read access will automatically happen over Git, and authenticated SSH is only required for pushes.<br />
<br />
Note that pushing your changes will only work if you have a KDE developer identity. You can get a contributor account as explained on [http://techbase.kde.org/Contribute/Get_a_Contributor_Account the KDE Techbase].<br />
<br />
The $HOME/kde4/src/calligra directory will be created regardless of the way how the source code has been downloaded.<br />
<br />
*'''Option 2: download a repository tarball'''<br />
<br />
Go to https://projects.kde.org/projects/calligra/repository. Press the "Tarball" button. Copy the url text and paste it on your command line. It will look like:<br />
<br />
wget -c http://anongit.kde.org/calligra/calligra-latest.tar.gz<br />
<br />
Unpack and cd into directory, then run <br />
<br />
$ ./initrepo.sh<br />
<br />
From now on, you can run<br />
<br />
$ git pull<br />
<br />
to update, or if you have local changes:<br />
<br />
$ git rebase origin/master<br />
<br />
<br />
<br />
<br />
*'''Option 3: if beta or rc version was released''', the source code for the latest beta can be found on KDE's ftp [ftp://ftp.kde.org/pub/kde/unstable/calligra-latest/ calligra-latest]. Uncompress the code so that $HOME/kde4/src/calligra is created.<br />
<br />
=== Working with Multiple Versions ===<br />
You will often want to have more than one build environment in parallel, for example if you want to work on both stable and unstable branches at the same time or several ''feature'' branches.<br />
<br />
Recommended way is to use '''git-new-workdir''' tool. The solution is based on a single git repository clone multiplied to many separate source directories for each branch you wish to use, all without performing full clone (what consumes disk space and requires fetching each clone separately). It is explained in the Techbase article [http://techbase.kde.org/Development/Git/Configuration#Multiple_Work_Branches Multiple Work Branches] and you can find the script there.<br />
<br />
Example commands to have code for both Calligra ''{{Calligra/UnstableBranch}}.x'' and ''master'' versions:<br />
<br />
To get the ''master'' into <tt>$HOME/kde4/src/calligra</tt>:<br />
$ git clone kde:calligra<br />
<br />
Then, to get the Calligra ''{{Calligra/UnstableBranch}}.x'' into <tt>$HOME/kde4/src/calligra-{{Calligra/UnstableBranch}}</tt>:<br />
$ git-new-workdir $HOME/kde4/src/calligra $HOME/kde4/src/calligra-{{Calligra/UnstableBranch}} calligra/{{Calligra/UnstableBranch}}<br />
<br />
(which means ''git-new-workdir <original clone's directory> <new source directory> <branch name>'')<br />
<br />
= Build Requirements =<br />
This section provides information about '''hard''' (required) and '''optional''' software packages needed to build the Calligra software.<br />
<br />
== Required Dependencies ==<br />
<br />
{{Note|'''A note for developers:''' to add (or remove) a hard dependency, an explanation of the reason, and possibly a discussion must be posted in advance on calligra-devel@kde.org. The new dependency need to be packaged in the most widely used distributions (Debian, Fedora Core, OpenSuSE, (K)ubuntu). First try to make your new feature optional.}}<br />
<br />
Following are the general must-have dependencies for Calligra (unless you really need to do otherwise, just install relevant binary packages):<br />
* Qt 4.7.0 or newer<br />
*kdelibs and kdelibs development files<br />
**the minimal requirement is currently 4.3.0, that or any later release packaged in your distribution is OK<br />
**On opensuse the development package is called libkde4-devel; on Ubuntu and Debian it is called kdelibs5-dev. (TODO: add info for other distributions)<br />
**Calligra should also build fine with either kdelibs from ''git'' repository (see [http://techbase.kde.org/Getting_Started/Build/KDE4 techbase] for an explanation on how to compile kdelibs from svn), needed for parts of Calligra build with the Mobile Frameworks Profile of the KDE platform (Calligra Words, Calligra Sheets, Calligra Stage, krita)<br />
* kdebase/runtime 4.3 or newer<br />
* cmake 2.6.2 or newer<br />
* lcms 2.4 or newer<br />
* libpng development package (libpng14-devel on opensuse, libpng-dev on Ubuntu/Debian)<br />
** development packages for other libraries may be needed; on ubuntu/Debian these can be installed using 'apt-get build-dep kdelibs5'<br />
<br />
For Calligra Sheets:<br />
* libeigen 3.0<br />
<br />
For Krita:<br />
* libeigen 3.0<br />
* libexiv2 >= 0.16<br />
<br />
For Stage:<br />
* boost<br />
<br />
For Kexi:<br />
* sqlite3 and sqlite3-devel packages (package names can differ on various distributions), version >= 3.7.10<br />
* icu, libicu and libicu-devel (unicode support)<br />
<br />
== Optional Dependencies ==<br />
<br />
All optional dependencies are logged at the end of the cmake run, so it is easy to figure out what is missing. The buildsystem also reports what component will not be built because given missing dependency.<br />
<br />
For users who want to use Krita it is also recommended to install the [http://code.compeng.uni-frankfurt.de/projects/vc Vc library]. It is optional, but makes the performance much higher.<br />
<br />
== Distribution Specific Instructions ==<br />
<br />
=== Debian-based Distributions ===<br />
On '''Debian''', '''Ubuntu''' and '''Kubuntu''', all the dependencies used for the packages can be installed by running :<br />
<pre style="white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap; white-space:pre-wrap; word-wrap:break-word">sudo apt-get build-dep calligra</pre><br />
Note you'll need to activate 'software sources' in your repositories. <br />
<br />
Additionnal more or less mandatory librairies for Ubuntu and derivatives :<br />
<pre style="white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap; white-space:pre-wrap; word-wrap:break-word">sudo apt-get install libeigen3-dev libxi-dev phonon-backend-gstreamer kdelibs5-dev libboost-dev</pre><br />
<br />
For a better appearance on non-KDE desktop environment :<br />
<pre style="white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap; white-space:pre-wrap; word-wrap:break-word">sudo apt-get install kde-style-oxygen</pre><br />
<br />
On '''Linux Mint''' , you'll need to activate the software sources repositories manually. ( Search for 'Software Sources' in your menu then open it, On the tab 'Linux Mint Software' , check to activate 'Source code', On the tab 'Other Software' check to activate 'Ubuntu **.** <name> (source code) then close the windows to finish )''<br />
<br />
=== OpenSuSE ===<br />
All the dependencies used for building Calligra can be installed by running:<br />
<br />
zypper si -d calligra<br />
<br />
''( Note : enable in 'Yast' > 'Software Repository' the sources packages )''<br />
<br />
=== Fedora ===<br />
All the dependencies used for building Calligra can be installed by running:<br />
yum-builddep calligra<br />
<br />
=== Arch Linux & Manjaro ===<br />
All the dependencies used for building Calligra can be installed by running:<br />
<br />
<pre style="white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap; white-space:pre-wrap; word-wrap:break-word">sudo pacman -Sy automoc4 git cmake make kdepimlibs eigen freetds kdegraphics-okular libgsf libwpd libwpg libwps pstoedit glew gsl cmake automoc4 boost libkdcraw libpqxx fftw lcms2 vc</pre><br />
<br />
''( Note : Manual installation of some packages may be needed, since the package manager (pacman) may miss certain packages during installation. Use pacman -S <package_name> to install missing package.)''<br />
<br />
=== Chakra ===<br />
All the dependencies used for building Calligra can be installed by running:<br />
<br />
<pre style="white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap; white-space:pre-wrap; word-wrap:break-word">sudo pacman -S kdelibs kdepimlibs eigen freetds kdegraphics-okular kdeedu-marble xbase libgsf libwpd libwpg libwps libvisio pstoedit glew gsl cmake automoc4 libspnav libqtgtl boost libkdcraw libpqxx fftw opengtl docbook-xsl create-resources lcms2 qrencode libdmtx</pre><br />
<br />
= Build Calligra =<br />
{{Note|It is '''not''' possible to build Calligra in the source directory. Set up your directories as described in the [[#Recommended_setup|Recommended setup]] section above}}<br />
<br />
Type:<br />
mkdir -p $HOME/kde4/build/calligra<br />
mkdir -p $HOME/kde4/inst<br />
cd $HOME/kde4/build/calligra<br />
<br />
Then, type this command:<br />
<br />
cmake -DCMAKE_INSTALL_PREFIX=$HOME/kde4/inst $HOME/kde4/src/calligra \<br />
-DCMAKE_BUILD_TYPE=RelWithDebInfo<br />
<br />
'''Note:''' if version of your Qt framework if exactly 4.8.0 or 4.8.1 add an extra parameter to the above command [[/Qt 4.8.0 and 4.8.1 patch/|as explained here]].<br />
<br />
(''cmakekde'' tool can be used as explained on [http://techbase.kde.org/Getting_Started/Build/KDE4 the build instructions for KDE4])<br />
<br />
Then type:<br />
make<br />
<br />
Then type this command to install the software:<br />
make install<br />
<br />
'''But first read the advice below''' regarding speeding up the build process and adding extra debugging capabilities.<br />
<br />
Please follow the [[Calligra/Building#Running_Calligra_Applications|Running Calligra Applications]] instructions before trying to run an application.<br />
<br />
==Speed up==<br />
'''Recommended: Taking advantage of multi-core processors.''' On dual-core machines compilation can be '''greatly speed up''' with the <tt>-j</tt> parameter of the <tt>make</tt> program. For example whenever you are invoking <tt>make</tt>, for dual-core processor try to invoke:<br />
make -j3<br />
Similarly, for quad-core processor:<br />
make -j5<br />
<br />
Generaly for ''N-core'' processor use the <tt>-jN+1</tt> parameter.<br />
<br />
'''Recommended: Faster linking on Linux.''' [http://en.wikipedia.org/wiki/Linker_%28computing%29 Linking] can take noticeable time in large software such as Calligra. On Linux [http://en.wikipedia.org/wiki/Gold_%28linker%29 Gold linker] can be used to speed up this task. If you're building for Linux, install the Gold linker package and add the following to your <tt>cmake</tt> command:<br />
-DCMAKE_C_FLAGS=-fuse-linker-plugin -DCMAKE_CXX_FLAGS=-fuse-linker-plugin<br />
<br />
(you can set the <tt>CMAKE_C_FLAGS</tt> adn <tt>CMAKE_CXX_FLAGS</tt> variables in your {build dir}/CMakeCache.txt file either using text editor or the <tt>ccmake</tt> tool)<br />
<br />
==Debugging options==<br />
'''Recommended for accurate debugging:''' The default debug setting is <tt>RelWithDebInfo</tt> which is suitable only for obtaining backtraces. If you are developing or debugging an application by setting breakpoints, watchpoints, using step by step command accurately in your debugger, if you rely on assertions, debug and warning messages, you can replace <tt>-DCMAKE_BUILD_TYPE=RelWithDebInfo</tt> with:<br />
-DCMAKE_BUILD_TYPE=DebugFull<br />
<br />
Using <tt>DebugFull</tt> results in a slower code. That can be acceptable in most cases during testing and development given the machine is fast enough. It is not intended for production releases of the software unless you know what you're doing.<br />
<br />
'''Special case for Krita:''' If you are working on Krita, always use the <tt>KritaDevs</tt> option by setting:<br />
-DCMAKE_BUILD_TYPE=KritaDevs<br />
<br />
= Updating and Rebuilding =<br />
If the source code has been cloned using Git, it is possible to update the source code with newly added changes and build again. Usually only changing parts will be built, so this operation would be faster than building the source code from scratch.<br />
<br />
Type:<br />
cd $HOME/kde4/src/calligra<br />
git pull --rebase<br />
cd $HOME/kde4/build/calligra<br />
make<br />
make install<br />
<br />
(note that you can always append the <tt>-jN</tt> option to the <tt>make</tt> command to speed up the build as explained earlier in the [[#Speed_up|Speed up]] section.<br />
<br />
= Building Selected Applications =<br />
== Using Product Sets ==<br />
By default, the build system tries to build all applications. The recommended way to change this is to specify a different product set by setting the <tt>PRODUCTSET</tt> CMake variable. The following table illustrates the predefined product sets.<br />
<br />
{| class="wikitable" style="margin: 1em auto; text-align: center;"<br />
! rowspan="2" width="100"| Application<br />
! colspan="5" | Product Set<br />
|-<br />
!width="100"| DESKTOP<br />
!width="100"| CREATIVE<br />
!width="100"| ACTIVE<br />
!width="100"| OSX<br />
!width="100"| ALL<br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Active<br />
| <br />
| <br />
| X<br />
| <br />
| X<br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Author<br />
| X<br />
| <br />
| <br />
| X<br />
| X<br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Braindump<br />
| X<br />
| <br />
| <br />
| X<br />
| X<br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Flow<br />
| X<br />
| <br />
| <br />
| X<br />
| X<br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Karbon<br />
| X<br />
| X<br />
| <br />
| X<br />
| X<br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Kexi<br />
| X<br />
| <br />
| <br />
|<br />
| X<br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Krita<br />
| X<br />
| X<br />
| <br />
| X<br />
| X<br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Plan<br />
| X<br />
| <br />
| <br />
| <br />
| X<br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Sheets<br />
| X<br />
| <br />
| <br />
| X<br />
| X<br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Stage<br />
| X<br />
| <br />
| <br />
| X<br />
| X<br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Words<br />
| X<br />
| <br />
| <br />
| X<br />
| X<br />
|-<br />
|}<br />
<br />
For example, to build the <tt>CREATIVE</tt> product set, pass<br />
<br />
-DPRODUCTSET=CREATIVE<br />
<br />
on the CMake command line.<br />
<br />
{{note|The set of included plugins, import/export filters and extra tools may differ between product sets. Consult the product set definitions in the <tt>cmake/productsets</tt> directory of the Calligra sources for detailed information about what is included in each product set.}}<br />
<br />
== Specific Product Sets ==<br />
For convenience, specific cases have been covered by extra product sets.<br />
<br />
{| class="wikitable" style="margin: 1em auto; text-align: center;"<br />
! rowspan="2" width="100"| Application<br />
! colspan="5" | Product Set<br />
|-<br />
!width="100"| KEXI<br />
!width="100"| KEXI+SHEETS<br />
!width="100"| KRITA<br />
!width="100"| <br />
!width="100"| <br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Active<br />
| <br />
| <br />
| <br />
| <br />
| <br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Author<br />
| <br />
| <br />
| <br />
| <br />
| <br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Braindump<br />
| <br />
| <br />
| <br />
| <br />
| <br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Flow<br />
| <br />
| <br />
| <br />
| <br />
| <br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Karbon<br />
| <br />
| <br />
| <br />
| <br />
| <br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Kexi<br />
| X<br />
| X<br />
| <br />
| <br />
| <br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Krita<br />
| <br />
| <br />
| X<br />
| <br />
| <br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Plan<br />
| <br />
| <br />
| <br />
| <br />
| <br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Sheets<br />
| <br />
| X<br />
| <br />
| <br />
| <br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Stage<br />
| <br />
| <br />
| <br />
| <br />
| <br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Words<br />
| <br />
| <br />
| <br />
| <br />
| <br />
|-<br />
|}<br />
<br />
== Fine-grained Selection ==<br />
Advanced users and developers wishing to design completely own productsets can do so. How to do that is described in the file [https://projects.kde.org/projects/calligra/repository/revisions/master/entry/cmake/productsets/README README] in the <tt> cmake/productsets </tt> directory of the Calligra sources. Creating own productsets is the recommended solution for this wish.<br />
<br />
Alternatively, though not recommended, instead of designing completely own productsets, it is also possible to disabe products from a selected pre-defined productset. One does so by setting the corresponding <tt>BUILD_{application}</tt> variable to <tt>OFF</tt>. For example, to disable compilation of Krita and Karbon, you can pass<br />
<br />
-DBUILD_krita=OFF -DBUILD_karbon=OFF<br />
<br />
on the CMake command line. You can also do this using the <tt>ccmake</tt> tool included with CMake, which you may run ''after'' the initial CMake run but ''before'' you run <tt>make</tt>.<br />
<br />
{{note|Many components should '''not''' be disabled using <tt>BUILD_{something}</tt>. Set these variables with caution!}}<br />
<br />
= Running Calligra Applications =<br />
After you installed them, there are two options to now make the Calligra applications available for running.<br />
<br />
== Running from Command Line ==<br />
If you have installed Calligra in a different prefix than KDElibs (which is recommended in this document), you have to set the environment variables as folows. '''These are example values reflecting the the recommended directory structure''':<br />
<br />
export KDEDIRS=$HOME/kde4/inst:$KDEDIRS<br />
export PATH=$HOME/kde4/inst/bin:$PATH<br />
export KDEHOME=$HOME/kde4/.kde<br />
export KDETMP=/tmp/kdedev-$USER<br />
export KDEVARTMP=/var/tmp/kdedev-$USER<br />
export KDESYCOCA=$KDEVARTMP/ksycoca<br />
<br />
Make sure temporary directories exist:<br />
mkdir -p $KDETMP<br />
mkdir -p $KDEVARTMP<br />
<br />
{{note|It is important to set KDEHOME to a directory different of $HOME/.kde, and if the directory does not exist, it will be created automatically.}}<br />
<br />
Then in this special environment you need to register all the Calligra internal plugins, by executing:<br />
<br />
kbuildsycoca4<br />
<br />
== Running from Menus or Desktop Icons ==<br />
Instead of using ''KDEDIRS'', you can add these lines to $HOME/.kde/share/config/kdeglobals file using text editor:<br />
<br />
[Directories]<br />
prefixes=/path/to/install<br />
<br />
And then you need to register all the Calligra internal plugins to the system, by executing:<br />
<br />
kbuildsycoca4<br />
<br />
The advantage of this is that KDE will always look for the services where Calligra is installed. <br />
For example for the recommended directory structure:<br />
<br />
[Directories]<br />
prefixes=$HOME/kde4/inst<br />
<br />
= Executing Unit Tests =<br />
1. To be able to execute unit tests, you need to explicitly enable them in the build configuration. To do so, set the KDE4_BUILD_TESTS variable to "ON", either by issuing the command in the build directory:<br />
<br />
cd $HOME/kde4/build/calligra<br />
cmake -DKDE4_BUILD_TESTS=ON .<br />
<br />
Or you can run <code>ccmake .</code> in the buld directory and set KDE4_BUILD_TESTS to "on".<br />
<br />
2. Then run the test by executing:<br />
<br />
make test<br />
<br />
or run a test app individually in the tests directories.<br />
<br />
3. Note: It is recommended to execute<br />
<br />
make install<br />
<br />
before running tests.<br />
<br />
= CMake Build Options =<br />
When you enter your build directory, you can type "ccmake ." to see many build options, e.g. you can turn off compilation of apps you don't want - you can save time when compiling.<br />
<br />
Here is list for Krita related options:<br />
* HAVE_MEMORY_LEAK_TRACKER [On/Off] - You can turn on compilation of the tool in krita which detects memory leak. If you want to help debug Krita memory usage, it is useful. Otherwise you just slow down your Krita.<br />
* HAVE_BACKTRACE_SUPPORT [On/Off] - It is related to the memory leak tool. If you activate, you will be able to see code path which leads to memory leak.<br />
<br />
= Resources =<br />
*[[../Developer Info|Useful hints for who wants to hack on Calligra]]<br />
*[http://wiki.opengtl.org/libraries:developers-resources Opengtl debugging, or turning it off]<br />
*[http://winkde.org/pub/kde/ports/win32/dashboard/ Status of Calligra build on Windows (msvc 2008, mingw)]<br />
<br />
= Possible Issues =<br />
<br />
If you get errors when running an application like:<br />
<br />
krita(8565)/calligra (lib komain) KoPluginLoader::load: Loading plugin "Animation Tool" failed, <br />
"Cannot load library /home/michael/kde4/inst/lib/kde4/kpresentertoolanimation.so: <br />
(/home/michael/kde4/inst/lib/libkopageapp.so.7: undefined symbol:<br />
_ZN28KoShapeContainerDefaultModel3addEP7KoShape)" ( 1 ) <br />
<br />
or crashes when starting an application, then you very likely have a version of Calligra installed through your package manager. '''As emphasized earlier in this document, you can only have one version of Calligra, and you should uninstall your packaged Calligra'''.<br />
<br />
See also:<br />
*[[/Nightly Builds/]]<br />
*[[/Developing With KDevelop/]]<br />
*[[/Developing With QtCreator/]]<br />
*[http://techbase.kde.org/Projects/KDE_on_Windows Pages about compiling KDE software for Windows]<br />
*[http://techbase.kde.org/Getting_Started/Build/KDE4/Mac_OS_X Pages about compiling KDE software for Mac OS X]<br />
*[https://wiki.kubuntu.org/CompilingKoffice2 Community HOWTO dedicated to building for Kubuntu]<br />
*[http://community.kde.org/Sysadmin/GitKdeOrgManual kde's git infrastructure manual]<br />
*[http://techbase.kde.org/Development/Tutorials/Git KDE and Git for developers]<br />
*[http://git.or.cz/course/svn.html git crash course]<br />
*[http://community.kde.org/Calligra/Building_Calligra_on_Windows Bulding Calligra on Windows]<br />
<br />
Note: if you want to build FreOffice using the Nokia Qt SDK, please check out the [http://techbase.kde.org/index.php?title=User:Kumarafaque&oldid=54703 build instructions on techbase].</div>David2https://community.kde.org/index.php?title=Calligra/Building&diff=38205Calligra/Building2014-06-24T11:11:43Z<p>David2: Distribution Specific Instructions : update Ubuntu , now libeigen3-dev is needed ; and for Arch/Manjaro ; eigen2 is deprecated and renamed eigen</p>
<hr />
<div>These instructions are for Unix and similar operating systems.<br><br />
For Windows, see the [[Calligra/Building_Calligra_on_Windows|building Calligra on Windows]] page.<br><br />
For OSX, see the [[Calligra/Building_Calligra_on_OSX|building Calligra on OSX]] page.<br />
<br />
= Preparation =<br />
{{Warning|First, to avoid conflicting copies of software, '''make sure you do not have other copy of Calligra or KOffice''' either installed through the package manager of your distribution or installed in any other way. Calligra and KOffice are mutually exclusive!}}<br />
<br />
{{Warning|Follow this guide as an ordinary user. Do not login as '''root'''!}}<br />
<br />
{{Warning|Some distributions (*Buntu, Arch) are now making Qt5 the defaulft! That does not work. Do not try to use Qt5, use Qt4.}}<br />
<br />
== Recommended Setup ==<br />
Here is recommendation of a directory structure:<br />
;$HOME/kde4/src/:source code<br />
;$HOME/kde4/build/calligra:directory that Calligra will be built in<br />
;$HOME/kde4/inst:directory that Calligra will be installed in<br />
<br />
The ''build'' directory is needed because you cannot (or should not) build Calligra inside the source directory; the source and build directory have to be separated. <br />
<br />
Create these directories with:<br />
<br />
mkdir -p ~/kde4/src; mkdir -p ~/kde4/build; mkdir -p ~/kde4/inst<br />
<br />
'''Advantages of this setup:'''<br />
*It is possible to have different builds (e.g. with different options out of the same source code)<br />
*[http://techbase.kde.org/Getting_Started/Increased_Productivity_in_KDE4_with_Scripts David Faure's scripts] can be used to make development easier. With those scripts "make" can be typed in the source directory and building will happen in the right (build) directory automatically. <br />
<br />
Also, check the [http://techbase.kde.org/Getting_Started/Build Techbase instructions on setting up a build environment]. That contains some useful scripts and functions.<br />
<br />
== Getting the Source Code ==<br />
There are two most useful options:<br />
#'''Get the source code for the latest stable version.'''<br />
#'''Get the source code for the current development version.''' Needed to test, check and give feedback about features that is in development and have not been released yet.<br />
<br />
If unsure pick the stable version.<br />
<br />
=== Latest Stable Version ===<br />
<br />
The latest stable Calligra version is '''{{Calligra/Stable}}'''.<br />
<br />
*'''Option 1: It can be downloaded as a single archive file''' from http://download.kde.org/stable/calligra-{{Calligra/Stable}}/calligra-{{Calligra/Stable}}.tar.xz. Right now it weights about 114 MiB. The source code has to be uncompressed using:<br />
<br />
<br />
tar xJf calligra-{{Calligra/Stable}}.tar.xz<br />
<br />
:Then ''calligra-{{Calligra/Stable}}'' will appear. You '''do not''' need to execute initrepo.sh in it, the code is ready to build. Please note there is a price for smaller download: to update the source code to a newer version, another .tar.xz should be downloaded. See the option 2 to see how to address this with one-time bigger updatable download.<br />
<br />
:When the source code is properly downloaded, the next step is to ensure that [[#Build_Requirements|build requirements]] are met and to [[#Build_Calligra|build Calligra]].<br />
<br />
*'''Option 2: Alternative download from the git repository''', what weights about 650MB. If you prefer, stable versions are also available on the git repository too. It is heavier but one-time download, the advantage is that lightweight updates can be obtained without a need for downloading entire source code again.<br />
<br />
:To get stable version x.y (currently {{Calligra/Stable}}) from git, first follow instructions for downloading [[#Development Version|the development version]] below, either the Option #1 (directly from git) or the Option #2 (download a repository tarball). Then you need to switch from the development version to stable version of the source code. To do so, in the main Calligra source code directory that has been downloaded, type:<br />
<br />
git checkout calligra/{{Calligra/Stable}}<br />
<br />
:''calligra/x.y'' is a notation for branches in the Calligra project. The latest stable version {{Calligra/Stable}}) the branch is called calligra/{{Calligra/Stable}} and contains code updates for current minor stable release '''{{Calligra/Stable}}''' plus updates for the next minor stable (if there are any).<br />
<br />
:When the source code is properly downloaded, the next step is to ensure that [[#Build_Requirements|build requirements]] are met and to [[#Build_Calligra|build Calligra]].<br />
<br />
=== Development Version ===<br />
<br />
The latest development version of Calligra is '''{{Calligra/Unstable}} {{Calligra/Stage}}'''; developers always refer to it as to '''master'''. Applications from ''Master'' should always compile and be reasonably stable. Calligra developers never place experimental features there. Once tested and released, ''Master'' becomes the new current stable version {{Calligra/UnstableBranch}}. <br />
<br />
''TODO: Here we should explain local branches, staging and always-release-ready Master, if we have that setup.''<br />
<br />
*'''Option 1: directly from git'''<br />
<br />
To retrieve the source code from Git you have to use the following setup:<br />
<br />
Add the following text to your ~/.gitconfig: <br />
<br />
<nowiki>[url "git://anongit.kde.org/"]</nowiki><br />
insteadOf = kde:<br />
[url "ssh://git@git.kde.org/"]<br />
pushInsteadOf = kde:<br />
<br />
Then execute<br />
<br />
$ git clone kde:calligra<br />
<br />
By using the kde: prefix, read access will automatically happen over Git, and authenticated SSH is only required for pushes.<br />
<br />
Note that pushing your changes will only work if you have a KDE developer identity. You can get a contributor account as explained on [http://techbase.kde.org/Contribute/Get_a_Contributor_Account the KDE Techbase].<br />
<br />
The $HOME/kde4/src/calligra directory will be created regardless of the way how the source code has been downloaded.<br />
<br />
*'''Option 2: download a repository tarball'''<br />
<br />
Go to https://projects.kde.org/projects/calligra/repository. Press the "Tarball" button. Copy the url text and paste it on your command line. It will look like:<br />
<br />
wget -c http://anongit.kde.org/calligra/calligra-latest.tar.gz<br />
<br />
Unpack and cd into directory, then run <br />
<br />
$ ./initrepo.sh<br />
<br />
From now on, you can run<br />
<br />
$ git pull<br />
<br />
to update, or if you have local changes:<br />
<br />
$ git rebase origin/master<br />
<br />
<br />
<br />
<br />
*'''Option 3: if beta or rc version was released''', the source code for the latest beta can be found on KDE's ftp [ftp://ftp.kde.org/pub/kde/unstable/calligra-latest/ calligra-latest]. Uncompress the code so that $HOME/kde4/src/calligra is created.<br />
<br />
=== Working with Multiple Versions ===<br />
You will often want to have more than one build environment in parallel, for example if you want to work on both stable and unstable branches at the same time or several ''feature'' branches.<br />
<br />
Recommended way is to use '''git-new-workdir''' tool. The solution is based on a single git repository clone multiplied to many separate source directories for each branch you wish to use, all without performing full clone (what consumes disk space and requires fetching each clone separately). It is explained in the Techbase article [http://techbase.kde.org/Development/Git/Configuration#Multiple_Work_Branches Multiple Work Branches] and you can find the script there.<br />
<br />
Example commands to have code for both Calligra ''{{Calligra/UnstableBranch}}.x'' and ''master'' versions:<br />
<br />
To get the ''master'' into <tt>$HOME/kde4/src/calligra</tt>:<br />
$ git clone kde:calligra<br />
<br />
Then, to get the Calligra ''{{Calligra/UnstableBranch}}.x'' into <tt>$HOME/kde4/src/calligra-{{Calligra/UnstableBranch}}</tt>:<br />
$ git-new-workdir $HOME/kde4/src/calligra $HOME/kde4/src/calligra-{{Calligra/UnstableBranch}} calligra/{{Calligra/UnstableBranch}}<br />
<br />
(which means ''git-new-workdir <original clone's directory> <new source directory> <branch name>'')<br />
<br />
= Build Requirements =<br />
This section provides information about '''hard''' (required) and '''optional''' software packages needed to build the Calligra software.<br />
<br />
== Required Dependencies ==<br />
<br />
{{Note|'''A note for developers:''' to add (or remove) a hard dependency, an explanation of the reason, and possibly a discussion must be posted in advance on calligra-devel@kde.org. The new dependency need to be packaged in the most widely used distributions (Debian, Fedora Core, OpenSuSE, (K)ubuntu). First try to make your new feature optional.}}<br />
<br />
Following are the general must-have dependencies for Calligra (unless you really need to do otherwise, just install relevant binary packages):<br />
* Qt 4.7.0 or newer<br />
*kdelibs and kdelibs development files<br />
**the minimal requirement is currently 4.3.0, that or any later release packaged in your distribution is OK<br />
**On opensuse the development package is called libkde4-devel; on Ubuntu and Debian it is called kdelibs5-dev. (TODO: add info for other distributions)<br />
**Calligra should also build fine with either kdelibs from ''git'' repository (see [http://techbase.kde.org/Getting_Started/Build/KDE4 techbase] for an explanation on how to compile kdelibs from svn), needed for parts of Calligra build with the Mobile Frameworks Profile of the KDE platform (Calligra Words, Calligra Sheets, Calligra Stage, krita)<br />
* kdebase/runtime 4.3 or newer<br />
* cmake 2.6.2 or newer<br />
* lcms 2.4 or newer<br />
* libpng development package (libpng14-devel on opensuse, libpng-dev on Ubuntu/Debian)<br />
** development packages for other libraries may be needed; on ubuntu/Debian these can be installed using 'apt-get build-dep kdelibs5'<br />
<br />
For Calligra Sheets:<br />
* libeigen 2.0<br />
<br />
For Krita:<br />
* libeigen 2.0<br />
* libexiv2 >= 0.16<br />
<br />
For Stage:<br />
* boost<br />
<br />
For Kexi:<br />
* sqlite3 and sqlite3-devel packages (package names can differ on various distributions), version >= 3.7.10<br />
* icu, libicu and libicu-devel (unicode support)<br />
<br />
== Optional Dependencies ==<br />
<br />
All optional dependencies are logged at the end of the cmake run, so it is easy to figure out what is missing. The buildsystem also reports what component will not be built because given missing dependency.<br />
<br />
For users who want to use Krita it is also recommended to install the [http://code.compeng.uni-frankfurt.de/projects/vc Vc library]. It is optional, but makes the performance much higher.<br />
<br />
== Distribution Specific Instructions ==<br />
<br />
=== Debian-based Distributions ===<br />
On '''Debian''', '''Ubuntu''' and '''Kubuntu''', all the dependencies used for the packages can be installed by running :<br />
<pre style="white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap; white-space:pre-wrap; word-wrap:break-word">sudo apt-get build-dep calligra</pre><br />
Note you'll need to activate 'software sources' in your repositories. <br />
<br />
Additionnal more or less mandatory librairies for Ubuntu and derivatives :<br />
<pre style="white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap; white-space:pre-wrap; word-wrap:break-word">sudo apt-get install libeigen3-dev libxi-dev phonon-backend-gstreamer kdelibs5-dev libboost-dev</pre><br />
<br />
For a better appearance on non-KDE desktop environment :<br />
<pre style="white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap; white-space:pre-wrap; word-wrap:break-word">sudo apt-get install kde-style-oxygen</pre><br />
<br />
On '''Linux Mint''' , you'll need to activate the software sources repositories manually. ( Search for 'Software Sources' in your menu then open it, On the tab 'Linux Mint Software' , check to activate 'Source code', On the tab 'Other Software' check to activate 'Ubuntu **.** <name> (source code) then close the windows to finish )''<br />
<br />
=== OpenSuSE ===<br />
All the dependencies used for building Calligra can be installed by running:<br />
<br />
zypper si -d calligra<br />
<br />
''( Note : enable in 'Yast' > 'Software Repository' the sources packages )''<br />
<br />
=== Fedora ===<br />
All the dependencies used for building Calligra can be installed by running:<br />
yum-builddep calligra<br />
<br />
=== Arch Linux & Manjaro ===<br />
All the dependencies used for building Calligra can be installed by running:<br />
<br />
<pre style="white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap; white-space:pre-wrap; word-wrap:break-word">sudo pacman -Sy automoc4 git cmake make kdepimlibs eigen freetds kdegraphics-okular libgsf libwpd libwpg libwps pstoedit glew gsl cmake automoc4 boost libkdcraw libpqxx fftw lcms2 vc</pre><br />
<br />
''( Note : Manual installation of some packages may be needed, since the package manager (pacman) may miss certain packages during installation. Use pacman -S <package_name> to install missing package.)''<br />
<br />
=== Chakra ===<br />
All the dependencies used for building Calligra can be installed by running:<br />
<br />
<pre style="white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap; white-space:pre-wrap; word-wrap:break-word">sudo pacman -S kdelibs kdepimlibs eigen freetds kdegraphics-okular kdeedu-marble xbase libgsf libwpd libwpg libwps libvisio pstoedit glew gsl cmake automoc4 libspnav libqtgtl boost libkdcraw libpqxx fftw opengtl docbook-xsl create-resources lcms2 qrencode libdmtx</pre><br />
<br />
= Build Calligra =<br />
{{Note|It is '''not''' possible to build Calligra in the source directory. Set up your directories as described in the [[#Recommended_setup|Recommended setup]] section above}}<br />
<br />
Type:<br />
mkdir -p $HOME/kde4/build/calligra<br />
mkdir -p $HOME/kde4/inst<br />
cd $HOME/kde4/build/calligra<br />
<br />
Then, type this command:<br />
<br />
cmake -DCMAKE_INSTALL_PREFIX=$HOME/kde4/inst $HOME/kde4/src/calligra \<br />
-DCMAKE_BUILD_TYPE=RelWithDebInfo<br />
<br />
'''Note:''' if version of your Qt framework if exactly 4.8.0 or 4.8.1 add an extra parameter to the above command [[/Qt 4.8.0 and 4.8.1 patch/|as explained here]].<br />
<br />
(''cmakekde'' tool can be used as explained on [http://techbase.kde.org/Getting_Started/Build/KDE4 the build instructions for KDE4])<br />
<br />
Then type:<br />
make<br />
<br />
Then type this command to install the software:<br />
make install<br />
<br />
'''But first read the advice below''' regarding speeding up the build process and adding extra debugging capabilities.<br />
<br />
Please follow the [[Calligra/Building#Running_Calligra_Applications|Running Calligra Applications]] instructions before trying to run an application.<br />
<br />
==Speed up==<br />
'''Recommended: Taking advantage of multi-core processors.''' On dual-core machines compilation can be '''greatly speed up''' with the <tt>-j</tt> parameter of the <tt>make</tt> program. For example whenever you are invoking <tt>make</tt>, for dual-core processor try to invoke:<br />
make -j3<br />
Similarly, for quad-core processor:<br />
make -j5<br />
<br />
Generaly for ''N-core'' processor use the <tt>-jN+1</tt> parameter.<br />
<br />
'''Recommended: Faster linking on Linux.''' [http://en.wikipedia.org/wiki/Linker_%28computing%29 Linking] can take noticeable time in large software such as Calligra. On Linux [http://en.wikipedia.org/wiki/Gold_%28linker%29 Gold linker] can be used to speed up this task. If you're building for Linux, install the Gold linker package and add the following to your <tt>cmake</tt> command:<br />
-DCMAKE_C_FLAGS=-fuse-linker-plugin -DCMAKE_CXX_FLAGS=-fuse-linker-plugin<br />
<br />
(you can set the <tt>CMAKE_C_FLAGS</tt> adn <tt>CMAKE_CXX_FLAGS</tt> variables in your {build dir}/CMakeCache.txt file either using text editor or the <tt>ccmake</tt> tool)<br />
<br />
==Debugging options==<br />
'''Recommended for accurate debugging:''' The default debug setting is <tt>RelWithDebInfo</tt> which is suitable only for obtaining backtraces. If you are developing or debugging an application by setting breakpoints, watchpoints, using step by step command accurately in your debugger, if you rely on assertions, debug and warning messages, you can replace <tt>-DCMAKE_BUILD_TYPE=RelWithDebInfo</tt> with:<br />
-DCMAKE_BUILD_TYPE=DebugFull<br />
<br />
Using <tt>DebugFull</tt> results in a slower code. That can be acceptable in most cases during testing and development given the machine is fast enough. It is not intended for production releases of the software unless you know what you're doing.<br />
<br />
'''Special case for Krita:''' If you are working on Krita, always use the <tt>KritaDevs</tt> option by setting:<br />
-DCMAKE_BUILD_TYPE=KritaDevs<br />
<br />
= Updating and Rebuilding =<br />
If the source code has been cloned using Git, it is possible to update the source code with newly added changes and build again. Usually only changing parts will be built, so this operation would be faster than building the source code from scratch.<br />
<br />
Type:<br />
cd $HOME/kde4/src/calligra<br />
git pull --rebase<br />
cd $HOME/kde4/build/calligra<br />
make<br />
make install<br />
<br />
(note that you can always append the <tt>-jN</tt> option to the <tt>make</tt> command to speed up the build as explained earlier in the [[#Speed_up|Speed up]] section.<br />
<br />
= Building Selected Applications =<br />
== Using Product Sets ==<br />
By default, the build system tries to build all applications. The recommended way to change this is to specify a different product set by setting the <tt>PRODUCTSET</tt> CMake variable. The following table illustrates the predefined product sets.<br />
<br />
{| class="wikitable" style="margin: 1em auto; text-align: center;"<br />
! rowspan="2" width="100"| Application<br />
! colspan="5" | Product Set<br />
|-<br />
!width="100"| DESKTOP<br />
!width="100"| CREATIVE<br />
!width="100"| ACTIVE<br />
!width="100"| OSX<br />
!width="100"| ALL<br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Active<br />
| <br />
| <br />
| X<br />
| <br />
| X<br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Author<br />
| X<br />
| <br />
| <br />
| X<br />
| X<br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Braindump<br />
| X<br />
| <br />
| <br />
| X<br />
| X<br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Flow<br />
| X<br />
| <br />
| <br />
| X<br />
| X<br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Karbon<br />
| X<br />
| X<br />
| <br />
| X<br />
| X<br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Kexi<br />
| X<br />
| <br />
| <br />
|<br />
| X<br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Krita<br />
| X<br />
| X<br />
| <br />
| X<br />
| X<br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Plan<br />
| X<br />
| <br />
| <br />
| <br />
| X<br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Sheets<br />
| X<br />
| <br />
| <br />
| X<br />
| X<br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Stage<br />
| X<br />
| <br />
| <br />
| X<br />
| X<br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Words<br />
| X<br />
| <br />
| <br />
| X<br />
| X<br />
|-<br />
|}<br />
<br />
For example, to build the <tt>CREATIVE</tt> product set, pass<br />
<br />
-DPRODUCTSET=CREATIVE<br />
<br />
on the CMake command line.<br />
<br />
{{note|The set of included plugins, import/export filters and extra tools may differ between product sets. Consult the product set definitions in the <tt>cmake/productsets</tt> directory of the Calligra sources for detailed information about what is included in each product set.}}<br />
<br />
== Specific Product Sets ==<br />
For convenience, specific cases have been covered by extra product sets.<br />
<br />
{| class="wikitable" style="margin: 1em auto; text-align: center;"<br />
! rowspan="2" width="100"| Application<br />
! colspan="5" | Product Set<br />
|-<br />
!width="100"| KEXI<br />
!width="100"| KEXI+SHEETS<br />
!width="100"| KRITA<br />
!width="100"| <br />
!width="100"| <br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Active<br />
| <br />
| <br />
| <br />
| <br />
| <br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Author<br />
| <br />
| <br />
| <br />
| <br />
| <br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Braindump<br />
| <br />
| <br />
| <br />
| <br />
| <br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Flow<br />
| <br />
| <br />
| <br />
| <br />
| <br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Karbon<br />
| <br />
| <br />
| <br />
| <br />
| <br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Kexi<br />
| X<br />
| X<br />
| <br />
| <br />
| <br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Krita<br />
| <br />
| <br />
| X<br />
| <br />
| <br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Plan<br />
| <br />
| <br />
| <br />
| <br />
| <br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Sheets<br />
| <br />
| X<br />
| <br />
| <br />
| <br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Stage<br />
| <br />
| <br />
| <br />
| <br />
| <br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Words<br />
| <br />
| <br />
| <br />
| <br />
| <br />
|-<br />
|}<br />
<br />
== Fine-grained Selection ==<br />
Advanced users and developers wishing to design completely own productsets can do so. How to do that is described in the file [https://projects.kde.org/projects/calligra/repository/revisions/master/entry/cmake/productsets/README README] in the <tt> cmake/productsets </tt> directory of the Calligra sources. Creating own productsets is the recommended solution for this wish.<br />
<br />
Alternatively, though not recommended, instead of designing completely own productsets, it is also possible to disabe products from a selected pre-defined productset. One does so by setting the corresponding <tt>BUILD_{application}</tt> variable to <tt>OFF</tt>. For example, to disable compilation of Krita and Karbon, you can pass<br />
<br />
-DBUILD_krita=OFF -DBUILD_karbon=OFF<br />
<br />
on the CMake command line. You can also do this using the <tt>ccmake</tt> tool included with CMake, which you may run ''after'' the initial CMake run but ''before'' you run <tt>make</tt>.<br />
<br />
{{note|Many components should '''not''' be disabled using <tt>BUILD_{something}</tt>. Set these variables with caution!}}<br />
<br />
= Running Calligra Applications =<br />
After you installed them, there are two options to now make the Calligra applications available for running.<br />
<br />
== Running from Command Line ==<br />
If you have installed Calligra in a different prefix than KDElibs (which is recommended in this document), you have to set the environment variables as folows. '''These are example values reflecting the the recommended directory structure''':<br />
<br />
export KDEDIRS=$HOME/kde4/inst:$KDEDIRS<br />
export PATH=$HOME/kde4/inst/bin:$PATH<br />
export KDEHOME=$HOME/kde4/.kde<br />
export KDETMP=/tmp/kdedev-$USER<br />
export KDEVARTMP=/var/tmp/kdedev-$USER<br />
export KDESYCOCA=$KDEVARTMP/ksycoca<br />
<br />
Make sure temporary directories exist:<br />
mkdir -p $KDETMP<br />
mkdir -p $KDEVARTMP<br />
<br />
{{note|It is important to set KDEHOME to a directory different of $HOME/.kde, and if the directory does not exist, it will be created automatically.}}<br />
<br />
Then in this special environment you need to register all the Calligra internal plugins, by executing:<br />
<br />
kbuildsycoca4<br />
<br />
== Running from Menus or Desktop Icons ==<br />
Instead of using ''KDEDIRS'', you can add these lines to $HOME/.kde/share/config/kdeglobals file using text editor:<br />
<br />
[Directories]<br />
prefixes=/path/to/install<br />
<br />
And then you need to register all the Calligra internal plugins to the system, by executing:<br />
<br />
kbuildsycoca4<br />
<br />
The advantage of this is that KDE will always look for the services where Calligra is installed. <br />
For example for the recommended directory structure:<br />
<br />
[Directories]<br />
prefixes=$HOME/kde4/inst<br />
<br />
= Executing Unit Tests =<br />
1. To be able to execute unit tests, you need to explicitly enable them in the build configuration. To do so, set the KDE4_BUILD_TESTS variable to "ON", either by issuing the command in the build directory:<br />
<br />
cd $HOME/kde4/build/calligra<br />
cmake -DKDE4_BUILD_TESTS=ON .<br />
<br />
Or you can run <code>ccmake .</code> in the buld directory and set KDE4_BUILD_TESTS to "on".<br />
<br />
2. Then run the test by executing:<br />
<br />
make test<br />
<br />
or run a test app individually in the tests directories.<br />
<br />
3. Note: It is recommended to execute<br />
<br />
make install<br />
<br />
before running tests.<br />
<br />
= CMake Build Options =<br />
When you enter your build directory, you can type "ccmake ." to see many build options, e.g. you can turn off compilation of apps you don't want - you can save time when compiling.<br />
<br />
Here is list for Krita related options:<br />
* HAVE_MEMORY_LEAK_TRACKER [On/Off] - You can turn on compilation of the tool in krita which detects memory leak. If you want to help debug Krita memory usage, it is useful. Otherwise you just slow down your Krita.<br />
* HAVE_BACKTRACE_SUPPORT [On/Off] - It is related to the memory leak tool. If you activate, you will be able to see code path which leads to memory leak.<br />
<br />
= Resources =<br />
*[[../Developer Info|Useful hints for who wants to hack on Calligra]]<br />
*[http://wiki.opengtl.org/libraries:developers-resources Opengtl debugging, or turning it off]<br />
*[http://winkde.org/pub/kde/ports/win32/dashboard/ Status of Calligra build on Windows (msvc 2008, mingw)]<br />
<br />
= Possible Issues =<br />
<br />
If you get errors when running an application like:<br />
<br />
krita(8565)/calligra (lib komain) KoPluginLoader::load: Loading plugin "Animation Tool" failed, <br />
"Cannot load library /home/michael/kde4/inst/lib/kde4/kpresentertoolanimation.so: <br />
(/home/michael/kde4/inst/lib/libkopageapp.so.7: undefined symbol:<br />
_ZN28KoShapeContainerDefaultModel3addEP7KoShape)" ( 1 ) <br />
<br />
or crashes when starting an application, then you very likely have a version of Calligra installed through your package manager. '''As emphasized earlier in this document, you can only have one version of Calligra, and you should uninstall your packaged Calligra'''.<br />
<br />
See also:<br />
*[[/Nightly Builds/]]<br />
*[[/Developing With KDevelop/]]<br />
*[[/Developing With QtCreator/]]<br />
*[http://techbase.kde.org/Projects/KDE_on_Windows Pages about compiling KDE software for Windows]<br />
*[http://techbase.kde.org/Getting_Started/Build/KDE4/Mac_OS_X Pages about compiling KDE software for Mac OS X]<br />
*[https://wiki.kubuntu.org/CompilingKoffice2 Community HOWTO dedicated to building for Kubuntu]<br />
*[http://community.kde.org/Sysadmin/GitKdeOrgManual kde's git infrastructure manual]<br />
*[http://techbase.kde.org/Development/Tutorials/Git KDE and Git for developers]<br />
*[http://git.or.cz/course/svn.html git crash course]<br />
*[http://forum.kde.org/viewtopic.php?f=139&t=92880 script for building Calligra (build only krita by default, but easilly configurable)]<br />
*[http://community.kde.org/Calligra/Building_Calligra_on_Windows Bulding Calligra on Windows]<br />
<br />
Note: if you want to build FreOffice using the Nokia Qt SDK, please check out the [http://techbase.kde.org/index.php?title=User:Kumarafaque&oldid=54703 build instructions on techbase].</div>David2https://community.kde.org/index.php?title=Calligra/Building&diff=36274Calligra/Building2014-01-30T22:20:28Z<p>David2: modification after made a Ubuntu 13.10 install , maintainance ; libxi-dev is now required and not in buildep calligra...</p>
<hr />
<div>These instructions are for Unix and similar operating systems. For Windows, see the [[Calligra/Building_Calligra_on_Windows|building Calligra on Windows]] page.<br />
<br />
= Preparation =<br />
{{Warning|First, to avoid conflicting copies of software, '''make sure you do not have other copy of Calligra or KOffice''' either installed through the package manager of your distribution or installed in any other way. Calligra and KOffice are mutually exclusive!}}<br />
<br />
{{Warning|Follow this guide as an ordinary user. Do not login as '''root'''!}}<br />
<br />
{{Warning|Some distributions (*Buntu, Arch) are now making Qt5 the defaulft! That does not work. Do not try to use Qt5, use Qt4.}}<br />
<br />
== Recommended Setup ==<br />
Here is recommendation of a directory structure:<br />
;$HOME/kde4/src/:source code<br />
;$HOME/kde4/build/calligra:directory that Calligra will be built in<br />
;$HOME/kde4/inst:directory that Calligra will be installed in<br />
<br />
The ''build'' directory is needed because you cannot (or should not) build Calligra inside the source directory; the source and build directory have to be separated. <br />
<br />
Create these directories with:<br />
<br />
mkdir -p ~/kde4/src; mkdir -p ~/kde4/build; mkdir -p ~/kde4/inst<br />
<br />
'''Advantages of this setup:'''<br />
*It is possible to have different builds (e.g. with different options out of the same source code)<br />
*[http://techbase.kde.org/Getting_Started/Increased_Productivity_in_KDE4_with_Scripts David Faure's scripts] can be used to make development easier. With those scripts "make" can be typed in the source directory and building will happen in the right (build) directory automatically. <br />
<br />
Also, check the [http://techbase.kde.org/Getting_Started/Build/KDE4 Techbase instructions on setting up a build environment]. That contains some useful scripts and functions.<br />
<br />
== Getting the Source Code ==<br />
There are two most useful options:<br />
#'''Get the source code for the latest stable version.'''<br />
#'''Get the source code for the current development version.''' Needed to test, check and give feedback about features that is in development and have not been released yet.<br />
<br />
If unsure pick the stable version.<br />
<br />
=== Latest Stable Version ===<br />
<br />
The latest stable Calligra version is '''{{Calligra/Stable}}'''.<br />
<br />
*'''Option 1: It can be downloaded as a single archive file''' from http://download.kde.org/stable/calligra-{{Calligra/Stable}}/calligra-{{Calligra/Stable}}.tar.xz. Right now it weights about 114 MiB. The source code has to be uncompressed using:<br />
<br />
<br />
tar xJf calligra-{{Calligra/Stable}}.tar.xz<br />
<br />
:Then ''calligra-{{Calligra/Stable}}'' will appear. You '''do not''' need to execute initrepo.sh in it, the code is ready to build. Please note there is a price for smaller download: to update the source code to a newer version, another .tar.xz should be downloaded. See the option 2 to see how to address this with one-time bigger updatable download.<br />
<br />
:When the source code is properly downloaded, the next step is to ensure that [[#Build_Requirements|build requirements]] are met and to [[#Build_Calligra|build Calligra]].<br />
<br />
*'''Option 2: Alternative download from the git repository''', what weights about 650MB. If you prefer, stable versions are also available on the git repository too. It is heavier but one-time download, the advantage is that lightweight updates can be obtained without a need for downloading entire source code again.<br />
<br />
:To get stable version x.y (currently {{Calligra/Stable}}) from git, first follow instructions for downloading [[#Development Version|the development version]] below, either the Option #1 (directly from git) or the Option #2 (download a repository tarball). Then you need to switch from the development version to stable version of the source code. To do so, in the main Calligra source code directory that has been downloaded, type:<br />
<br />
git checkout calligra/{{Calligra/Stable}}<br />
<br />
:''calligra/x.y'' is a notation for branches in the Calligra project. The latest stable version {{Calligra/Stable}}) the branch is called calligra/{{Calligra/Stable}} and contains code updates for current minor stable release '''{{Calligra/Stable}}''' plus updates for the next minor stable (if there are any).<br />
<br />
:When the source code is properly downloaded, the next step is to ensure that [[#Build_Requirements|build requirements]] are met and to [[#Build_Calligra|build Calligra]].<br />
<br />
=== Development Version ===<br />
<br />
The latest development version of Calligra is '''{{Calligra/Unstable}} {{Calligra/Stage}}'''; developers always refer to it as to '''master'''. Applications from ''Master'' should always compile and be reasonably stable. Calligra developers never place experimental features there. Once tested and released, ''Master'' becomes the new current stable version {{Calligra/UnstableBranch}}. <br />
<br />
''TODO: Here we should explain local branches, staging and always-release-ready Master, if we have that setup.''<br />
<br />
*'''Option 1: directly from git'''<br />
<br />
To retrieve the source code from Git you have to use the following setup:<br />
<br />
Add the following text to your ~/.gitconfig: <br />
<br />
<nowiki>[url "git://anongit.kde.org/"]</nowiki><br />
insteadOf = kde:<br />
[url "ssh://git@git.kde.org/"]<br />
pushInsteadOf = kde:<br />
<br />
Then execute<br />
<br />
$ git clone kde:calligra<br />
<br />
By using the kde: prefix, read access will automatically happen over Git, and authenticated SSH is only required for pushes.<br />
<br />
Note that pushing your changes will only work if you have a KDE developer identity (https://identity.kde.org/register.php).<br />
<br />
The $HOME/kde4/src/calligra directory will be created regardless of the way how the source code has been downloaded.<br />
<br />
*'''Option 2: download a repository tarball'''<br />
<br />
Go to https://projects.kde.org/projects/calligra/repository. Press the "Tarball" button. Copy the url text and paste it on your command line. It will look like:<br />
<br />
wget -c http://anongit.kde.org/calligra/calligra-latest.tar.gz<br />
<br />
Unpack and cd into directory, then run <br />
<br />
$ ./initrepo.sh<br />
<br />
From now on, you can run<br />
<br />
$ git pull<br />
<br />
to update, or if you have local changes:<br />
<br />
$ git rebase origin/master<br />
<br />
<br />
<br />
<br />
*'''Option 3: if beta or rc version was released''', the source code for the latest beta can be found on KDE's ftp [ftp://ftp.kde.org/pub/kde/unstable/calligra-latest/ calligra-latest]. Uncompress the code so that $HOME/kde4/src/calligra is created.<br />
<br />
=== Working with Multiple Versions ===<br />
You will often want to have more than one build environment in parallel, for example if you want to work on both stable and unstable branches at the same time or several ''feature'' branches.<br />
<br />
Recommended way is to use '''git-new-workdir''' tool. The solution is based on a single git repository clone multiplied to many separate source directories for each branch you wish to use, all without performing full clone (what consumes disk space and requires fetching each clone separately). It is explained in the Techbase article [http://techbase.kde.org/Development/Git/Configuration#Multiple_Work_Branches Multiple Work Branches] and you can find the script there.<br />
<br />
Example commands to have code for both Calligra ''{{Calligra/UnstableBranch}}.x'' and ''master'' versions:<br />
<br />
To get the ''master'' into <tt>$HOME/kde4/src/calligra</tt>:<br />
$ git clone kde:calligra<br />
<br />
Then, to get the Calligra ''{{Calligra/UnstableBranch}}.x'' into <tt>$HOME/kde4/src/calligra-{{Calligra/UnstableBranch}}</tt>:<br />
$ git-new-workdir $HOME/kde4/src/calligra $HOME/kde4/src/calligra-{{Calligra/UnstableBranch}} calligra/{{Calligra/UnstableBranch}}<br />
<br />
(which means ''git-new-workdir <original clone's directory> <new source directory> <branch name>'')<br />
<br />
= Build Requirements =<br />
This section provides information about '''hard''' (required) and '''optional''' software packages needed to build the Calligra software.<br />
<br />
== Required Dependencies ==<br />
<br />
{{Note|'''A note for developers:''' to add (or remove) a hard dependency, an explanation of the reason, and possibly a discussion must be posted in advance on calligra-devel@kde.org. The new dependency need to be packaged in the most widely used distributions (Debian, Fedora Core, OpenSuSE, (K)ubuntu). First try to make your new feature optional.}}<br />
<br />
Following are the general must-have dependencies for Calligra (unless you really need to do otherwise, just install relevant binary packages):<br />
* Qt 4.7.0 or newer<br />
*kdelibs and kdelibs development files<br />
**the minimal requirement is currently 4.3.0, that or any later release packaged in your distribution is OK<br />
**On opensuse the development package is called libkde4-devel; on Ubuntu and Debian it is called kdelibs5-dev. (TODO: add info for other distributions)<br />
**Calligra should also build fine with either kdelibs from ''git'' repository (see [http://techbase.kde.org/Getting_Started/Build/KDE4 techbase] for an explanation on how to compile kdelibs from svn), needed for parts of Calligra build with the Mobile Frameworks Profile of the KDE platform (Calligra Words, Calligra Sheets, Calligra Stage, krita)<br />
* kdebase/runtime 4.3 or newer<br />
* cmake 2.6.2 or newer<br />
* lcms 2.4 or newer<br />
* libpng development package (libpng14-devel on opensuse, libpng-dev on Ubuntu/Debian)<br />
** development packages for other libraries may be needed; on ubuntu/Debian these can be installed using 'apt-get build-dep kdelibs5'<br />
<br />
For Calligra Sheets:<br />
* libeigen 2.0<br />
<br />
For Krita:<br />
* libeigen 2.0<br />
* libexiv2 >= 0.16<br />
<br />
For Stage:<br />
* boost<br />
<br />
For Kexi:<br />
* sqlite3 and sqlite3-devel packages (package names can differ on various distributions), version >= 3.7.10<br />
* icu, libicu and libicu-devel (unicode support)<br />
<br />
== Optional Dependencies ==<br />
<br />
All optional dependencies are logged at the end of the cmake run, so it is easy to figure out what is missing. The buildsystem also reports what component will not be built because given missing dependency.<br />
<br />
For users who want to use Krita it is also recommended to install the [http://code.compeng.uni-frankfurt.de/projects/vc Vc library]. It is optional, but makes the performance much higher.<br />
<br />
== Distribution Specific Instructions ==<br />
<br />
=== Debian-based Distributions ===<br />
On '''Debian''', '''Ubuntu''' and '''Kubuntu''', all the dependencies used for the packages can be installed by running :<br />
<pre style="white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap; white-space:pre-wrap; word-wrap:break-word">sudo apt-get build-dep calligra</pre><br />
Note you'll need to activate 'software sources' in your repositories. <br />
<br />
Additionnal librairies for Ubuntu 13.10 and derivatives :<br />
<pre style="white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap; white-space:pre-wrap; word-wrap:break-word">sudo apt-get install libxi-dev phonon-backend-gstreamer</pre><br />
<br />
For a better appearance on non-KDE desktop environment :<br />
<pre style="white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap; white-space:pre-wrap; word-wrap:break-word">sudo apt-get install kde-style-oxygen</pre><br />
<br />
On '''Linux Mint''' , you'll need to activate the software sources repositories manually. ( Search for 'Software Sources' in your menu then open it, On the tab 'Linux Mint Software' , check to activate 'Source code', On the tab 'Other Software' check to activate 'Ubuntu **.** <name> (source code) then close the windows to finish )''<br />
<br />
=== OpenSuSE ===<br />
All the dependencies used for building Calligra can be installed by running:<br />
<br />
zypper si -d calligra<br />
<br />
''( Note : enable in 'Yast' > 'Software Repository' the sources packages )''<br />
<br />
=== Fedora ===<br />
All the dependencies used for building Calligra can be installed by running:<br />
yum-builddep calligra<br />
<br />
=== Arch Linux & Manjaro ===<br />
All the dependencies used for building Calligra can be installed by running:<br />
<br />
<pre style="white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap; white-space:pre-wrap; word-wrap:break-word">sudo pacman -Sy automoc4 git cmake make boost boost-build kdepimlibs eigen2 freetds kdegraphics-okular libgsf libwpd libwpg libwps pstoedit glew gsl cmake automoc4 boost libkdcraw libpqxx fftw opengtl lcms2 vc</pre><br />
<br />
=== Chakra ===<br />
All the dependencies used for building Calligra can be installed by running:<br />
<br />
<pre style="white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap; white-space:pre-wrap; word-wrap:break-word">sudo pacman -S kdelibs kdepimlibs eigen freetds kdegraphics-okular kdeedu-marble xbase libgsf libwpd libwpg libwps libvisio pstoedit glew gsl cmake automoc4 libspnav libqtgtl boost libkdcraw libpqxx fftw opengtl docbook-xsl create-resources lcms2 qrencode libdmtx</pre><br />
<br />
=== OS X ===<br />
Latest effort of packaging Calligra in OS X is using Homebrew.<br />
<br />
First, include the calligra tap to your homebrew system:<br />
<br />
brew tap philacs/homebrew-calligra<br />
<br />
If later you decide to remove the tap, use:<br />
<br />
brew untap philacs/calligra<br />
<br />
Then you can get list of required dependencies through:<br />
<br />
brew deps --1 calligra<br />
<br />
For optional dependencies, use:<br />
<br />
brew info calligra<br />
<br />
Install those dependencies through homebrew or manage them manually or through Macports.<br />
<br />
If you want to use ninja instead of GNU make:<br />
<br />
brew install ninja<br />
<br />
Since KDE is not packaged in Homebrew and Calligra only depends on some features in kdelibs, we build a stripped kdelibs as Calligra's KDE dependency, this is the same to what is done on Windows platform.<br />
<br />
First clone the kdelibs-stripped repo:<br />
<br />
git clone git://anongit.kde.org/clones/kdelibs/rempt/kdelibs-stripped.git<br />
<br />
We use the 'stripped' branch:<br />
<br />
git checkout -b origin/stripped stripped<br />
<br />
Create a build directory:<br />
<br />
mkdir -p $HOME/kde4/build/kdelibs-stripped<br />
cd $HOME/kde4/build/kdelibs-stripped<br />
<br />
Under the build directory, build kdelibs:<br />
<br />
<pre style="word-wrap:break-word">cmake -DCMAKE_INSTALL_PREFIX=$HOME/kde4/inst -DCMAKE_PREFIX_PATH=/usr/local/opt/gettext <path to source code directory> (-GNinja if you use ninja instead of make)</pre><br />
<br />
make install (or ninja install)<br />
<br />
Calligra still depends on Eigen 2, while Homebrew already upgraded to Eigen 3, so you have to install old version of eigen through Homebrew and pin it in that version, or compile your own eigen 2:<br />
<br />
mkdir -p $HOME/kde4/build/eigen2<br />
cd $HOME/kde4/build/eigen2<br />
curl -LO http://bitbucket.org/eigen/eigen/get/2.0.17.tar.bz2<br />
tar jvxf 2.0.17.tar.bz2<br />
<pre style="word-wrap:break-word">cmake -DCMAKE_INSTALL_PREFIX=$HOME/kde4/inst -DCMAKE_BUILD_TYPE=Release eigen-eigen-* (-GNinja if using ninja) </pre><br />
make install (or ninja install)<br />
<br />
= Build Calligra =<br />
{{Note|It is '''not''' possible to build Calligra in the source directory. Set up your directories as described in the [[#Recommended_setup|Recommended setup]] section above}}<br />
<br />
Type:<br />
mkdir -p $HOME/kde4/build/calligra<br />
mkdir -p $HOME/kde4/inst<br />
cd $HOME/kde4/build/calligra<br />
<br />
The next step depends on your Qt version: There is a bug in Qt 4.8.0 and 4.8.1 which crashes the textshape quite heavily. The bug is fixed in Qt 4.8.2. There is a patch available for both Qt 4.8.0 & Qt 4.8.1 and most distributions that ship Calligra have included the patch in their Qt, if those versions. See [http://quickgit.kde.org/index.php?p=calligra.git&a=blob_plain&f=README.PACKAGERS README.PACKAGERS] for more information on the topic.<br />
So if your Qt is either 4.8.0 or 4.8.1 and it has the patch applied here is the cmake command you need to use so all gets build:<br />
<br />
cmake -DCMAKE_INSTALL_PREFIX=$HOME/kde4/inst $HOME/kde4/src/calligra \<br />
-DCMAKE_BUILD_TYPE=RelWithDebInfo -DIHAVEPATCHEDQT=true<br />
<br />
Otherwise, if your Qt is a different version or does not have the patch applied, type the command without the IHAVEPATCHEDQT flag:<br />
<br />
cmake -DCMAKE_INSTALL_PREFIX=$HOME/kde4/inst $HOME/kde4/src/calligra \<br />
-DCMAKE_BUILD_TYPE=RelWithDebInfo<br />
<br />
If you use OS X and followed previous steps about dependencies:<br />
<br />
<pre style="word-wrap:break-word">cmake -DPRODUCTSET=osx -DCMAKE_INSTALL_PREFIX=$HOME/kde4/inst -DCMAKE_PREFIX_PATH=/usr/local/opt/gettext \<br />
(Homebrew gettext prefix) -DCMAKE_BUILD_TYPE:STRING=Debug -DQT_QTDBUS_DEFINITIONS=-DQT_NO_DBUS \<br />
$HOME/kde4/src/calligra</pre><br />
<br />
''cmakekde'' tool can be used as explained on [http://techbase.kde.org/Getting_Started/Build/KDE4 the build instructions for KDE4].<br />
<br />
Then type:<br />
make<br />
<br />
Note that on dual-core machines compilation can be '''greatly speed up''' with the -j parameter of the ''make'' program, for example for dual-core:<br />
make -j3<br />
and for quad-core:<br />
make -j5<br />
<br />
n cores -> -jn+1<br />
<br />
Then type this command to install the software:<br />
make install<br />
<br />
'''Debugging options.''' The default debug setting is <tt>RelWithDebInfo</tt> which is suitable for most developers. If you are debugging an application and cannot trace the codew, you can set CMAKE_BUILD_TYPE to <tt>"DebugFull"</tt> to get a slower Calligra but with even more verbose debugging (backtrace) information. For this replace ''-DCMAKE_BUILD_TYPE=RelWithDebInfo'' in the above cmake command with ''-DCMAKE_BUILD_TYPE=DebugFull''. However, all Calligra applications will crash on closing with this option enabled.<br />
<br />
If you are working on Krita, use the <tt>KritaDevs</tt> option always.<br />
<br />
Please follow the [[Calligra/Building#Running_Calligra_Applications|Running Calligra Applications]] instructions before trying to run an application.<br />
<br />
= Updating and Rebuilding =<br />
If the source code has been cloned using Git, it is possible to update the source code with newly added changes and build again. Usually only changing parts will be built, so this operation would be faster than building the source code from scratch.<br />
<br />
Type:<br />
cd $HOME/kde4/src/calligra<br />
git pull --rebase<br />
cd $HOME/kde4/build/calligra<br />
make<br />
make install<br />
<br />
{{Note|''make -j4'' or ''make -j8'' can be used instead of ''make'' to speedup the build on multicore machines}}<br />
<br />
= Building Selected Applications =<br />
== Using Product Sets ==<br />
By default, the build system tries to build all applications. The recommended way to change this is to specify a different product set by setting the <tt>PRODUCTSET</tt> CMake variable. The following table illustrates the predefined product sets.<br />
<br />
{| class="wikitable" style="margin: 1em auto; text-align: center;"<br />
! rowspan="2" width="100"| Application<br />
! colspan="5" | Product Set<br />
|-<br />
!width="100"| DESKTOP<br />
!width="100"| CREATIVE<br />
!width="100"| ACTIVE<br />
!width="100"| OSX<br />
!width="100"| ALL<br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Active<br />
| <br />
| <br />
| X<br />
| <br />
| X<br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Author<br />
| X<br />
| <br />
| <br />
| X<br />
| X<br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Braindump<br />
| X<br />
| <br />
| <br />
| X<br />
| X<br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Flow<br />
| X<br />
| <br />
| <br />
| X<br />
| X<br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Karbon<br />
| X<br />
| X<br />
| <br />
| X<br />
| X<br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Kexi<br />
| X<br />
| <br />
| <br />
|<br />
| X<br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Krita<br />
| X<br />
| X<br />
| <br />
| X<br />
| X<br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Plan<br />
| X<br />
| <br />
| <br />
| <br />
| X<br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Sheets<br />
| X<br />
| <br />
| <br />
| X<br />
| X<br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Stage<br />
| X<br />
| <br />
| <br />
| X<br />
| X<br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Words<br />
| X<br />
| <br />
| <br />
| X<br />
| X<br />
|-<br />
|}<br />
<br />
For example, to build the <tt>CREATIVE</tt> product set, pass<br />
<br />
-DPRODUCTSET=CREATIVE<br />
<br />
on the CMake command line.<br />
<br />
{{note|The set of included plugins, import/export filters and extra tools may differ between product sets. Consult the product set definitions in the <tt>cmake/productsets</tt> directory of the Calligra sources for detailed information about what is included in each product set.}}<br />
<br />
== Specific Product Sets ==<br />
For convenience, specific cases have been covered by extra product sets.<br />
<br />
{| class="wikitable" style="margin: 1em auto; text-align: center;"<br />
! rowspan="2" width="100"| Application<br />
! colspan="5" | Product Set<br />
|-<br />
!width="100"| KEXI<br />
!width="100"| KEXI+SHEETS<br />
!width="100"| <br />
!width="100"| <br />
!width="100"| <br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Active<br />
| <br />
| <br />
| <br />
| <br />
| <br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Author<br />
| <br />
| <br />
| <br />
| <br />
| <br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Braindump<br />
| <br />
| <br />
| <br />
| <br />
| <br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Flow<br />
| <br />
| <br />
| <br />
| <br />
| <br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Karbon<br />
| <br />
| <br />
| <br />
| <br />
| <br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Kexi<br />
| X<br />
| X<br />
| <br />
| <br />
| <br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Krita<br />
| <br />
| <br />
| <br />
| <br />
| <br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Plan<br />
| <br />
| <br />
| <br />
| <br />
| <br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Sheets<br />
| <br />
| X<br />
| <br />
| <br />
| <br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Stage<br />
| <br />
| <br />
| <br />
| <br />
| <br />
|-<br />
!style="text-align: right; padding: 0.5em;"| Words<br />
| <br />
| <br />
| <br />
| <br />
| <br />
|-<br />
|}<br />
<br />
== Fine-grained Selection ==<br />
Advanced users and developers wishing to disable certain applications or other products from the selected productset may do so by setting the corresponding <tt>BUILD_{application}</tt> variable to <tt>OFF</tt>. For example, to disable compilation of Krita and Karbon, you can pass<br />
<br />
-DBUILD_krita=OFF -DBUILD_karbon=OFF<br />
<br />
on the CMake command line. You can also do this using the <tt>ccmake</tt> tool included with CMake, which you may run ''after'' the initial CMake run but ''before'' you run <tt>make</tt>.<br />
<br />
{{note|Many components should '''not''' be disabled using <tt>BUILD_{something}</tt>. Set these variables with caution!}}<br />
<br />
Instead of disabling products from the selected productset, it is also possible to design completely own productsets and then select one of them with the PRODUCTSET CMake variable. How to do that is described in the file README in the cmake/productsets directory of the Calligra sources.<br />
<br />
= Running Calligra Applications =<br />
After you installed them, there are two options to now make the Calligra applications available for running.<br />
<br />
== Running from Command Line ==<br />
If you have installed Calligra in a different prefix than KDElibs (which iss recommended in this document), you have to set the following environment variables:<br />
<br />
export KDEDIRS=/path/to/install:$KDEDIRS<br />
export PATH=/path/to/install/bin:$PATH<br />
export KDEHOME=/path/to/a/config/dir<br />
<br />
And then you need to register all the Calligra internal plugins to the system, by executing:<br />
<br />
kbuildsycoca4<br />
<br />
For example for the recommended directory structure:<br />
<br />
export KDEDIRS=$HOME/kde4/inst:$KDEDIRS<br />
export PATH=$HOME/kde4/inst/bin:$PATH<br />
export KDEHOME=$HOME/kde4/.kde<br />
<br />
{{note|It is important to set KDEHOME to a directory different of $HOME/.kde, and if the directory does not exist, it will be created automatically.}}<br />
<br />
== Running from Menus or Desktop Icons ==<br />
Instead of using ''KDEDIRS'', you can add these lines to $HOME/.kde/share/config/kdeglobals file using text editor:<br />
<br />
[Directories]<br />
prefixes=/path/to/install<br />
<br />
And then you need to register all the Calligra internal plugins to the system, by executing:<br />
<br />
kbuildsycoca4<br />
<br />
The advantage of this is that KDE will always look for the services where Calligra is installed. <br />
For example for the recommended directory structure:<br />
<br />
[Directories]<br />
prefixes=$HOME/kde4/inst<br />
<br />
= Executing Unit Tests =<br />
To be able to execute unit tests, you need to explicitly enable them in the build configuration. To do so, set the KDE4_BUILD_TESTS variable to "ON", either by issuing the command in the build directory:<br />
<br />
cd $HOME/kde4/build/calligra<br />
cmake -DKDE4_BUILD_TESTS=ON .<br />
<br />
Or you can run <code>ccmake .</code> in the buld directory and set KDE4_BUILD_TESTS to "on".<br />
<br />
You can then run the test by executing:<br />
<br />
make test<br />
<br />
or individually in the tests directories.<br />
<br />
It is recommended to execute<br />
<br />
make install<br />
<br />
before running tests.<br />
<br />
= CMake Build Options =<br />
When you enter your build directory, you can type "ccmake ." to see many build options, e.g. you can turn off compilation of apps you don't want - you can save time when compiling.<br />
<br />
Here is list for Krita related options:<br />
* HAVE_MEMORY_LEAK_TRACKER [On/Off] - You can turn on compilation of the tool in krita which detects memory leak. If you want to help debug Krita memory usage, it is useful. Otherwise you just slow down your Krita.<br />
* HAVE_BACKTRACE_SUPPORT [On/Off] - It is related to the memory leak tool. If you activate, you will be able to see code path which leads to memory leak.<br />
<br />
= Resources =<br />
*[[../Developer Info|Useful hints for who wants to hack on Calligra]]<br />
*[http://wiki.opengtl.org/libraries:developers-resources Opengtl debugging, or turning it off]<br />
*[http://winkde.org/pub/kde/ports/win32/dashboard/ Status of Calligra build on Windows (msvc 2008, mingw)]<br />
<br />
= Possible Issues =<br />
<br />
If you get errors when running an application like:<br />
<br />
krita(8565)/calligra (lib komain) KoPluginLoader::load: Loading plugin "Animation Tool" failed, <br />
"Cannot load library /home/michael/kde4/inst/lib/kde4/kpresentertoolanimation.so: <br />
(/home/michael/kde4/inst/lib/libkopageapp.so.7: undefined symbol:<br />
_ZN28KoShapeContainerDefaultModel3addEP7KoShape)" ( 1 ) <br />
<br />
or crashes when starting an application, then you very likely have a version of Calligra installed through your package manager. '''As emphasized earlier in this document, you can only have one version of Calligra, and you should uninstall your packaged Calligra'''.<br />
<br />
See also:<br />
*[[/Nightly Builds/]]<br />
*[[/Developing With KDevelop/]]<br />
*[[/Developing With QtCreator/]]<br />
*[http://techbase.kde.org/Projects/KDE_on_Windows Pages about compiling KDE software for Windows]<br />
*[http://techbase.kde.org/Getting_Started/Build/KDE4/Mac_OS_X Pages about compiling KDE software for Mac OS X]<br />
*[https://wiki.kubuntu.org/CompilingKoffice2 Community HOWTO dedicated to building for Kubuntu]<br />
*[http://community.kde.org/Sysadmin/GitKdeOrgManual kde's git infrastructure manual]<br />
*[http://techbase.kde.org/Development/Tutorials/Git KDE and Git for developers]<br />
*[http://git.or.cz/course/svn.html git crash course]<br />
*[http://forum.kde.org/viewtopic.php?f=139&t=92880 script for building Calligra (build only krita by default, but easilly configurable)]<br />
*[http://community.kde.org/Calligra/Building_Calligra_on_Windows Bulding Calligra on Windows]<br />
<br />
Note: if you want to build FreOffice using the Nokia Qt SDK, please check out the [http://techbase.kde.org/index.php?title=User:Kumarafaque&oldid=54703 build instructions on techbase].</div>David2