I want to use functions from Boost C++ Libraries (like gauss_kronrod.hpp) in my Pybind11 project to optimize python using C++.
Using C++ functions from standard libraries (like numeric) is straightforward:
#include <pybind11/pybind11.h>
#include <pybind11/numpy.h>
#include <pybind11/stl.h>
#include <numeric>
namespace py = pybind11;
.
.
.
PYBIND11_MODULE(_test, m) {
m.def("test_func", &test_func);
}
How can I access all the functions from Boost? I downloaded it and saved it in the folder thirdparty of my Pybind11 project. I can include a single function from Boost using to complete path to this function:
# include <thirdparty/boost/boost/math/quadrature/gauss_kronrod.hpp>
However func.hpp loads other functions from Boost which can not be found. I feel like I need to add the Path to Boost in my file CMakeLists.txt.
Under PyBind11: boost::multiprecision::cpp_int to Python is an example where cpp_int.hpp from Boost was successfully used within Pybind11. Unfortunately, its not clear how they made the command
#include <boost/multiprecision/cpp_int.hpp>
work properly