4 首先写在掉原来linux系统中的libprotobuf-dev protobuf-compiler、pip uninstall protobuf
sudo apt-get autoremove libprotobuf-dev protobuf-compiler
./configure --prefix=/usr/local/protobuf
make
sudo make install
export PATH=$PATH:/usr/local/protobuf/bin/
export PKG_CONFIG_PATH=/usr/local/protobuf/lib/pkgconfig/
- 在include_directories中,第298行添加
/usr/local/protobuf/include
- 拷贝缺失的文件
- /usr/lib/x86_64-linux-gnu目录下执行
sudo cp /usr/local/protobuf/lib/libprotobuf.so ./
cp /usr/local/protobuf/bin/protoc ./
cd MNN
./schema/generate.sh
mkdir
build
cd build
cmake .. -DMNN_BUILD_CONVERTER=true && make -j4
- 会在MNN/build目录下生成MNNConvert可执行文件 (修改了以后要在ncnn目录下的CMakeLists中添加include_directories(/usr/local/protobuf/include)