[Cython] Any way to embed C/C++ in a single source compilation of a pyx file?

Jason Newton nevion at gmail.com
Sat Aug 13 21:28:35 EDT 2016


I just added inline_module's and submitted a PR today here:
https://github.com/cython/cython/pull/555

My intent was something like OpenCL's JIT/AOC compilation (PyCUDA/PyOpenCL
also work this way) which is simple and high performance, and I saw cython
had this capability and just needed a little bit of a wrapper to expose it
better.

But after trying to put it into use for my own problems, where I would
regularly want to use Eigen or other integration problems I realized I'd
still have to write and save [many] code fragments to other files which
cythonize-ing would read in through includes, when you need to work with
something that doesn't have a cython cimport module.  This is pretty ugly
and doesn't achieve the easier flow that I had wanted.

However if there was a way to embed C/C++ inside a pyx file (that is inline
to strings), there would be no such issue.

I submitted an issue here https://github.com/cython/cython/issues/556 but I
was hoping to get the ball rolling if the ML is where the development
conversations happen - it's not clear to me right now the best place for
the Cython project to request this from, so sorry to cross post.

Regards,
-Jason
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cython-devel/attachments/20160813/9c777042/attachment.html>


More information about the cython-devel mailing list