win10下安装ncnn,过程其实不复杂,顺利的话一会儿就好了。下面是详细过程。
1.安装vs2017,cmake
vs2017读者自行到官网下载安装
cmake安装包我已经上传到百度网盘,读者自行下载安装,下面是链接和密码
链接:https://pan.baidu.com/s/1eW2YuYk9s_Tw3Jgb6eohaA
提取码:sg56
2.下载protobuf和ncnn源码
protobuf下载链接:https://github.com/google/protobuf/archive/v3.4.0.zip
ncnn下载链接:https://github.com/Tencent/ncnn
3.编译protobuf(读者自行修改路径 <protobuf-root-dir>换成你的protobuf下载的位置)
> cd <protobuf-root-dir>
> mkdir build-vs2017
> cd build-vs2017
> cmake -G"NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=%cd%/install -Dprotobuf_BUILD_TESTS=OFF -Dprotobuf_MSVC_STATIC_RUNTIME=OFF ../cmake
> nmake
> nmake install
下面是截图;
4 编译ncnn (将ncnn-root-dir换成你的ncnn下载位置,第四条命令里面所有的<protobuf-root-dir>都换成读者自己的protobuf路径)
> cd <ncnn-root-dir>
> mkdir -p build-vs2017
> cd build-vs2017
> cmake -G"NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=%cd%/install -DProtobuf_INCLUDE_DIR=<protobuf-root-dir>/build-vs2017/install/include -DProtobuf_LIBRARIES=<protobuf-root-dir>/build-vs2017/install/lib/libprotobuf.lib -DProtobuf_PROTOC_EXECUTABLE=<protobuf-root-dir>/build-vs2017/install/bin/protoc.exe ..
> nmake
> nmake install
pick build-vs2017/install folder for further usage
上面3、4所有命令都用vs2017终端命令行窗口输入。
如果上面全部成功,恭喜你ncnn安装好了。