RSS/Atom feed Twitter
Site is read-only, email is disabled

GIMP looking for babl and GEGL outside the prefix

This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

10 of 10 messages available
Toggle history

Please log in to manage your subscriptions.

GIMP looking for babl and GEGL outside the prefix Elle Stone 22 Feb 16:03
  GIMP looking for babl and GEGL outside the prefix Partha Bagchi 22 Feb 16:27
   GIMP looking for babl and GEGL outside the prefix Elle Stone 22 Feb 17:14
    GIMP looking for babl and GEGL outside the prefix Christopher Curtis 22 Feb 17:51
    GIMP looking for babl and GEGL outside the prefix Partha Bagchi 22 Feb 18:17
    GIMP looking for babl and GEGL outside the prefix Mukund Sivaraman 22 Feb 19:09
     GIMP looking for babl and GEGL outside the prefix Elle Stone 22 Feb 22:18
    GIMP looking for babl and GEGL outside the prefix Michael Natterer 23 Feb 12:11
     GIMP looking for babl and GEGL outside the prefix Elle Stone 23 Feb 14:25
      GIMP looking for babl and GEGL outside the prefix Michael Natterer 23 Feb 18:12
Elle Stone
2015-02-22 16:03:00 UTC (about 9 years ago)

GIMP looking for babl and GEGL outside the prefix

I installed babl/GEGL/GIMP from git in a prefix. Then I installed babl/GEGL/GIMP-2.8 from Gentoo portage. When I tried to update GIMP from git in the prefix, I got the following terminal output

core/libappcore.a(gimphistogram.o): In function `gimp_histogram_calculate': /home/elle/code/gimpdefault/build/gimp/app/core/gimphistogram.c:261: undefined reference to `babl_format_get_model' . . .
collect2: error: ld returned 1 exit status Makefile:890: recipe for target 'gimp-2.9' failed make[4]: *** [gimp-2.9] Error 1
. . .

This problem is documented here: http://wiki.gimp.org/wiki/Hacking:Problems_and_solutions#GIMP_build_fails_for_missing_BABL_function

Why is GIMP looking for babl outside the prefix?

Is there a way to make GIMP look inside the prefix and ignore the babl install that's outside the prefix? I mean besides uninstalling babl/GEGL from portage before updating GIMP in the prefix?

Elle

Partha Bagchi
2015-02-22 16:27:04 UTC (about 9 years ago)

GIMP looking for babl and GEGL outside the prefix

Welcome back. :)

Can you not simply pass the LIB statement to configure/autogen or adjust PKG_CONFIG_PATH?

On Sun, Feb 22, 2015 at 11:03 AM, Elle Stone wrote:

I installed babl/GEGL/GIMP from git in a prefix. Then I installed babl/GEGL/GIMP-2.8 from Gentoo portage. When I tried to update GIMP from git in the prefix, I got the following terminal output

core/libappcore.a(gimphistogram.o): In function `gimp_histogram_calculate': /home/elle/code/gimpdefault/build/gimp/app/core/gimphistogram.c:261: undefined reference to `babl_format_get_model' . . .
collect2: error: ld returned 1 exit status Makefile:890: recipe for target 'gimp-2.9' failed make[4]: *** [gimp-2.9] Error 1
. . .

This problem is documented here: http://wiki.gimp.org/wiki/Hacking:Problems_and_solutions#GIMP_build_fails_for_missing_BABL_function

Why is GIMP looking for babl outside the prefix?

Is there a way to make GIMP look inside the prefix and ignore the babl install that's outside the prefix? I mean besides uninstalling babl/GEGL from portage before updating GIMP in the prefix?

Elle _______________________________________________ gimp-developer-list mailing list
List address: gimp-developer-list@gnome.org List membership: https://mail.gnome.org/mailman/listinfo/gimp-developer-list List archives: https://mail.gnome.org/archives/gimp-developer-list

Elle Stone
2015-02-22 17:14:20 UTC (about 9 years ago)

GIMP looking for babl and GEGL outside the prefix

On 02/22/2015 11:27 AM, Partha Bagchi wrote:

Welcome back. :)

Thanks!

