Wes McKinney wrote:
> I'm starting to have a lot of Cython code, and I would like to figure
> out how to compile many pyx files into a single extension. I tried
> just listing the pyx files and am getting strange compilation errors
> like "multiple definitions of initEXTNAME". I googled a bit and didn't
> immediately find anything on this. It's listed as TODO in the online
> documentation.

You can split the module into separate chunks (usually called xyz.pxi with
an "i" for "include") and then include them into your main module .pyx file
using 'include "xyz.pxi"'.

There are also more sophisticated mechanisms (via cimport) to run efficient
call between different modules, but if you want all your code to end up in
one big module that the C compiler can optimise via aggressive inlining and
friends, there's nothing better than a plain include.

Stefan

_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to