wdu / pywt

Python bindings for Wt
Other
6 stars 4 forks source link

pywt-gen.sh error #3

Closed rashadkm closed 11 years ago

rashadkm commented 11 years ago

Error running pywt-gen.sh

EXECUTING Wrong dir

this is where the code is exiting

# check root dir
flist = glob.glob("%s/*.cl" % root)
if len(flist) == 0:
    print "Wrong dir"
    sys.exit(1)
wdu commented 11 years ago

python_dump should create a directory called 'descr' with a bunch of *.cl files in it. This directory is assumed to be a subdirectory of pywt/ by the pywt-gen.sh script.

rashadkm commented 11 years ago

python_dump creates a dir named out and there are a bunch of .cl files there. I renamed 'out' to 'descr' and it gave me this error

Reading /packages/pywt/descr/Http/Method.cl Reading /packages/pywt/descr/Http/Client.cl Reading /packages/pywt/descr/Http/Message.cl Reading /packages/pywt/descr/Http/Request.cl Reading /packages/pywt/descr/Http/Response.cl Reading /packages/pywt/descr/Http/ResponseContinuation.cl Reading /packages/pywt/descr/Http/UploadedFile.cl Reading /packages/pywt/descr/Http/WtClient.cl Patching wthttp Traceback (most recent call last): File "scripts/PyGenBindings.py", line 1424, in createUnit(root + "/descr/Http", root + "/src/generated/wt/http", "wthttp") File "scripts/PyGenBindings.py", line 1394, in createUnit patchClasses.patch(prefix, classmap) File "/packages/pywt/scripts/patchClasses.py", line 333, in patch patchHttp(clist) File "/packages/pywt/scripts/patchClasses.py", line 307, in patchHttp del clist["Request"].innerclasses["ByteRangeSpecifier"] KeyError: 'ByteRangeSpecifier'

wdu commented 11 years ago

Yes out and descr that has to be streamlined; it is the same.

Contents of descr/Http/Request.cl are not what they should be.

Did you see any error at the beginning when you run python_dump? Are you sure you linked against the patched libclang and not the standard one on your system?

rashadkm commented 11 years ago

yes i linked with your patched clang

Also I am getting this warning at the start of python_dump

./python_dump wt.cc warning: ./python_dump: 'linker' input unused [-Wunused-command-line-argument] /usr/include/wchar.h:40:11: fatal error: 'stdarg.h' file not found Wt::stuff WFlags, type 31

wdu commented 11 years ago

I expect that you have to add include directives for Wt and boost. However, that stdarg.h is not found, points to a different problem too. did you run 'make install' on the patched clang (set CMAKE_INSTALL_PREFIX to somewhere in your home dir)? Adding a -I to find stdarg.h may resolve the issue too.

e.g.: ./python_dump wt.cc -I/home/wim/wt-install/include -I/home/wim/boost-install/include

Wim.

rashadkm commented 11 years ago

i tried this ./python_dump wt.cc -I/usr/include/c++/4.6/tr1/ warning: ./python_dump: 'linker' input unused [-Wunused-command-line-argument] /usr/include/c++/4.6/tr1/cwchar:43:14: error: no member named 'wcstof' in namespace 'std' /usr/include/c++/4.6/tr1/cwchar:46:14: error: no member named 'vfwscanf' in namespace 'std' /usr/include/c++/4.6/tr1/cwchar:49:14: error: no member named 'vswscanf' in namespace 'std' /usr/include/c++/4.6/tr1/cwchar:52:14: error: no member named 'vwscanf' in namespace 'std' /usr/include/c++/4.6/tr1/cwchar:56:14: error: no member named 'wcstold' in namespace 'std' /usr/include/c++/4.6/tr1/cwchar:57:14: error: no member named 'wcstoll' in namespace 'std' /usr/include/c++/4.6/tr1/cwchar:58:14: error: no member named 'wcstoull' in namespace 'std' /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/postypes.h:230:16: error: use of undeclared identifier 'mbstate_t' /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/postypes.h:232:16: error: use of undeclared identifier 'mbstate_t' /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/char_traits.h:65:20: error: no type named 'mbstate_t' in namespace 'std' /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/char_traits.h:241:15: error: unknown type name 'mbstate_t' /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/char_traits.h:309:15: error: unknown type name 'wint_t' /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/char_traits.h:312:15: error: unknown type name 'mbstate_t' /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/char_traits.h:328:16: error: use of undeclared identifier 'wmemcmp' /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/char_traits.h:332:16: error: use of undeclared identifier 'wcslen' /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/char_traits.h:336:16: error: use of undeclared identifier 'wmemchr' /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/char_traits.h:340:16: error: use of undeclared identifier 'wmemmove' /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/char_traits.h:344:16: error: use of undeclared identifier 'wmemcpy' /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/char_traits.h:348:16: error: use of undeclared identifier 'wmemset' fatal error: too many errors emitted, stopping now [-ferror-limit=] Wt::stuff WFlags, type 31 Wt::stuff Wt::WFlags, type 24 Wt::stuff Wt::WFlags, type 24

wdu commented 11 years ago

I developed on my mac, which is clang by default. I never tried this on ubuntu. Does google give you any hints about clang and ubuntu (gcc?) include files?

rashadkm commented 11 years ago

google shows up missing stdarg.h error for clang in both mac and windows

