- boost: example for Boost.Python
- pybind11: example for pybind11
- nanobind: example for nanobind
It is assumed that the Boost.Python has been compiled and installed into some place by using e.g., MateriApps Installer, etc, and BOOST_ROOT environment variable has been set properly.
Pybind11 is a header-only library. It is automatically downloaded.
Nanobind11 is automatically downloaded.
cd /somewhere/pycxx
cmake -B build
cmake --build build
cmake --build build --target test
-
BOOST_ROOT
: specify the place in which the Boost Library is installedex)
-DBOOST_ROOT=$HOME/boost/
-
CMAKE_CXX_COMPILER
: spacify C++ compilerex)
-DCMAKE_CXX_COMPILER=g++
-
PYTHON_EXECUTABLE
: specify Python interpreterex)
-DPYTHON_EXECUTABLE=/opt/local/bin/python3