Can you not simply pass the LIB statement to configure/autogen or adjust PKG_CONFIG_PATH?

I use these commands to set up the prefix before installing and updating babl/GEGL/GIMP:

prefix=/home/elle/code/gimpdefault/run exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
datarootdir=${prefix}/share

The babl/GEGL/GIMP run/lib/pkgconfig/ pc files have text like this (sometimes fewer or more lines):

prefix=/home/elle/code/gimpdefault/run exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
datarootdir=${prefix}/share

Is there another step involved in passing the LIB statement to configure/autogen or adjusting the PKG_CONFIG_PATH?

Elle

Christopher Curtis
2015-02-22 17:51:38 UTC (about 9 years ago)

GIMP looking for babl and GEGL outside the prefix

Hi Elle,

Not a GIMP dev, so just some general advice here.

It looks like the problem is from compiling gimphistogram.c. Scroll back through the history to find the 'gcc' line where this is compiled and look at the full arguments. Make sure that there's a "-L/home/elle/..." argument that appears before any other "-L/usr/lib" type arguments.

Then, I'd look at the Makefile to see if it makes sense. Where are the -L arguments coming from? Are you running some pkgconfig command from /usr/bin instead of your custom path? Etc.

Regards, Chris

On Sun, Feb 22, 2015 at 12:14 PM, Elle Stone

wrote:

On 02/22/2015 11:27 AM, Partha Bagchi wrote:

Welcome back. :)

Thanks!

Can you not simply pass the LIB statement to configure/autogen or

adjust PKG_CONFIG_PATH?

I use these commands to set up the prefix before installing and updating babl/GEGL/GIMP:

prefix=/home/elle/code/gimpdefault/run exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
datarootdir=${prefix}/share

The babl/GEGL/GIMP run/lib/pkgconfig/ pc files have text like this (sometimes fewer or more lines):

prefix=/home/elle/code/gimpdefault/run exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
datarootdir=${prefix}/share

Is there another step involved in passing the LIB statement to configure/autogen or adjusting the PKG_CONFIG_PATH?

Elle _______________________________________________ gimp-developer-list mailing list
List address: gimp-developer-list@gnome.org List membership: https://mail.gnome.org/mailman/listinfo/gimp- developer-list
List archives: https://mail.gnome.org/archives/gimp-developer-list

Partha Bagchi
2015-02-22 18:17:45 UTC (about 9 years ago)

GIMP looking for babl and GEGL outside the prefix

Let's say that you are building it somewhere like /opt

Let's also say that your babl/gegl are in /opt/babl and /opt/gegl respectively.

Then, I would do the following:

export PKG_CONFIG_PATH=/opt/babl/lib/pkgconfig;/opt/gegl/lib/pkgconfig;$PKG_CONFIG_PATH

Babl has no dependencies and so you can build it first.

Then to build gegl, I would say ./configure --prefix=/opt/gegl LIBS=-L/opt/babl/lib CPPFLAGS=-I/opt/babl/include

For gimp then I would say ./configure --prefix=/opt/gimp LIBS="-L/opt/babl/lib -L/opt/gegl/lib" CPPFLAGS="-I/opt/babl/include -I/opt/gegl/include"

etc.

Note that both gegl and gimp pick up the libraries from PKG_CONFIG_PATH

On Sun, Feb 22, 2015 at 12:14 PM, Elle Stone wrote:

On 02/22/2015 11:27 AM, Partha Bagchi wrote:

Welcome back. :)

Thanks!

Can you not simply pass the LIB statement to configure/autogen or adjust PKG_CONFIG_PATH?

I use these commands to set up the prefix before installing and updating babl/GEGL/GIMP:

prefix=/home/elle/code/gimpdefault/run exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
datarootdir=${prefix}/share

The babl/GEGL/GIMP run/lib/pkgconfig/ pc files have text like this (sometimes fewer or more lines):

prefix=/home/elle/code/gimpdefault/run exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
datarootdir=${prefix}/share

Is there another step involved in passing the LIB statement to configure/autogen or adjusting the PKG_CONFIG_PATH?

Elle

