[C++][ubuntu]MNN在ubuntu18.04源码编译流程

Posted FL1623863129

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[C++][ubuntu]MNN在ubuntu18.04源码编译流程相关的知识,希望对你有一定的参考价值。

1、先编译protobuf

安装依赖

sudo apt update
sudo apt install libprotobuf-dev protobuf-compiler cmake git  -y

下载源码:

wget https://github.com/protocolbuffers/protobuf/releases/download/v3.19.4/protobuf-all-3.19.4.tar.gz

 tar -zxvf protobuf-all-3.19.4.tar.gz

你也可以下载其他版本源码或者最新的,比如:

git clone https://github.com/protocolbuffers/protobuf.git

开始编译:

cd protobuf-3.19.4
./autogen.sh
./configure
make -j8
sudo make install
sudo ldconfig    # refresh shared library cache

检查是否安装成功:

protoc --version
2、编译MNN

git clone https://github.com/alibaba/MNN.git

cd MNN
./schema/generate.sh
mkdir build 
cd build
cmake .. -DMNN_BUILD_CONVERTER=true
make -j8

sudo make install

以上是关于[C++][ubuntu]MNN在ubuntu18.04源码编译流程的主要内容,如果未能解决你的问题,请参考以下文章