[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-bindings
Subject:    Re: [Kde-bindings] Progress report on Py*5 binding generation
From:       Shaheed Haque <srhaque () theiet ! org>
Date:       2016-04-22 19:43:41
Message-ID: CAHAc2jevFoLFjcu6YuHmOJZbfkZ7H0zVhyBX4s424ibgqPtPqQ () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi Steve,

On 22 April 2016 at 08:35, Stephen Kelly <steveire@gmail.com> wrote:

> Stephen Kelly wrote:
>
> > "/usr/include/x86_64-linux-gnu/qt5,/usr/include/x86_64-linux-
> gnu/qt5/QtCore"
> > --select @kitemmodelsmod.sip sip cxx
>
> Oops, the cxx at the end should be removed, but the end result is still
> that
> the module is reported as having an error:
>
> $ ./create_script.sh
> ERROR: Parse error
> /usr/include/x86_64-linux-gnu/qt5/QtCore/qglobal.h:38[10]
> 'stddef.h' file not found
> 2016-04-22 09:35:03,078 __main__ INFO: Creating PyKF5/tmp/kitemmodels
> 2016-04-22 09:35:03,078 __main__ DEBUG:
> PyKF5/tmp/kitemmodels/kitemmodelsmod.sip.tmp
> 2016-04-22 09:35:03,078 __main__ INFO: /usr/bin/sip -c
> PyKF5/tmp/kitemmodels
> -b PyKF5/tmp/kitemmodels/module.sbf -x kitemmodelsmod_sip -x VendorID -t
> WS_X11 -t Qt_5_4_2 -x Py_v3 -I/usr/share/sip/PyQt5 -Isip
> PyKF5/tmp/kitemmodels/kitemmodelsmod.sip.tmp
> 2016-04-22 09:35:03,406 __main__ INFO: make -f module.Makefile
> g++ -c -g -O2 -fstack-protector-strong -Wformat -Werror=format-security  -
> D_FORTIFY_SOURCE=2 -fPIC -Wall -W -DNDEBUG -I. -I/usr/include/x86_64-linux-
> gnu/qt5 -I/usr/include/x86_64-linux-gnu/qt5/QtCore -I/usr/include/python2.7
> -o sipkitemmodelscmodule.o sipkitemmodelscmodule.cpp
> g++ -c -g -O2 -fstack-protector-strong -Wformat -Werror=format-security  -
> D_FORTIFY_SOURCE=2 -fPIC -Wall -W -DNDEBUG -I. -I/usr/include/x86_64-linux-
> gnu/qt5 -I/usr/include/x86_64-linux-gnu/qt5/QtCore -I/usr/include/python2.7
> -o sipkitemmodelsKSelectionProxyModel.o
> sipkitemmodelsKSelectionProxyModel.cpp
> g++ -Wl,-Bsymbolic-functions -Wl,-z,relro -shared -Wl,--version-
> script=kitemmodels.exp -o kitemmodels.so sipkitemmodelscmodule.o
> sipkitemmodelsKSelectionProxyModel.o -lm /usr/lib/x86_64-linux-
> gnu/libQt5Core.so /usr/lib/x86_64-linux-gnu/libKF5ItemModels.so
> /usr/lib/x86_64-linux-gnu/libpython2.7.so
> 2016-04-22 09:35:03,665 __main__ INFO: Publishing PyKF5.kitemmodels
> <module 'PyQt5.QtCore' from '/usr/lib/python2.7/dist-
> packages/PyQt5/QtCore.so'>
> Traceback (most recent call last):
>   File "./pythontest.py", line 7, in <module>
>     from PyKF5 import kitemmodels
> SystemError: dynamic module not initialized properly
>


I think the only thing you did wrong is the %Module declaration in
kitemmodelsmod.sip. If I change it from:

%Module PyKDE5.kitemmodels

to

%Module PyKF5.kitemmodels

then it all seems to work:

$ ./create_script.sh
ERROR: Parse error
/usr/lib/gcc/x86_64-linux-gnu/5.3.1/../../../../include/c++/5.3.1/cstddef:45[10]
'stddef.h' file not found
2016-04-22 20:39:23,846 __main__ INFO: Creating PyKF5/tmp/kitemmodels
2016-04-22 20:39:23,846 __main__ DEBUG:
PyKF5/tmp/kitemmodels/kitemmodelsmod.sip.tmp
2016-04-22 20:39:23,846 __main__ INFO: /usr/bin/sip -c
PyKF5/tmp/kitemmodels -b PyKF5/tmp/kitemmodels/module.sbf -x
kitemmodelsmod_sip -x VendorID -t WS_X11 -t Qt_5_5_1 -x Py_v3
-I/usr/share/sip/PyQt5 -Istevesip
PyKF5/tmp/kitemmodels/kitemmodelsmod.sip.tmp
2016-04-22 20:39:24,149 __main__ INFO: make -f module.Makefile
g++ -c -g -O2 -fstack-protector-strong -Wformat -Werror=format-security
-Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Wall -W -DNDEBUG -I.
-I/usr/include/x86_64-linux-gnu/qt5
-I/usr/include/x86_64-linux-gnu/qt5/QtCore -I/usr/include/python2.7 -o
sipkitemmodelscmodule.o sipkitemmodelscmodule.cpp
g++ -c -g -O2 -fstack-protector-strong -Wformat -Werror=format-security
-Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Wall -W -DNDEBUG -I.
-I/usr/include/x86_64-linux-gnu/qt5
-I/usr/include/x86_64-linux-gnu/qt5/QtCore -I/usr/include/python2.7 -o
sipkitemmodelsKSelectionProxyModel.o sipkitemmodelsKSelectionProxyModel.cpp
g++ -Wl,-Bsymbolic-functions -Wl,-z,relro -shared
-Wl,--version-script=kitemmodels.exp -o kitemmodels.so
sipkitemmodelscmodule.o sipkitemmodelsKSelectionProxyModel.o -lm
/usr/lib/x86_64-linux-gnu/libQt5Core.so
/usr/lib/x86_64-linux-gnu/libKF5ItemModels.so /usr/lib/x86_64-linux-gnu/
libpython2.7.so
2016-04-22 20:39:26,124 __main__ INFO: Publishing PyKF5.kitemmodels
<module 'PyQt5.QtCore' from '/usr/lib/python2.7/dist-packages/PyQt5/
QtCore.x86_64-linux-gnu.so'>

And just to be sure:

$ python -c 'from PyKF5 import kitemmodels; print(kitemmodels)'
<module 'PyKF5.kitemmodels' from 'PyKF5/kitemmodels.so'>

Thanks, Shaheed



> Thanks,
>
> Steve.
> _______________________________________________
> Kde-bindings mailing list
> Kde-bindings@kde.org
> https://mail.kde.org/mailman/listinfo/kde-bindings
>

[Attachment #5 (text/html)]

<div dir="ltr"><div><div class="gmail_extra">Hi Steve,<br><br><div \
class="gmail_quote">On 22 April 2016 at 08:35, Stephen Kelly <span dir="ltr">&lt;<a \
href="mailto:steveire@gmail.com" target="_blank">steveire@gmail.com</a>&gt;</span> \
wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="">Stephen \
Kelly wrote:<br> <br>
&gt; &quot;/usr/include/x86_64-linux-gnu/qt5,/usr/include/x86_64-linux-<br>
gnu/qt5/QtCore&quot;<br>
&gt; --select @kitemmodelsmod.sip sip cxx<br>
<br>
</span>Oops, the cxx at the end should be removed, but the end result is still \
that<br> the module is reported as having an error:<br>
<br>
$ ./create_script.sh<br>
ERROR: Parse error /usr/include/x86_64-linux-gnu/qt5/QtCore/qglobal.h:38[10]<br>
&#39;stddef.h&#39; file not found<br>
2016-04-22 09:35:03,078 __main__ INFO: Creating PyKF5/tmp/kitemmodels<br>
2016-04-22 09:35:03,078 __main__ DEBUG:<br>
PyKF5/tmp/kitemmodels/kitemmodelsmod.sip.tmp<br>
2016-04-22 09:35:03,078 __main__ INFO: /usr/bin/sip -c PyKF5/tmp/kitemmodels<br>
-b PyKF5/tmp/kitemmodels/module.sbf -x kitemmodelsmod_sip -x VendorID -t<br>
<span class="">WS_X11 -t Qt_5_4_2 -x Py_v3 -I/usr/share/sip/PyQt5 -Isip<br>
</span>PyKF5/tmp/kitemmodels/kitemmodelsmod.sip.tmp<br>
2016-04-22 09:35:03,406 __main__ INFO: make -f module.Makefile<br>
g++ -c -g -O2 -fstack-protector-strong -Wformat -Werror=format-security   -<br>
<span class="">D_FORTIFY_SOURCE=2 -fPIC -Wall -W -DNDEBUG -I. \
-I/usr/include/x86_64-linux-<br> </span>gnu/qt5 \
                -I/usr/include/x86_64-linux-gnu/qt5/QtCore \
                -I/usr/include/python2.7<br>
-o sipkitemmodelscmodule.o sipkitemmodelscmodule.cpp<br>
g++ -c -g -O2 -fstack-protector-strong -Wformat -Werror=format-security   -<br>
<span class="">D_FORTIFY_SOURCE=2 -fPIC -Wall -W -DNDEBUG -I. \
-I/usr/include/x86_64-linux-<br> </span>gnu/qt5 \
                -I/usr/include/x86_64-linux-gnu/qt5/QtCore \
                -I/usr/include/python2.7<br>
-o sipkitemmodelsKSelectionProxyModel.o<br>
sipkitemmodelsKSelectionProxyModel.cpp<br>
g++ -Wl,-Bsymbolic-functions -Wl,-z,relro -shared -Wl,--version-<br>
<span class="">script=kitemmodels.exp -o kitemmodels.so sipkitemmodelscmodule.o<br>
sipkitemmodelsKSelectionProxyModel.o -lm /usr/lib/x86_64-linux-<br>
gnu/libQt5Core.so /usr/lib/x86_64-linux-gnu/libKF5ItemModels.so<br>
/usr/lib/x86_64-linux-gnu/<a href="http://libpython2.7.so" rel="noreferrer" \
target="_blank">libpython2.7.so</a><br> </span>2016-04-22 09:35:03,665 __main__ INFO: \
Publishing PyKF5.kitemmodels<br> &lt;module &#39;PyQt5.QtCore&#39; from \
&#39;/usr/lib/python2.7/dist-<br> packages/PyQt5/QtCore.so&#39;&gt;<br>
<span class="">Traceback (most recent call last):<br>
</span>   File &quot;./pythontest.py&quot;, line 7, in &lt;module&gt;<br>
      from PyKF5 import kitemmodels<br>
<span class="im">SystemError: dynamic module not initialized \
properly<br></span></blockquote><div><br><br>I think the only thing you did wrong is \
the %Module declaration in kitemmodelsmod.sip. If I change it from:<br><br>%Module \
PyKDE5.kitemmodels<br><br>to<br><br>%Module PyKF5.kitemmodels<br><br>then it all \
seems to work:<br><br>$ ./create_script.sh <br>ERROR: Parse error \
/usr/lib/gcc/x86_64-linux-gnu/5.3.1/../../../../include/c++/5.3.1/cstddef:45[10] \
&#39;stddef.h&#39; file not found<br>2016-04-22 20:39:23,846 __main__ INFO: Creating \
PyKF5/tmp/kitemmodels<br>2016-04-22 20:39:23,846 __main__ DEBUG: \
PyKF5/tmp/kitemmodels/kitemmodelsmod.sip.tmp<br>2016-04-22  20:39:23,846 __main__ \
INFO: /usr/bin/sip -c PyKF5/tmp/kitemmodels -b  PyKF5/tmp/kitemmodels/module.sbf -x \
kitemmodelsmod_sip -x VendorID -t  WS_X11 -t Qt_5_5_1 -x Py_v3 -I/usr/share/sip/PyQt5 \
-Istevesip  PyKF5/tmp/kitemmodels/kitemmodelsmod.sip.tmp<br>2016-04-22 20:39:24,149 \
                __main__ INFO: make -f module.Makefile<br>g++
 -c -g -O2 -fstack-protector-strong -Wformat -Werror=format-security   
-Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Wall -W -DNDEBUG -I. 
-I/usr/include/x86_64-linux-gnu/qt5 
-I/usr/include/x86_64-linux-gnu/qt5/QtCore -I/usr/include/python2.7 -o 
sipkitemmodelscmodule.o sipkitemmodelscmodule.cpp<br>g++ -c -g -O2 
-fstack-protector-strong -Wformat -Werror=format-security   -Wdate-time 
-D_FORTIFY_SOURCE=2 -fPIC -Wall -W -DNDEBUG -I. 
-I/usr/include/x86_64-linux-gnu/qt5 
-I/usr/include/x86_64-linux-gnu/qt5/QtCore -I/usr/include/python2.7 -o 
sipkitemmodelsKSelectionProxyModel.o 
sipkitemmodelsKSelectionProxyModel.cpp<br>g++ -Wl,-Bsymbolic-functions 
-Wl,-z,relro -shared -Wl,--version-script=kitemmodels.exp -o 
kitemmodels.so sipkitemmodelscmodule.o 
sipkitemmodelsKSelectionProxyModel.o -lm 
/usr/lib/x86_64-linux-gnu/libQt5Core.so 
/usr/lib/x86_64-linux-gnu/libKF5ItemModels.so 
/usr/lib/x86_64-linux-gnu/<a \
href="http://libpython2.7.so">libpython2.7.so</a><br>2016-04-22 20:39:26,124 __main__ \
INFO: Publishing PyKF5.kitemmodels<br>&lt;module &#39;PyQt5.QtCore&#39; from \
&#39;/usr/lib/python2.7/dist-packages/PyQt5/<a \
href="http://QtCore.x86_64-linux-gnu.so">QtCore.x86_64-linux-gnu.so</a>&#39;&gt;<br><br>And \
just to be sure:<br><br>$ python -c &#39;from PyKF5 import kitemmodels; \
print(kitemmodels)&#39;<br>&lt;module &#39;PyKF5.kitemmodels&#39; from \
&#39;PyKF5/kitemmodels.so&#39;&gt;<br><br><div>Thanks, \
Shaheed<br></div><div><br></div>  <span class="im"></span><br><span class="im"> \
</span></div><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class=""><div \
class="h5">Thanks,<br> <br>
Steve.<br>
_______________________________________________<br>
Kde-bindings mailing list<br>
<a href="mailto:Kde-bindings@kde.org">Kde-bindings@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/kde-bindings" rel="noreferrer" \
target="_blank">https://mail.kde.org/mailman/listinfo/kde-bindings</a><br> \
</div></div></blockquote></div><br></div></div></div>


[Attachment #6 (text/plain)]

_______________________________________________
Kde-bindings mailing list
Kde-bindings@kde.org
https://mail.kde.org/mailman/listinfo/kde-bindings


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic