zorba-processor / zorba

Zorba - the NoSQL processor
http://zorba.io
Apache License 2.0
42 stars 16 forks source link

Source code for Python Zorba api? #8

Open whiterockerart opened 7 years ago

whiterockerart commented 7 years ago

We are currently working on to get Zorba api working for Python 3.4+ and it seems problematic to import the _zorba_api.pyd file. Is there any way we can get the source code for that file and make it work for Python 3.4+?

cezarfx commented 7 years ago

Michael,

The python port is generated by swig from the .i files. See: https://github.com/zorba-processor/zorba/tree/master/swig/ and https://github.com/zorba-processor/zorba/tree/master/swig/python

Cezar

On Wed, Jul 5, 2017 at 9:56 AM, Michael Estwik notifications@github.com wrote:

We are currently working on to get Zorba api working for Python 3.4+ and it seems problematic to import the _zorba_api.pyd file. Is there any way we can get the source code for that file and make it work for Python 3.4+?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/zorba-processor/zorba/issues/8, or mute the thread https://github.com/notifications/unsubscribe-auth/AApPXhP5IreuwXrNclFQFVpemf7meDjxks5sK6QHgaJpZM4OOdF3 .

whiterockerart commented 7 years ago

Thank you!

But one question, where is the interface file that is mentioned in the zorba_api.py?

This file was automatically generated by SWIG (http://www.swig.org).

Version 2.0.9

#

Do not make changes to this file unless you know what you are doing--modify

the SWIG interface file instead.

Also, that file is created for Python 2.7 and not 3.x.

whiterockerart commented 7 years ago

Also on more question, how do I build the file with Swig? We haven't touched Swig before.

cezarfx commented 7 years ago

Michael,

If you have the swig packages installed on your computer as described in: http://www.zorba.io/documentation/latest/zorba/build/build_prerequisites

You should just run the regular build cmake .. and make, and the make scripts will call the swig compiler to generate python bindings according to the .i files that are the input for the swig compiler.

For python 3 you might need to debug the build and get into the swig details to generate the appropriate bindings. Let us know how it went.

Cezar

On Thu, Jul 6, 2017 at 4:28 AM, Michael Estwik notifications@github.com wrote:

Also on more question, how do I build the file with Swig? We haven't touched Swig before.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/zorba-processor/zorba/issues/8#issuecomment-313345348, or mute the thread https://github.com/notifications/unsubscribe-auth/AApPXtAvxrnW7J3lI_sDohEzxWAI3D0fks5sLKjCgaJpZM4OOdF3 .

whiterockerart commented 7 years ago

I managed to build it with the following packages:

And used the command: cmake ../.. -DPYTHON_EXECUTABLE=$ENV{ProgramFiles(x86)}\Python35-32python.exe -DPYTHON_INCLUDE_DIRS=$ENV{ProgramFiles(x86)}\Python35-32\include -DPYTHON_LIBRARY=$ENV{ProgramFiles(x86)}\Python35-32\lib -DZORBA_USE_SWIG=ON -DZORBA_WITH_DEBUGGER=ON

The problem is that in the swig/python folder, I only get header files and no api file for python.

I'm trying to read the documentation of the Zorba but there are to many broken links and I can't get any further.

And yes, there are som errors with missing headerfiles (will include it in a seperate comment)

whiterockerart commented 7 years ago

CMakeError.log: Sorry, the log is to long to include in one comment. It's a .txt file.

https://app.box.com/s/zbgsvbafubk4ib4bre31w5tzt4x7nx9v

Rod-O commented 7 years ago

You are working on Windows, were you able to compile Zorba in first instance?? I did a quick lookup on your log file, seems that you are missing iconv.h, that means you don't have libiconv. Try to install missing libraries first with https://github.com/zorba-processor/winports

Rod-O commented 7 years ago

let me try to get a working version for you...

whiterockerart commented 7 years ago

Yes, I have a working example of Zorba on my computer. Yes, I did install an instance of iconv.h but it didn't wan't to find it, but it does find it during the building process - which is quite weird.

I found out that it could be easier to build this on Linux, but we are not using Linux at my workplace.

That would be great, thank you. I think others would appreciate that as well.

cezarfx commented 7 years ago

Michael, did you try the binaries from github? https://github.com/zorba-processor/zorba/releases

On Tue, Jul 25, 2017 at 3:56 PM, Michael Estwik notifications@github.com wrote:

Yes, I have a working example of Zorba on my computer. Yes, I did install an instance of iconv.h but it didn't wan't to find it, but it does find it during the building process - which is quite weird.

I found out that it could be easier to build this on Linux, but we are not using Linux at my workplace.

That would be great, thank you. I think others would appreciate that as well.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/zorba-processor/zorba/issues/8#issuecomment-317869564, or mute the thread https://github.com/notifications/unsubscribe-auth/AApPXmV8x21QWerMFieAdwJU5sneMNy8ks5sRlZqgaJpZM4OOdF3 .