1.安装protobuf
下载protobuf并安装,我使用的是3.7最新版本,下载地址为:https://github.com/protocolbuffers/protobuf/releases/tag/v3.7.0
再下载这个protobuf-all-3.7.0.tar.gz,并解压然后编译。
cd protobuf-3.7.0
./configure
make
make check
sudo make install
sudo ldconfig # refresh shared library cache
安装完成,查看版本号:
protoc --version
2.安装ncnn
$ git clone https://github.com/Tencent/ncnn.git
$ cd ncnn
$ cd build
$ cmake -DNCNN_VULKAN=OFF ..
$ make -j8
$ make install
这样在ncnn/build/install/ 就会生成include lib 文件夹。里面包含自己所需的头文件和ncnn 库文件。