But nothing works. I am very much stuck :(

rashadkm commented 11 years ago

here is the o/p of python_dump for me it seems fine. no stdarg.h missing error

./python_dump wt.cc -I/usr/include/clang/3.0/include/

http://pastebin.com/1RbRs9Zz

wdu commented 11 years ago

ok does pywt-gen.sh run without errors?

rashadkm commented 11 years ago

no it doesnt

./pywt-gen.sh EXECUTING GenAutoFunctions Reading /packages/pywt/descr/Http/Method.cl Reading /packages/pywt/descr/Http/Client.cl Reading /packages/pywt/descr/Http/Message.cl Reading /packages/pywt/descr/Http/Request.cl Reading /packages/pywt/descr/Http/Response.cl Reading /packages/pywt/descr/Http/ResponseContinuation.cl Reading /packages/pywt/descr/Http/UploadedFile.cl Reading /packages/pywt/descr/Http/WtClient.cl Patching wthttp Traceback (most recent call last): File "scripts/PyGenBindings.py", line 1424, in createUnit(root + "/descr/Http", root + "/src/generated/wt/http", "wthttp") File "scripts/PyGenBindings.py", line 1394, in createUnit patchClasses.patch(prefix, classmap) File "/packages/pywt/scripts/patchClasses.py", line 333, in patch patchHttp(clist) File "/packages/pywt/scripts/patchClasses.py", line 307, in patchHttp del clist["Request"].innerclasses["ByteRangeSpecifier"] KeyError: 'ByteRangeSpecifier'

rashadkm commented 11 years ago

FYI, I had someone tested on mac too with the same error

rashadkm commented 11 years ago

commenting out scripts/patchClasses.py L# 307 - 308 it shows this error

./pywt-gen.sh EXECUTING GenAutoFunctions Reading /packages/pywt/descr/Http/Method.cl Reading /packages/pywt/descr/Http/Client.cl Reading /packages/pywt/descr/Http/Message.cl Reading /packages/pywt/descr/Http/Request.cl Reading /packages/pywt/descr/Http/Response.cl Reading /packages/pywt/descr/Http/ResponseContinuation.cl Reading /packages/pywt/descr/Http/UploadedFile.cl Reading /packages/pywt/descr/Http/WtClient.cl Patching wthttp Processing Request Processing ResponseContinuation Processing Client Processing WtClient Processing UploadedFile Processing Message Processing Response Generating Request Generating ResponseContinuation Generating Client Traceback (most recent call last): File "scripts/PyGenBindings.py", line 1424, in createUnit(root + "/descr/Http", root + "/src/generated/wt/http", "wthttp") File "scripts/PyGenBindings.py", line 1402, in createUnit Generate(enums, classlist, prefix) File "scripts/PyGenBindings.py", line 1342, in Generate generatePyObject(c) File "scripts/PyGenBindings.py", line 850, in generatePyObject f.write("\t\t\tType->Factory = new Poly_PyInstanceFactory< %s, %s >;\n" % (c.fullCoreName(), c.baseclass[0].fullCoreName())) IndexError: list index out of range

wdu commented 11 years ago

sounds like you did not execute descr-cleanup.sh, which removes some .cl files

rashadkm commented 11 years ago

After running descr-cleanup.sh and with some comment outs pywt-gen.sh works

PFA

On Wed, Feb 20, 2013 at 9:02 PM, wdu notifications@github.com wrote:

sounds like you did not execute descr-cleanup.sh, which removes some .cl files

— Reply to this email directly or view it on GitHubhttps://github.com/wdu/pywt/issues/3#issuecomment-13837632.

Regards, Rashad

rashadkm commented 11 years ago

where to upload diff files?

rashadkm commented 11 years ago

well, I could say there is progress but still build is not sucessful

here is my compile error

58%] Building CXX object src/wt/CMakeFiles/wtmodule.dir/__/generated/wt/gwt_Compare.o [ 61%] Building CXX object src/wt/CMakeFiles/wtmodule.dir/WtWrappers1.o [ 64%] Building CXX object src/wt/CMakeFiles/wtmodule.dir/WtWrappers2.o In file included from /packages/pywt/src/wt/../python/ComplexConversion.h:19:0, from /packages/pywt/src/wt/WtWrappers2.cpp:19: /usr/local/include/Wt/WEnvironment: In destructor ‘Arg<const TYPE&>::~Arg() [with TYPE = Wt::WEnvironment]’: /packages/pywt/src/wt/../generated/wt/gPyWApplication.inc:32:3: instantiated from here /usr/local/include/Wt/WEnvironment:664:3: error: ‘Wt::WEnvironment::~WEnvironment()’ is protected /packages/pywt/src/wt/../python/Arg.h:39:4: error: within this context make[2]: * [src/wt/CMakeFiles/wtmodule.dir/WtWrappers2.o] Error 1 make[1]: * [src/wt/CMakeFiles/wtmodule.dir/all] Error 2 make: *\ [all] Error 2

wdu commented 11 years ago

That's a todo in the generated code. Edit /usr/local/include/Wt/WEnvironment, and mark the destructor public. This is of course a hack; the generated code should never call delete on WEnvironment.

rashadkm commented 11 years ago

did the hack

