目录
1. 编译ncnn
1. 编译opencv和portobuf,也可以直接下载windows版本的opencv
2. 安装vulkan,直接取官网下载
3. 下载ncnn源码:
git clone https://github.com/Tencent/ncnn.git
4. 下载补充包:
cd ncnn
git submodule update --init
5. 打开vs终端(X64 native tools...)
6. 输入编译脚本:
// 生成Makefile, -DNCNN_VULKAN=ON 编译vulkan,使用gpu加速
cmake -G"NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=./install -DProtobuf_INCLUDE_DIR=D:/working_soft/protobuf/protobuf-3.4.0/build-vs2019/install/include -DProtobuf_LIBRARIES=D:/working_soft/protobuf/protobuf-3.4.0/build-vs2019/install/lib/libprotobuf.lib -DProtobuf_PROTOC_EXECUTABLE=D:/working_soft/protobuf/protobuf-3.4.0/build-vs2019/install/bin/protoc.exe -DNCNN_VULKAN=ON ..
// 编译
nmake
// 安装
nmake install
2. 配置ncnn
在vs studio中ncnn配置如下,附加依赖项必须按照文中顺序
包含目录