本文首发于个人博客https://kezunlin.me/post/8b9c051d/,欢迎阅读!
Interfacing C and Python with pybind11 on windows 10
Series
- Part 1: Interfacing C and Python with pybind11 on windows 10
- Part 2: Interfacing C and Python with pybind11 on ubuntu 16.04
Guide
requirements:
- pybind11 v2.3.dev0
- python 2.7
install pytest
pip install pytest
compile
git clone https://github.com/pybind/pybind11.git
cd pybind11
mkdir build
cd build
cmake-gui ..
with options
PYBIND11_CPP_STANDARD /std:c 11 # default c 14
PYTHON_EXECUTABLE C:/Python27/python.exe
CMAKE_INSTALL_PREFIX C:/Program Files/pybind11
compile with VS 2015
with x64 Release
install to C:Program Filespybind11
with only include
and share
$ tree .
.
├── include
│ └── pybind11
│ ├── attr.h
│ ├── buffer_info.h
│ ├── cast.h
│ ├── chrono.h
│ ├── common.h
│ ├── complex.h
│ ├── detail
│ │ ├── class.h
│ │ ├── common.h
│ │ ├── descr.h
│ │ ├── init.h
│ │ ├── internals.h
│ │ └── typeid.h
│ ├── eigen.h
│ ├── embed.h
│ ├── eval.h
│ ├── functional.h
│ ├── iostream.h
│ ├── numpy.h
│ ├── operators.h
│ ├── options.h
│ ├── pybind11.h
│ ├── pytypes.h
│ ├── stl.h
│ └── stl_bind.h
└── share
└── cmake
└──