Skip to Content

pybind11 v2.13.6

Created
Updated

pybind11 is a lightweight header-only library that exposes C++ types in Python and vice versa, mainly to create Python bindings of existing C++ code

# Usage

pybind11 provides CMake targets. There are two modes provided; classic, which is built on the old Python
discovery packages in CMake, or the new FindPython mode, which uses FindPython
from 3.12+ forward (3.15+ _highly_ recommended).

New FindPython mode:

find_package(Python COMPONENTS Interpreter Development)
find_package(pybind11 CONFIG)

# pybind11 method:
pybind11_add_module(MyModule1 src1.cpp)

# Python method:
Python_add_library(MyModule2 src2.cpp)
target_link_libraries(MyModule2 pybind11::headers)
set_target_properties(MyModule2 PROPERTIES
    INTERPROCEDURAL_OPTIMIZATION ON
    CXX_VISIBILITY_PRESET ON
    VISIBILITY_INLINES_HIDDEN ON
) 

For more information see here:
https://pybind11.readthedocs.io/en/latest/compiling.html#building-with-cmake

# License

# Supported Platforms

!(arm & windows)

  • linux
  • osx
  • uwp
  • windows-x64
  • windows-x86
  • windows-arm64

# Features

No features defined.

# Dependencies

and 11 transitive dependencies:

# Host Dependencies

# Dependents

# Host Dependents

No dependents.

# Contributors

  • Ethan Smith's avatar Ethan Smith
  • Robert Schumacher's avatar Robert Schumacher
  • Kyle Macfarlan's avatar Kyle Macfarlan
  • Alexander Karatarakis's avatar Alexander Karatarakis
  • Albert Ziegenhagel's avatar Albert Ziegenhagel
  • Albert Ziegenhagel's avatar Albert Ziegenhagel
  • Stanislav Ershov's avatar Stanislav Ershov
  • Sztergbaum Roman's avatar Sztergbaum Roman
  • zhihaoy's avatar zhihaoy
  • pravic's avatar pravic
  • Stefano Sinigardi's avatar Stefano Sinigardi
  • Anand Balakrishnan's avatar Anand Balakrishnan
  • ras0219's avatar ras0219
  • Mikhail Boldyrev's avatar Mikhail Boldyrev
  • Adam Johnson's avatar Adam Johnson
  • JonLiu1993's avatar JonLiu1993
  • Ryan's avatar Ryan
  • chausner's avatar chausner
  • NancyLi1013's avatar NancyLi1013
  • SunBlack's avatar SunBlack
  • Alexander Neumann's avatar Alexander Neumann
  • Qingnan Duan's avatar Qingnan Duan
  • Jack·Boos·Yu's avatar Jack·Boos·Yu
  • Yury Bura's avatar Yury Bura
  • miyanyan's avatar miyanyan
  • Osyotr's avatar Osyotr

# Changelog

and 39 more commits:

# Source