Hi all,
I am trying to use wxPython with SAGE (Software for Algebra and
Geometry Experimentation).
I do think that the problem is in this output I get when running setup.py:
cc1plus: warning: command line option "-Wstrict-prototypes" is valid
for Ada/C/ObjC but not for C++
Anyway, here goes some details of the journey:
SAGE uses python. And I found out that sage users really install 3rd
party python packages and use them normally on sage. Standard modules
are available and, for example, if I go like:
sage: import sys
sage: sys.path
['', '/media/kubold/home/ref/Desktop/packages/sage',
'/media/kubold/home/ref/Desktop/packages/sage/local/lib/python',
'/media/kubold/home/ref/Desktop/packages/sage/local/lib/python25.zip',
'/media/kubold/home/ref/Desktop/packages/sage/local/lib/python2.5',
'/media/kubold/home/ref/Desktop/packages/sage/local/lib/python2.5/plat-linux2',
'/media/kubold/home/ref/Desktop/packages/sage/local/lib/python2.5/lib-tk',
'/media/kubold/home/ref/Desktop/packages/sage/local/lib/python2.5/lib-dynload',
'/media/kubold/home/ref/Desktop/packages/sage/local/lib/python2.5/site-packages']
I am using Ubuntu 7.04 and 6.10 (multiboot). The problems are exactly the same.
---- First try: Appending python's sys.path to sage's python's sys.path
$ python
Python 2.5.1 (r251:54863, May 2 2007, 16:56:35)
[GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
import wx ##So wx is working, right?
import sys
sys.path
['', '/usr/lib/python25.zip', '/usr/lib/python2.5',
'/usr/lib/python2.5/plat-linux2', '/usr/lib/python2.5/lib-tk',
'/usr/lib/python2.5/lib-dynload',
'/usr/local/lib/python2.5/site-packages',
'/usr/lib/python2.5/site-packages',
'/var/lib/python-support/python2.5',
'/usr/lib/python2.5/site-packages/wx-2.6-gtk2-unicode']
When I append these directories (or just
'/usr/lib/python2.5/site-packages/wx-2.6-gtk2-unicode') to sage' path,
the output is:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.5/site-packages/wx-2.6-gtk2-unicode/wx/__init__.py",
line 42, in <module>
from wx._core import *
File "/usr/lib/python2.5/site-packages/wx-2.6-gtk2-unicode/wx/_core.py",
line 4, in <module>
import _core_
ImportError: /usr/lib/python2.5/site-packages/wx-2.6-gtk2-unicode/wx/_core_.so:
undefined symbol: PyUnicodeUCS4_FromWideChar
Ok. This wxPython install is called from apt. It seem to be compiled
for UCS4-based Unicode support (as seems to be python's apt
compilation). And SAGE's python seems to use UCS2-based Unicode
support. Assuming that all this is right, I went though:
---- Second Try: building wxwidgets and wxpython from source with no
Unicode support, and installing it to sage's python.
I am using wxPython just to make a Panel with buttons and SpinCtrl.
Some sizers.. all in English (firstly in Portuguese.. but that's ok,
maybe next time), I should not need Unicode support. Dependencies
should be ok, because wxPython for gtk2.8 is installed with apt.
$ cd wxPython-src-2.8.4.0/
$ mkdir bld
$ cd bld
$ ../configure --prefix=/home/tatius/Desktop/packs/experimental
And I get this output on one of the last lines:
Should wxWidgets be compiled in Unicode mode? no
Great.
$ make
...
$ make install
Wonderful. /home/tatius/Desktop/packs/experimental is there and seems
to have wxwidgets installation.
Next:
sage -python calls sage's python. So:
/media/kubold/home/ref/Desktop/packages/sage/sage -python setup.py
build_ext --inplace
WX_CONFIG=/home/tatius/Desktop/packs/experimental/bin/wx-config
UNICODE=0
I received several error of the types:
warning: command line option "-Wstrict-prototypes" is valid for
Ada/C/ObjC but not for C++
and
warning: 'created2' may be used uninitialized in this function
and
error: expected primary-expression before ')' token
contrib/glcanvas/gtk/glcanvas_wrap.cpp:2991: error: expected `;' before '__null'
contrib/glcanvas/gtk/glcanvas_wrap.cpp:3003: error: 'wxGLCanvas' was
not declared in this scope
and:
contrib/glcanvas/gtk/glcanvas_wrap.cpp:4505: error: 'WX_GL_MIN_BLUE'
was not declared in this scope
finally:
error: command 'gcc' failed with exit status 1
...
then:
$ .../sage -python
Python 2.5.1 (r251:54863, May 8 2007, 11:39:04)
[GCC 3.3.5 (Debian 1:3.3.5-13)] on linux2
Type "help", "copyright", "credits" or "license" for more information
sys.path.append('/home/tatius/Desktop/packs/wxPython-src-2.8.4.0/wxPython')
import wx
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/tatius/Desktop/packs/wxPython-src-2.8.4.0/wxPython/wx/__init__.py",
line 45, in <module>
from wx._core import *
File "/home/tatius/Desktop/packs/wxPython-src-2.8.4.0/wxPython/wx/_core.py",
line 4, in <module>
import _core_
ImportError: libwx_gtk2_aui-2.8.so.0: cannot open shared object file:
No such file or directory
Ok. Is seems to have no access to my compiled wxwidgets libs.
I tryed:
$ export LD_LIBRARY_PATH=/home/tatius/Desktop/packs/experimental/lib
$ export PYTHONPATH=/home/tatius/Desktop/packs/wxPython-src-2.8.4.0/wxPython
Even though I think it was not a good idea. No improvement.
An other try was using 'sage' not sage -python.
Very similar output and:
error: command 'gcc' failed with exit status 1
The same problem with using standard python to run setup.py .
...
2º Try, on 2º Try:
mkdir bld2
cd bld2
../configure --prefix=/home/tatius/Desktop/packs/exp2 --with-gtk
make (Ok)
make -C contrib/src/gizmos (ok)
make -C contrib/src/stc (ok)
make install (ok)
make -C contrib/src/gizmos install (ok)
make -C contrib/src/stc install (ok)
cd ../wxPython
/media/kubold/home/ref/Desktop/packages/sage/sage setup.py buld_ext
WX_CONFIG=/home/tatius/Desktop/packs/exp2/bin/wx-config UNICODE=0
..
error: command 'gcc' failed with exit status 1
sage: Error running setup.py using Python
3º Try on 2º Try:
mkdir bld3
cd bld3
../configure --prefix=/home/tatius/Desktop/packs/exp2 --with-gtk
--enable-display
archieve: rola.sh
#!/bin/bash
make $* \
&& make -C contrib/src/gizmos $* \
&& make -C contrib/src/stc $*
chmod -x rola.sh
./rola.sh (ok)
./rola.sh install (ok)
cd ../wxPython
/media/kubold/home/ref/Desktop/packages/sage/sage setup.py build_ext
--inplace WX_CONFIG=/home/tatius/Desktop/packs/exp2/bin/wx-config
UNICODE=0
cc1plus: warning: command line option "-Wstrict-prototypes" is valid
for Ada/C/ObjC but not for C++
Any help is appreciated, this is quite important for stuffs I am doing.
Thanks in advance,
gk