Welcome to follow my public account [Jizhi Vision], reply 001 to get Google programming specification

O_o >_< O_o O_o ~_~ O_o

This tutorial details how to quickly build Tengine VS projects using Cmake in a Win10 environment.

Win10 怎 么 用 nmake and qmake 怎 么 用 NCNN vs 解 决 方法? Here use cmake to walk through the Tengine vs 解 决 方法. As you know, NCNN and Tengine are both popular deep learning reasoning frameworks for low power scenarios, while Cmake is probably the most used cross-platform compilation tool in open source projects, while Qmake is a bit less popular. Put these articles together, and you’ll see that when you have a NCNN in your left hand, a Tengine in your right hand, a Cmake in your left hand, and a Qmake in your right hand, it doesn’t matter whether you’re working on Windows or Linux, whether you’re deploying to embedded boards or mobile, You can do it all.

On.

1. Prepare the Tengine source code

Clone Tengine’s engineering code:

git clone https://github.com/OAID/Tengine.git
Copy the code

The structure of the project is clear, such as benchmark, examples, tests and other needless to say, a glance to know what to use. Speaking of Tools, tools provides some useful tools that were previously a separate Git project, such as the model transformation tool convert_tool, but are now integrated into the Tengine project to make it more user-friendly. Convert_tool is a model conversion tool. For example, optimize is a model optimization tool. Quantize is a model quantization tool. The quantization modes of min-max, KL, EQ and DFQ include symmetrical quantization, asymmetric quantization and channel by channel quantization. The covered scenes are still very comprehensive, give a thumbs up.

       

2. Prepare cmake bat

By the way, vs Studio 2019, remember.

Sort out three BATS:

  • Env. bat: used for environment configuration.
  • Vs_create_project. bat: creates a VS project.
  • Run_project. bat: Runs vs projects;

Take a look at the specific content of the three BATS.

Env. Bat:

SET WATCH_VC_DIR=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build
Copy the code

Vs_create_project. Bat:

@echo off call :prepare_env call :build_vs goto :EOF :prepare_env echo "call env.bat if exist" if exist env.bat (call env.bat) goto :EOF :build_vs if defined WATCH_VC_DIR ( echo "has WATCH_VC_DIR in env.bat" ) else ( echo "please set the 1 env variables: WATCH_VC_DIR in env.bat, and retry again." pause exit ) call "%WATCH_VC_DIR%\vcvarsall.bat" x64 if exist build (echo "build folder exist.") else (md build) cd build cmake -G "Visual Studio 16 2019" -A x64 .. cd .. / pause exitCopy the code

Run_project. Bat:

set SLN=.\build\tengine-lite.sln set VC_DIR=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build call "%VC_DIR%\vcvars64.bat" x64 set OPENCV_PATH=.\third_party\opencv\x64\vc15\bin SET "PATH=%OPENCV_PATH%; %PATH%" start devenv.exe %SLN%Copy the code

3. Build the Tengine Project

Put the three BATS mentioned above into the <Tengine_path> directory. Now that we have the above preparations in place, the process of building the Tengine project should be very easy.

If you want to build certain modules, you can turn the corresponding switch on, as I did with CONVERT_TOOL and QUANT_TOOL modules, as follows:

Bat -> vs_create_project.bat -> run_project.bat -> vs_create_project.bat -> run_project.bat -> run_project.bat

     

Then compile:

To prove I’m not talking nonsense, let me run bentchmark:

Win10 系 统 下 载 : Win10 系 统 下 载 : Win10 系 列 : Win10 系 列 : Win10 系 列 : Win10 系 列 : Win10 系 列 : Win10 系 列 : Win10 系 列 : Win10 系 列 : Win10 系 列 : Win10 系 列


Win10 cmake build Tengine project win10 Cmake build Tengine project