Skip to content
August 22, 2012 / alancads

Compiling GIMP 2.8.0 in Ubuntu 10.04

1 – This tutorial shows you how to compile GIMP 2.8 on Ubuntu Linux 10.04 (Lucid Lynx). However, you can use it for other GIMP/Linux versions too, because I’ll try to explain how to do it, and not to just tell you the necessary commands so you can compile it but don’t know what you’re doing.

If a step doesn’t work as expected or there are required additional steps, please modify the procedure on your own and maybe leave a comment to inform other users about your findings.

If there are newer versions available as the ones in the tutorial (for instance, for babl or GEGL), use the newer versions.

2 – First, create a temporary directory where the sources are put into:

mkdir -p ~/tmp/gimp
cd ~/tmp/gimp

3 – Then, fetch the source code of the GIMP version you want to compile and put it into the directory.

So, either download the GIMP 2.8 sources and extract it. Open a console window and type:

cd ~/tmp/gimp
wget ftp://ftp.gimp.org/pub/gimp/v2.8/gimp-2.8.0.tar.bz2
tar -xjf gimp-2.8.0.tar.bz2

Alternatively, fetch the latest sources with git (make sure git is installed – install with sudo apt-get install git ):

Open a console window and type:

cd ~/tmp
git clone git://git.gnome.org/gimp

4 – We want to install GIMP into a special directory (/opt/gimp-2.8) so that it doesn’t interfere with the system’s GIMP package. To accomplish that, open a console window (if you didn’t do already) and type:

export PATH=/opt/gimp-2.8/bin:$PATH
export PKG_CONFIG_PATH=/opt/gimp-2.8/lib/pkgconfig
export LD_LIBRARY_PATH=/opt/gimp-2.8/lib

The PATH is a list of directories where binaries are looked for, PKG_CONFIG_PATH allows the pkg-config tool to recognize libraries compiled in our GIMP-2.8 directory and LD_LIBRARY_PATH allows shared objects to be located in some custom path.

Please note that these exports are only stored for this session (= console window). If you close it and open another one later, you will have to type these lines again (or put it into .bashrc).

If you compile only for your machine (i.e., you don’t want to run the compiled binary on other machines), you can also do

export CFLAGS="-march=native -O3" 

It allows the C compiler to use all instructions your processor supports and will optimize the compiled code for greatest performance.

5 – Now we have the GIMP source ready. Before the next step, install all development dependencies that the system-packaged GIMP requires. The chances for GIMP 2.8 needing these libraries is high and so we don’t need to install everything by hand:

sudo apt-get build-dep gimp

This will probably install a bunch of packages, so be patient.

6 – Now lets’s try to ./configure the source:

If you downloaded the tarball (.tar.bz2):

cd ~/tmp/gimp/gimp-2.8.0
./configure --prefix=/opt/gimp-2.8

Or if you fetched the sources from git:

cd ~/tmp/gimp/gimp
./autogen.sh --prefix=/opt/gimp-2.8

7 – The configuration fails saying that babl >= 0.1.10 is required but not found. So we have a look on the babl webpage. There is no tarball for >= 0.1.10 so we fetch the source via git:

cd ~/tmp/gimp
git clone git://git.gnome.org/babl

babl-configure throws an error if libtool is missing, so install it using sudo apt-get install libtool. Then:

cd babl
./autogen.sh --prefix=/opt/gimp-2.8
make -j5
sudo make install -j5

The -j argument controls how many processes are created simultaneously. Use number of CPUcores + 1 — for instance, if you have 4 CPU cores, use -j5. This makes compiling faster, but not the resulting binary, of course.

8 – Now let’s try to compile GIMP again:

cd ~/tmp/gimp/gimp-2.8.0
./configure --prefix=/opt/gimp-2.8

Now there’s another error: “Package requirements (gegl >= 0.1.6) were not met.”

As you may have guessed — now it’s required to go to theGEGL webpage and download the latest GEGL version:

cd ~/tmp/gimp
wget ftp://ftp.gimp.org/pub/gegl/0.2/gegl-0.2.0.tar.bz2
tar -xjf gegl-0.2.0.tar.bz2
cd gegl-0.2.0
./configure --prefix=/opt/gimp-2.8

9 – Now check the output of the configuration script. It tells you which libraries are found and used. If you need some features that have not been configured now, install the necessary libraries and run the ./configure script again.

Finally, compile with: make -j5 && sudo make install -j5

10 – Time for trying to compile GIMP again:

cd ~/tmp/gimp/gimp-2.8.0
./configure --prefix=/opt/gimp-2.8

Watch the output again. If there are libraries missing or if you want to enable additional features, install the required libraries (compiling should not be required for these libs, they are available as -dev package) ./configure again until everything is OK.

GIMP is now configured and ready to compile.

11 – Compile GIMP (takes some time, depending on your machine) and install it:

make -j5
make install -j5

12 – GIMP should have been installed to /opt/gimp-2.8 now. Now, run it with /opt/gimp-2.8/bin/gimp-2.8 …

13 – … check Window / Single-window-mode and it’s ready to use and enjoy. 🙂

Advertisements

3 Comments

Leave a Comment
  1. Don / Aug 31 2012 12:38 pm

    Nice! I will have to try this on Debian 6.0.5 (Squeeze). Will try proof of concept first in a VM, maybe even make a .deb package from it.

    • alancads / Aug 31 2012 6:20 pm

      Thanks, Good Luck!

      • Don / Dec 23 2012 11:03 pm

        I’ve still been meaning to get around to it for Debian Squeeze, maybe this week. I just posted the URL for your blog entry over on the Debian User Forums as there’s a whole thread about wanting to get Gimp 2.8 running in Squeeze:
        http://forums.debian.net/viewtopic.php?f=6&t=81324

        Not even Steve Pusser in the Debian binary compatable Mepis Linux has backported Gimp 2.8.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: