安装pybind11时出现cmake问题

问题描述

documentation之后,我正在尝试使用pybind11。我已经使用pip安装了pybind11。目录的位置是:

~/anaconda3/lib/python3.6/site-packages/pybind11

下一步是编译测试用例。根据文档,我应该运行

mkdir build

cd build

cmake ..

make check -j 4

但是,在运行cmake ..时出现错误CMake Error: The source directory "/home/MyUserName/anaconda3/lib/python3.6/site-packages/pybind11" does not appear to contain CMakeLists.txt。因此,看来我在pip安装创建的CMakeLists.txt目录中没有文件pybind11

关于这里出了什么问题的任何想法吗?

解决方法

使用pip安装pybind11时,只会得到结果,而不是pybind的源(py文件,include文件...)。

要运行该示例,必须检出源git clone --recursive https://github.com/pybind/cmake_example.git,然后根据文档运行命令。