Mukund Sivaraman
2015-02-22 19:09:09 UTC (about 9 years ago)

GIMP looking for babl and GEGL outside the prefix

Hi Elle

On Sun, Feb 22, 2015 at 12:14:20PM -0500, Elle Stone wrote:

Is there another step involved in passing the LIB statement to configure/autogen or adjusting the PKG_CONFIG_PATH?

I use these steps for building and installing GIMP into my home directory: https://mukund.org/tmp/gimp-build-script.txt

It has (historically) worked for others too. It may need some fiddling of version numbers for the deps. After the exports, You can start from the babl step if you have a very new distro such as Fedora 21 which has the gtk+-2.0 version that GIMP needs.

Mukund

Elle Stone
2015-02-22 22:18:52 UTC (about 9 years ago)

GIMP looking for babl and GEGL outside the prefix

Hi Partha, Chris, and Mukund, and thanks! for trying to help sort this out.

I've rebuilt babl/GEGL/GIMP in a prefix many times without any problems. The problem started when I installed babl/GEGL/GIMP-2.8 from Gentoo portage. For some reason GIMP from git is looking for babl in /usr before checking the prefix.

Mukund, the build script failed with gegl saying it couldn't find babl.

Chris, I don't know how to make sense of what's in the makefile. I did look at it.

Partha, I'm not sure how to interpret these lines:

export PKG_CONFIG_PATH=/opt/babl/lib/pkgconfig;/opt/gegl/lib/pkgconfig;$PKG_CONFIG_PATH

Babl has no dependencies and so you can build it first.

Then to build gegl, I would say ./configure --prefix=/opt/gegl LIBS=-L/opt/babl/lib CPPFLAGS=-I/opt/babl/include

because there is no "blah/babl/lib" but rather "blah/lib/babl". So I tried the following:

./autogen.sh --prefix=/home/elle/code/gimpdefault/run LIBS=-L/home/elle/code/gimpdefault/run/lib/babl-0.1 CPPFLAGS=-I/home/elle/code/gimpdefault/run/include/babl-0.1

