Tutorial: Compiling GIMP 2.8-RC1 for Ubuntu 12.04
-
1
This tutorial shows you how to compile GIMP 2.8-RC1 on Ubuntu Linux 12.04 (Precise Pangolin). 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-RC1 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-RC1.tar.bz2 tar -xjf gimp-2.8.0-RC1.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-RC1 ./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 CPU cores + 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-RC1 ./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 the GEGL 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
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-RC1 ./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 :)
Comments
Post your own comments, questions or hints here. The author and other users will see your posting and can reply to it.
Of course, you can also ask in the chat.
Subscription management
Please log in to manage your subscriptions.
User rating
This topic (Compiling GIMP 2.8-RC1 for Ubuntu 12.04) has been rated 4.0/5.0.
New comments are disabled because of spam.