Thursday, March 5, 2009

Wrapping: The Devil's Hobby

As Andrew posted yesterday, we have spent the better part of two weeks working on integrating our C block code into the python interface. The first step of this is supposed to be wrapping our C code so that it can be imported into python.

Now you'd expect that this process wouldn't be so bad since I hear its a common thing to do. I have no idea what kind of experience everyone else has with this, but I have worked out that only the wrapping code is what the devil has programmers do in hell.

I've managed to use SWIG (Simplified Wrapper and Interface Generator) to make wrapped files of some of my own C code. However, the point where I seem to fail is when I try to use a python setup file to compile a python module file that points to the wrapped code, enabling it to be called from python.

I've installed mingw and gcc in various ways (on their own, with ide's, etc.) and followed like 5 different example procedures and failed to get it working every time. I am now toying with the idea of getting visual studio which might be able to fix this problem. In the mean time there's a race between Andrew and I to find a way to make this work.

Until next time.

1 comment:

  1. You may be aware of this but you can legally get a free copy of visual studio at www.dreamspark.com. Microsoft DreamSpark has several microsoft development tools which they make freely available to any verified student. The verification process is quick and easy and it's done totally online, and then you can download a full iso of the install CD for Visual Studio and get a free key to use. So unless you have some major problem with microsoft, I can't think of any reason why you wouldn't use it...

    ReplyDelete