Opened 20 years ago

Closed 20 years ago

#680 closed defect (fixed)

[MapServer]Variables not read when building python mapscript

Reported by: nsavard@… Owned by: sgillies@…
Priority: high Milestone:
Component: MapScript-SWIG Version: 4.2
Severity: normal Keywords:
Cc: sgillies@…

Description

Variables on line two of "mapscriptvars" file not read when building python
mapscript.  This causes some problem when using non standard library location. 
I included the "mapscriptvars" file and error message when starting the building
process.

The command use is "python setup.py build".


-------------------------
mapscriptvars:

[nsavard@localhost src]$ more mapscriptvars
/opt/mapserver_42/src
-DIGNORE_MISSING_DATA -DUSE_EPPL -DUSE_PROJ -DUSE_PROJ_API_H -DUSE_GD_PNG
-DUSE_GD_JPEG -DUSE_GD_WBMP -DUSE_GD_FT -DUSE_OGR -DUSE_GDAL
-I. -I/usr/local//include -I/usr//include -I/opt/gdal_12//include
-L. -lmap -L/usr//lib -lgd -ljpeg -lfreetype -lpng -lz -ljpeg -lfreetype -lpng
-lz -L/usr/local//lib -lproj -ljpeg -L/opt/gdal_12//lib -lgdal -lcurl
-L/usr/kerberos/lib -lssl -lcrypto -lgssapi_krb5 -lkrb5 -lcom_err -lk5crypto
-lresolv -ldl
-lz -L/usr/kerberos/lib -lz -lssl -lcrypto -lssl -lcrypto -lgssapi_krb5 -lkrb5
-lcom_err -lk5crypto -lresolv -ldl -lz -lz -lm -lstdc++

----------------
Error message:

[nsavard@localhost python]$     python setup.py build
running build
running build_py
creating build
creating build/lib.linux-i686-2.2
copying mapscript.py -> build/lib.linux-i686-2.2
running build_ext
building '_mapscript' extension
creating build/temp.linux-i686-2.2
gcc -DNDEBUG -O2 -g -pipe -march=i386 -mcpu=i686 -D_GNU_SOURCE -fPIC -fPIC
-DIGNORE_MISSING_DATA -DUSE_EPPL -DUSE_PROJ -DUSE_PROJ_API_H -DUSE_GD_PNG
-DUSE_GD_JPEG -DUSE_GD_WBMP -DUSE_GD_FT -DUSE_OGR -DUSE_GDAL
-I/usr/include/python2.2 -I/usr/include/python2.2 -c mapscript_wrap.c -o
build/temp.linux-i686-2.2/mapscript_wrap.o
In file included from mapscript_wrap.c:739:
../../map.h:61:21: ogr_api.h: No such file or directory
In file included from mapscript_wrap.c:739:
../../map.h:1158: error: syntax error before "hGeometry"
In file included from mapscript_wrap.c:741:
../../mapogcsld.h:72:25: cpl_minixml.h: No such file or directory
I

Change History (8)

comment:1 by sdlime, 20 years ago

Cc: sgillies@… added

comment:2 by sdlime, 20 years ago

Component: MapScriptMapScript-SWIG

comment:3 by sgillies@…, 20 years ago

Status: newassigned
Good to see Python being used at DM Solutions!  Write me for help any time. 

Frank Warmerdam fixed this in the CVS main (4.3), but it's not going to be
fixed in 4.2.  Too close to the release.  We'll take of it for 4.2.1.

Work around is to run the setup script like

   python setup.py -I -I/opt/gdal_12/include build

See http://docs.python.org/dist/dist.html for more info about Python's
distutils module.

My idea for the best solution is to have the Python setup ignore mapscriptvars.
Instead, the mapserver makefile will write a distutils setup.cfg file in
mapscript/python.  Then we can clean up and simply setup.py.

comment:4 by nsavard@…, 20 years ago

I tried the workaround and obtain an error message (see below).


--------------------
Error message:

[nsavard@localhost python]$ python setup.py build --helppython setup.py -I
-I/opt/gdal_12/include build
[nsavard@localhost python]$ python setup.py -I -I/opt/gdal_12/include build
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: setup.py --help [cmd1 cmd2 ...]
   or: setup.py --help-commands
   or: setup.py cmd --help
 
error: option -I not recognized
[

comment:5 by nsavard@…, 20 years ago

I forgot to say that I'm switching to 4.3 for testing purpose.

comment:6 by sgillies@…, 20 years ago

Owner: changed from sdlime to sgillies@…
Status: assignednew
Sorry, my previous instructions were bad.  Try

   python setup.py build_ext -I /opt/gdal_12/include build


comment:7 by nsavard@…, 20 years ago

I'm happy to use mapscript Pyton.  Thank you for your help.

comment:8 by sgillies@…, 20 years ago

Resolution: fixed
Status: newclosed
This is fixed in 4.2 as well as 4.3.  I simply copied the setup.py
in 4.3 (fixed by Frank) to the 4.2 branch and verified that it works.

Note: See TracTickets for help on using tickets.