1.參考https://www.ziiai.com/blog/194
下載編譯源碼
git clone https://github.com/Tencent/ncnn
下載完成後,需要對源碼進行編譯
cd ncnn mkdir build && cd build cmake .. make -j make install
出現錯誤,protobuf有關。Could NOT find Protobuf
2.參考https://www.jianshu.com/p/6bf604c9748a
但是安裝的是protobuf-3.9.2。結果又報錯。Protobuf compiler version 3.9.2 doesn't match library version 2.6.1
原文如下,
下載:
https://github.com/google/protobuf/releases --> protobuf-all-3.6.0.zip
編譯安裝流程(注意加上sudo防止創建目錄權限不足):
unzip protobuf-all-3.6.0.zip
cd protobuf-all-3.6.0
./autogen.sh
./configure --prefix=/usr/local/protobuf
(https://www.cnblogs.com/darkknightzh/p/5782992.html ./configure --prefix=/usr)
sudo make -j8 && sudo make install
ldconfig
環境變量配置:
sudo gedit ~/.bashrc
添加: PATH=/usr/local/protobuf/bin:$PATH(如果findpackage報錯注意添加lib和include到環境變量)
source ~/.bashrc
3.抓緊又下了個protobuf-2.6.1,按照2步驟再走一遍,結果就能把ncnn安裝上了。具體怎麼回事,以後再研究。