ncnn之二:Linux环境下ncnn安装+protobuf+opencv
1 安装g++
复制代码
1
2$ sudo apt-get install build-essential
2 安装cmake
复制代码
1
2
3
4
5
6
7
8
9
10# 下载地址: https://cmake.org/ $ tar -xvf cmake-3.16.0-rc1.tar.gz $ chmod -R 777 cmake-3.16.0-rc1 # 检测gcc和g++是否安装 $ sudo apt-get install build-essential $ cd cmake-3.16.0-rc1 $ sudo ./bootstrap $ sudo make $ sudo make install
参考: https://blog.csdn.net/libo2017/article/details/90084742
3 安装 protobuf
online:
复制代码
1
2
3
4
5
6
7
8
9
10
11$ sudo apt-get install autoconf automake libtool curl make g++ unzip $ git clone https://github.com/google/protobuf.git $ cd protobuf $ git submodule update --init --recursive $ ./autogen.sh $ ./configure $ make $ make check $ sudo make install $ sudo ldconfig #refresh shared library cache.
参考: https://blog.csdn.net/halazi100/article/details/85846858
offline:
复制代码
1
2
3
4
5
6
7
8
9# 下载地址:https://github.com/google/protobuf/releases $ tar -xvf protobuf-cpp-3.10.0.tar.gz $ cd protobuf-3.10.0 $ ./configure --prefix=/usr/local/protobuf $ make $ make check $ sudo make install $ protoc –version
4 安装opencv
复制代码
1
2
3
4
5
6
7
8
9
10# https://opencv.org/releases.html $ unzip opencv-3.4.0.zip $ cd opencv-3.4.0/ $ mkdir build $ cd build/ $ cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local .. $ sudo make instal # 查看opencv版本 $ pkg-config --modversion opencv
5 安装ncnn
复制代码
1
2
3
4
5
6
7$ git clone https://github.com/Tencent/ncnn $ cd <ncnn-root-dir> $ mkdir -p build $ cd build $ cmake .. $ make -j4
最后
以上就是迷你蓝天最近收集整理的关于ncnn之二:Linux环境下ncnn安装+protobuf+opencv的全部内容,更多相关ncnn之二内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复