and similarly for GIMP, which ended in the same GIMP "make" error message about an undefined reference to `babl_format_get_model'.

I'm sure Partha's advice is on the right track. The babl build ends with the following:

Libraries have been installed in: /home/elle/code/gimpdefault/run/lib/babl-0.1

If you ever happen to want to link against installed libraries in a given directory, LIBDIR, you must either use libtool, and specify the full pathname of the library, or use the '-LLIBDIR' flag during linking and do at least one of the following: - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable during execution
- add LIBDIR to the 'LD_RUN_PATH' environment variable during linking
- use the '-Wl,-rpath -Wl,LIBDIR' linker flag - have your system administrator add LIBDIR to '/etc/ld.so.conf'

Unfortunately I don't know the right syntax and place to implement above.

Anyway, thanks! everyone for trying to help. At this point I'll use the "workaround" of uninstalling babl/GEGL from portage before updating babl/GEGL/GIMP from git, unless someone knows how to implement the above babl output.

Elle

Michael Natterer
2015-02-23 12:11:31 UTC (about 9 years ago)

GIMP looking for babl and GEGL outside the prefix

On Sun, 2015-02-22 at 12:14 -0500, Elle Stone wrote:

On 02/22/2015 11:27 AM, Partha Bagchi wrote:

Welcome back. :)

Thanks!

Can you not simply pass the LIB statement to configure/autogen or adjust PKG_CONFIG_PATH?

I use these commands to set up the prefix before installing and updating babl/GEGL/GIMP:

prefix=/home/elle/code/gimpdefault/run exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
datarootdir=${prefix}/share

Hi Elle,

these variables won't help at all. A more-or-less complete development prefix environment looks like this (working example from my disk, with all the same packages in prefix also installed by the OS in /usr):

PREFIX=/home/elle/code/gimpdefault/run export PATH=$PREFIX/bin:$PATH
export LD_LIBRARY_PATH=$PREFIX/lib:$LD_LIBRARY_PATH export XDG_DATA_DIRS=$PREFIX/share:$XDG_DATA_DIRS export ACLOCAL_FLAGS="-I $PREFIX/share/aclocal" export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH

If you also build glib in that prefix, it needs to find OS-installed modules. On debian unstable 64 bit this looks like:

export GIO_EXTRA_MODULES=/usr/lib/x86_64-linux-gnu/gio/modules

but might be different depending on the distribution.

Regards, --Mitch

Elle Stone
2015-02-23 14:25:48 UTC (about 9 years ago)

GIMP looking for babl and GEGL outside the prefix

On 02/23/2015 07:11 AM, Michael Natterer wrote:

A more-or-less complete development prefix environment looks like this (working example from my disk, with all the same packages in prefix also installed by the OS in /usr):

PREFIX=/home/elle/code/gimpdefault/run export PATH=$PREFIX/bin:$PATH
export LD_LIBRARY_PATH=$PREFIX/lib:$LD_LIBRARY_PATH export XDG_DATA_DIRS=$PREFIX/share:$XDG_DATA_DIRS export ACLOCAL_FLAGS="-I $PREFIX/share/aclocal" export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH

If you also build glib in that prefix, it needs to find OS-installed modules. On debian unstable 64 bit this looks like:

export GIO_EXTRA_MODULES=/usr/lib/x86_64-linux-gnu/gio/modules

but might be different depending on the distribution.

Mitch, thanks! Following your setup worked perfectly.

glib did complain that $PREFIX/share/aclocal didn't exist, so I created the empty directory and then everything went smoothly, with GIMP and glib both writing ".m4" files to the aclocal directory. From curiosity, why didn't babl and GEGL also write ".m4" files?

In case anyone else is running Gentoo, the path (at least for a pure 64-bit build) is "/usr/lib/gio/modules".

For the next person who encounters this problem, maybe a link to Mitch's post could be added to
http://wiki.gimp.org/wiki/Hacking:Problems_and_solutions#GIMP_build_fails_for_missing_BABL_function?

Elle

Michael Natterer
2015-02-23 18:12:10 UTC (about 9 years ago)

GIMP looking for babl and GEGL outside the prefix

On Mon, 2015-02-23 at 09:25 -0500, Elle Stone wrote:

On 02/23/2015 07:11 AM, Michael Natterer wrote:

A more-or-less complete development prefix environment looks like this (working example from my disk, with all the same packages in prefix also installed by the OS in /usr):

PREFIX=/home/elle/code/gimpdefault/run export PATH=$PREFIX/bin:$PATH
export LD_LIBRARY_PATH=$PREFIX/lib:$LD_LIBRARY_PATH export XDG_DATA_DIRS=$PREFIX/share:$XDG_DATA_DIRS export ACLOCAL_FLAGS="-I $PREFIX/share/aclocal" export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH

If you also build glib in that prefix, it needs to find OS-installed modules. On debian unstable 64 bit this looks like:

export GIO_EXTRA_MODULES=/usr/lib/x86_64-linux-gnu/gio/modules

but might be different depending on the distribution.

Mitch, thanks! Following your setup worked perfectly.

glib did complain that $PREFIX/share/aclocal didn't exist, so I created the empty directory and then everything went smoothly, with GIMP and glib both writing ".m4" files to the aclocal directory. From curiosity, why didn't babl and GEGL also write ".m4" files?

The m4 macros are doing fancy stuff... Instead of simply doing

pkg-config --foo glib-2.0"

or its m4 version

PKG_CHECK_MODULES(GLIB, glib-2.0 >= glib_required_version)

you would use:

AM_PATH_GLIB_2_0(...)

which does the above, and additionally does paranoia checks like verifying that the lib and its headers belong together, that a program can actually be compiled against that version, and whatnot.

It's "extra paranoia", useful, but not strictly needed.

In case anyone else is running Gentoo, the path (at least for a pure 64-bit build) is "/usr/lib/gio/modules".

For the next person who encounters this problem, maybe a link to Mitch's post could be added to
http://wiki.gimp.org/wiki/Hacking:Problems_and_solutions#GIMP_build_fails_for_missing_BABL_function?

Or maybe it should be part of the FAQ?

Alexandre? I think this could be useful.

Regards, --Mitch