ncnn之二:Linux环境下ncnn安装+protobuf+opencv

ncnn之二:Linux环境下ncnn安装+protobuf+opencv

1 安装g++

$ sudo apt-get install build-essential

2 安装cmake

# 下载地址: 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:

$ 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:

# 下载地址: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

# 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

$ git clone https://github.com/Tencent/ncnn
$ cd <ncnn-root-dir>
$ mkdir -p build
$ cd build
$ cmake ..
$ make -j4
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

mingo_敏

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值