Python Bindings : SWIG vs BOOST-python

907 views
Skip to first unread message

Saheb Motiani

unread,
Apr 10, 2013, 4:33:47 AM4/10/13
to og...@googlegroups.com

Hi OGDF Mentors,

I am Saheb and I am a python developer. I did my previous GSOC in ASCEND and programmed in Python. ASCEND uses SWIG library to use it's C++ code in Python GUI. The only problem I felt was the time it takes to generate the swig code and it increases the build time for the software. I have enough knowledge on SWIG and have used it for small purposes.

I just wanted to say it's a great decision to start developing application to create an interface for making use of OGDF library, which is superb for Graph Algorithms. I was looking for such a thing and looking forward for the same.

I wanted to discuss it in detail, regarding decision of SWIG. Means we can even discuss the purpose we need it for and does speed play a crucial role or not?

Other alternative is Boost python library, but we need to discuss it, so I was looking for a mentor who could guide me through this and give me some direction.

Here is a link for comparison of SWIG and Boost Python - https://dev.lsstcorp.org/trac/wiki/SwigVsBoostPython which might be of help.

I even support SWIG as it will be easy for future maintenance and it is a prefectly valid option. I think the project is quite clear. I wanted to know the skills you are looking for. I am good at Graphs - I mean have scored AA in Graph Theory course, and attended a national workshop on Graph Theory and Graph Algorithms even.
I am proficient in C++, and Python and good at using Open Source tools and even experienced with version control tools.

Do let me know the mentor of this project. Waiting for your reply.

Cheers,
Saheb

Christoph Schulz

unread,
Apr 10, 2013, 11:11:22 AM4/10/13
to og...@googlegroups.com
Hello Saheb,


Am Mittwoch, 10. April 2013 10:33:47 UTC+2 schrieb Saheb Motiani:
I am Saheb and I am a python developer. I did my previous GSOC in ASCEND and programmed in Python. ASCEND uses SWIG library to use it's C++ code in Python GUI. The only problem I felt was the time it takes to generate the swig code and it increases the build time for the software. I have enough knowledge on SWIG and have used it for small purposes.
Yes, dealing with interface files can be very time consuming and I like the idea to evaluate tools before using them a lot. Boost.Python lags support for other langauges (C#, Java, Ruby, ...) and it's bound to GCC (huge dependency). I can't tell if thats a no-go (Carsten?).

Regards,
Christoph

Carsten Gutwenger

unread,
Apr 11, 2013, 4:40:06 AM4/11/13
to og...@googlegroups.com
Being restricted to GCC is really bad. Our two main development platforms are currently Linux/gcc and Windows/Visual C++, so both should be supported. However, it also depends on what a user needs for getting OGDF support in Python: it must be possible for Windows, Linux (& Mac) users to install and use OGDF Python.

Carsten

Saheb Motiani

unread,
Apr 11, 2013, 6:06:10 AM4/11/13
to og...@googlegroups.com
SWIG is suitable for gcc and Visual C++ both, so I think going with SWIG is the right choice for now :). Can you suggest some OGDF module or algorithm as a simple start to check the working of SWIG on OGDF modules?

Carsten Gutwenger

unread,
Apr 11, 2013, 6:22:00 AM4/11/13
to og...@googlegroups.com

Am Donnerstag, 11. April 2013 12:06:10 UTC+2 schrieb Saheb Motiani:
SWIG is suitable for gcc and Visual C++ both, so I think going with SWIG is the right choice for now :). Can you suggest some OGDF module or algorithm as a simple start to check the working of SWIG on OGDF modules?

I don't think that there is a simple starter, as all the (interesting) algorithms require a graph data structure. So first you will need some kind of a (simple) representation for ogdf::Graph in Python.

Christoph Schulz

unread,
Apr 11, 2013, 12:58:42 PM4/11/13
to og...@googlegroups.com
Am Donnerstag, 11. April 2013 12:06:10 UTC+2 schrieb Saheb Motiani:
Can you suggest some OGDF module or algorithm as a simple start to check the working of SWIG on OGDF modules?
I'd suggest you start with Graph and GraphAttributes. GraphAttributes might be a tricky one for SWIG as its using return by non-const reference.

Saheb Motiani

unread,
Apr 12, 2013, 3:26:10 AM4/12/13
to og...@googlegroups.com
Hi Cristoph,

Thanx for the direction. Even I figured that out.:-).Now its better its confirmed. I am working on it and will get back to you soon.

Cheers,
Saheb

Reply all
Reply to author
Forward
0 new messages