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
發佈了258 篇原創文章 · 獲贊 339 · 訪問量 64萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章