Code Monkey home page Code Monkey logo

pywt's Introduction

pywt

Python bindings for WtPyWt consists of:

  • an introspection tool based on clang to extract API information from Wt header files. This introspection tool generates the API description files.
  • a set of python scripts that use the API description files to generate C++ code, being the core implementation of the python bindings
  • a set of C++ support files which are not generated, but are also required to complete the binding

Since a few functions are missing from clang, PyWt uses a modified version of clang to generate the introspection tool.

Steps to build:

  1. build llvm and a patched clang https://github.com/wdu/clang
  2. build and run the python-dump tool on wt.cc (add -I for Wt and boost)
  3. run descr-cleanup.sh
  4. run pywt-gen.sh
  5. mkdir build; cd build; cmake ..; make

Running the examples:

  • put the .so files in the extensions directory searched by python
  • cd examples/hello
  • python hello.py --docroot . --http-address 0.0.0.0 --http-port 8080
  • don't forget to create a link to the resources directory of Wt when your example requires files from the resources folder (most examples do).

State of the PyWt bindings: The state of the current project is alpha. It is work-in-progress, and is released in order to obtain feedback on the API, architecture, and performance. Any comments or patches are welcomed and appreciated. The Wt fora are the appropriate place to discuss PyWt.

See LICENSE file for license information.

pywt's People

Contributors

wdu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

pywt's Issues

build error : c++config.h not found

cmake seems not able to find c++config.h

a locate c++config.h shows it is here :

/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/iostream:39:10: fatal error: 'bits/c++config.h' file not found

(linux 64bit - ubuntu 13.04)

error temporary fixed with a sim link in /usr/local/include :

sudo ln -s /usr/include/x86_64-linux-gnu/c++/4.7/bits /usr/local/include/

build fails on : WValidator

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>::s_emit(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)

pywt-gen.sh error

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)

python-dump

I had built your fork of llvm and clang as said int README but I am unable to find python-dump

Where can I get it?

error running examples/hello.py

succesful built on ubuntu 13.04 - 64bit
trying to run hello.py :

epi@ubuntu:~/dev/src/pywt/examples/hello$ python hello.py --docroot . --http-address 0.0.0.0 --http-port 8080
[2013-Feb-24 02:08:15.956822] 3735 - [info] "config: reading Wt config file: /etc/wt/wt_config.xml (location = 'hello.py')"
[2013-Feb-24 02:08:15.957361] 3735 - [info] "WServer/wthttp: initializing built-in wthttpd"
[2013-Feb-24 02:08:15.957701] 3735 - [info] "wthttp: started server: http://0.0.0.0:8080"

i got the following error in the browser (firefox) :

Python Error

Traceback (most recent call last):
File "hello.py", line 40, in createApplication
return MyApplication(env)
File "hello.py", line 14, in init
self.setTitle("Hello")
AttributeError: 'MyApplication' object has no attribute 'setTitle'

osx build, can't find WT

I'm using homebrew to satisfy boost and other dep.
instaled WT from git in "/usr/local/"

trying to run cmake in pywt :

  • cd pwt

  • mkdir build

  • cd build

  • ccmake ..

    CMake Error at cmake/FindWt.cmake:112 (MESSAGE):
    Could NOT find Wt
    Call Stack (most recent call first):
    CMakeLists.txt:50 (FIND_PACKAGE)

attached my CMakeCache.txt :

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

debian wheezy build - error on llvm build

Hi, I'm tring to build PyWt on a debian stable 64 bit.
I followed the procedure :

git clone pywt
cd pywt
git clone http://github.com/wdu/llvm.git
cd llvm/tools
git clone http://github.com/wdu/clang.git
cd ../../
cd src
git clone git://github.com/kdeforche/wt.git
cd ../
mkdir build
cd build
ccmake ..
# c - configure
# g - generate
make

cmake seems to find all the needed dependencies, this the llvm build log :

Linking CXX static library ../../libLLVMJIT.a
[ 31%] Built target LLVMJIT
Scanning dependencies of target LLVMMCJIT
[ 31%] Building CXX object lib/ExecutionEngine/MCJIT/CMakeFiles/LLVMMCJIT.dir/MCJIT.cpp.o
[ 31%] Building CXX object lib/ExecutionEngine/MCJIT/CMakeFiles/LLVMMCJIT.dir/SectionMemoryManager.cpp.o
Linking CXX static library ../../libLLVMMCJIT.a
[ 31%] Built target LLVMMCJIT
Scanning dependencies of target LLVMAArch64Utils
make[5]: *** No rule to make target `lib/Target/AArch64/AArch64GenSubtargetInfo.inc', needed by `lib/Target/AArch64/Utils/CMakeFiles/LLVMAArch64Utils.dir/AArch64BaseInfo.cpp.o'.  Stop.
make[4]: *** [lib/Target/AArch64/Utils/CMakeFiles/LLVMAArch64Utils.dir/all] Error 2
make[3]: *** [all] Error 2
make[2]: *** [llvm-prefix/src/llvm-stamp/llvm-build] Error 2
make[1]: *** [CMakeFiles/llvm.dir/all] Error 2
make: *** [all] Error 2

Thanks a lot to look into this!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.