wdu / pywt

Python bindings for Wt
Other
6 stars 4 forks source link

build fails on : WValidator #5

Open epifanio opened 11 years ago

epifanio commented 11 years ago

trying to build i got this error :

In file included from /home/epi/dev/src/pywt/src/wt/includeTemplateWrapperImpl.h:49:0, from /home/epi/dev/src/pywt/src/wt/PyWt.cpp:27: /home/epi/dev/src/pywt/src/wt/PySignal.inc: In instantiation of ‘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]’: /home/epi/dev/src/pywt/src/wt/PySignal.h:29:4: required 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]’ /home/epi/dev/src/pywt/src/wt/../generated/wt/gwt_TemplateTypeInst.inc:73:83: required from here /home/epi/dev/src/pywt/src/wt/PySignal.inc:63:32: error: ‘arg’ is not a member of ‘Python2CWt::WValidator::Result’ In file included from /home/epi/dev/src/pywt/src/wt/SlotConnectorFactory.h:13:0, from /home/epi/dev/src/pywt/src/wt/PyEventSignal.h:18, from /home/epi/dev/src/pywt/src/wt/includeTemplateTypes.h:11, from /home/epi/dev/src/pywt/src/wt/PyWt.cpp:23: /home/epi/dev/src/pywt/src/wt/SlotConnector.h: In instantiation of ‘void SlotConnector<SIGNAL, A1>::call(A1) [with SIGNAL = Wt::SignalWt::WValidator::Result; A1 = Wt::WValidator::Result]’: /home/epi/dev/src/pywt/src/wt/SlotConnector.h:161:4: required from ‘void SlotConnector<SIGNAL, A1>::connect() [with SIGNAL = Wt::SignalWt::WValidator::Result; A1 = Wt::WValidator::Result]’ /home/epi/dev/src/pywt/src/wt/PyWt.cpp:80:1: required from here /home/epi/dev/src/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

this is the full log:

https://gist.github.com/epifanio/5023009/

i got succesfull build commenting this lines :

PyModule_AddObject(m, "Wt::EventSignal<>", (PyObject *)&tt16);
//static PySignal<Wt::WValidator::Result> tt17("Wt::Signal<Wt::WValidator::Result>");
//PyType_Ready((PyTypeObject*)&tt17);
//Py_INCREF(&tt17);
//PyModule_AddObject(m, "Wt::Signal<Wt::WValidator::Result>", (PyObject *)&tt17);
static PySignal<enum Wt::Orientation, int, int> tt18("Wt::Signal<enum Wt::Orientation, int, int>");
PyType_Ready((PyTypeObject*)&tt18);
Py_INCREF(&tt18);

but trying the hello,py example i got error (see issue 5)

epifanio commented 11 years ago

this is a full report on my attempt to build on Linux 12.10

cd pywt mkdir build cd build ccmake ..

.. .. [ 16%] Building CXX object src/wt/CMakeFiles/wtmodule.dir/PyWt.o In file included from /home/epi/dev/pywt/src/wt/includeTemplateWrapperImpl.h:49:0, from /home/epi/dev/pywt/src/wt/PyWt.cpp:27: /home/epi/dev/pywt/src/wt/PySignal.inc: In instantiation of ‘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]’: /home/epi/dev/pywt/src/wt/PySignal.h:29:4: required 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]’ /home/epi/dev/pywt/src/wt/../generated/wt/gwt_TemplateTypeInst.inc:73:83: required from here /home/epi/dev/pywt/src/wt/PySignal.inc:63:32: error: ‘arg’ is not a member of ‘Python2CWt::WValidator::Result’ In file included from /home/epi/dev/pywt/src/wt/SlotConnectorFactory.h:13:0, from /home/epi/dev/pywt/src/wt/PyEventSignal.h:18, from /home/epi/dev/pywt/src/wt/includeTemplateTypes.h:11, from /home/epi/dev/pywt/src/wt/PyWt.cpp:23: /home/epi/dev/pywt/src/wt/SlotConnector.h: In instantiation of ‘void SlotConnector<SIGNAL, A1>::call(A1) [with SIGNAL = Wt::SignalWt::WValidator::Result; A1 = Wt::WValidator::Result]’: /home/epi/dev/pywt/src/wt/SlotConnector.h:161:4: required from ‘void SlotConnector<SIGNAL, A1>::connect() [with SIGNAL = Wt::SignalWt::WValidator::Result; A1 = Wt::WValidator::Result]’ /home/epi/dev/pywt/src/wt/PyWt.cpp:80:1: required from here /home/epi/dev/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

make & make install

https://gist.github.com/epifanio/5024756

wdu commented 11 years ago

Can you please find out why none of the setDocumentation() calls contains a documentation string (this is also the cause for the "i" flag in the methods)? I have no idea why this happens - for me it looks like this:

https://gist.github.com/wdu/5025313

rashadkm commented 11 years ago

I guess the problem is with python_dump which generates the .cl? . Is there anything special with documentation extraction done by python_dump tool.? Any extra packages needed?

