[Numpy-discussion] rewriting NumPy code in C or C++ or similar

Dan Halbert halbert at halwitz.org
Mon Mar 7 19:22:25 EST 2011

On 3/7/2011 6:48 PM, Christopher Barker wrote:
> On 3/7/11 3:36 PM, Dan Halbert wrote:
>> We currently have some straightforward NumPy code that indirectly implements a C API defined by a third party. We built a Cython layer that directly provides the API in a .a library, and then calls Python. The layering looks like this:
>>     C main program ->   API in Cython ->   Python ->   NumPy
>> This is difficult to package for distribution, because of the Python and NumPy dependencies.
> I'd say learn py2exe, py2app and friends, and be done with it.
> Otherwise, I wonder if you could re-factor your Cython code enough to
> remove all python dependencies -- or at least have something you could
> compile and run without a python interpreter running.

What we ship is the library and associated files. The library gets 
linked with someone else's main program. So py2exe and pyinstaller, etc. 
can't help much here, since we don't control the executable. I have 
thought about doing more in Cython, but I still need a libpython2.x.so, 
etc., I believe.


More information about the NumPy-Discussion mailing list