python mapscript compile errors (solved - sort of)

Matthew Perry perrygeo at GMAIL.COM
Mon Oct 15 04:06:02 EDT 2007


On 10/14/07, Umberto Nicoletti <umberto.nicoletti at gmail.com> wrote:
> You did not mention the architecture (x86, amd64 or other) so I will
> assume that you are on x86.
>
> You are using a custom GD (in /usr/local) which might conflict with gd
> installed by ubuntu and the same probably goes with agg too.
> On Ubuntu 7.10 you get a very recent GD and agg so there is no reason
> (that I know of or imagine) to compile your own.
>

Well there is a very good reason .. it doesn't work! Using the ubuntu
packages, I can compile the mapserver binaries just fine but the
python mapscript bindings give the undefined symbol error. There are
no documented solutions or workarounds but it was suggested that some
compiler flags used with AGG might be causing the issue. Hence the
effort to build from source.

I am on 32-bit x86 btw with standard hardware all around.

In any case, I was able to solve the issue with the help of hobu on
IRC this afternoon. The goal is to build a shared libagg.so with
freetype which mapserver can link against without any problems.

It was, honestly, way too much Makefile hacking for me. I was stunned
at how abysmal the AGG build system is. I can't believe I'm the only
person to run into this problem so, to spare others the pain, here is
the procedure that worked for me:

http://perrygeo.net/agg_mapserver.txt

I can't vouche for every detail; there are probably many things that
are not considered the "right" way to do things. But in the absence of
any real documentation and a desire to have at least part of my sunday
free, I did what worked.

Mapserver devs - maybe you could consider forking AGG 2.4 (the pre-GPL
version) and including it in the source tree so that the builds could
be a bit smoother?

- Matt


> On my system (Ubuntu 7.10 x86) agg and gd are:
>
> unicoletti at ziggy ~ $apt-cache show libagg-dev | grep Version
> Version: 2.4+20060719-3
>
> unicoletti at ziggy ~ $apt-cache show libgd2-xpm | grep Version
> Version: 2.0.34~rc1-2ubuntu1.1
>
> which are both very recent and stable with mapserver.
> Try to use those and python mapscript will build flawlessy.
>
> Umberto
>
>
> On 10/14/07, Matthew Perry <perrygeo at gmail.com> wrote:
> > Hey folks,
> >
> >  Trying to install mapscript on ubuntu 7.10 and I'm getting this error:
> >
> > ------------------------------
> > ./configure --without-tiff --with-jpeg --with-png --with-freetype \
> > --with-zlib --with-threads --with-proj \
> >  --with-gdal=/usr/local/bin/gdal-config --with-wcs --with-ogr \
> > --with-wmsclient --with-wfsclient --with-wfs \
> > --without-pdf --with-geos --enable-debug --with-agg=/home/perry/src/agg-2.4 \
> > --with-postgis=/usr/bin/pg_config \
> > --with-curl-config=/usr/bin/curl-config --with-httpd=/usr/sbin/apache2
> > --with-gd=/usr/local \
> > --with-fastcgi
> > make
> > cd mapscript/python
> > swig -python -shadow -modern -templatereduce -fastdispatch -fvirtual
> > -fastproxy \
> >      -modernargs -castmode -dirvtable -fastinit -fastquery
> > -noproxydel -nobuildnone  \
> >     -o mapscript_wrap.c ../mapscript.i
> > python setup.py build
> > cd tests/cases && python runalltests.py -v
> > ........
> >  File "../../build/lib.linux-i686-2.5/mapscript.py", line 6, in <module>
> >    import _mapscript
> > ImportError: ../../build/lib.linux-i686-2.5/_mapscript.so: undefined
> > symbol: _ZN3agg17g_elder_bit_tableE
> >
> > --------------
> >
> >
> > This occurs with both mapserver svn and 5.0. I've also tried with the
> > system libagg as well as a self-compiled libagg with fPIC and
> > freetype. I've tried the simple swig statement as well as the newer
> > optimized swig flags. The same outcome occurs each under every combo.
> >
> > I'm out of ideas (and patience). Has anyone else experienced this
> > issue and solved it?
> >
> > --
> > Matthew T. Perry
> > http://www.perrygeo.net
> >
> > "Never ascribe to malice, that which can be adequately explained by
> > incompetence."
> >
>


-- 
Matthew T. Perry
http://www.perrygeo.net

"Never ascribe to malice, that which can be adequately explained by
incompetence."



More information about the mapserver-users mailing list