1、安装第三方库
sudo apt-get install cmake==3.18.2
#(已经安装cmake,升级一下:sudo pip install --upgrade cmake==3.18.2)
sudo pip install -i https://pypi.tuna.tsinghua.edu.cn/simple/ pytest
2、安装pybind11
1)源码下载
github:https://github.com/pybind/pybind11
克隆下来
git clone https://github.com/pybind/pybind11.git
2)编译安装
cd pybind11
mkdir build
cd build
cmake ..
make check -j 4
sudo make install #(如果使用python2需要禁用/usr/bin/下的python3)
可以看到安装完成之后include的目录是在:/usr/local/include/,而不是在/usr/include,如果发现导入不存在,则用全路径导入
#include <string>
#include <sstream>
#include </usr/local/include/pybind11/pybind11.h>
#include </usr/local/include/pybind11/eigen.h>
#include </usr/local/include/pybind11/stl.h>
#include "teaser/registration.h"
#include "teaser/certification.h"
namespace py = pybind11;
参考文献:https://blog.csdn.net/u012483097/article/details/108797976
版权声明:本文为qq_27149279原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。