[Cython] Shared Cython runtime (was: Upcoming cython/numpy breakage with stride checking)

mark florisson markflorisson88 at gmail.com
Tue Apr 9 16:54:39 CEST 2013


On 9 April 2013 15:45, Nathaniel Smith <njs at pobox.com> wrote:

> On Tue, Apr 9, 2013 at 3:32 PM, mark florisson
> <markflorisson88 at gmail.com> wrote:
> > On 9 April 2013 14:55, Nikita Nemkin <nikita at nemkin.ru> wrote:
> >> One alternative for code reuse in large Cython projects
> >> could be packaging multiple modules into one shared library.
> >
> > We have 'include'! :) Seriously though, that wouldn't work well with the
> > import mechanism, and probably not for C compile time either.
>
> You can link multiple .c files into a single shared library.
>

I did mean the Cython include statement, not the C one :) Include actually
works out of the box with distutils. Though that may not be a very
compelling argument for anything :)


> This is off-topic again, but I've often thought in the past it would
> be nice if one could easily build a single module out of a combination
> of multiple .c and .pyx files. Specifically it'd be nice to be able to
> port bits of numpy/core/multiarray.so to Cython, but it's already
> 50,000 lines of C code spread out over 38 files and defining a single
> module; no real way to move just part of it to Cython so far as I
> know...


I don't know if it's what you want, but you can simply list .c files in the
'sources' list and call 'cdef public' Cython functions from C.


> -n
> _______________________________________________
> cython-devel mailing list
> cython-devel at python.org
> http://mail.python.org/mailman/listinfo/cython-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cython-devel/attachments/20130409/67bc2056/attachment.html>


More information about the cython-devel mailing list