[GRASS-dev] trying to compile wxPython digitizer display_driver

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

On Aug 19, 2007, at 11:47 AM, Michael Barton wrote:

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 think there are a couple levels to the SWIG setup. (ie see MapServer and GDAL) One is the developers - they need swig installed so they can generate the SWIG stuff in the GRASS source. The other is users - anyone who downloads the GRASS source should not need SWIG on their computer to compile GRASS, the SWIG bits are already generated by the developers.

Dunno about how appropriate SWIG is, though...

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

[I'm responding to the OSX bit below, but felt I could answer some other questions also]

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.

MODULE_TOPDIR is the GRASS source top. Whereever you put the display driver source, the MODULE_TOPDIR = should backtrack to get to the source top.

Someone else could probably answer off the top of their head, but a little poking around reveals: display/drivers in the GRASS source.

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.

ARCH_DISTDIR is where binaries are built into, dist-[platform] off the grass top dir. The includes above (Lib.make, ...) should set all the necessary make variables for you.

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.

-dynamiclib for OSX. But whatever it is for a platform, this is already in the GRASS makefile parts that are included, so -shared/-dynamiclib should be left out here. But it looks like display drivers are built as programs anyways, not libraries. Try using the PNG driver makefile as an example.

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

"Mon Dieu! but they are all alike. Cheating, murdering, lying, fighting, and all for things that the beasts of the jungle would not deign to possess - money to purchase the effeminate pleasures of weaklings. And yet withal bound down by silly customs that make them slaves to their unhappy lot while firm in the belief that they be the lords of creation enjoying the only real pleasures of existence....

- the wisdom of Tarzan

Ah, I missed a few points.

- this driver is loaded by python, not GRASS, so the library form is probably correct. Though maybe not a library, but a "module" - OSX has a distinction between libraries loaded by the system dyld, and bundle modules loaded by programs (usually used for plugins). I think Python does this. There should be a way to automatically do this, but I think it involves using setup.py. (MapServer does this for Python Mapscript)

- It's also C++, so the GRASS make system can't deal with it directly (like r.terraflow). So it *does* need the manual compile and link stuff in the makefile. But still can use GRASS make variables for most of it.

- GRASS libraries should be specified with the makefile variables, ie $(VECTLIB).

- the ARCH_DISTDIR include is in the makefile includes, so it doesn't need to be here.

I started fiddling with it, then noticed this stuff. The SWIG stuff should probably be separated into optional make targets, for the developer side. Then the default make target will assume that these SWIG bits are made.

On Aug 19, 2007, at 12:29 PM, William Kyngesburye wrote:

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

[I'm responding to the OSX bit below, but felt I could answer some other questions also]

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.

MODULE_TOPDIR is the GRASS source top. Whereever you put the display driver source, the MODULE_TOPDIR = should backtrack to get to the source top.

Someone else could probably answer off the top of their head, but a little poking around reveals: display/drivers in the GRASS source.

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.

ARCH_DISTDIR is where binaries are built into, dist-[platform] off the grass top dir. The includes above (Lib.make, ...) should set all the necessary make variables for you.

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.

-dynamiclib for OSX. But whatever it is for a platform, this is already in the GRASS makefile parts that are included, so -shared/-dynamiclib should be left out here. But it looks like display drivers are built as programs anyways, not libraries. Try using the PNG driver makefile as an example.

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

"History is an illusion caused by the passage of time, and time is an illusion caused by the passage of history."

- Hitchhiker's Guide to the Galaxy

Hey guys,

I worked out a setup.py script to build the display driver. This makes it easier to configure the installation of python and wxpython. I pulled bits from the MapServer and GDAL Python setup.py scripts.

- no python version needed from configure for the makefile

- doesn't hardwire the compile/link flags or grass libs

- source compilation and linking is handled externally by python, only the swig step must be handled by the GRASS makefile

A couple things to work out:

- the OSX wx-config script is buried in a non-standard location (lib/wxPython-unicode-[version]/bin). For now, add that to your path before building the driver. Eventually, it needs to be configured with something like a --with-wxpython= option.

- installation - distutils builds in a subfolder, "build", with platform subfolders from that. The distutils install option knows where to find this, but that installs in the python site-packages folder. If we want to keep the driver within the GRASS installation, the makefile needs to figure out the platform folder to find it. Or there may be an option to setup.py to do this - I've only fiddled with distutils and don't know all its capabilities.

- it's currently setup for grass_src/somefolder/gui/display_driver - that is, 3 levels deep. (this is for the MODULE_TOPDIR in the makefile and a couple items in setup.py) This should work with grass_src/swig/python/display_driver, as you seem to have it Martin. Or something like grass_src/gui/wx/display_driver.

Here are the files:

(attachments)

Makefile (650 Bytes)
setup.py (3.16 KB)

William,

Thanks for working on this. I just tried it. I seem to be missing something.

I put the display_driver folder into ../grass6/gui/wxpython as you
suggested.

I copied your new Makefile and setup.py into the display_driver folder

I then ran

python setup.py

I received the following error

cmb-MBP:~/grass_dev/grass6/gui/wxpython/display_driver cmbarton$ python
setup.pyusage: 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

I tried --help-commands, which gave me some options. So I tried build,
build_py, and install as arguments to setup.py. The results are below. Any
suggestions?

Michael

======= attempts to run setup.py ==============

cmb-MBP:~/grass_dev/grass6/gui/wxpython/display_driver cmbarton$ python
setup.py build
running build
running build_py
file grass6_wxdriver.py (for module grass6_wxdriver) not found
file grass6_wxdriver.py (for module grass6_wxdriver) not found
running build_ext
building 'grass6_wxdriver' extension
creating build
creating build/temp.macosx-10.3-fat-2.5
gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk
-fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd
-fno-common -dynamic -DNDEBUG -g -O3 -D__WXDEBUG__= -D__WXMAC__=
-D_FILE_OFFSET_BITS=64 -D_LARGE_FILES= -DNO_GCC_PRAGMA=
-I/usr/lib/wx/include/mac-unicode-debug-2.5 -I/usr/include/wx-2.5
-I/Library/Frameworks/GDAL.framework/unix/include
-I/Users/cmbarton/grass_dev/grass6/dist.i686-apple-darwin8.10.1/include
-I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c
grass6_wxdriver_wrap.cxx -o
build/temp.macosx-10.3-fat-2.5/grass6_wxdriver_wrap.o
powerpc-apple-darwin8-gcc-4.0.1: grass6_wxdriver_wrap.cxx: No such file or
directory
powerpc-apple-darwin8-gcc-4.0.1: no input files
i686-apple-darwin8-gcc-4.0.1: grass6_wxdriver_wrap.cxx: No such file or
directory
i686-apple-darwin8-gcc-4.0.1: no input files
lipo: can't figure out the architecture type of: /var/tmp//ccFKl9UF.out
error: command 'gcc' failed with exit status 1

cmb-MBP:~/grass_dev/grass6/gui/wxpython/display_driver cmbarton$ python
setup.py build_py
running build_py
file grass6_wxdriver.py (for module grass6_wxdriver) not found
file grass6_wxdriver.py (for module grass6_wxdriver) not found
cmb-MBP:~/grass_dev/grass6/gui/wxpython/display_driver cmbarton$

cmb-MBP:~/grass_dev/grass6/gui/wxpython/display_driver cmbarton$ python
setup.py install
running install
running build
running build_py
file grass6_wxdriver.py (for module grass6_wxdriver) not found
file grass6_wxdriver.py (for module grass6_wxdriver) not found
running build_ext
building 'grass6_wxdriver' extension
gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk
-fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd
-fno-common -dynamic -DNDEBUG -g -O3 -D__WXDEBUG__= -D__WXMAC__=
-D_FILE_OFFSET_BITS=64 -D_LARGE_FILES= -DNO_GCC_PRAGMA=
-I/usr/lib/wx/include/mac-unicode-debug-2.5 -I/usr/include/wx-2.5
-I/Library/Frameworks/GDAL.framework/unix/include
-I/Users/cmbarton/grass_dev/grass6/dist.i686-apple-darwin8.10.1/include
-I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c
grass6_wxdriver_wrap.cxx -o
build/temp.macosx-10.3-fat-2.5/grass6_wxdriver_wrap.o
i686-apple-darwin8-gcc-4.0.1: grass6_wxdriver_wrap.cxx: No such file or
directory
powerpc-apple-darwin8-gcc-4.0.1: i686-apple-darwin8-gcc-4.0.1: no input
files
grass6_wxdriver_wrap.cxx: No such file or directory
powerpc-apple-darwin8-gcc-4.0.1: no input files
lipo: can't figure out the architecture type of: /var/tmp//ccML6MOz.out
error: command 'gcc' failed with exit status 1
cmb-MBP:~/grass_dev/grass6/gui/wxpython/display_driver cmbarton$

__________________________________________
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

It was meant to be run from the makefile. So just "make" and it should work. The makefile does the swig stuff. Then runs "python setup.py build". Also, before running make, set the shell PATH to include wxpython - for the 2.8.4 version I just installed today that would be:

export PATH="/usr/local/lib/wxPython-unicode-2.8.4.2/bin:$PATH"

On Aug 19, 2007, at 10:11 PM, Michael Barton wrote:

William,

Thanks for working on this. I just tried it. I seem to be missing something.

I put the display_driver folder into ../grass6/gui/wxpython as you
suggested.

I copied your new Makefile and setup.py into the display_driver folder

I then ran

python setup.py

I received the following error

cmb-MBP:~/grass_dev/grass6/gui/wxpython/display_driver cmbarton$ python
setup.pyusage: 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

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

"Mon Dieu! but they are all alike. Cheating, murdering, lying, fighting, and all for things that the beasts of the jungle would not deign to possess - money to purchase the effeminate pleasures of weaklings. And yet withal bound down by silly customs that make them slaves to their unhappy lot while firm in the belief that they be the lords of creation enjoying the only real pleasures of existence....

- the wisdom of Tarzan

On 8/19/07 8:32 PM, "William Kyngesburye" <woklist@kyngchaos.com> wrote:

It was meant to be run from the makefile. So just "make" and it
should work. The makefile does the swig stuff. Then runs "python
setup.py build". Also, before running make, set the shell PATH to
include wxpython - for the 2.8.4 version I just installed today that
would be:

export PATH="/usr/local/lib/wxPython-unicode-2.8.4.2/bin:$PATH"

I tried this but got the error...

cmb-MBP:~/grass_dev/grass6/gui/wxpython/display_driver cmbarton$ make
make: *** No targets. Stop.
cmb-MBP:~/grass_dev/grass6/gui/wxpython/display_driver cmbarton$

Michael

On Aug 19, 2007, at 10:11 PM, Michael Barton wrote:

William,

Thanks for working on this. I just tried it. I seem to be missing
something.

I put the display_driver folder into ../grass6/gui/wxpython as you
suggested.

I copied your new Makefile and setup.py into the display_driver folder

I then ran

python setup.py

I received the following error

cmb-MBP:~/grass_dev/grass6/gui/wxpython/display_driver cmbarton$
python
setup.pyusage: 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

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

"Mon Dieu! but they are all alike. Cheating, murdering, lying,
fighting, and all for things that the beasts of the jungle would not
deign to possess - money to purchase the effeminate pleasures of
weaklings. And yet withal bound down by silly customs that make them
slaves to their unhappy lot while firm in the belief that they be the
lords of creation enjoying the only real pleasures of existence....

- the wisdom of Tarzan

__________________________________________
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

Michael Barton wrote:

With regard to swig, this adds a major new dependency to the wxPython GUI.

..

Martin Landa is using it to create a display driver for the wxPython GUI
digitizing module.

It's a fundamental choice we will have to make. With it we can build
much richer GUI tools. Without it we get simpler installs.

We will most likely be able to do anything without resorting to SWIG if
we try hard enough; but how much extra work would that then be to
write/maintain new C code to act as a go between for libgis & python?

I'd leave it to the binary packagers to worry about installing swig, if it's needed by the user at runtime.

Hamish

Michael,

I disabled loading the driver in digit.py today. The driver is not
finished yet. The are parts of Makefile which are hardcoded (ugly), I
will fix it. At the end of the week it should be stable and usable.
Sorry, I am now busy with another work. I will tell you when it is
ready for testing.

Martin

2007/8/19, Michael Barton <michael.barton@asu.edu>:

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

--
Martin Landa <landa.martin@gmail.com> * http://gama.fsv.cvut.cz/~landa *

Hi William,

thanks for notes and scripts!! I will take a look at these files.
Anyway I need to update the python code to enable this driver. I hope
very soon available for testing.

Martin

2007/8/20, William Kyngesburye <woklist@kyngchaos.com>:

Hey guys,

I worked out a setup.py script to build the display driver. This
makes it easier to configure the installation of python and
wxpython. I pulled bits from the MapServer and GDAL Python setup.py
scripts.

- no python version needed from configure for the makefile

- doesn't hardwire the compile/link flags or grass libs

- source compilation and linking is handled externally by python,
only the swig step must be handled by the GRASS makefile

A couple things to work out:

- the OSX wx-config script is buried in a non-standard location (lib/
wxPython-unicode-[version]/bin). For now, add that to your path
before building the driver. Eventually, it needs to be configured
with something like a --with-wxpython= option.

- installation - distutils builds in a subfolder, "build", with
platform subfolders from that. The distutils install option knows
where to find this, but that installs in the python site-packages
folder. If we want to keep the driver within the GRASS installation,
the makefile needs to figure out the platform folder to find it. Or
there may be an option to setup.py to do this - I've only fiddled
with distutils and don't know all its capabilities.

- it's currently setup for grass_src/somefolder/gui/display_driver -
that is, 3 levels deep. (this is for the MODULE_TOPDIR in the
makefile and a couple items in setup.py) This should work with
grass_src/swig/python/display_driver, as you seem to have it Martin.
Or something like grass_src/gui/wx/display_driver.

Here are the files:

(note: don't need makefile.in)

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

"Oh, look, I seem to have fallen down a deep, dark hole. Now what
does that remind me of? Ah, yes - life."

- Marvin

--
Martin Landa <landa.martin@gmail.com> * http://gama.fsv.cvut.cz/~landa *

Strange. It sees the makefile, or it it would also say it couldn't find one. All I can think of is that it somehow became empty or mangled.

On Aug 19, 2007, at 11:36 PM, Michael Barton wrote:

On 8/19/07 8:32 PM, "William Kyngesburye" <woklist@kyngchaos.com> wrote:

It was meant to be run from the makefile. So just "make" and it
should work. The makefile does the swig stuff. Then runs "python
setup.py build". Also, before running make, set the shell PATH to
include wxpython - for the 2.8.4 version I just installed today that
would be:

export PATH="/usr/local/lib/wxPython-unicode-2.8.4.2/bin:$PATH"

I tried this but got the error...

cmb-MBP:~/grass_dev/grass6/gui/wxpython/display_driver cmbarton$ make
make: *** No targets. Stop.
cmb-MBP:~/grass_dev/grass6/gui/wxpython/display_driver cmbarton$

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

"Time is an illusion - lunchtime doubly so."

- Ford Prefect

Thanks William and Martin. I think this will be nice when it is all
together.

Martin,

I add an optional dialog to the map selection control, specifically with the
digitizer issues on Mac in mind. If you switch to that, using a button in
the digitizing toolbar to select a map instead of the combobox control, it
should display on a Mac.

Michael

On 8/20/07 4:18 AM, "Martin Landa" <landa.martin@gmail.com> wrote:

Hi William,

thanks for notes and scripts!! I will take a look at these files.
Anyway I need to update the python code to enable this driver. I hope
very soon available for testing.

Martin

2007/8/20, William Kyngesburye <woklist@kyngchaos.com>:

Hey guys,

I worked out a setup.py script to build the display driver. This
makes it easier to configure the installation of python and
wxpython. I pulled bits from the MapServer and GDAL Python setup.py
scripts.

- no python version needed from configure for the makefile

- doesn't hardwire the compile/link flags or grass libs

- source compilation and linking is handled externally by python,
only the swig step must be handled by the GRASS makefile

A couple things to work out:

- the OSX wx-config script is buried in a non-standard location (lib/
wxPython-unicode-[version]/bin). For now, add that to your path
before building the driver. Eventually, it needs to be configured
with something like a --with-wxpython= option.

- installation - distutils builds in a subfolder, "build", with
platform subfolders from that. The distutils install option knows
where to find this, but that installs in the python site-packages
folder. If we want to keep the driver within the GRASS installation,
the makefile needs to figure out the platform folder to find it. Or
there may be an option to setup.py to do this - I've only fiddled
with distutils and don't know all its capabilities.

- it's currently setup for grass_src/somefolder/gui/display_driver -
that is, 3 levels deep. (this is for the MODULE_TOPDIR in the
makefile and a couple items in setup.py) This should work with
grass_src/swig/python/display_driver, as you seem to have it Martin.
Or something like grass_src/gui/wx/display_driver.

Here are the files:

(note: don't need makefile.in)

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

"Oh, look, I seem to have fallen down a deep, dark hole. Now what
does that remind me of? Ah, yes - life."

- Marvin

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

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