Build without using the bundled agg24 library

Hello,
I'm currently trying to study if it's possible to remove the bundled
agg library and use the one available in Debian instead.

Currently (and sadly) we have only a -dev package (that contains only
the development stuff) and not a real shared library to link against.

If it will be available, do you think it would be possible to link the
mpl source code against that one?

As of now, I was only able to force to use the system headers file with:

--- matplotlib-0.98.3.orig/setupext.py 2008-08-22 00:12:08.622829529 +0200
+++ matplotlib-0.98.3/setupext.py 2008-08-22 00:12:20.759521159 +0200
@@ -585,7 +585,7 @@
     # before adding the freetype flags since -z comes later
     add_base_flags(module)
     add_numpy_flags(module)
- module.include_dirs.extend(['src', '%s/include'%AGG_VERSION, '.'])
+ module.include_dirs.extend(['src', '/usr/include/agg2/', '.'])

     # put these later for correct link order
     module.libraries.extend(std_libs)

Thanks in advance,
Sandro

···

--
Sandro Tosi (aka morph, Morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi

This is something we have discussed in the past and decided against
supporting, because agg-2.5 is released under the terms of the GPL.

Darren

···

On Thursday 21 August 2008 19:15:49 Sandro Tosi wrote:

Hello,
I'm currently trying to study if it's possible to remove the bundled
agg library and use the one available in Debian instead.

Currently (and sadly) we have only a -dev package (that contains only
the development stuff) and not a real shared library to link against.

If it will be available, do you think it would be possible to link the
mpl source code against that one?

As of now, I was only able to force to use the system headers file with:

--- matplotlib-0.98.3.orig/setupext.py 2008-08-22 00:12:08.622829529 +0200
+++ matplotlib-0.98.3/setupext.py 2008-08-22 00:12:20.759521159 +0200
@@ -585,7 +585,7 @@
     # before adding the freetype flags since -z comes later
     add_base_flags(module)
     add_numpy_flags(module)
- module.include_dirs.extend(['src', '%s/include'%AGG_VERSION, '.'])
+ module.include_dirs.extend(['src', '/usr/include/agg2/', '.'])

     # put these later for correct link order
     module.libraries.extend(std_libs)

As you sort of allude to, Agg is so heavily templatized that there's little benefit to linking against a shared library (little disk space savings, for instance).

However, there are some .cpp (i.e. non-header files) that need to be compiled and linked. If Debian doesn't include a shared library, how would we link to those?

You can see what .cpp files we need (we don't need all of them) by looking at build_agg in setupext.py

Assuming you can get this to work with Debian's packages, I think the cleanest way to find and link to it is by using pkg-config. Does the Agg Debian package provide a pkg-config .pc file? There is code in setupext to do pkg-config lookups -- we could try that first, and if that fails, fall back on out included copy of Agg.

What we would want to avoid, of course, is including the system Agg and linking against the local Agg as your patch appears to do. That could be a problem, especially wrt any Debian-specific patches added in the future.

Sorry I can't help more now (I'm away from the office), but let me know how far you get with this info and if you run up against something else.

Cheers,
Mike

I agree with Darren. In my previous response, I was assuming Agg-2.4 would be the requirement in Debian.

If you are planning to link to a different version, licensing may be an issue (I can't really comment on that as IANAL), but there's a high likelihood of compatibility issues. The upgrade from 2.3 to 2.4 was reasonably painful and it's impossible (without large #ifdef's of course) to code across both simultaneously.

Cheers,
Mike