- MNN编译环境配置—Linux
- Protocol Buffers配置">Protocol Buffers配置
- 1、Python版本
- All版本,源码安装">2、All版本,源码安装
- Step1: On Ubuntu/Debian, you can install them with:
- Step2: To get the source, download one of the release .tar.gz or .zip packages in the release page:
- Step3: You can also get the source by “git clone” our git repository. Make sure you have also cloned the submodules and generated the configure script (skip this if you are using a release .tar.gz or .zip package):
- Step4: To build and install the C++ Protocol Buffer runtime and the Protocol Buffer compiler (protoc) execute the following:
- Step5: If “make check” fails, you can still install, but it is likely that some features of this library will not work correctly on your system. Proceed at your own risk.
- Step6: 检查版本
- Cmake安装-Linux
- Protocol Buffers配置">Protocol Buffers配置
- MNN编译环境配置-Windows(Fail)
MNN编译环境配置—Linux
(按照步骤2安装:
gcc:7.5.0
g++:7.5.0
protoc:3.12.0
cmake:3.10
)
Protocol Buffers配置
1、Python版本
Step1:安装protobuf
# version = 3.12.0,需要与系统版本一致pip install -i https://douban.pypi.com/simple/ protobuf
Step2: 下载二进制bin文件,安装Protocol Compiler v3.0.0
# 使用以下命令会默认安装Protobuf 3+版本,对于TensorFlowkennel导致问题sudo apt-get install protobuf-compiler
2、All版本,源码安装
Step1: On Ubuntu/Debian, you can install them with:
sudo apt-get install autoconf automake libtool curl make g++ unzip
Step2: To get the source, download one of the release .tar.gz or .zip packages in the release page:
# if you need C++ and multiple other languages, download protobuf-all-[VERSION].tar.gz.https://github.com/protocolbuffers/protobuf/releases/latest
Step3: You can also get the source by “git clone” our git repository. Make sure you have also cloned the submodules and generated the configure script (skip this if you are using a release .tar.gz or .zip package):
git clone https://github.com/protocolbuffers/protobuf.gitcd protobufgit submodule update --init --recursive./autogen.sh
Step4: To build and install the C++ Protocol Buffer runtime and the Protocol Buffer compiler (protoc) execute the following:
./configuremakemake checksudo make install # !!!sudo ldconfig # refresh shared library cache.
Step5: If “make check” fails, you can still install, but it is likely that some features of this library will not work correctly on your system. Proceed at your own risk.
Hint on install location
By default, the package will be installed to /usr/local. However, on many platforms, /usr/local/lib is not part of LD_LIBRARY_PATH. You can add it, but it may be easier to just install to /usr instead. To do this, invoke configure as follows:
./configure --prefix=/usr
Step6: 检查版本
# libprotoc 3.12.3protoc --version
Cmake安装-Linux
1、sudo apt-get install cmake
此方式安装方便,缺点是如果想要自己编译Android平台的opencv会提示版本太低,因为ubuntu16.04源里的cmake版本只有3.5.1,而Android交叉编译工具链android.toolchain.cmake要求cmake最低版本是3.6.0。
2、源码安装
Step1: 下载cmake-3.18.0-rc2版本源码
Step2: 安装
./bootstrapmake -j8sudo make install# 验证版本cmake --version
MNN编译环境配置-Windows(Fail)
环境要求
- Microsoft Visual Studio (2017或者以上)
- cmake(建议使用3.10或以上版本)
- powershell
- Ninja(构建工具,比nmake更快)
环境配置
cmake安装
Ninja安装
- 下载ninjia-v1.10.0源码,解压
- 使用源码编译生成.exe文件报错。下载ninja-win.zip文件,解压将其.exe文件拷贝到ninja源码更目录
- 单击ninja.exe文件,闪退,会在其源码根目录下生成build文件夹
配置ninja.exe系统环境变量
