concaveman-cpp
concaveman-cpp copied to clipboard
use pybind11 and cppimport
Thank you for porting this to C++.
This PR changes the compilation to pybind11 and cppimport.
In this way, it becomes really easy to install and run, e.g. running
cd src/main
python demo.py
will just work (assuming you have cppimport
installed): it will automatically compile src/main/cpp/concaveman.cpp
and load it.
The code for passing in and returning the arrays also becomes a lot simpler.
Not directly related to this change: I added a DEBUG
flag for removing the std::cout
printouts, and fixed one compiler warning for a missing typedef.
Nice work!
could this be restructured to use pybind11 and pre-build the all teh code so it would run without a compiler or any other dependencies?
I've done that with Cython (#14) -- because that's what I'm used to -- but pybind11 would probably make cleaner binding code.