Building Krita From Source
Closed, ResolvedPublic

Description

Building krita from source

You can build Krita on Linux, Windows and OSX. Linux is the easier option because all the libraries that Krita needs are available on most recent Linux distributions. On OSX you can use tools like homebrew to get the dependencies.

On Windows you will have to build the dependencies yourself. This takes a lot of time and is only recommended for experienced people. See https://phabricator.kde.org/source/krita/browse/master/3rdparty/README.md for detailed instructions.

This page only deals with building Krita on Linux. You need to be familiar with using a terminal.

Preparing your development environment

The most convenient layout is as follows:

kritadev/krita -- the source code
kritadev/build -- the location where you compile krita
kritadev/install -- the location where you install krita to and run krita from

we will call the "kritadev" folder your build root.

Note: type in what's shown after '>' in the following commands

you@yourcomputer:~> mkdir kritadev
you@yourcomputer:~/> cd kritadev
you@yourcomputer:~/kritadev> mkdir build
you@yourcomputer:~/kritadev> mkdir install

Getting the source code

Open a terminal and enter the build root. Clone Krita from kde's git infrastructure (not github):

you@yourcomputer:~/kritadev> git clone git://anongit.kde.org/krita.git

Building the source code

you@yourcomputer:~/kritadev> cd build

Running cmake

Krita uses cmake (https://cmake.org) to define how Krita is built on various platforms. You first need to run cmake to generate the build system, in the kritadevs/build directory, then run make to make Krita, then run make install to install krita.

you@yourcomputer:~/kritadev/build>cmake ../krita -DCMAKE_INSTALL_PREFIX=/path/to/kritadev/install -DCMAKE_BUILD_TYPE=RelWithDebInfo

Unless you have installed all the dependencies Krita needs, on first running cmake, cmake will complain about missing dependencies. For instance:

-- The following RECOMMENDED packages have not been found:

 * GSL , <http://www.gnu.org/software/gsl>
   Required by Krita's Transform tool.

This is not an error, and you can fix this by installing the missing package using your distribution's package manager. Do not download these packages manually from the source website and build them manually.

If all dependencies have been installed, cmake will output something like this:

-- Configuring done
-- Generating done
-- Build files have been written to: /home/boud/dev/b-krita

Until that is shown, cmake has not succeeded and you cannot build Krita. When this is shown, you can build Krita:

you@yourcomputer:~/kritadev/build> make
you@yourcomputer:~/kritadev/build> make install

When these commands have succeeded, you can run Krita:

you@yourcomputer:~/kritadev/build>../install/bin/krita

Common problems

  • The most common problem is a missing dependency. Install it. A missing dependency is not an "error" that you need to report to the other Krita developers.
  • A dependency can also be too old. CMake will report when the version of a dependency is too old. That is also not an "error". You might need to update your Linux installation to a newer version.

Related Objects

rempt created this task.Jan 8 2018, 2:24 PM
rempt triaged this task as Normal priority.
rempt updated the task description. (Show Details)Jan 8 2018, 2:26 PM
woltherav updated the task description. (Show Details)Jan 8 2018, 2:29 PM
rempt closed this task as Resolved.Aug 13 2018, 9:22 AM