[ 16%] Building CXX object src/wt/CMakeFiles/wtmodule.dir/PyWt.o In file included from /packages/pywt/src/wt/includeTemplateWrapperImpl.h:50:0, from /packages/pywt/src/wt/PyWt.cpp:27: /packages/pywt/src/wt/PyJSignal.inc: In static member function ‘static PyObject* PyJSignal<A1, A2, A3, A4, A5, A6>::semit(PyCPPClassInstance, PyObject, PyObject) [with A1 = Wt::WGoogleMap::Coordinate, A2 = Wt::NoClass, A3 = Wt::NoClass, A4 = Wt::NoClass, A5 = Wt::NoClass, A6 = Wt::NoClass, PyObject = object]’: /packages/pywt/src/wt/PyJSignal.h:55:4: instantiated from ‘PyJSignal<A1, A2, A3, A4, A5, A6>::PyJSignal(const char, PyTypeObject_) [with A1 = Wt::WGoogleMap::Coordinate, A2 = Wt::NoClass, A3 = Wt::NoClass, A4 = Wt::NoClass, A5 = Wt::NoClass, A6 = Wt::NoClass, PyTypeObject = _typeobject]’ /packages/pywt/src/wt/../generated/wt/gwtTemplateTypeInst.inc:61:93: instantiated from here /packages/pywt/src/wt/PyJSignal.inc:85:32: error: ‘arg’ is not a member of ‘Python2CWt::WGoogleMap::Coordinate’ In file included from /packages/pywt/src/wt/includeTemplateWrapperImpl.h:49:0, from /packages/pywt/src/wt/PyWt.cpp:27: /packages/pywt/src/wt/PySignal.inc: In static member function ‘static PyObject PySignal<A1, A2, A3, A4, A5, A6>::semit(PyCPPClassInstance, PyObject, PyObject) [with A1 = Wt::WValidator::Result, A2 = Wt::NoClass, A3 = Wt::NoClass, A4 = Wt::NoClass, A5 = Wt::NoClass, A6 = Wt::NoClass, PyObject = object]’: /packages/pywt/src/wt/PySignal.h:29:4: instantiated from ‘PySignal<A1, A2, A3, A4, A5, A6>::PySignal(const char) [with A1 = Wt::WValidator::Result, A2 = Wt::NoClass, A3 = Wt::NoClass, A4 = Wt::NoClass, A5 = Wt::NoClass, A6 = Wt::NoClass]’ /packages/pywt/src/wt/../generated/wt/gwt_TemplateTypeInst.inc:109:83: instantiated from here /packages/pywt/src/wt/PySignal.inc:63:32: error: ‘arg’ is not a member of ‘Python2CWt::WValidator::Result’ /packages/pywt/src/wt/PySignal.inc: In static member function ‘static PyObject\ PySignal<A1, A2, A3, A4, A5, A6>::semit(PyCPPClassInstance, PyObject, PyObject) [with A1 = Wt::WDialog::DialogCode, A2 = Wt::NoClass, A3 = Wt::NoClass, A4 = Wt::NoClass, A5 = Wt::NoClass, A6 = Wt::NoClass, PyObject = object]’: /packages/pywt/src/wt/PySignal.h:29:4: instantiated from ‘PySignal<A1, A2, A3, A4, A5, A6>::PySignal(const char) [with A1 = Wt::WDialog::DialogCode, A2 = Wt::NoClass, A3 = Wt::NoClass, A4 = Wt::NoClass, A5 = Wt::NoClass, A6 = Wt::NoClass]’ /packages/pywt/src/wt/../generated/wt/gwt_TemplateTypeInst.inc:125:95: instantiated from here /packages/pywt/src/wt/PySignal.inc:63:32: error: ‘arg’ is not a member of ‘Python2CWt::WDialog::DialogCode’ In file included from /packages/pywt/src/wt/SlotConnectorFactory.h:13:0, from /packages/pywt/src/wt/PyEventSignal.h:18, from /packages/pywt/src/wt/includeTemplateTypes.h:11, from /packages/pywt/src/wt/PyWt.cpp:23: /packages/pywt/src/wt/SlotConnector.h: In member function ‘void SlotConnector<SIGNAL, A1>::call(A1) [with SIGNAL = Wt::SignalWt::WDialog::DialogCode, A1 = Wt::WDialog::DialogCode]’: /packages/pywt/src/wt/SlotConnector.h:161:4: instantiated from ‘void SlotConnector<SIGNAL, A1>::connect() [with SIGNAL = Wt::SignalWt::WDialog::DialogCode, A1 = Wt::WDialog::DialogCode]’ /packages/pywt/src/wt/PyWt.cpp:80:1: instantiated from here /packages/pywt/src/wt/SlotConnector.h:155:26: error: ‘arg’ is not a member of ‘C2PythonWt::WDialog::DialogCode’ /packages/pywt/src/wt/SlotConnector.h: In member function ‘void SlotConnector<SIGNAL, A1>::call(A1) [with SIGNAL = Wt::SignalWt::WValidator::Result, A1 = Wt::WValidator::Result]’: /packages/pywt/src/wt/SlotConnector.h:161:4: instantiated from ‘void SlotConnector<SIGNAL, A1>::connect() [with SIGNAL = Wt::SignalWt::WValidator::Result, A1 = Wt::WValidator::Result]’ /packages/pywt/src/wt/PyWt.cpp:80:1: instantiated from here /packages/pywt/src/wt/SlotConnector.h:155:26: error: ‘arg’ is not a member of ‘C2PythonWt::WValidator::Result’ /packages/pywt/src/wt/SlotConnector.h: In member function ‘void SlotConnector<SIGNAL, A1>::call(A1) [with SIGNAL = Wt::JSignalWt::WGoogleMap::Coordinate, A1 = Wt::WGoogleMap::Coordinate]’: /packages/pywt/src/wt/SlotConnector.h:161:4: instantiated from ‘void SlotConnector<SIGNAL, A1>::connect() [with SIGNAL = Wt::JSignalWt::WGoogleMap::Coordinate, A1 = Wt::WGoogleMap::Coordinate]’ /packages/pywt/src/wt/PyWt.cpp:80:1: instantiated from here /packages/pywt/src/wt/SlotConnector.h:155:26: error: ‘arg’ is not a member of ‘C2PythonWt::WGoogleMap::Coordinate’ make[2]: * [src/wt/CMakeFiles/wtmodule.dir/PyWt.o] Error 1 make[1]: * [src/wt/CMakeFiles/wtmodule.dir/all] Error 2 make: *\ [all] Error 2

wdu commented 11 years ago

Are you using latest Wt git?

rashadkm commented 11 years ago

yes just updated and the error is

