sparky module segfaults

2002-12-21 Thread Jack Howarth
   Could someone familar with python give sparky a test on debian
i386 sid? On debian ppc sid the program segfaults on loading its
python module. The source for the program is available from...

http://www.cgl.ucsf.edu/home/sparky/

as sparky-source-3.106.tar.gz. If you untar it in /usr/local/src
and then apply the patch below...

--
diff -uNr /home/howarth/sparky/c++/Makefile /usr/local/src/sparky/c++/Makefile
--- /home/howarth/sparky/c++/Makefile   2002-01-17 22:14:16.0 -0500
+++ /usr/local/src/sparky/c++/Makefile  2002-12-21 13:45:22.0 -0500
@@ -17,26 +17,27 @@
 
 SPARKY = /usr/local/src/sparky
 SPARKY_SRC = $(SPARKY)/c++
+SPARKY_INSTALL = /usr/local/sparky
 PY_VERSION = 2.1
 PY_VER = 21
-PYTHON_PREFIX  = /usr/local
+PYTHON_PREFIX  = /usr
 PYTHON_LIB = $(PYTHON_PREFIX)/lib/python$(PY_VERSION)
 PYTHON_INC = $(PYTHON_PREFIX)/include/python$(PY_VERSION)
 TCLTK_VERSION  = 8.3
 TCLTK_VER  = 83
-TK_PREFIX  = /usr/local
+TK_PREFIX  = /usr
 TK_VERSION = tk$(TCLTK_VERSION)
 TCL_VERSION= tcl$(TCLTK_VERSION)
 PLATFORM   = unix
 
-CXX= g++
-CXXFLAGS   = 
-CC = gcc
-CFLAGS =
+CXX= g++-2.95
+CXXFLAGS   = -O2 -fPIC
+CC = gcc-2.95
+CFLAGS = -O2 -fPIC
 PYFLAGS= -I$(PYTHON_INC) -I$(PYTHON_LIB)/config
-TKFLAGS= -I$(TK_PREFIX)/include
-TKLIBS = -L$(TK_PREFIX)/lib -l$(TK_VERSION) -l$(TCL_VERSION) -lX11
-EXTRALIBS  = 
+TKFLAGS= -I$(TK_PREFIX)/include/$(TCL_VERSION)
+TKLIBS = -L$(TK_PREFIX)/lib -l$(TK_VERSION) -l$(TCL_VERSION) 
+EXTRALIBS  = -L/usr/X11R6/lib -lX11 
 SYSLIBS= -lm
 LDLIBS = $(TKLIBS) $(SYSLIBS) $(EXTRALIBS)
 LDFLAGS=
diff -uNr /home/howarth/sparky/lib/Makefile /usr/local/src/sparky/lib/Makefile
--- /home/howarth/sparky/lib/Makefile   2002-01-17 22:17:14.0 -0500
+++ /usr/local/src/sparky/lib/Makefile  2002-12-20 22:41:32.0 -0500
@@ -12,7 +12,7 @@
 TCLTK_VERSION  = 8.3
 TK_VERSION = tk$(TCLTK_VERSION)
 TCL_VERSION= tcl$(TCLTK_VERSION)
-TK_PREFIX  = /usr/local
+TK_PREFIX  = /usr
 TCL_TK_LIB = $(TK_PREFIX)/lib
 TCL_TK_SHLIB   = $(TCL_TK_LIB)
 TCLTK_SHLIB_SUFFIX = .so
diff -uNr /home/howarth/sparky/manual/Makefile 
/usr/local/src/sparky/manual/Makefile
--- /home/howarth/sparky/manual/Makefile2001-11-13 18:37:53.0 
-0500
+++ /usr/local/src/sparky/manual/Makefile   2002-12-20 22:48:27.0 
-0500
@@ -65,13 +65,13 @@
rdist -R -c $(IMAGE_FILES) socrates:$(MANUAL_WWW)/images
 
 manual.html: $(MANUAL_SECTIONS)
-   htmlcat $(MANUAL_SECTIONS) > manual.html
+   ../bin/htmlcat $(MANUAL_SECTIONS) > manual.html
 
 manual.ps: manual.html
echo 'Postscript Sparky manual needs updating'
 
 make-manual.ps: manual.html
-   html2ps manual.html > manual.ps
+   ../bin/html2ps manual.html > manual.ps
 
 manual-postscript.gz: manual.ps
gzip -c manual.ps > manual-postscript.gz
diff -uNr /home/howarth/sparky/python/Makefile 
/usr/local/src/sparky/python/Makefile
--- /home/howarth/sparky/python/Makefile2001-08-28 18:09:59.0 
-0400
+++ /usr/local/src/sparky/python/Makefile   2002-12-21 13:34:53.0 
-0500
@@ -5,8 +5,8 @@
 INSTALL= \cp
 
 SPARKY_INSTALL = /usr/local/sparky
