Tutorial: Compiling GIMP 2.7.2 for Ubuntu 11.04

Compiling GIMP 2.7.2 for Ubuntu 11.04 — Result

Motivation / Intro

GIMP development versions are not intended for production use, so they don't come as an official package for Linux distributions normally. However, you can compile them yourself to see what will come.

Tutorial details

  • Category: Basics
  • Written by
  • Created on Apr 21, 2011, last updated 10 months ago
  • Time to reproduce: ≈15 minutes Skill_2
  • Tested with GIMP 2.7.2
Creative Commons License
This work by Richard Hirner is licensed under the Attribution-NonCommercial 3.0 Unported terms.
Your Ad Here
  1. 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. 2

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

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

  3. 3

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

    1. 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
    2. 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. 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/lib

    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 (= 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. 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.7

    OR if you fetched the sources from git:
    cd ~/tmp/gimp/gimp
    ./autogen.sh —prefix=/opt/gimp-2.7

  6. 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.7

    babl wants libtool, so install it: sudo apt-get install libtool and try again:

    ./autogen.sh —prefix=/opt/gimp-2.7
    make -j5
    sudo make install

    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.

  7. 7

    Now let’s try to compile GIMP again:

    cd ~/tmp/gimp/gimp-2.7.2
    ./configure —prefix=/opt/gimp-2.7.2

    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.1/gegl-0.1.6.tar.bz2
    tar -xjf gegl-0.1.6.tar.bz2

    As 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.7

    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: make -j5 and install: sudo make install GEGL.

  8. 8

    Time for trying to compile GIMP again:

    cd ~/tmp/gimp/gimp-2.7.2
    ./configure —prefix=/opt/gimp-2.7.2

    It 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.2

    GIMP is now configured and ready to compile.

  9. 9

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

    make -j5
    make install -j5

  10. 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. 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.

*

As a registered user, you can rate articles and comments, attach files to comments, subscribe to topics and you don't need to solve CAPTCHAs anymore.

*…optional

BillyG BillyG member for 6 days rated this topic with 3/5
2 days ago

I have been attempting to compile GIMP version 2.7.4 with the instructions given in this article. After many adventures, made necessary by the far greater number of missing libraries, the configure script came down to the Python headers and then refused to compile because it could not find the Python 2.6 headers. I have looked. My Python headers are in /usr/python2.6. How do I proceed from here?

DzaDze DzaDze member for 10 days rated this topic with 4/5
10 days ago

Mine error:

checking for GLIB - version >= 2.30.2... no
*** Could not run GLIB test program, checking why...
*** The test program failed to compile or link. See the file config.log for the
*** exact error that occured. This usually means GLIB is incorrectly installed.
configure: error: Test for GLIB failed. See the file 'INSTALL' for help.

What to do now ?

Peter
3 months ago

brilliant! one window at last! thanks!

serge
5 months ago

Hi
I need also install plugin save for web. How i can do this?

Georgiy S
5 months ago

Thank you. I spent hours on this with 2.7.3, but it was worth it.

ill
7 months ago

this is the first time i try to compile something.
i could fix some error by realizing, that i have to correct the syntax in some cases (typographic " ", dashes etc.), but now i got stucked here:
:~/tmp/gimp$ ./autogen.sh --prefix=/opt/gimp-2.7
bash: ./autogen.sh: Datei oder Verzeichnis nicht gefunden

what did i do wrong?

SpEcIeS SpEcIeS member for over 3 years
8 months ago

@billn: There is a PPA for gimp 2.7.2. But if you use it, you cannot install 2.7.2 beside 2.6. It will replace 2.6.

Just open a terminal and type:
sudo add-apt-repository ppa:matthaeus123/mrw-gimp-svn && sudo apt-get update && sudo apt-get-install gimp

billn
8 months ago

Will someone convert Gimp 2.7+ to a deb package so idiots like me can use it? I hope someone can help me...

Bryce
9 months ago

There are bugs filed against Ubuntu to update babl and gegl. See: https://launchpad.net/ubuntu/+source/babl

BN
9 months ago

Can you supply a solution to?

WARNING: aclocal's directory is /usr/share/aclocal, but...
no file /usr/share/aclocal/gtk-2.0.m4
You may see fatal macro warnings below.
If these files are installed in /some/dir, set the
ACLOCAL_FLAGS environment variable to "-I /some/dir"
or install /usr/share/aclocal/gtk-2.0.m4.

configure.ac:497: warning: macro `AM_PATH_GTK_2_0' not found in library

Bryce
9 months ago

Thanks SO MUCH. Though I think given how easy git is to install, you should rewrite to use git only. Then you'll have all the configure vs. autogen.sh issues worked out also.

BN
9 months ago

Stuck at:

configure.ac:509: error: possibly undefined macro: AM_PATH_GTK_2_0
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.

Erasme
9 months ago

Hi and thank you redforce.
It worked perfectly.
I just didn't do export CFLAGS="-march=native". It made the configuration fail.

akovia akovia member for over 3 years rated this topic with 4/5
10 months ago

Got stuck at making babl:
Version mismatch error. This is libtool 2.4 Debian-2.4-2, but the
definition of this LT_INIT comes from libtool 2.2.6b.
You should recreate aclocal.m4 with macros from libtool 2.4 Debian-2.4-2
and run autoconf again.

I was about to go look for an updated version of libtool, but after reading comments about copying over all the themes, icons, and GTK, and other additional packages I'm not so sure anymore. My drive is getting a little low on space and not sure it's worth it anymore.

I would recommend cleaning up the additional information from the comments and adding it to the guide as a footnote. Thanks anyway though. I may revisit this again once I free up some space or can't wait any longer for some single window gimpness.

SpEcIeS SpEcIeS member for over 3 years
10 months ago

Addition: Since you use a different version of gtk+ for gimp 2.7.2, gimp will look awful. You need to copy the engines from /usr/lib/gtk-2.0/2.10.0/engines to /opt/gimp-2.7/lib/gtk-2.0/2.10.0/engines, the theme you are using from /usr/share/themes to /opt/gimp-2.7/share/themes and the icon theme your are using from /usr/share/icons to /opt/gimp-2.7/share/icons.

SpEcIeS SpEcIeS member for over 3 years
10 months ago

I'm compiling on 10.10 at the moment. I need newer versions of: glib, gtk+, gdk_pixbuf, cairo, pixman (for cairo).
You can get these packages with:
wget http://ftp.gnome.org/pub/GNOME/sources/gdk-pixbuf/2.22/gdk-pixbuf-2.22.1.tar.bz2
git clone git://anongit.freedesktop.org/git/cairo
git clone git://anongit.freedesktop.org/git/pixman.git
(see Granner's comment for glib and gtk+)

redforce redforce member for over 5 years
10 months ago

I think for Ubuntu 10.10, you need glib and maybe gdk_pixbuf

Granner Granner member for about 4 years rated this topic with 4/5
10 months ago

I also miss the right glib

Just do it with wget (version number is 2.28.3:
Go back to your /tmp/gimp/ folder.
cd ~/tmp/gimp/
wget http://ftp.gnome.org/pub/GNOME/sources/glib/2.28/glib-2.28.1.tar.bz2

then

tar -xjf glib-2.28.1.tar.bz2

Switch too:
cd ./glib-2.28.1
./configure -prefix=/opt/gimp-2.7.2
make -j3
--> that in my case i think you will use make -j5 or whatever
sudo make install

Afterwards you will see that you havn't the right GTK+ version. If so do the follow:
Go back to tmp/gimp folder again:
cd ~/tmp/gimp/
wget http://ftp.gnome.org/pub/GNOME/sources/gtk+/2.24/gtk+-2.24.3.tar.bz2

Then:
tar -xjf gtk+-2.24.3
and:
cd ./gtk+-2.24.3
./configure -prefix=/opt/gimp-2.7.2
make -j3
sudo make install

--> you see it is really easy and just try and error thing... godawful ...

MC-Photography MC-Photography member for about 2 years
10 months ago

Some comments:

You can use --disable-gtk-doc with autogen if you don't have or want "gtk-doc".

In step 6, you need to go to the babl-directory and run the "autogen" script, followed by "make" to install babl.

But I failed at missing or not finding Glib. So I need to work on that now first.

Welcome!


Lost password?

Sign in with Facebook
Sign in with Google
Sign in with Twitter

Not a member? Sign up!

Random tutorials | Latest tutorials

  1. Generate a stripe-like texture Generate a stripe-like texture 6
  2. How to generate realistic mass waterdrops on a surface How to generate realistic mass waterdrops on a surface 40
  3. Creating a Vista-like wallpaper Creating a Vista-like wallpaper 14
  4. Creating an industrial-style wallpaper Creating an industrial-style wallpaper 9

Latest comments

I have been attempting to compile GIMP version 2.7.4 with the instr... (2 days ago in Compiling GIMP 2.7.2 for Ubuntu 11.04)

Fantastic beginner tutorial for Python filter writing. Thanks much... (3 days ago in Write a Python plugin in GIMP (HD-VIDEO))

OK I got it I think. I am using Windows 7 (Pro I think...) 64 bit (... (3 days ago in Installing Python for GIMP 2.6 (Windows))

Poll

How well do you accomplish the tutorials and instructions for GIMP here on gimpusers.com.

View results

Latest forum activities

Your Ad Here

facts & numbers

gimpusers.com RSS feed

51 identi.ca followers
754 Twitter followers

powered by bitfire it services