3%] Building CXX object src/wt/CMakeFiles/wtmodule.dir/PyWt.o In file included from /packages/pywt/src/wt/PyWt.cpp:18:0: /packages/pywt/src/wt/../generated/wt/gwt_Conversion.h:1328:22: error: using typedef-name ‘Wt::WSubMenuItem’ after ‘class’ /usr/local/include/Wt/WGlobal:159:27: error: ‘Wt::WSubMenuItem’ has a previous declaration here /packages/pywt/src/wt/../generated/wt/gwt_Conversion.h:1329:18: error: redefinition of ‘class Python2CWt::WMenuItem’ /packages/pywt/src/wt/../generated/wt/gwt_Conversion.h:873:18: error: previous definition of ‘class Python2CWt::WMenuItem’ /packages/pywt/src/wt/../generated/wt/gwt_Conversion.h:1330:18: error: redefinition of ‘class Python2C<const Wt::WMenuItem>’ /packages/pywt/src/wt/../generated/wt/gwt_Conversion.h:874:18: error: previous definition of ‘class Python2C<const Wt::WMenuItem>’ /packages/pywt/src/wt/../generated/wt/gwt_Conversion.h:1331:18: error: redefinition of ‘class Python2C<const Wt::WMenuItem&>’ /packages/pywt/src/wt/../generated/wt/gwt_Conversion.h:875:18: error: previous definition of ‘class Python2C<const Wt::WMenuItem&>’ /packages/pywt/src/wt/../generated/wt/gwt_Conversion.h:1332:18: error: redefinition of ‘class Python2CWt::WMenuItem&’ /packages/pywt/src/wt/../generated/wt/gwt_Conversion.h:876:18: error: previous definition of ‘class Python2CWt::WMenuItem&’ /packages/pywt/src/wt/../generated/wt/gwt_Conversion.h:1333:18: error: redefinition of ‘class C2PythonWt::WMenuItem’ /packages/pywt/src/wt/../generated/wt/gwt_Conversion.h:877:18: error: previous definition of ‘class C2PythonWt::WMenuItem’ /packages/pywt/src/wt/../generated/wt/gwt_Conversion.h:1334:18: error: redefinition of ‘class C2Python<const Wt::WMenuItem>’ /packages/pywt/src/wt/../generated/wt/gwt_Conversion.h:878:18: error: previous definition of ‘class C2Python<const Wt::WMenuItem>’ /packages/pywt/src/wt/../generated/wt/gwt_Conversion.h:1335:18: error: redefinition of ‘class C2Python<const Wt::WMenuItem&>’ /packages/pywt/src/wt/../generated/wt/gwt_Conversion.h:879:18: error: previous definition of ‘class C2Python<const Wt::WMenuItem&>’ /packages/pywt/src/wt/../generated/wt/gwt_Conversion.h:1336:18: error: redefinition of ‘class C2PythonWt::WMenuItem&’ /packages/pywt/src/wt/../generated/wt/gwt_Conversion.h:880:18: error: previous definition of ‘class C2PythonWt::WMenuItem&’ /packages/pywt/src/wt/../generated/wt/gwt_Conversion.h:1568:22: error: using typedef-name ‘Wt::WPopupMenuItem’ after ‘class’ /usr/local/include/Wt/WGlobal:129:21: error: ‘Wt::WPopupMenuItem’ has a previous declaration here /packages/pywt/src/wt/../generated/wt/gwt_Conversion.h:1569:18: error: redefinition of ‘class Python2CWt::WMenuItem’ /packages/pywt/src/wt/../generated/wt/gwt_Conversion.h:873:18: error: previous definition of ‘class Python2CWt::WMenuItem’ /packages/pywt/src/wt/../generated/wt/gwt_Conversion.h:1570:18: error: redefinition of ‘class Python2C<const Wt::WMenuItem>’ /packages/pywt/src/wt/../generated/wt/gwt_Conversion.h:874:18: error: previous definition of ‘class Python2C<const Wt::WMenuItem>’ /packages/pywt/src/wt/../generated/wt/gwt_Conversion.h:1571:18: error: redefinition of ‘class Python2C<const Wt::WMenuItem&>’ /packages/pywt/src/wt/../generated/wt/gwt_Conversion.h:875:18: error: previous definition of ‘class Python2C<const Wt::WMenuItem&>’ /packages/pywt/src/wt/../generated/wt/gwt_Conversion.h:1572:18: error: redefinition of ‘class Python2CWt::WMenuItem&’ /packages/pywt/src/wt/../generated/wt/gwt_Conversion.h:876:18: error: previous definition of ‘class Python2CWt::WMenuItem&’ /packages/pywt/src/wt/../generated/wt/gwt_Conversion.h:1573:18: error: redefinition of ‘class C2PythonWt::WMenuItem’ /packages/pywt/src/wt/../generated/wt/gwt_Conversion.h:877:18: error: previous definition of ‘class C2PythonWt::WMenuItem’ /packages/pywt/src/wt/../generated/wt/gwt_Conversion.h:1574:18: error: redefinition of ‘class C2Python<const Wt::WMenuItem>’ /packages/pywt/src/wt/../generated/wt/gwt_Conversion.h:878:18: error: previous definition of ‘class C2Python<const Wt::WMenuItem>’ /packages/pywt/src/wt/../generated/wt/gwt_Conversion.h:1575:18: error: redefinition of ‘class C2Python<const Wt::WMenuItem&>’ /packages/pywt/src/wt/../generated/wt/gwt_Conversion.h:879:18: error: previous definition of ‘class C2Python<const Wt::WMenuItem&>’ /packages/pywt/src/wt/../generated/wt/gwt_Conversion.h:1576:18: error: redefinition of ‘class C2PythonWt::WMenuItem&’ /packages/pywt/src/wt/../generated/wt/gwt_Conversion.h:880:18: error: previous definition of ‘class C2PythonWt::WMenuItem&’ In file included from /packages/pywt/src/wt/WtProxy.h:14:0, from /packages/pywt/src/wt/PyWt.cpp:20: /packages/pywt/src/wt/../generated/wt/gwt_ProxyTypes.h:218:19: error: redefinition of ‘class ProxyWt::WMenuItem’ /packages/pywt/src/wt/../generated/wt/gwt_ProxyTypes.h:142:19: error: previous definition of ‘class ProxyWt::WMenuItem’ In file included from /packages/pywt/src/wt/WtProxy.h:14:0, from /packages/pywt/src/wt/PyWt.cpp:20: /packages/pywt/src/wt/../generated/wt/gwt_ProxyTypes.h:258:19: error: redefinition of ‘class ProxyWt::WMenuItem’ /packages/pywt/src/wt/../generated/wt/gwt_ProxyTypes.h:142:19: error: previous definition of ‘class ProxyWt::WMenuItem’ In file included from /packages/pywt/src/wt/../generated/wt/gwt_includeTypes.h:113:0, from /packages/pywt/src/wt/PyWt.cpp:22: /packages/pywt/src/wt/../generated/wt/gPyWSubMenuItem.h:13:22: error: using typedef-name ‘Wt::WSubMenuItem’ after ‘class’ /usr/local/include/Wt/WGlobal:159:27: error: ‘Wt::WSubMenuItem’ has a previous declaration here In file included from /packages/pywt/src/wt/../generated/wt/gwt_includeTypes.h:133:0, from /packages/pywt/src/wt/PyWt.cpp:22: /packages/pywt/src/wt/../generated/wt/gPyWPopupMenuItem.h:13:22: error: using typedef-name ‘Wt::WPopupMenuItem’ after ‘class’ /usr/local/include/Wt/WGlobal:129:21: error: ‘Wt::WPopupMenuItem’ has a previous declaration here In file included from /packages/pywt/src/wt/includeTemplateWrapperImpl.h:19:0, from /packages/pywt/src/wt/PyWt.cpp:27: /packages/pywt/src/wt/../generated/wt/gwt_TemplateTypeDefs.inc:42:106: error: redefinition of ‘PyCPPClassTypeWt::Signal<Wt::WMenuItem >* PyCPPClassTypeWt::Signal<Wt::WMenuItem >::Type’ /packages/pywt/src/wt/../generated/wt/gwt_TemplateTypeDefs.inc:12:64: error: ‘PyCPPClassTypeWt::Signal<Wt::WMenuItem >* PyCPPClassTypeWt::Signal<Wt::WMenuItem >::Type’ previously declared here In file included from /packages/pywt/src/wt/includeTemplateWrapperImpl.h:50:0, from /packages/pywt/src/wt/PyWt.cpp:27: /packages/pywt/src/wt/PyJSignal.inc: In static member function ‘static PyObject* PyJSignal<A1, A2, A3, A4, A5, A6>::semit(PyCPPClassInstance, PyObject, PyObject) [with A1 = Wt::WGoogleMap::Coordinate, A2 = Wt::NoClass, A3 = Wt::NoClass, A4 = Wt::NoClass, A5 = Wt::NoClass, A6 = Wt::NoClass, PyObject = object]’: /packages/pywt/src/wt/PyJSignal.h:55:4: instantiated from ‘PyJSignal<A1, A2, A3, A4, A5, A6>::PyJSignal(const char, PyTypeObject_) [with A1 = Wt::WGoogleMap::Coordinate, A2 = Wt::NoClass, A3 = Wt::NoClass, A4 = Wt::NoClass, A5 = Wt::NoClass, A6 = Wt::NoClass, PyTypeObject = _typeobject]’ /packages/pywt/src/wt/../generated/wt/gwtTemplateTypeInst.inc:61:93: instantiated from here /packages/pywt/src/wt/PyJSignal.inc:85:32: error: ‘arg’ is not a member of ‘Python2CWt::WGoogleMap::Coordinate’ In file included from /packages/pywt/src/wt/includeTemplateWrapperImpl.h:49:0, from /packages/pywt/src/wt/PyWt.cpp:27: /packages/pywt/src/wt/PySignal.inc: In static member function ‘static PyObject PySignal<A1, A2, A3, A4, A5, A6>::semit(PyCPPClassInstance, PyObject, PyObject) [with A1 = Wt::WValidator::Result, A2 = Wt::NoClass, A3 = Wt::NoClass, A4 = Wt::NoClass, A5 = Wt::NoClass, A6 = Wt::NoClass, PyObject = object]’: /packages/pywt/src/wt/PySignal.h:29:4: instantiated from ‘PySignal<A1, A2, A3, A4, A5, A6>::PySignal(const char) [with A1 = Wt::WValidator::Result, A2 = Wt::NoClass, A3 = Wt::NoClass, A4 = Wt::NoClass, A5 = Wt::NoClass, A6 = Wt::NoClass]’ /packages/pywt/src/wt/../generated/wt/gwt_TemplateTypeInst.inc:109:83: instantiated from here /packages/pywt/src/wt/PySignal.inc:63:32: error: ‘arg’ is not a member of ‘Python2CWt::WValidator::Result’ /packages/pywt/src/wt/PySignal.inc: In static member function ‘static PyObject\ PySignal<A1, A2, A3, A4, A5, A6>::semit(PyCPPClassInstance, PyObject, PyObject) [with A1 = Wt::WDialog::DialogCode, A2 = Wt::NoClass, A3 = Wt::NoClass, A4 = Wt::NoClass, A5 = Wt::NoClass, A6 = Wt::NoClass, PyObject = object]’: /packages/pywt/src/wt/PySignal.h:29:4: instantiated from ‘PySignal<A1, A2, A3, A4, A5, A6>::PySignal(const char) [with A1 = Wt::WDialog::DialogCode, A2 = Wt::NoClass, A3 = Wt::NoClass, A4 = Wt::NoClass, A5 = Wt::NoClass, A6 = Wt::NoClass]’ /packages/pywt/src/wt/../generated/wt/gwt_TemplateTypeInst.inc:125:95: instantiated from here /packages/pywt/src/wt/PySignal.inc:63:32: error: ‘arg’ is not a member of ‘Python2CWt::WDialog::DialogCode’ In file included from /packages/pywt/src/wt/SlotConnectorFactory.h:13:0, from /packages/pywt/src/wt/PyEventSignal.h:18, from /packages/pywt/src/wt/includeTemplateTypes.h:11, from /packages/pywt/src/wt/PyWt.cpp:23: /packages/pywt/src/wt/SlotConnector.h: In member function ‘void SlotConnector<SIGNAL, A1>::call(A1) [with SIGNAL = Wt::SignalWt::WDialog::DialogCode, A1 = Wt::WDialog::DialogCode]’: /packages/pywt/src/wt/SlotConnector.h:161:4: instantiated from ‘void SlotConnector<SIGNAL, A1>::connect() [with SIGNAL = Wt::SignalWt::WDialog::DialogCode, A1 = Wt::WDialog::DialogCode]’ /packages/pywt/src/wt/PyWt.cpp:80:1: instantiated from here /packages/pywt/src/wt/SlotConnector.h:155:26: error: ‘arg’ is not a member of ‘C2PythonWt::WDialog::DialogCode’ /packages/pywt/src/wt/SlotConnector.h: In member function ‘void SlotConnector<SIGNAL, A1>::call(A1) [with SIGNAL = Wt::SignalWt::WValidator::Result, A1 = Wt::WValidator::Result]’: /packages/pywt/src/wt/SlotConnector.h:161:4: instantiated from ‘void SlotConnector<SIGNAL, A1>::connect() [with SIGNAL = Wt::SignalWt::WValidator::Result, A1 = Wt::WValidator::Result]’ /packages/pywt/src/wt/PyWt.cpp:80:1: instantiated from here /packages/pywt/src/wt/SlotConnector.h:155:26: error: ‘arg’ is not a member of ‘C2PythonWt::WValidator::Result’ /packages/pywt/src/wt/SlotConnector.h: In member function ‘void SlotConnector<SIGNAL, A1>::call(A1) [with SIGNAL = Wt::JSignalWt::WGoogleMap::Coordinate, A1 = Wt::WGoogleMap::Coordinate]’: /packages/pywt/src/wt/SlotConnector.h:161:4: instantiated from ‘void SlotConnector<SIGNAL, A1>::connect() [with SIGNAL = Wt::JSignalWt::WGoogleMap::Coordinate, A1 = Wt::WGoogleMap::Coordinate]’ /packages/pywt/src/wt/PyWt.cpp:80:1: instantiated from here /packages/pywt/src/wt/SlotConnector.h:155:26: error: ‘arg’ is not a member of ‘C2PythonWt::WGoogleMap::Coordinate’ make[2]: * [src/wt/CMakeFiles/wtmodule.dir/PyWt.o] Error 1 make[1]: * [src/wt/CMakeFiles/wtmodule.dir/all] Error 2 make: *\ [all] Error 2

