<div dir="ltr">We use Cython very heavily in DyND's Python bindings. It has worked well for us<div><span style="line-height:1.5">even when working with some very modern C++. That said, a lot depends on</span></div><div><span style="line-height:1.5">exactly which C++ features you want to expose as a part of the interface.</span></div><div><span style="line-height:1.5">Interfaces that require things like non-type template parameters or variadic</span></div><div><span style="line-height:1.5">templates will often require a some extra C++ code to work them in to something</span></div><div><span style="line-height:1.5">that Cython can understand. In my experience, those particular limitations haven't</span></div><div><span style="line-height:1.5">been that hard to work with.</span></div><div>Best,</div><div>Ian Henriksen<br><div><br><div class="gmail_quote"><div dir="ltr">On Wed, Aug 31, 2016 at 12:20 PM Jason Newton <<a href="mailto:nevion@gmail.com">nevion@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>I just wanted to follow up on the C++ side of OP email - Cython has quite a few difficulties working with C++ code at the moment.  It's really more of a C solution most of the time and you must split things up into a mostly C call interface (that is the C code Cython can call) and limit exposure/complications with templates and  complex C++11+ constructs.  This may change in the longer term but in the near, that is the state.<br><br></div>I used to use Boost.Python but I'm getting my feet wet with Pybind (which is basically the same api but works more as you expect it to with it's signature/type plumbing  (including std::shared_ptr islanding), with some other C++11 based improvements, and is header only + submodule friendly!).  I also remembered ndarray thanks to Neal's post but I haven't figured out how to leverage it better than pybind, at the moment.  I'd be interested to see ndarray gain support for pybind interoperability...<br><br></div></div><div dir="ltr">-Jason<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Aug 31, 2016 at 1:08 PM, David Morris <span dir="ltr"><<a href="mailto:othalan@othalan.net" target="_blank">othalan@othalan.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span>On Wed, Aug 31, 2016 at 2:28 PM, Michael Bieri <span dir="ltr"><<a href="mailto:mibieri@gmail.com" target="_blank">mibieri@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi all<div><br></div><div>There are several ways on how to use C/C++ code from Python with NumPy, as given in <a href="http://docs.scipy.org/doc/numpy/user/c-info.html" target="_blank">http://docs.scipy.org/doc/numpy/user/c-info.html</a> . Furthermore, there's at least pybind11. </div><div><br></div><div>I'm not quite sure which approach is state-of-the-art as of 2016. How would you do it if you had to make a C/C++ library available in Python right now?</div><div><br></div><div>In my case, I have a C library with some scientific functions on matrices and vectors. You will typically call a few functions to configure the computation, then hand over some pointers to existing buffers containing vector data, then start the computation, and finally read back the data. The library also can use MPI to parallelize.</div></div></blockquote><div><br></div></span><div>I have been delighted with Cython for this purpose.  Great integration with NumPy (you can access numpy arrays directly as C arrays), very python like syntax and amazing performance.</div><div><br></div><div>Good luck,</div><div><br></div><div>David</div></div></div></div>
<br>_______________________________________________<br>
NumPy-Discussion mailing list<br>
<a href="mailto:NumPy-Discussion@scipy.org" target="_blank">NumPy-Discussion@scipy.org</a><br>
<a href="https://mail.scipy.org/mailman/listinfo/numpy-discussion" rel="noreferrer" target="_blank">https://mail.scipy.org/mailman/listinfo/numpy-discussion</a><br>
<br></blockquote></div><br></div>
_______________________________________________<br>
NumPy-Discussion mailing list<br>
<a href="mailto:NumPy-Discussion@scipy.org" target="_blank">NumPy-Discussion@scipy.org</a><br>
<a href="https://mail.scipy.org/mailman/listinfo/numpy-discussion" rel="noreferrer" target="_blank">https://mail.scipy.org/mailman/listinfo/numpy-discussion</a><br>
</blockquote></div></div></div></div>