[C++-sig] Boost.Python NumPy extension

Alex Mohr amohr at pixar.com
Sun Oct 9 00:40:33 EDT 2016


Cool!  Sorry, I don't have the expertise to help with the boost.build 
aspect, but I did have some questions and comments regarding the feature.

Does this add a dependency of boost.python on numpy?  We'd love to be 
able to continue use boost.python without a numpy dependency.  We did a 
nontrivial amount of work to remove this dependency in USD (openusd.org, 
https://github.com/PixarAnimationStudios/USD), a C++ library that 
provides python bindings via boost.python, so adding it back would be a 
problem for us.

Instead of depending on numpy, we made our array structures implement 
the python buffer protocol.  This lets clients that wish to use numpy do 
so easily, since numpy supports the buffer protocol, but it does not 
burden those that don't with the numpy dependency.  We did this manually 
of course but supporting the buffer protocol would be a cool feature for 
boost.python.

Alex

On 10/8/16 9:21 PM, Stefan Seefeld wrote:
> Hello,
>
> I'm happy to announce that I just merged the NumPy C++ wrappers from
> https://github.com/ndarray/Boost.NumPy into Boost.Python's development
> branch. (Online documentation for it can be browsed here:
> http://boostorg.github.io/python/develop/doc/html/numpy)
>
> I'd very much like to be able to merge this into the master branch for
> the next Boost release (version 1.63).
> At present I'm using SCons to build Boost.Python (stand-alone, against a
> separately installed Boost), which is also the infrastructure I use for
> CI testing (https://travis-ci.org/boostorg/python).
>
> I would like to ask for help with integrating the new NumPy extension
> into the Boost.Build-based build system, such that this will also be
> picked up by the regular Boost infrastructure. Please refer to
> https://github.com/boostorg/python/issues/89 if you'd like to help with
> this.
>
> Many thanks !
>
>         Stefan
>


More information about the Cplusplus-sig mailing list