wdu commented 11 years ago

make sure you delete all .cl files before you run the introspection tool. You may have an old version of WSubMenuItem.cl ...

rashadkm commented 11 years ago

all the .cl files in descr dir?

wdu commented 11 years ago

correct (I suggest you make a symbolic link from descr -> out, since both directories should be effectively the same)

rashadkm commented 11 years ago

I run descr-cleanup.sh and the pywt-gen.sh and both went fine But after descr-cleanup there are some .cl in the descr dir but if i remove those pywt-gen.sh gives 'wrong dir' error what should I do? I think this is now more of a generated code issue than mac vs ubuntu I had commented out some lines in patchClasses.py Is that creating problem?

Another possibility might be of some modules not compiled by my default Wt cmake configuration eg PDF is not compiled by default and I need to comment out those lines from patchClasses.py

rashadkm commented 11 years ago

this was the latest build error

[ 67%] Building CXX object src/wt/CMakeFiles/wtmodule.dir/PyWt.o In file included from /packages/pywt/src/wt/includeTemplateWrapperImpl.h:49:0, from /packages/pywt/src/wt/PyWt.cpp:27: /packages/pywt/src/wt/PySignal.inc: In static member function ‘static PyObject* PySignal<A1, A2, A3, A4, A5, A6>::semit(PyCPPClassInstance, PyObject, PyObject) [with A1 = Wt::WValidator::Result, A2 = Wt::NoClass, A3 = Wt::NoClass, A4 = Wt::NoClass, A5 = Wt::NoClass, A6 = Wt::NoClass, PyObject = object]’: /packages/pywt/src/wt/PySignal.h:29:4: instantiated from ‘PySignal<A1, A2, A3, A4, A5, A6>::PySignal(const char) [with A1 = Wt::WValidator::Result, A2 = Wt::NoClass, A3 = Wt::NoClass, A4 = Wt::NoClass, A5 = Wt::NoClass, A6 = Wt::NoClass]’ /packages/pywt/src/wt/../generated/wt/gwt_TemplateTypeInst.inc:73:83: instantiated from here /packages/pywt/src/wt/PySignal.inc:63:32: error: ‘arg’ is not a member of ‘Python2CWt::WValidator::Result’ /packages/pywt/src/wt/PySignal.inc: In static member function ‘static PyObject* PySignal<A1, A2, A3, A4, A5, A6>::semit(PyCPPClassInstance, PyObject, PyObject) [with A1 = Wt::WDialog::DialogCode, A2 = Wt::NoClass, A3 = Wt::NoClass, A4 = Wt::NoClass, A5 = Wt::NoClass, A6 = Wt::NoClass, PyObject = object]’: /packages/pywt/src/wt/PySignal.h:29:4: instantiated from ‘PySignal<A1, A2, A3, A4, A5, A6>::PySignal(const char) [with A1 = Wt::WDialog::DialogCode, A2 = Wt::NoClass, A3 = Wt::NoClass, A4 = Wt::NoClass, A5 = Wt::NoClass, A6 = Wt::NoClass]’ /packages/pywt/src/wt/../generated/wt/gwt_TemplateTypeInst.inc:117:95: instantiated from here /packages/pywt/src/wt/PySignal.inc:63:32: error: ‘arg’ is not a member of ‘Python2CWt::WDialog::DialogCode’ In file included from /packages/pywt/src/wt/SlotConnectorFactory.h:13:0, from /packages/pywt/src/wt/PyEventSignal.h:18, from /packages/pywt/src/wt/includeTemplateTypes.h:11, from /packages/pywt/src/wt/PyWt.cpp:23: /packages/pywt/src/wt/SlotConnector.h: In member function ‘void SlotConnector<SIGNAL, A1>::call(A1) [with SIGNAL = Wt::SignalWt::WDialog::DialogCode, A1 = Wt::WDialog::DialogCode]’: /packages/pywt/src/wt/SlotConnector.h:161:4: instantiated from ‘void SlotConnector<SIGNAL, A1>::connect() [with SIGNAL = Wt::SignalWt::WDialog::DialogCode, A1 = Wt::WDialog::DialogCode]’ /packages/pywt/src/wt/PyWt.cpp:80:1: instantiated from here /packages/pywt/src/wt/SlotConnector.h:155:26: error: ‘arg’ is not a member of ‘C2PythonWt::WDialog::DialogCode’ /packages/pywt/src/wt/SlotConnector.h: In member function ‘void SlotConnector<SIGNAL, A1>::call(A1) [with SIGNAL = Wt::SignalWt::WValidator::Result, A1 = Wt::WValidator::Result]’: /packages/pywt/src/wt/SlotConnector.h:161:4: instantiated from ‘void SlotConnector<SIGNAL, A1>::connect() [with SIGNAL = Wt::SignalWt::WValidator::Result, A1 = Wt::WValidator::Result]’ /packages/pywt/src/wt/PyWt.cpp:80:1: instantiated from here /packages/pywt/src/wt/SlotConnector.h:155:26: error: ‘arg’ is not a member of ‘C2PythonWt::WValidator::Result’ make[2]: * [src/wt/CMakeFiles/wtmodule.dir/PyWt.o] Error 1 make[1]: * [src/wt/CMakeFiles/wtmodule.dir/all] Error 2 make: *\ [all] Error 2