-PYTHON_PREFIX  = /usr/local
-PYTHON_VERSION = python1.5
+PYTHON_PREFIX  = /usr
+PYTHON_VERSION = python2.1
 PYTHON = $(PYTHON_PREFIX)/bin/$(PYTHON_VERSION)
 PYTHON_LIB = $(PYTHON_PREFIX)/lib/$(PYTHON_VERSION)
 
@@ -28,7 +28,9 @@
  tkutil.py volumeerror.py xeasy.py xplor.py
 
 install: $(SPARKY_INSTALL)/python $(SPARKY_INSTALL)/python/sparky \
-   $(SPARKY_INSTALL)/python/lib-tk
+   $(SPARKY_INSTALL)/python/lib-tk
+   mkdir -p $(SPARKY_INSTALL)/python $(SPARKY_INSTALL)/python/sparky \
+   $(SPARKY_INSTALL)/python/lib-tk
$(INSTALL) README $(SPARKY_INSTALL)/python
for pyfile in $(PYTHON_CODE) ; do \
  $(INSTALL) $$pyfile $(SPARKY_INSTALL)/python/sparky ; \
--

you will be able to do a 'make' and a 'make install'. At this point
if you 'cd /usr/local/sparky/bin' and run 'sparky-no-python' on
debian ppc sid the program starts up fine. However if you run
'sparky' instead, which uses the python extensions, you get a 
segfault. I would really like to know if this is ppc specific or
if i386 sid sees this as well. Thanks in advance for helping with
this.
   Jack
ps I plan to send any fixes we find upstream the sparky maintainers.




please help test sparky

2002-12-21 Thread Jack Howarth
   Could someone familar with python give sparky a test on debian
i386 sid? On debian ppc sid the program segfaults on loading its
python module. The source for the program is available from...

http://www.cgl.ucsf.edu/home/sparky/

as sparky-source-3.106.tar.gz. If you untar it in /usr/local/src
and then apply the patch below...

--
diff -uNr /home/howarth/sparky/c++/Makefile /usr/local/src/sparky/c++/Makefile
--- /home/howarth/sparky/c++/Makefile   2002-01-17 22:14:16.0 -0500
+++ /usr/local/src/sparky/c++/Makefile  2002-12-21 13:45:22.0 -0500
@@ -17,26 +17,27 @@
 
 SPARKY = /usr/local/src/sparky
 SPARKY_SRC = $(SPARKY)/c++
+SPARKY_INSTALL = /usr/local/sparky
 PY_VERSION = 2.1
 PY_VER = 21
-PYTHON_PREFIX  = /usr/local
+PYTHON_PREFIX  = /usr
 PYTHON_LIB = $(PYTHON_PREFIX)/lib/python$(PY_VERSION)
 PYTHON_INC = $(PYTHON_PREFIX)/include/python$(PY_VERSION)
 TCLTK_VERSION  = 8.3
 TCLTK_VER  = 83
-TK_PREFIX  = /usr/local
+TK_PREFIX  = /usr
 TK_VERSION = tk$(TCLTK_VERSION)
 TCL_VERSION= tcl$(TCLTK_VERSION)
 PLATFORM   = unix
 
-CXX= g++
-CXXFLAGS   = 
-CC = gcc
-CFLAGS =
+CXX= g++-2.95
+CXXFLAGS   = -O2 -fPIC
+CC = gcc-2.95
+CFLAGS = -O2 -fPIC
 PYFLAGS= -I$(PYTHON_INC) -I$(PYTHON_LIB)/config
-TKFLAGS= -I$(TK_PREFIX)/include
-TKLIBS = -L$(TK_PREFIX)/lib -l$(TK_VERSION) -l$(TCL_VERSION) -lX11
-EXTRALIBS  = 
+TKFLAGS= -I$(TK_PREFIX)/include/$(TCL_VERSION)
+TKLIBS = -L$(TK_PREFIX)/lib -l$(TK_VERSION) -l$(TCL_VERSION) 
+EXTRALIBS  = -L/usr/X11R6/lib -lX11 
 SYSLIBS= -lm
 LDLIBS = $(TKLIBS) $(SYSLIBS) $(EXTRALIBS)
 LDFLAGS=
diff -uNr /home/howarth/sparky/lib/Makefile /usr/local/src/sparky/lib/Makefile
--- /home/howarth/sparky/lib/Makefile   2002-01-17 22:17:14.0 -0500
+++ /usr/local/src/sparky/lib/Makefile  2002-12-20 22:41:32.0 -0500
@@ -12,7 +12,7 @@
 TCLTK_VERSION  = 8.3
 TK_VERSION = tk$(TCLTK_VERSION)
 TCL_VERSION= tcl$(TCLTK_VERSION)
-TK_PREFIX  = /usr/local
+TK_PREFIX  = /usr
 TCL_TK_LIB = $(TK_PREFIX)/lib
 TCL_TK_SHLIB   = $(TCL_TK_LIB)
 TCLTK_SHLIB_SUFFIX = .so
