Tutorial: Compiling GIMP 2.7.2 for Ubuntu 11.04
-
1
This tutorial shows you how to compile GIMP 2.7.2/HEAD on Ubuntu Linux 11.04 (Natty Narwhal). 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.
If you copy and paste the commands, be aware that “—” is not a single character but two times “-” (e.g., in —prefix). Please replace these characters accordingly.
-
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.7.2 sources and extract it. Open a console window and type:
cd ~/tmp/gimp
wget ftp://ftp.gimp.org/pub/gimp/v2.7/gimp-2.7.2.tar.bz2
tar -xjf gimp-2.7.2.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
- So, either download the GIMP 2.7.2 sources and extract it. Open a console window and type:
-
4
We want to install GIMP into a special directory (/opt/gimp-2.7) so that it doesn’t interfere with the system’s GIMP package. So open a console window (if you didn’t do already) and type:
export PATH=/opt/gimp-2.7/bin:$PATH
export PKG_CONFIG_PATH=/opt/gimp-2.7/lib/pkgconfig
export LD_LIBRARY_PATH=/opt/gimp-2.7/libPlease 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 (= you don’t want to run the compiled binary on other machines), you may also do export CFLAGS=“-march=native”. It allows the C compiler to use all instructions your processor supports.
-
5
Now we have the GIMP source ready. Lets’s try to do configure it:
If you downloaded the tarball (.tar.bz2):
cd ~/tmp/gimp/gimp-2.7.2
./configure —prefix=/opt/gimp-2.7OR if you fetched the sources from git:
cd ~/tmp/gimp/gimp
./autogen.sh —prefix=/opt/gimp-2.7 -
6
The configuration fails with this message: checking for intltool >= 0.40.1… ./configure: line 14468: intltool-update: command not found
A quick check with dpkg -l | grep intltool shows that there’s a intltook-debian package installed, but not intltool. So: sudo apt-get install intltool and run the configure script again.
The next error is that babl >= 0.1.4 is required but not found. So we have a look on the babl webpage. At the moment, there is no tarball for >= 0.1.4 (if it is there, use the latest tarball) so we have to fetch the 0.1.4 sources with git (install the git package, if required):
cd ~/tmp/gimp
git clone git://git.gnome.org/babl
./autogen.sh —prefix=/opt/gimp-2.7babl wants libtool, so install it: sudo apt-get install libtool and try again:
./autogen.sh —prefix=/opt/gimp-2.7
make -j5
sudo make installThe -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.
-
7
Now let’s try to compile GIMP again:
cd ~/tmp/gimp/gimp-2.7.2
./configure —prefix=/opt/gimp-2.7.2Now 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.1/gegl-0.1.6.tar.bz2
tar -xjf gegl-0.1.6.tar.bz2As to read on GEGL’s Web site, there are some dependencies:
- GEGL needs libjpeg, so do apt-cache search libjpeg. As you can see, you have to install libjpeg62-dev (don’t use libjpeg8 as the package is apparently not compatible with libtiff4-dev, as I found out later). The -dev postfix means “including headers and development files” which are required for compiling software.
- apt-cache search openexr ⇒ libopenexr-dev
- apt-cache search rsvg ⇒ librsvg2-dev
- Install the libs: sudo apt-get install libjpeg62-dev libopenexr-dev librsvg2-dev
Now the necessary libraries are installed, so GEGL can be compiled:
cd ~/tmp/gimp/gegl-0.1.6
./configure —prefix=/opt/gimp-2.7Now 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: make -j5 and install: sudo make install GEGL.
-
8
Time for trying to compile GIMP again:
cd ~/tmp/gimp/gimp-2.7.2
./configure —prefix=/opt/gimp-2.7.2It doesn’t finish again. To get it working, install the required libraries (compiling is not required for these libs, they are available as -dev package) for every time it aborts and then try to ./configure again. For me, it was required to sudo apt-get install libtiff4-dev python-dev python-gtk2-dev.
Finally, GIMP’s ./configure script completes and informs you about the used libraries. Again, if you need some features that have not been configured now, install the necessary libraries and run the configuration again. In my case, I’d like GIMP to use lcms (the color management engine LittleCMS) and libexif to understand EXIF data:
sudo apt-get install libexif-dev liblcms1-dev
./configure —prefix=/opt/gimp-2.7.2GIMP is now configured and ready to compile.
-
9
Compile GIMP (takes some time, depending on your machine) and install it:
make -j5
make install -j5 -
10
GIMP should have been installed to /opt/gimp-2.7 now. Now, run it with /opt/gimp-2.7/bin/gimp-2.7 …
-
11
… 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.7.2 for Ubuntu 11.04) was rated 3.8/5.0 in 4 votes out of 19 comments.