mnn is mainly divided into 4 libraries that need to be compiled
(1) Inference part compilation
(2) Compilation of training part
(3) Convert partial compilation
(4) Quantized partial compilation
Compilation requires cmake, gcc, lib and protobuf
Generally the first three libraries are installed, so only protobuf is installed here
git clone https://github.com/google/protobuf.git
cd protobuf
git submodule update --init --recursive
./autogen.sh
./configure
make
make check
sudo make install
If the installation is successful, we can compile mnn
(1) Inference part compilation
cd mnn
./schema/generate.sh
mkdir build && cd build && cmake .. && make -j8
Note that if the cpu of the machine is not 8 cores, remove -j8, the same below
(2) Compilation of training part
The same is done under the build path
cmake .. -DMNN_BUILD_TRAIN=ON
make -j8
(3) Convert partial compilation
cd build
cmake .. -DMNN_BUILD_CONVERTER=true && make -j4
(4) Quantized partial compilation
cmake .. -DMNN_BUILD_QUANTOOLS=on
make
So far, the compilation is successful