diff -uNr /home/howarth/sparky/manual/Makefile 
/usr/local/src/sparky/manual/Makefile
--- /home/howarth/sparky/manual/Makefile2001-11-13 18:37:53.0 
-0500
+++ /usr/local/src/sparky/manual/Makefile   2002-12-20 22:48:27.0 
-0500
@@ -65,13 +65,13 @@
rdist -R -c $(IMAGE_FILES) socrates:$(MANUAL_WWW)/images
 
 manual.html: $(MANUAL_SECTIONS)
-   htmlcat $(MANUAL_SECTIONS) > manual.html
+   ../bin/htmlcat $(MANUAL_SECTIONS) > manual.html
 
 manual.ps: manual.html
echo 'Postscript Sparky manual needs updating'
 
 make-manual.ps: manual.html
-   html2ps manual.html > manual.ps
+   ../bin/html2ps manual.html > manual.ps
 
 manual-postscript.gz: manual.ps
gzip -c manual.ps > manual-postscript.gz
diff -uNr /home/howarth/sparky/python/Makefile 
/usr/local/src/sparky/python/Makefile
--- /home/howarth/sparky/python/Makefile2001-08-28 18:09:59.0 
-0400
+++ /usr/local/src/sparky/python/Makefile   2002-12-21 13:34:53.0 
-0500
@@ -5,8 +5,8 @@
 INSTALL= \cp
 
 SPARKY_INSTALL = /usr/local/sparky
-PYTHON_PREFIX  = /usr/local
-PYTHON_VERSION = python1.5
+PYTHON_PREFIX  = /usr
+PYTHON_VERSION = python2.1
 PYTHON = $(PYTHON_PREFIX)/bin/$(PYTHON_VERSION)
 PYTHON_LIB = $(PYTHON_PREFIX)/lib/$(PYTHON_VERSION)
 
@@ -28,7 +28,9 @@
  tkutil.py volumeerror.py xeasy.py xplor.py
 
 install: $(SPARKY_INSTALL)/python $(SPARKY_INSTALL)/python/sparky \
-   $(SPARKY_INSTALL)/python/lib-tk
+   $(SPARKY_INSTALL)/python/lib-tk
+   mkdir -p $(SPARKY_INSTALL)/python $(SPARKY_INSTALL)/python/sparky \
+   $(SPARKY_INSTALL)/python/lib-tk
$(INSTALL) README $(SPARKY_INSTALL)/python
for pyfile in $(PYTHON_CODE) ; do \
  $(INSTALL) $$pyfile $(SPARKY_INSTALL)/python/sparky ; \
--

you will be able to do a 'make' and a 'make install'. At this point
if you 'cd /usr/local/sparky/bin' and run 'sparky-no-python' on
debian ppc sid the program starts up fine. However if you run
'sparky' instead, which uses the python extensions, you get a 
segfault. I would really like to know if this is ppc specific or
if i386 sid sees this as well. Thanks in advance for helping with
this.
   Jack
ps I plan to send any fixes we find upstream to the sparky maintainers.



sorry about the duplicate

2002-12-21 Thread Jack Howarth
   Sorry about the duplicate message. I get a bounce back from the
list server that seemed to indicate the first message was rejected
as spam because of the title. So I resent it with a modified title.
 Jack



clue on sparky

2002-12-21 Thread Jack Howarth
I believe I may have a clue as to why sparky is segfaulting in
when run as a python extension. The upstream maintainer is using
python 2.1.1 and tcl 8.3.4 so I built against our python 2.1.3 and
tck 8.3.3. However I just noticed that sid's python2.1 is in
fact built against tcl-8.4 now. Could this case problems if one
builds a python2.1 module against tcl8.3 instead and try to import it?
I tried building sparky against tcl8.4 but got errors of the form...

g++-2.95 -O2 -fPIC -I/usr/include/tcl8.4 -c 
/usr/local/src/sparky/c++/winsystem-unix.cc
In file included from /usr/local/src/sparky/c++/winsystem-unix.cc:9:
/usr/local/src/sparky/c++/winsystem-all.cc: In function `void 
update_argv(WinSysP *, int *, char **)':
/usr/local/src/sparky/c++/winsystem-all.cc:354: initialization to `char *' from 
`const char *' discards qualifiers
/usr/local/src/sparky/c++/winsystem-all.cc:360: passing `char ***' as argument 
4 of `Tcl_SplitList(Tcl_Interp *, const char *, int *, const char ***)' adds 
cv-quals without intervening `const'
/usr/local/src/sparky/c++/winsystem-all.cc: In method 
`Command_Callback::Command_Callback(WinSysP *, void *, void (*)(void *, void *, 
void *), void *, bool = true)':
/usr/local/src/sparky/c++/winsystem-all.cc:1717: passing `int (*)(void *, 
Tcl_Interp *, int, char **)' as argument 3 of `add_tcl_command(WinSysP *, const 
Stringy &, int (*)(void *, Tcl_Interp *, int, const char **), void *)'

..etc. Anyone have any idea how to properly handle those?
Jack