ncnn编译过程(win10+vs2017)

参考链接:https://github.com/Tencent/ncnn
https://github.com/Tencent/ncnn/wiki/how-to-build#build-for-windows-x64-using-visual-studio-community-2017

1.编译protobuf。
https://github.com/Tencent/ncnn/wiki/how-to-build#build-for-windows-x64-using-visual-studio-community-2017
在这里插入图片描述
2.下载vulkan软件:
https://vulkan.lunarg.com/sdk/home
3。编译ncnn。
进入vs2017 x64本机工具命令提示界面:输入如下:
cmake -G"NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=%cd%/install -DProtobuf_INCLUDE_DIR=D:/doc/github_program/protobuf/build_for_ncnn_by_vs2017/install/include -DProtobuf_LIBRARIES=D:/doc/github_program/protobuf/build_for_ncnn_by_vs2017/install/lib/libprotobuf.lib -DProtobuf_PROTOC_EXECUTABLE=D:/doc/github_program/protobuf/build_for_ncnn_by_vs2017/install/bin/protoc.exe -DNCNN_VULKAN=ON … (该路径为自己电脑私人路径,需要自己修改)
此时部分doc界面显示如下:
在这里插入图片描述
这里应该已经编译好了,但是本人想要使用ncnn中的自动量化功能,因此还需要cmake找到opencv后,重新cmake编译。关于这个问题在ncnn的github中提了issue,已自行解决:
https://github.com/Tencent/ncnn/issues/1982
这里需要把opencv的cmake路径加入到cmake 中。具体如下:

*cmake -G"NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=%cd%/install -DProtobuf_INCLUDE_DIR=D:/doc/github_program/protobuf/build_for_ncnn_by_vs2017/install/include -DProtobuf_LIBRARIES=D:/doc/github_program/protobuf/build_for_ncnn_by_vs2017/install/lib/libprotobuf.lib -DProtobuf_PROTOC_EXECUTABLE=D:/doc/github_program/protobuf/build_for_ncnn_by_vs2017/install/bin/protoc.exe -DOpenCV_DIR=D:/software/tool/opencv/opencv/build -DNCNN_VULKAN=ON ..*

cmake成功,截图如下:
在这里插入图片描述
运行nmake进行编译。
在这里插入图片描述
运行nmake install进行安装。
在这里插入图片描述
编译完成!

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值