boost-python3

Build Python 3 extensions in C++ with Boost libraries.

brewmacoslinux
Try with needOr install directly
Source

About

C++ library for C++/Python3 interoperability

Examples

compile C++ code that uses Python 3$ g++ -I/usr/local/include/python3.9 -I/usr/local/opt/boost-python3/include mymodule.cpp -o mymodule.so -L/usr/local/opt/boost-python3/lib -lboost_python39
create a Python 3 module from C++ class$ python3 setup.py build_ext --inplace
check boost python headers are installed$ ls /usr/local/opt/boost-python3/include/boost/python.hpp
link boost python library to C++ project$ pkg-config --cflags --libs boost_python3-py39
find all boost python shared libraries$ find /usr/local/opt/boost-python3 -name '*.dylib' -o -name '*.so'