Package python-qwt3d broken in Karmic

Bug #478230 reported by zzarko
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
pyqwt3d (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Binary package hint: python-qwt3d-qt4

This bug is connected with https://bugs.launchpad.net/bugs/342782, as it depends on python-qwt5-qt4. After solving problems described in previous bug (ImportError: /usr/lib/pymodules/python2.6/PyQt4/Qwt5/Qwt.so: undefined symbol: _ZN13QwtLegendItem17setIdentfierWidthEi; I resolved error by using python-qwt5-qt4_5.2.0+dfsg-1~ppa1_i386.deb from Vaclav's PPA), this is the error I got from trying to use python-qwt3d-qt4 package:

File "/usr/lib/pymodules/python2.6/PyQt4/Qwt3D/__init__.py", line 30, in <module>
    from _Qwt3D import *
RuntimeError: the sip module implements API v6.0 but the PyQt4.Qwt3D._Qwt3D module requires API v5.0

I downloaded cvs repository for qwtplot3d, tried to compile it according to instructions and got numerous errors. This is how I resolved them (I know this is not the right way to do it, but I don't know how to do it properly):

1. I needed to change configure/configure.py file, line 588 from
        options.extra_libs.append('qwtplot3d')
to
        options.extra_libs.append('qwtplot3d-qt4')
because at the end, after I resolved other errors, I got error from ld saying it cannot find -lqwtplot3d (although package was properly installed with symlink to qwtplot3d-qt4)

2. ./configure.py -I /usr/include/qwtplot3d-qt4/

3. After this, make failed with:
make[1]: Entering directory `/home/zzarko/Programs/pyqwt3d/configure/Qwt3D_Qt4'
g++ -c -pipe -fPIC -g -O2 -Os -Wall -W -D_REENTRANT -DNDEBUG -DHAS_NUMERIC -DHAS_NUMPY -DQT_NO_DEBUG -DQT_CORE_LIB -DQT_GUI_LIB -DQT_OPENGL_LIB -I. -I/usr/include/qwtplot3d-qt4/ -I/usr/include/python2.6 -I/usr/lib/python2.6/dist-packages/numpy/core/include -I/usr/include/qt4/Qt -I/usr/share/qt4/mkspecs/default -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4 -I/usr/X11R6/include -o sip_Qwt3Dcmodule.o sip_Qwt3Dcmodule.cpp
../sip/qwt3d_plot.sip: In function ‘const sipTypeDef* sipSubClass_Plot3D(void**)’:
../sip/qwt3d_plot.sip:50: error: invalid conversion from ‘const char*’ to ‘char*’
../sip/qwt3d_plot.sip:50: error: invalid conversion from ‘const char*’ to ‘char*’
make[1]: *** [sip_Qwt3Dcmodule.o] Error 1
make[1]: Leaving directory `/home/zzarko/Programs/trt/pyqwt3d/configure/Qwt3D_Qt4'
make: *** [all] Error 2

Beacuse I don't know how to fix this before configure step, I changed generated file directly. configure/Qwt3D_Qt4/sip_Qwt3Dcmodule.cpp, line 1487, from:
        {sipName_Plot3D, &sipClass_Plot3D, 1, -1},
        {sipName_SurfacePlot, &sipClass_SurfacePlot, -1, -1},
to
        {(char*)sipName_Plot3D, &sipClass_Plot3D, 1, -1},
        {(char*)sipName_SurfacePlot, &sipClass_SurfacePlot, -1, -1},

After this, make goes without further errors. Then, I tried just to install new files over original ones (without uninstalling python-qwt3d-qt4 package) and got the same error about 5.0/6.0 API as before. After that, I uninstalled the package, tried again sudo make install and got this:
File "./FSVisio.py", line 27, in <module>
    from PyQt4.Qwt3D import Function, RGBA, SurfacePlot, BOX, X1, Y1, Z1, TripleField, CellField, Triple, Cell
ImportError: No module named Qwt3D

I had problems using qwt/qwt3d on Jaunty also, but I was able to solve them using similar approach to this one. After upgrade to Karmic, qwt/qwt3d packages are still broken, but I don't know what to do next. Any help?

P.S. I tried also to statically link libqwt3d (using source for qwt3d and ./configure.py -I /usr/include/qwtplot3d-qt4/ -Q ../qwtplot3d-0.2.7/), buth with same results.

Tags: qwt qwt3d
Revision history for this message
zzarko (zzarko-gmail) wrote :

I tried to compile it using similar options Darren Dale used for pyqwt (I also installed pyqwt 5.2.0 this way):
python configure.py -Q ../qwtplot3d-0.2.7 -L /usr -I /usr --module-install-path=/usr/lib/pymodules/python2.6/PyQt4/Qwt3D

and I still got errors for ‘const char*’. After directly changing cpp file, make goes without further errors, and after installing and starting my program I got this:
File "./FSVisio.py", line 27, in <module>
    from PyQt4.Qwt3D import Function, RGBA, SurfacePlot, BOX, X1, Y1, Z1, TripleField, CellField, Triple, Cell
  File "/usr/lib/pymodules/python2.6/PyQt4/Qwt3D/__init__.py", line 30, in <module>
    from _Qwt3D import *
ImportError: /usr/lib/pymodules/python2.6/PyQt4/Qwt3D/_Qwt3D.so: undefined symbol: gluCylinder

I'm not using any 3D cylinders, and I don't know where to search for solution for this. I tried pyqwt3d 0.1.6 with same configure options, and I got the same error.

Revision history for this message
zzarko (zzarko-gmail) wrote :

Gerard Vermeulen from PyQwt responded regarding gluCylinder issue and it appeared that libGLU wasn't linked with _Qwt3D.so during pyqwt3d compilation. I addded -lGLU in configure options and finally I'm able to use the pyqwt3d. So, to summarize things:

1. python configure.py -Q ../qwtplot3d-0.2.7 -lGLU -L /usr -I /usr --module-install-path=/usr/lib/pymodules/python2.6/PyQt4/Qwt3D

2. configure/Qwt3D_Qt4/sip_Qwt3Dcmodule.cpp, line 1487
from:
        {sipName_Plot3D, &sipClass_Plot3D, 1, -1},
        {sipName_SurfacePlot, &sipClass_SurfacePlot, -1, -1},
to
        {(char*)sipName_Plot3D, &sipClass_Plot3D, 1, -1},
        {(char*)sipName_SurfacePlot, &sipClass_SurfacePlot, -1, -1}

3. make/sudo make install

Revision history for this message
zzarko (zzarko-gmail) wrote :

After some more talk with Gerad, here is (I hope) final version of pyqwt3d installation for Karmic:
1. Get latest cvs version (some bugs were corrected):
cvs -z3 -d:pserver:<email address hidden>:/cvsroot/pyqwt co -P pyqwt3d

2. Go to pyqwt3d directory and get and patch qwtplot3d:
make -f GNUmakefile qwtplot3d-0.2.7

3. Add
#include <stdio.h>
at the beginning of qwtplot3d-0.2.7/src/qwt3d_function.cpp

4. Go to configure directory and do the rest:
python configure.py -Q ../qwtplot3d-0.2.7 -lGLU -L /usr -I /usr --module-install-path=/usr/lib/pymodules/python2.6/PyQt4/Qwt3D
make
sudo make install

Now, someone who knows how just need to make a package...

Revision history for this message
wyderkat (wyderka-t) wrote :

I have fast workaround. Just set up variable like this:

export LD_PRELOAD=/usr/lib/i386-linux-gnu/libGLU.so.1

and everything sould be solved. But remeber to check if this file exist at your filesystem :)

This mean that prior to any binary code loading, this library will be loaded with it. I wanted more elegant solution, link this library to already compiled qwt3dplot library, but I cannot understand "man ld"... Anybody knows how?

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in pyqwt3d (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.