and this is sloved by a dirty hack

removing lines from generated/gwt_TemplateTypeInst.inc

/* static PySignalWt::WValidator::Result tt17("Wt::SignalWt::WValidator::Result");/ / PyTypeReady((PyTypeObject)&tt17);_/ /* PyINCREF(&tt17);/ /_ PyModuleAddObject(m, "Wt::SignalWt::WValidator::Result", (PyObject )&tt17);_/

and

/* static PySignal tt28("Wt::Signal");/ / PyTypeReady((PyTypeObject)&tt28);_/ /* PyINCREF(&tt28);/ /_ PyModuleAddObject(m, "Wt::Signal", (PyObject )&tt28);_/

This result in a sucessful build and install

but still no sucess. from python shell I tried import Wt and i show this error:

import Wt Traceback (most recent call last): File "", line 1, in ImportError: /usr/lib/python2.7/dist-packages/Wt.so: undefined symbol: _ZN14PyCPPClassTypeIN2Wt6SignalIxNS0_7NoClassES2_S2_S2_S2_EEE4TypeE

wdu commented 11 years ago

I tried out pywt on ubuntu linux yesterday and came to the following conclusions:

  1. I forgot to push some Wt modifications related to undefined symbols (a few unimplemented Wt methods).
  2. I added to CMakeLists.txt: SET(CMAKE_SHARED_LINKER_FLAGS "-Wl,--as-needed -Wl,-z,defs") in order to see undefined symbols at library link time
  3. I had to apply the following addiontional patch, as below

With these three modfications, I could run python hello world

diff --git a/src/wt/WtSpecialConversion.cpp b/src/wt/WtSpecialConversion.cpp index a88100c..3ef17d3 100644 --- a/src/wt/WtSpecialConversion.cpp +++ b/src/wt/WtSpecialConversion.cpp @@ -49,9 +49,10 @@ template class C2Python_ref< Wt::Signal< int, Wt::WLength > > template class C2Python_ref< Wt::Signal< std::string > >; template class C2Python_ref< Wt::Signal< bool > >; template class C2Python_ref< Wt::Signal< int > >; -template class C2Python_ref< Wt::Signal< long long > >; +//template class C2Python_ref< Wt::Signal< long long > >; template class C2Python_ref< Wt::Signal< double > >; template class C2Python_ref< Wt::Signal< int, int > >; +template class C2Python_ref< Wt::Signal< int64_t > >; template class C2Python_ref< Wt::Signal< int64_t, int64_t > >; template class C2Python_ref< Wt::Signal< uint64_t, uint64_t > >;

ifndef _LP64

rashadkm commented 11 years ago

did you commited the changes to git?

wdu commented 11 years ago

changes to pywt are now pushed. Wt changes should be in the public git.

rashadkm commented 11 years ago

Dialogcode enum is skipped when generating .cl files so as WValidator::Result

This is causing these errors: 13%] Building CXX object src/wt/CMakeFiles/wtmodule.dir/WtWrappers5.o [ 16%] Building CXX object src/wt/CMakeFiles/wtmodule.dir/PyWt.o In file included from /repos/pywt/src/wt/includeTemplateWrapperImpl.h:49:0, from /repos/pywt/src/wt/PyWt.cpp:27: /repos/pywt/src/wt/PySignal.inc: In static member function ‘static PyObject* PySignal<A1, A2, A3, A4, A5, A6>::semit(PyCPPClassInstance, PyObject, PyObject) [with A1 = Wt::WValidator::Result, A2 = Wt::NoClass, A3 = Wt::NoClass, A4 = Wt::NoClass, A5 = Wt::NoClass, A6 = Wt::NoClass, PyObject = object]’: /repos/pywt/src/wt/PySignal.h:29:4: instantiated from ‘PySignal<A1, A2, A3, A4, A5, A6>::PySignal(const char) [with A1 = Wt::WValidator::Result, A2 = Wt::NoClass, A3 = Wt::NoClass, A4 = Wt::NoClass, A5 = Wt::NoClass, A6 = Wt::NoClass]’ /repos/pywt/src/wt/../generated/wt/gwt_TemplateTypeInst.inc:73:83: instantiated from here /repos/pywt/src/wt/PySignal.inc:63:32: error: ‘arg’ is not a member of ‘Python2CWt::WValidator::Result’ /repos/pywt/src/wt/PySignal.inc: In static member function ‘static PyObject* PySignal<A1, A2, A3, A4, A5, A6>::semit(PyCPPClassInstance, PyObject, PyObject) [with A1 = Wt::WDialog::DialogCode, A2 = Wt::NoClass, A3 = Wt::NoClass, A4 = Wt::NoClass, A5 = Wt::NoClass, A6 = Wt::NoClass, PyObject = object]’: /repos/pywt/src/wt/PySignal.h:29:4: instantiated from ‘PySignal<A1, A2, A3, A4, A5, A6>::PySignal(const char) [with A1 = Wt::WDialog::DialogCode, A2 = Wt::NoClass, A3 = Wt::NoClass, A4 = Wt::NoClass, A5 = Wt::NoClass, A6 = Wt::NoClass]’ /repos/pywt/src/wt/../generated/wt/gwt_TemplateTypeInst.inc:117:95: instantiated from here /repos/pywt/src/wt/PySignal.inc:63:32: error: ‘arg’ is not a member of ‘Python2CWt::WDialog::DialogCode’ In file included from /repos/pywt/src/wt/SlotConnectorFactory.h:13:0, from /repos/pywt/src/wt/PyEventSignal.h:18, from /repos/pywt/src/wt/includeTemplateTypes.h:11, from /repos/pywt/src/wt/PyWt.cpp:23: /repos/pywt/src/wt/SlotConnector.h: In member function ‘void SlotConnector<SIGNAL, A1>::call(A1) [with SIGNAL = Wt::SignalWt::WDialog::DialogCode, A1 = Wt::WDialog::DialogCode]’: /repos/pywt/src/wt/SlotConnector.h:161:4: instantiated from ‘void SlotConnector<SIGNAL, A1>::connect() [with SIGNAL = Wt::SignalWt::WDialog::DialogCode, A1 = Wt::WDialog::DialogCode]’ /repos/pywt/src/wt/PyWt.cpp:80:1: instantiated from here /repos/pywt/src/wt/SlotConnector.h:155:26: error: ‘arg’ is not a member of ‘C2PythonWt::WDialog::DialogCode’ /repos/pywt/src/wt/SlotConnector.h: In member function ‘void SlotConnector<SIGNAL, A1>::call(A1) [with SIGNAL = Wt::SignalWt::WValidator::Result, A1 = Wt::WValidator::Result]’: /repos/pywt/src/wt/SlotConnector.h:161:4: instantiated from ‘void SlotConnector<SIGNAL, A1>::connect() [with SIGNAL = Wt::SignalWt::WValidator::Result, A1 = Wt::WValidator::Result]’ /repos/pywt/src/wt/PyWt.cpp:80:1: instantiated from here /repos/pywt/src/wt/SlotConnector.h:155:26: error: ‘arg’ is not a member of ‘C2PythonWt::WValidator::Result’ make[2]: * [src/wt/CMakeFiles/wtmodule.dir/PyWt.o] Error 1 make[1]: * [src/wt/CMakeFiles/wtmodule.dir/all] Error 2 make: *\ [all] Error 2

How to prevent enum (DialogCode) and inner class (WValidator::Result) from skipping when creating .cl files?

wdu commented 11 years ago

Both DialogCode and WValidator::Result are in my descr files.

In WDialog.cl, I have a line that says:

    c.addEnum("DialogCode", "Rejected", "Accepted")

And in WValidator, the following code defines inner class Result:

    # inner class Result
    base = c
    c = None
    # Generated Python script for class Result
    from CClass import *
    c = CClass("Result", [], "Wt");
    c.corefile = "Wt/WValidator"
    ...

Make sure that your modifications to patchClasses.py don't throw away too many classes; with respect to compiling there's a lot of things that are interconnected. I'm not sure what could cause that these classes are skipped on your system.

rashadkm commented 11 years ago

here is a part from my WDialog.cl

c = CClass("WDialog", ["Wt::WPopupWidget"], "Wt"); c.corefile = "Wt/WDialog" c.setDocumentation("") skipping enum DialogCode skipping constructor [("Wt::WObject ", "parent", {'default': r'0'})] skipping constructor [("const class Wt::WString &", "windowTitle"),("Wt::WObject ", "parent", {'default': r'0'})] c.addMethod("setWindowTitle", "void", [("cons

I think maybe the fix should be in python_dump

wdu commented 11 years ago

Looks like documentation extraction is not working for some reason. That's really weird since for me this works. That c.setDocumentation("") for WDialog contains about 30 lines of documentation in my .cl file.

Note that a mehod/class/enum/... is considered public API if it is documented. Thus, we look at the documentation to decide if we must create introspection information for it, otherwise it's skipped (except for methods). Clang annotates documentation to methods/classes/enums, but that was not working good enough so I had to patch it in some locations. Maybe you're not using these patched version for some reason?

If that's what you get from running python_dump, it's definitely wrong output.

rashadkm commented 11 years ago

try with latest revision c061175543

wdu commented 11 years ago

So does this mean that you can run the hello.py example now?

rashadkm commented 11 years ago

yes i can run hello.py, charts.py and need to test others.

Its awesome. Thanks

On Thu, Feb 28, 2013 at 2:40 PM, wdu notifications@github.com wrote:

So does this mean that you can run the hello.py example now?

— Reply to this email directly or view it on GitHubhttps://github.com/wdu/pywt/issues/3#issuecomment-14223729 .

Regards, Rashad