wdu commented 11 years ago

python_dump is indeed doing something wrong here. That part is quite straight-forward, so I'm confused why it does not work for you guys. Some of the patches I applied to clang are in the documentation area, but they only impact some of the methods, not all of them. llvm+clang are really the only dependencies for the documentation extraction...

rashadkm commented 11 years ago

How could we individually test docString() of introspection/main.cc ?

wdu commented 11 years ago

You can start with simple files. For example, this one:

template<typename X, typename Y>
class C {
  int i;
};

template<typename X>
class D {
  int i;
};

namespace Wt {
/** \brief hello */
class A {
public:
  /** \brief this is foo */
  C<int, int> &foo();

  /*! \brief Returns whether this node has already been populated.
   *
   * \sa populate()
   */
  bool populated() const { return populated_; }

  /** \brief this is bar */
  D<int> &bar();

  bool populated_;
};

}

Only doxygen-style documented classes and methods in namespace Wt should be in the .cl file.

# Generated Python script for class A
from CClass import *
c = CClass("A", [], "Wt");
c.corefile = "tst3.cc"
c.nonPolymorphic()
c.setDocumentation("""
<p class="para-brief"> hello </p>
""")
c.addMethod("foo", "C<int, int> &", [], "")
c["foo"].setDocumentation("""
<p class="para-brief"> this is foo </p>
""")
c.addMethod("populated", "bool", [], "c")
c["populated"].setDocumentation("""
<p class="para-brief"> Returns whether this node has already been populated.</p><p> populate()   </p>
""")
c.addMethod("bar", "D<int> &", [], "")
c["bar"].setDocumentation("""
<p class="para-brief"> this is bar </p>
""")
# skipping non-static member populated_

I'm currently working on automating the build procedure better, in order to ensure that we're doing the same thing. It's really weird to me that you don't get any documentation; I tried today again from a clean build (on mac this time) and all works as expected.

wdu commented 11 years ago

I've pushed new cmake files. Can you guys test? They suppose that you link/copy llvm and wt sources in the pywt directory.

epifanio commented 11 years ago

On OSX 10.8, i tried the methid, cloning everythin into pywt, i got a mac-speciphic error "

https://gist.github.com/epifanio/5045872

the error seems to be related to Wt::WPdfImage:: maybe in need to rebuild something in universal mode, no clue which module (i use homebrew to satisfy dep.)

wdu commented 11 years ago

Probably solved when you remove WPdfImage.cl (add it to the cleanup script).

Among some other items, pdf support in Wt is optional and it depends on your system configuration whether it's built or not. PyWt is not yet aware of this.

rashadkm commented 11 years ago

needs fix to find python 2.7 remove WPdfImage.cl and update patchClasses.py

With this everything works on Ubuntu 12.04 LTS 64bit

still have some issues in 32 bit. Let me cross check one more time building everything from scrach and let you know

On Wed, Feb 27, 2013 at 1:33 PM, wdu notifications@github.com wrote:

Probably solved when you remove WPdfImage.cl (add it to the cleanup script).

Among some other items, pdf support in Wt is optional and it depends on your system configuration whether it's built or not. PyWt is not yet aware of this.

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

Regards, Rashad

rashadkm commented 11 years ago

change FIND_LIBRARY(PYTHON_LIBRARY NAMES python python2.5 python2.6 python26 PATHS ${PYTHON_POSSIBLE_LIB_PATH} )

to

FIND_LIBRARY(PYTHON_LIBRARY NAMES python python2.5 python2.6 python26 python2.7 python27 PATHS ${PYTHON_POSSIBLE_LIB_PATH} )

On Thu, Feb 28, 2013 at 11:12 PM, epifanio notifications@github.com wrote:

how to fix :

CMake Error at cmake/WtFindPython.txt:49 (MESSAGE): \ Could not find python library (e.g. libpython) Call Stack (most recent call first): CMakeLists.txt:113 (INCLUDE)

on ubuntu.

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

Regards, Rashad

epifanio commented 11 years ago

ok, i got everything up and running on a linux ubuntu 12.04. i still have problems with OSX the build works fine, i had to export the DYLD_LIBRARY_PATH for llvm and clang but then after the make install :

..

[ 38%] Built target generate_bindings [ 97%] Built target wtmodule [100%] Built target wthttpmodule Install the project... -- Install configuration: "RelWithDebInfo" -- Installing: /Library/Python/2.7/site-packages/Wt.dylib -- Installing: /Library/Python/2.7/site-packages/WtHttp.dylib

import python gave me no module found.

any clue ?

wdu commented 11 years ago

Rename the .dylib file to .so (or put a symlink). Don't know how I figured that out...

epifanio commented 11 years ago

that works! thanks WDU :) i've the chart example running on osx too.

WDU, Rashad, what do you think, can we resume all the needed "manually" steps to fix build and try to see how to fix them ?

wdu commented 11 years ago

Yes, that's a great start.

See also the TODO file for more hints on important open issues.