From some time ago, it was possible to easily embed a python interpreter and build an exe with pybind11.
https://pybind11.readthedocs.io/en/stable/advanced/embedding.html
This is useful for programs that are mainly C ++ or whose entry point is C / C ++.
By default, it searches the system and links with libPython found (for example, python in the conda environment for conda, etc.).
If you want to specify Python explicitly
cmake -DPYTHON_EXECUTABLE = / path / to / bin / python ...
and PYTHON_EXECUTABLE
.
(Lib also seems to find it based on the bin directory)
This is because pybind11 internally find_package (PythonInterp)
.
https://cmake.org/cmake/help/v3.18/module/FindPythonInterp.html
By the way, there are suffixes such as python3.8m, but here is the meaning of suffix.
https://stackoverflow.com/questions/32544974/naming-convention-what-does-the-m-mean-in-libpython3-5m-dylib
TODO
Recommended Posts