Building GIMP

This page describes how to build GIMP.

Prerequisites

You should know how to use:

  • a terminal and the command line;
  • shell environment variables.

Download the source code

The sources needed to compile GIMP can be cloned or downloaded here.

If you clone GIMP, you need to be used to at least managing branches before building. Take a look at this comprehensive page.

GIMP’s dependencies

You may need to install some software to build GIMP, including a C compiler, meson, and more, plus many dependencies. See the OS-specific pages for this and other details like environment etc:

For a complete list of dependencies, if you’re interested, see the files included in the root of GIMP repo or tarball under the name INSTALL*.

These informative files linked above are generated by our build system and shipped with the tarballs, containing version information for dependencies.

Preparing for Building

After you installed all the dependencies, choose a place to safely install everything you will build, and set a custom environment variable pointing to it.

You may not want to install self builds in your system prefix, as you can get odd behavior or even break your system GIMP install (if there is one).

We can name your custom variable GIMP_PREFIX and set others accordingly. For information on how to do that, see the OS-specific pages.

Build the source code

babl and GEGL

Babl and GEGL use Meson to facilitate the build process.

These two deps should be built and ideally from the latest master branch (so, unless you know exactly what you’re doing, avoid pre-compiled binaries and the tarballs).

But the build process is simple. From the root of each project (babl then GEGL), run the following commands:

# Configure how the project will be built
# You can read the file `meson_options.txt` for the project options
# Meson itself also provides built-in options: https://mesonbuild.com/Builtin-options.html
meson setup _build -Dprefix="${GIMP_PREFIX}"

# Build in '_build' dir then install in $GIMP_PREFIX
cd _build
ninja
ninja install

GIMP

Finally, after building babl and GEGL, you’re ready to build GIMP!

Rejoice! All the commands and comments written above regarding babl and GEGL also applies to GIMP building.

Just regularly make sure that you keep gimp-data updated with git submodule update (inside gimp repo folder). This is mandatory to generate icons, splash screen, etc.

You can customize the directory where GIMP stores settings if you wish. This prevents any interference with other GIMP installations on the same computer (being more useful if you’re hacking the stable branch): -Dgimpdir=GIMP/git

Problems?

Most build failures will occur during the meson setup command. You should first re-read this entire page and the OS-specific page. Then, if the problem persists, please report on GIMP bug tracker.

Running Your New GIMP

To run frequently the GIMP you have installed outside the usual places, you need to keep defined the same variables as for the build.

You can do this seting some of these variables in your “profile”: a shell script that sets environment variables when you login (e.g. $HOME/.*profile on UNIX and $profile on Windows).

See the OS-specific pages for more specific advice:

Last updated on