[mapserver-users] Building Mapscript/Python

Doyon, Jean-Francois Jean-Francois.Doyon at CCRS.NRCan.gc.ca
Tue Aug 21 12:20:27 PDT 2001


Hmmmm, good point about the linking!

Actually I know *nothing* of Python right now, just starting ... I was just
following the instructions provided with swig, then again they probably
didn't take it accound the dependency on other librairies indeed ...

And I *really* don't feel like re-building Python, I just installed the RPM,
and would ratehr stick with that.

Turns out that thanks to your input, I modified my "ld" command to link
against all the other librairies that Mapserver depends on:

ld -shared mapscriptcmodule.o ../../libmap.a /usr/local/lib/libgd.a
/usr/local/lib/libproj.so /usr/lib/libtiff.so /usr/lib/libpng.so
/usr/lib/libfreetype.so -o mapscriptcmodule.so

now the import works ok :)

This is good: I'm trying to integrate MapServer into Zope
(http://www.zope.org), which is a Python based Web Application Framework of
sorts, or Content Management System, whatever you wanna call it :)
Hopefully I'll be able to develop re-usable mapscript components, so that
the system's users (The web designers) will be able to embed a mapping tool
by using nothing more than a simple tag for instance ...

Thanks!
J.F.

> ----------
> From: 	Norman Vine[SMTP:nhv at cape.com]
> Reply To: 	nhv at cape.com
> Sent: 	Tuesday, August 21, 2001 2:14 PM
> To: 	'Doyon, Jean-Francois'
> Cc: 	mapserver-users at lists.gis.umn.edu
> Subject: 	RE: [mapserver-users] Building Mapscript/Python
> 
> <<File: setup.mapscript>>
> Doyon, Jean-Francois writes:
> >
> >Hello,
> >
> >I'm trying to build a Mapscript module for Python 2.1 out of the CVS
> >version, and am having some problems. I was wondering if anybody has
> >succeeded?
> >
> >I've done:
> >
> >cd mapserver/mapscript/python
> >ln -s ../mapscript.i mapscript.i
> >swig -shadow -python mapscript.i
> >gcc -c mapscript_wrap.c -I/usr/include/python2.1 -o mapscriptcmodule.o
> >ld -shared mapscriptcmodule.o -o mapscriptcmodule.so
> 
> I really don't know much about making .so files 
> but don't you have to link the shared library against libmap.a  
> and the other libraries that it depends on ?
> 
> FWIW
> I haven't tried building mapserver or mapsript for a while
> but find attached a python Setup file that I have used before
> to build python mapscript with Linux
> If you are familiar with building Python modules this
> should be self documenting
> 
> IMHO 
> Python mapscript really needs a Python DistUtils Setup file written. 
> then in a cross platform way this would be as simple as 
> 
> % cd $MAP_SRC / mapscript / python
> % python setup.py --install
> 
> Unfortunately this is currently a rather low-priority on my todo list.
> < but that could possibly be changed if someone had a real need >
> 
> Cheers
> 
> Norman VIne
> 



More information about the MapServer-users mailing list