[GRASS-dev] trying to compile wxPython digitizer display_driver

Michael Barton michael.barton at asu.edu
Sun Aug 19 12:47:26 EDT 2007


Martin,

I compiled swig, but still am not able to compile your new display driver
for the wxPython GUI. I've had to drop back to the earlier (non-functional)
version of digit.py just to get it all to run.

I'm pretty sure that, after installing swig, the problem lies in the
Makefile, which seems to be hard-coded to match your system. I've tried
playing around with some of the parameters, but have been unsuccessful. I
just don't know much about the details of compiling C code. The Makefile is
short, so I'm including it below along with some of my comments. Maybe
someone can offer suggestions as to 1) how to make it work with my Mac and
2) how to generalize it so it works more easily with other systems as well.

With regard to swig, this adds a major new dependency to the wxPython GUI.
It doesn't come on the Mac and I had to compile it from source. IT was
pretty easy, but not something other most other Mac users will want to do.
Same with Windows users. Maybe we'll want to have Python-swig as a
requirement anyway. Several people have mentioned this. I know generally
what it swig does, but not the details. An important question is...Is swig
necessary for creating the driver for digitizing in wxPython or is there
potentially another way to do this? That is, can we accomplish what you are
trying to do without swig, oris it essential to make it work?

I'm looking forward to trying the new digitizer after getting this driver up
and working.

Cheers
Michal
__________________________________________
Michael Barton, Professor of Anthropology
Director of Graduate Studies
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton


Makefile below ==========================


PYTHONVERSION=2.4

>>>> NOTE: this should be 2.4 or above rather than hard coded to 2.4 (I have
2.5, for example). I know that there is some way to specify this, but don't
remember what it is.

MODULE_TOPDIR = ../../..

include $(MODULE_TOPDIR)/include/Make/Lib.make
include $(MODULE_TOPDIR)/include/Make/Doxygen.make

>>>> NOTE: This seems to imply putting the source directory for display_driver
somewhere in the GRASS source tree, but I can't figure out where it is supposed
to go. I've tried putting it at the root, in lib, and another place or two. My
GRASS source tree happens to be in /Users/cmbarton/grass_dev/grass6.

SWIG=swig

CFLAGS=-c -fpic -I/usr/include/python$(PYTHONVERSION) -I./
-I$(ARCH_DISTDIR)/include `wx-config --cxxflags`

>>>> NOTE: My Python includes are in a completely different place. I'm not sure
what ARCH_DISTDIR refers to but am guessing that this needs to be set to match
each system.

LDFLAGS=-shared -L$(ARCH_LIBDIR) -lgrass_vect -lgrass_gis `wx-config --libs`

>>>> NOTE: This may need to be changed for Mac OS X if I am correctly
remembering some discussions crossing the dev list.

default: grass6_wxdriver.so

clean:
    -rm -f *.o *.so grass6_wxdriver_wrap.cxx grass6_wxdriver.py
grass6_wxdriver.i grass6_wxdriver.pyc

grass6_wxdriver.i:
    cat ./driver.i > grass6_wxdriver.i
    echo "/* auto-generate swig typedef file (with some GRASS functions
removed) */" >> grass6_wxdriver.i
    cat ./driver.h >> grass6_wxdriver.i

grass6_wxdriver_wrap.cxx: grass6_wxdriver.i
    $(SWIG) -c++ -python -shadow $<

grass6_wxdriver_wrap.o: grass6_wxdriver_wrap.cxx
    $(CXX) $(CFLAGS) $(INCLUDE_DIRS) $<

driver.o: driver.cc
    $(CXX) $(CFLAGS) $(INCLUDE_DIRS) $<

pseudodc.o: pseudodc.cpp
    $(CXX) $(CFLAGS) $(INCLUDE_DIRS) $<

grass6_wxdriver.so: grass6_wxdriver_wrap.o driver.o pseudodc.o
    $(CXX) $(LDFLAGS) grass6_wxdriver_wrap.o driver.o pseudodc.o -o
_grass6_wxdriver.so



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-dev/attachments/20070819/818b262f/attachment.html


More information about the grass-dev mailing list