AGG install

rich.fromm nospam420 at YAHOO.COM
Tue Nov 27 16:32:19 EST 2007


frequens wrote:
> 
> On 9/6/07, Stephen Woodbridge <woodbri at swoodbridge.com> wrote:
> 
>> You do not need install AGG, just download it to a working dir and type
>> make in that dir. Then in the mapserver dir
>>     ./configure --with-agg=/path/to/agg/dir ...
>> and you are done.
> 
> Sorry, Steve and Thomas, did not work for me at all on a Linux Opteron
> box.
> 
> I had to do it the way Yves describes it:
> http://wiki.gloobe.org/doku.php/foss_installation#compilation_v5.0
> (already
> also in English, thanks Yves; I had to do also the "make install").
> And yes, libSDL2.1-devel seems to be obligatory, while the
> '–libdir=/usr/lib64'  setting was not needed on my system.
> 

Trying to access that URL, I get what I believe is trying to tell me of a
403
error in French, so I'll write up a few tips here based on my experiences.

Note that this was using AGG 2.5, so ymmv.  My understanding is that
mapserver
5.0.0 is currently recommending AGG 2.4 for licensing reasons, but for
initial
experimentation I decided to just download the latest since I'm building it
all from source.  I'm fairly certain it is now using AGG instead of GD,
although since I'm still not able to get working the feature that motivated
my
switch to AGG (antialiased lines), you may wish to take these instructions
with a grain of salt.

I am running Debian 3.1 (sarge).  As I noted before, there is currently no
sarge backport for libagg-dev (it is available on Debian 4.0, aka etch).

agg 2.5 suggests building using the auto* tools.  (This requires you to have
automake, autoconf, etc. already installed.  That's beyond the scope of what
I'm going to describe here.)

Once you unpack the *.tar.gz file, to run up to and through the configure
step, execute:

   . autogen.sh

When I did this, I ended up with the following error:

./configure: line 19907: syntax error near unexpected token `$SDL_VERSION,'
./configure: line 19907: `AM_PATH_SDL($SDL_VERSION,'

which seems to confirm what frequens earlier said about libsdl being
necessary.

This was trivial to install for me, since there was a debian package:

   sudo aptitude install libsdl-dev

(Or use apt-get instead of aptitude, and/or just run as root if you don't
use
sudo.)

This did scare me a little bit, since it pulled in a LOT of other
dependencies, but it ultimately seemed to install fine.

Now I reran the autogen script which I think seemed to go okay this time.

Make by executing:

   make

I think that not installing agg (as recommended by Stephen Woodbridge) is
likely to be problematic for your build of mapserver, since the build puts
the
resulting libbagg.so in a src/.libs subdir, and I think that the mapserver
build is assuming a lib subdir of whatever is passed to configure with the
--with-agg flag.

So I ended up installing it with:

   sudo make install

(Or run as root if you don't use sudo.)  This will put everything in subdirs
of /usr/local, unless you passed some different --prefix=/foo/bar to the
configure script (possibly via the autogen.sh script).

Now you're free to configure and build mapserver.  When I initially added
just
the following to my configure line:

   --with-agg=/usr/local

I got the following error:

checking if AGG support requested... configure: error: freetype required for
agg support - please configure --with-freetype.

So I ended up adding all of the following to my existing configure line:

   --with-agg=/usr/local --with-freetype

And that worked fine.  I already had the libfreetype6-dev debian package for
sarge (version 2.1.7-8), so there was nothing further to install.

Then I executed:

   make

And all worked well.

However, when I tried generating a map via apache2 and the CGI interface, I
got a 500 error, and the following in my /var/log/apache2/error.log file:

mapserv: error while loading shared libraries: libagg.so.2: cannot open
shared object file: No such file or directory

This was also evident when I tried to just run:

   mapserv -v

With the previous binary (before I build with AGG), it returned:

MapServer version 5.0.0 OUTPUT=GIF OUTPUT=PNG OUTPUT=WBMP OUTPUT=SVG
SUPPORTS=PROJ SUPPORTS=FREETYPE SUPPORTS=WMS_SERVER SUPPORTS=THREADS
INPUT=EPPL7 INPUT=SHAPEFILE

But now it returned:

/usr/lib/cgi-bin/mapserv: error while loading shared libraries: libagg.so.2:
cannot open shared object file: No such file or directory

I could fix this locally by setting:

   export LD_LIBRARY_PATH=/usr/local/lib

And now it returned:

MapServer version 5.0.0 OUTPUT=GIF OUTPUT=PNG OUTPUT=WBMP OUTPUT=SVG
SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=WMS_SERVER
SUPPORTS=THREADS INPUT=EPPL7 INPUT=SHAPEFILE

So the final bit was figuring out how to get apache2 to set this via the CGI
interface.

I added the following to my configuration at
/etc/apache2/sites-available/default

    <FilesMatch ^mapserv>
        SetEnv LD_LIBRARY_PATH /usr/local/lib
    </FilesMatch>

An alternative that also worked was just placing the SetEnv line within a
previously existing <Directory> tag.

    <Directory "/usr/lib/cgi-bin">
        # ...
        SetEnv LD_LIBRARY_PATH /usr/local/lib
        # ...
    </Directory>

But I preferred the former, since it limited this to just what I needed,
nameply mapserver.

Your specific manner of configuring your webserver may vary (this is for
apache2 2.0), and the specific location of your configuration files may also
vary (apache2 is installed for me via the sarge debian package).

Hopefully this might be of some help to someone.  This probably would have
been FAR easier on debian etch, since the libagg-dev package presumably
would
have automatically pulled in anything it needed (like libsdl-dev), and
the libraries would have ended up in /usr/lib instead of /usr/local/lib,
therefore avoiding having to explicitly set LD_LIBRARY_PATH for apache2.

- Rich Fromm

-- 
View this message in context: http://www.nabble.com/AGG-install-tf4390828.html#a13979959
Sent from the Mapserver - User mailing list archive at Nabble.com.



More information about the mapserver-users mailing list