1.. _compiling:
2
3Build systems
4#############
5
6.. _build-setuptools:
7
8Building with setuptools
9========================
10
11For projects on PyPI, building with setuptools is the way to go. Sylvain Corlay
12has kindly provided an example project which shows how to set up everything,
13including automatic generation of documentation using Sphinx. Please refer to
14the [python_example]_ repository.
15
16.. [python_example] https://github.com/pybind/python_example
17
18A helper file is provided with pybind11 that can simplify usage with setuptools.
19
20To use pybind11 inside your ``setup.py``, you have to have some system to
21ensure that ``pybind11`` is installed when you build your package. There are
22four possible ways to do this, and pybind11 supports all four: You can ask all
23users to install pybind11 beforehand (bad), you can use
24:ref:`setup_helpers-pep518` (good, but very new and requires Pip 10),
25:ref:`setup_helpers-setup_requires` (discouraged by Python packagers now that
26PEP 518 is available, but it still works everywhere), or you can
27:ref:`setup_helpers-copy-manually` (always works but you have to manually sync
28your copy to get updates).
29
30An example of a ``setup.py`` using pybind11's helpers:
31
32.. code-block:: python
33
34    from glob import glob
35    from setuptools import setup
36    from pybind11.setup_helpers import Pybind11Extension
37
38    ext_modules = [
39        Pybind11Extension(
40            "python_example",
41            sorted(glob("src/*.cpp")),  # Sort source files for reproducibility
42        ),
43    ]
44
45    setup(
46        ...,
47        ext_modules=ext_modules
48    )
49
50If you want to do an automatic search for the highest supported C++ standard,
51that is supported via a ``build_ext`` command override; it will only affect
52``Pybind11Extensions``:
53
54.. code-block:: python
55
56    from glob import glob
57    from setuptools import setup
58    from pybind11.setup_helpers import Pybind11Extension, build_ext
59
60    ext_modules = [
61        Pybind11Extension(
62            "python_example",
63            sorted(glob("src/*.cpp")),
64        ),
65    ]
66
67    setup(
68        ...,
69        cmdclass={"build_ext": build_ext},
70        ext_modules=ext_modules
71    )
72
73Since pybind11 does not require NumPy when building, a light-weight replacement
74for NumPy's parallel compilation distutils tool is included. Use it like this:
75
76.. code-block:: python
77
78    from pybind11.setup_helpers import ParallelCompile
79
80    # Optional multithreaded build
81    ParallelCompile("NPY_NUM_BUILD_JOBS").install()
82
83    setup(...)
84
85The argument is the name of an environment variable to control the number of
86threads, such as ``NPY_NUM_BUILD_JOBS`` (as used by NumPy), though you can set
87something different if you want; ``CMAKE_BUILD_PARALLEL_LEVEL`` is another choice
88a user might expect. You can also pass ``default=N`` to set the default number
89of threads (0 will take the number of threads available) and ``max=N``, the
90maximum number of threads; if you have a large extension you may want set this
91to a memory dependent number.
92
93If you are developing rapidly and have a lot of C++ files, you may want to
94avoid rebuilding files that have not changed. For simple cases were you are
95using ``pip install -e .`` and do not have local headers, you can skip the
96rebuild if a object file is newer than it's source (headers are not checked!)
97with the following:
98
99.. code-block:: python
100
101    from pybind11.setup_helpers import ParallelCompile, naive_recompile
102
103    SmartCompile("NPY_NUM_BUILD_JOBS", needs_recompile=naive_recompile).install()
104
105
106If you have a more complex build, you can implement a smarter function and pass
107it to ``needs_recompile``, or you can use [Ccache]_ instead. ``CXX="cache g++"
108pip install -e .`` would be the way to use it with GCC, for example. Unlike the
109simple solution, this even works even when not compiling in editable mode, but
110it does require Ccache to be installed.
111
112Keep in mind that Pip will not even attempt to rebuild if it thinks it has
113already built a copy of your code, which it deduces from the version number.
114One way to avoid this is to use [setuptools_scm]_, which will generate a
115version number that includes the number of commits since your last tag and a
116hash for a dirty directory. Another way to force a rebuild is purge your cache
117or use Pip's ``--no-cache-dir`` option.
118
119.. [Ccache] https://ccache.dev
120
121.. [setuptools_scm] https://github.com/pypa/setuptools_scm
122
123.. _setup_helpers-pep518:
124
125PEP 518 requirements (Pip 10+ required)
126---------------------------------------
127
128If you use `PEP 518's <https://www.python.org/dev/peps/pep-0518/>`_
129``pyproject.toml`` file, you can ensure that ``pybind11`` is available during
130the compilation of your project.  When this file exists, Pip will make a new
131virtual environment, download just the packages listed here in ``requires=``,
132and build a wheel (binary Python package). It will then throw away the
133environment, and install your wheel.
134
135Your ``pyproject.toml`` file will likely look something like this:
136
137.. code-block:: toml
138
139    [build-system]
140    requires = ["setuptools>=42", "wheel", "pybind11~=2.6.1"]
141    build-backend = "setuptools.build_meta"
142
143.. note::
144
145    The main drawback to this method is that a `PEP 517`_ compliant build tool,
146    such as Pip 10+, is required for this approach to work; older versions of
147    Pip completely ignore this file. If you distribute binaries (called wheels
148    in Python) using something like `cibuildwheel`_, remember that ``setup.py``
149    and ``pyproject.toml`` are not even contained in the wheel, so this high
150    Pip requirement is only for source builds, and will not affect users of
151    your binary wheels. If you are building SDists and wheels, then
152    `pypa-build`_ is the recommended offical tool.
153
154.. _PEP 517: https://www.python.org/dev/peps/pep-0517/
155.. _cibuildwheel: https://cibuildwheel.readthedocs.io
156.. _pypa-build: https://pypa-build.readthedocs.io/en/latest/
157
158.. _setup_helpers-setup_requires:
159
160Classic ``setup_requires``
161--------------------------
162
163If you want to support old versions of Pip with the classic
164``setup_requires=["pybind11"]`` keyword argument to setup, which triggers a
165two-phase ``setup.py`` run, then you will need to use something like this to
166ensure the first pass works (which has not yet installed the ``setup_requires``
167packages, since it can't install something it does not know about):
168
169.. code-block:: python
170
171    try:
172        from pybind11.setup_helpers import Pybind11Extension
173    except ImportError:
174        from setuptools import Extension as Pybind11Extension
175
176
177It doesn't matter that the Extension class is not the enhanced subclass for the
178first pass run; and the second pass will have the ``setup_requires``
179requirements.
180
181This is obviously more of a hack than the PEP 518 method, but it supports
182ancient versions of Pip.
183
184.. _setup_helpers-copy-manually:
185
186Copy manually
187-------------
188
189You can also copy ``setup_helpers.py`` directly to your project; it was
190designed to be usable standalone, like the old example ``setup.py``. You can
191set ``include_pybind11=False`` to skip including the pybind11 package headers,
192so you can use it with git submodules and a specific git version. If you use
193this, you will need to import from a local file in ``setup.py`` and ensure the
194helper file is part of your MANIFEST.
195
196
197Closely related, if you include pybind11 as a subproject, you can run the
198``setup_helpers.py`` inplace. If loaded correctly, this should even pick up
199the correct include for pybind11, though you can turn it off as shown above if
200you want to input it manually.
201
202Suggested usage if you have pybind11 as a submodule in ``extern/pybind11``:
203
204.. code-block:: python
205
206    DIR = os.path.abspath(os.path.dirname(__file__))
207
208    sys.path.append(os.path.join(DIR, "extern", "pybind11"))
209    from pybind11.setup_helpers import Pybind11Extension  # noqa: E402
210
211    del sys.path[-1]
212
213
214.. versionchanged:: 2.6
215
216    Added ``setup_helpers`` file.
217
218Building with cppimport
219========================
220
221[cppimport]_ is a small Python import hook that determines whether there is a C++
222source file whose name matches the requested module. If there is, the file is
223compiled as a Python extension using pybind11 and placed in the same folder as
224the C++ source file. Python is then able to find the module and load it.
225
226.. [cppimport] https://github.com/tbenthompson/cppimport
227
228.. _cmake:
229
230Building with CMake
231===================
232
233For C++ codebases that have an existing CMake-based build system, a Python
234extension module can be created with just a few lines of code:
235
236.. code-block:: cmake
237
238    cmake_minimum_required(VERSION 3.4...3.18)
239    project(example LANGUAGES CXX)
240
241    add_subdirectory(pybind11)
242    pybind11_add_module(example example.cpp)
243
244This assumes that the pybind11 repository is located in a subdirectory named
245:file:`pybind11` and that the code is located in a file named :file:`example.cpp`.
246The CMake command ``add_subdirectory`` will import the pybind11 project which
247provides the ``pybind11_add_module`` function. It will take care of all the
248details needed to build a Python extension module on any platform.
249
250A working sample project, including a way to invoke CMake from :file:`setup.py` for
251PyPI integration, can be found in the [cmake_example]_  repository.
252
253.. [cmake_example] https://github.com/pybind/cmake_example
254
255.. versionchanged:: 2.6
256   CMake 3.4+ is required.
257
258Further information can be found at :doc:`cmake/index`.
259
260pybind11_add_module
261-------------------
262
263To ease the creation of Python extension modules, pybind11 provides a CMake
264function with the following signature:
265
266.. code-block:: cmake
267
268    pybind11_add_module(<name> [MODULE | SHARED] [EXCLUDE_FROM_ALL]
269                        [NO_EXTRAS] [THIN_LTO] [OPT_SIZE] source1 [source2 ...])
270
271This function behaves very much like CMake's builtin ``add_library`` (in fact,
272it's a wrapper function around that command). It will add a library target
273called ``<name>`` to be built from the listed source files. In addition, it
274will take care of all the Python-specific compiler and linker flags as well
275as the OS- and Python-version-specific file extension. The produced target
276``<name>`` can be further manipulated with regular CMake commands.
277
278``MODULE`` or ``SHARED`` may be given to specify the type of library. If no
279type is given, ``MODULE`` is used by default which ensures the creation of a
280Python-exclusive module. Specifying ``SHARED`` will create a more traditional
281dynamic library which can also be linked from elsewhere. ``EXCLUDE_FROM_ALL``
282removes this target from the default build (see CMake docs for details).
283
284Since pybind11 is a template library, ``pybind11_add_module`` adds compiler
285flags to ensure high quality code generation without bloat arising from long
286symbol names and duplication of code in different translation units. It
287sets default visibility to *hidden*, which is required for some pybind11
288features and functionality when attempting to load multiple pybind11 modules
289compiled under different pybind11 versions.  It also adds additional flags
290enabling LTO (Link Time Optimization) and strip unneeded symbols. See the
291:ref:`FAQ entry <faq:symhidden>` for a more detailed explanation. These
292latter optimizations are never applied in ``Debug`` mode.  If ``NO_EXTRAS`` is
293given, they will always be disabled, even in ``Release`` mode. However, this
294will result in code bloat and is generally not recommended.
295
296As stated above, LTO is enabled by default. Some newer compilers also support
297different flavors of LTO such as `ThinLTO`_. Setting ``THIN_LTO`` will cause
298the function to prefer this flavor if available. The function falls back to
299regular LTO if ``-flto=thin`` is not available. If
300``CMAKE_INTERPROCEDURAL_OPTIMIZATION`` is set (either ``ON`` or ``OFF``), then
301that will be respected instead of the built-in flag search.
302
303.. note::
304
305   If you want to set the property form on targets or the
306   ``CMAKE_INTERPROCEDURAL_OPTIMIZATION_<CONFIG>`` versions of this, you should
307   still use ``set(CMAKE_INTERPROCEDURAL_OPTIMIZATION OFF)`` (otherwise a
308   no-op) to disable pybind11's ipo flags.
309
310The ``OPT_SIZE`` flag enables size-based optimization equivalent to the
311standard ``/Os`` or ``-Os`` compiler flags and the ``MinSizeRel`` build type,
312which avoid optimizations that that can substantially increase the size of the
313resulting binary. This flag is particularly useful in projects that are split
314into performance-critical parts and associated bindings. In this case, we can
315compile the project in release mode (and hence, optimize performance globally),
316and specify ``OPT_SIZE`` for the binding target, where size might be the main
317concern as performance is often less critical here. A ~25% size reduction has
318been observed in practice. This flag only changes the optimization behavior at
319a per-target level and takes precedence over the global CMake build type
320(``Release``, ``RelWithDebInfo``) except for ``Debug`` builds, where
321optimizations remain disabled.
322
323.. _ThinLTO: http://clang.llvm.org/docs/ThinLTO.html
324
325Configuration variables
326-----------------------
327
328By default, pybind11 will compile modules with the compiler default or the
329minimum standard required by pybind11, whichever is higher.  You can set the
330standard explicitly with
331`CMAKE_CXX_STANDARD <https://cmake.org/cmake/help/latest/variable/CMAKE_CXX_STANDARD.html>`_:
332
333.. code-block:: cmake
334
335    set(CMAKE_CXX_STANDARD 14 CACHE STRING "C++ version selection")  # or 11, 14, 17, 20
336    set(CMAKE_CXX_STANDARD_REQUIRED ON)  # optional, ensure standard is supported
337    set(CMAKE_CXX_EXTENSIONS OFF)  # optional, keep compiler extensionsn off
338
339The variables can also be set when calling CMake from the command line using
340the ``-D<variable>=<value>`` flag. You can also manually set ``CXX_STANDARD``
341on a target or use ``target_compile_features`` on your targets - anything that
342CMake supports.
343
344Classic Python support: The target Python version can be selected by setting
345``PYBIND11_PYTHON_VERSION`` or an exact Python installation can be specified
346with ``PYTHON_EXECUTABLE``.  For example:
347
348.. code-block:: bash
349
350    cmake -DPYBIND11_PYTHON_VERSION=3.6 ..
351
352    # Another method:
353    cmake -DPYTHON_EXECUTABLE=/path/to/python ..
354
355    # This often is a good way to get the current Python, works in environments:
356    cmake -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)") ..
357
358
359find_package vs. add_subdirectory
360---------------------------------
361
362For CMake-based projects that don't include the pybind11 repository internally,
363an external installation can be detected through ``find_package(pybind11)``.
364See the `Config file`_ docstring for details of relevant CMake variables.
365
366.. code-block:: cmake
367
368    cmake_minimum_required(VERSION 3.4...3.18)
369    project(example LANGUAGES CXX)
370
371    find_package(pybind11 REQUIRED)
372    pybind11_add_module(example example.cpp)
373
374Note that ``find_package(pybind11)`` will only work correctly if pybind11
375has been correctly installed on the system, e. g. after downloading or cloning
376the pybind11 repository  :
377
378.. code-block:: bash
379
380    # Classic CMake
381    cd pybind11
382    mkdir build
383    cd build
384    cmake ..
385    make install
386
387    # CMake 3.15+
388    cd pybind11
389    cmake -S . -B build
390    cmake --build build -j 2  # Build on 2 cores
391    cmake --install build
392
393Once detected, the aforementioned ``pybind11_add_module`` can be employed as
394before. The function usage and configuration variables are identical no matter
395if pybind11 is added as a subdirectory or found as an installed package. You
396can refer to the same [cmake_example]_ repository for a full sample project
397-- just swap out ``add_subdirectory`` for ``find_package``.
398
399.. _Config file: https://github.com/pybind/pybind11/blob/master/tools/pybind11Config.cmake.in
400
401
402.. _find-python-mode:
403
404FindPython mode
405---------------
406
407CMake 3.12+ (3.15+ recommended, 3.18.2+ ideal) added a new module called
408FindPython that had a highly improved search algorithm and modern targets
409and tools. If you use FindPython, pybind11 will detect this and use the
410existing targets instead:
411
412.. code-block:: cmake
413
414    cmake_minumum_required(VERSION 3.15...3.19)
415    project(example LANGUAGES CXX)
416
417    find_package(Python COMPONENTS Interpreter Development REQUIRED)
418    find_package(pybind11 CONFIG REQUIRED)
419    # or add_subdirectory(pybind11)
420
421    pybind11_add_module(example example.cpp)
422
423You can also use the targets (as listed below) with FindPython. If you define
424``PYBIND11_FINDPYTHON``, pybind11 will perform the FindPython step for you
425(mostly useful when building pybind11's own tests, or as a way to change search
426algorithms from the CMake invocation, with ``-DPYBIND11_FINDPYTHON=ON``.
427
428.. warning::
429
430    If you use FindPython2 and FindPython3 to dual-target Python, use the
431    individual targets listed below, and avoid targets that directly include
432    Python parts.
433
434There are `many ways to hint or force a discovery of a specific Python
435installation <https://cmake.org/cmake/help/latest/module/FindPython.html>`_),
436setting ``Python_ROOT_DIR`` may be the most common one (though with
437virtualenv/venv support, and Conda support, this tends to find the correct
438Python version more often than the old system did).
439
440.. warning::
441
442    When the Python libraries (i.e. ``libpythonXX.a`` and ``libpythonXX.so``
443    on Unix) are not available, as is the case on a manylinux image, the
444    ``Development`` component will not be resolved by ``FindPython``. When not
445    using the embedding functionality, CMake 3.18+ allows you to specify
446    ``Development.Module`` instead of ``Development`` to resolve this issue.
447
448.. versionadded:: 2.6
449
450Advanced: interface library targets
451-----------------------------------
452
453Pybind11 supports modern CMake usage patterns with a set of interface targets,
454available in all modes. The targets provided are:
455
456   ``pybind11::headers``
457     Just the pybind11 headers and minimum compile requirements
458
459   ``pybind11::python2_no_register``
460     Quiets the warning/error when mixing C++14 or higher and Python 2
461
462   ``pybind11::pybind11``
463     Python headers + ``pybind11::headers`` + ``pybind11::python2_no_register`` (Python 2 only)
464
465   ``pybind11::python_link_helper``
466     Just the "linking" part of pybind11:module
467
468   ``pybind11::module``
469     Everything for extension modules - ``pybind11::pybind11`` + ``Python::Module`` (FindPython CMake 3.15+) or ``pybind11::python_link_helper``
470
471   ``pybind11::embed``
472     Everything for embedding the Python interpreter - ``pybind11::pybind11`` + ``Python::Embed`` (FindPython) or Python libs
473
474   ``pybind11::lto`` / ``pybind11::thin_lto``
475     An alternative to `INTERPROCEDURAL_OPTIMIZATION` for adding link-time optimization.
476
477   ``pybind11::windows_extras``
478     ``/bigobj`` and ``/mp`` for MSVC.
479
480   ``pybind11::opt_size``
481     ``/Os`` for MSVC, ``-Os`` for other compilers. Does nothing for debug builds.
482
483Two helper functions are also provided:
484
485    ``pybind11_strip(target)``
486      Strips a target (uses ``CMAKE_STRIP`` after the target is built)
487
488    ``pybind11_extension(target)``
489      Sets the correct extension (with SOABI) for a target.
490
491You can use these targets to build complex applications. For example, the
492``add_python_module`` function is identical to:
493
494.. code-block:: cmake
495
496    cmake_minimum_required(VERSION 3.4)
497    project(example LANGUAGES CXX)
498
499    find_package(pybind11 REQUIRED)  # or add_subdirectory(pybind11)
500
501    add_library(example MODULE main.cpp)
502
503    target_link_libraries(example PRIVATE pybind11::module pybind11::lto pybind11::windows_extras)
504
505    pybind11_extension(example)
506    pybind11_strip(example)
507
508    set_target_properties(example PROPERTIES CXX_VISIBILITY_PRESET "hidden"
509                                             CUDA_VISIBILITY_PRESET "hidden")
510
511Instead of setting properties, you can set ``CMAKE_*`` variables to initialize these correctly.
512
513.. warning::
514
515    Since pybind11 is a metatemplate library, it is crucial that certain
516    compiler flags are provided to ensure high quality code generation. In
517    contrast to the ``pybind11_add_module()`` command, the CMake interface
518    provides a *composable* set of targets to ensure that you retain flexibility.
519    It can be expecially important to provide or set these properties; the
520    :ref:`FAQ <faq:symhidden>` contains an explanation on why these are needed.
521
522.. versionadded:: 2.6
523
524.. _nopython-mode:
525
526Advanced: NOPYTHON mode
527-----------------------
528
529If you want complete control, you can set ``PYBIND11_NOPYTHON`` to completely
530disable Python integration (this also happens if you run ``FindPython2`` and
531``FindPython3`` without running ``FindPython``). This gives you complete
532freedom to integrate into an existing system (like `Scikit-Build's
533<https://scikit-build.readthedocs.io>`_ ``PythonExtensions``).
534``pybind11_add_module`` and ``pybind11_extension`` will be unavailable, and the
535targets will be missing any Python specific behavior.
536
537.. versionadded:: 2.6
538
539Embedding the Python interpreter
540--------------------------------
541
542In addition to extension modules, pybind11 also supports embedding Python into
543a C++ executable or library. In CMake, simply link with the ``pybind11::embed``
544target. It provides everything needed to get the interpreter running. The Python
545headers and libraries are attached to the target. Unlike ``pybind11::module``,
546there is no need to manually set any additional properties here. For more
547information about usage in C++, see :doc:`/advanced/embedding`.
548
549.. code-block:: cmake
550
551    cmake_minimum_required(VERSION 3.4...3.18)
552    project(example LANGUAGES CXX)
553
554    find_package(pybind11 REQUIRED)  # or add_subdirectory(pybind11)
555
556    add_executable(example main.cpp)
557    target_link_libraries(example PRIVATE pybind11::embed)
558
559.. _building_manually:
560
561Building manually
562=================
563
564pybind11 is a header-only library, hence it is not necessary to link against
565any special libraries and there are no intermediate (magic) translation steps.
566
567On Linux, you can compile an example such as the one given in
568:ref:`simple_example` using the following command:
569
570.. code-block:: bash
571
572    $ c++ -O3 -Wall -shared -std=c++11 -fPIC $(python3 -m pybind11 --includes) example.cpp -o example$(python3-config --extension-suffix)
573
574The flags given here assume that you're using Python 3. For Python 2, just
575change the executable appropriately (to ``python`` or ``python2``).
576
577The ``python3 -m pybind11 --includes`` command fetches the include paths for
578both pybind11 and Python headers. This assumes that pybind11 has been installed
579using ``pip`` or ``conda``. If it hasn't, you can also manually specify
580``-I <path-to-pybind11>/include`` together with the Python includes path
581``python3-config --includes``.
582
583Note that Python 2.7 modules don't use a special suffix, so you should simply
584use ``example.so`` instead of ``example$(python3-config --extension-suffix)``.
585Besides, the ``--extension-suffix`` option may or may not be available, depending
586on the distribution; in the latter case, the module extension can be manually
587set to ``.so``.
588
589On macOS: the build command is almost the same but it also requires passing
590the ``-undefined dynamic_lookup`` flag so as to ignore missing symbols when
591building the module:
592
593.. code-block:: bash
594
595    $ c++ -O3 -Wall -shared -std=c++11 -undefined dynamic_lookup $(python3 -m pybind11 --includes) example.cpp -o example$(python3-config --extension-suffix)
596
597In general, it is advisable to include several additional build parameters
598that can considerably reduce the size of the created binary. Refer to section
599:ref:`cmake` for a detailed example of a suitable cross-platform CMake-based
600build system that works on all platforms including Windows.
601
602.. note::
603
604    On Linux and macOS, it's better to (intentionally) not link against
605    ``libpython``. The symbols will be resolved when the extension library
606    is loaded into a Python binary. This is preferable because you might
607    have several different installations of a given Python version (e.g. the
608    system-provided Python, and one that ships with a piece of commercial
609    software). In this way, the plugin will work with both versions, instead
610    of possibly importing a second Python library into a process that already
611    contains one (which will lead to a segfault).
612
613
614Building with Bazel
615===================
616
617You can build with the Bazel build system using the `pybind11_bazel
618<https://github.com/pybind/pybind11_bazel>`_ repository.
619
620Generating binding code automatically
621=====================================
622
623The ``Binder`` project is a tool for automatic generation of pybind11 binding
624code by introspecting existing C++ codebases using LLVM/Clang. See the
625[binder]_ documentation for details.
626
627.. [binder] http://cppbinder.readthedocs.io/en/latest/about.html
628
629[AutoWIG]_ is a Python library that wraps automatically compiled libraries into
630high-level languages. It parses C++ code using LLVM/Clang technologies and
631generates the wrappers using the Mako templating engine. The approach is automatic,
632extensible, and applies to very complex C++ libraries, composed of thousands of
633classes or incorporating modern meta-programming constructs.
634
635.. [AutoWIG] https://github.com/StatisKit/AutoWIG
636
637[robotpy-build]_ is a is a pure python, cross platform build tool that aims to
638simplify creation of python wheels for pybind11 projects, and provide
639cross-project dependency management. Additionally, it is able to autogenerate
640customizable pybind11-based wrappers by parsing C++ header files.
641
642.. [robotpy-build] https://robotpy-build.readthedocs.io
643