ncnn icon indicating copy to clipboard operation
ncnn copied to clipboard

Build for Ubuntu16.04 : why protobuf not find,是未找到protobuf 吗

Open llhe110 opened this issue 2 years ago • 2 comments

detail | 详细描述

依赖都已经按照要求安装。 运行编译的命令:cmake -DCMAKE_BUILD_TYPE=Release -DNCNN_VULKAN=OFF -DNCNN_BUILD_EXAMPLES=ON .. 发生如下错误。

  • Target arch: x86 64bit -- OpenCV library: /usr -- version: 2.4.9.1 -- libraries: opencv_core;opencv_highgui;opencv_imgproc -- include path: /usr/include/opencv;/usr/include CMake Warning at tools/caffe/CMakeLists.txt:2 (find_package): **Could not find a package configuration file provided by "protobuf" with any of the following names:

    protobufConfig.cmake protobuf-config.cmake**

    Add the installation prefix of "protobuf" to CMAKE_PREFIX_PATH or set "protobuf_DIR" to a directory containing one of the above files. If "protobuf" provides a separate development package or SDK, be sure it has been installed.

CMake Error at tools/caffe/CMakeLists.txt:18 (if): if given arguments:

"DEFINED" "PROTOBUF_VERSION" "AND" "PROTOBUF_VERSION" "VERSION_GREATER_EQUAL" "3.22"

Unknown arguments specified

-- Configuring incomplete, errors occurred!

llhe110 avatar Jan 14 '24 11:01 llhe110

cmake -DNCNN_BUILD_TOOLS=OFF .. 可以跳过工具编译,caffe2ncnn这些工具可以在 release 里下载编译好的二进制程序

nihui avatar Jan 15 '24 02:01 nihui

谢谢。您提供的方法。 另外我重新手动安装了 protocolbuffers,也编译通过了。

sudo apt-get install autoconf automake libtool curl make g++ unzip
git clone -b v3.6.1 https://github.com/protocolbuffers/protobuf.git
cd protobuf
git submodule update --init --recursive
./autogen.sh
./configure
make
make check
sudo make install
sudo ldconfig
protoc --version  #输出版本号成功

llhe110 avatar Jan 16 '24 01:01 llhe110

请关闭issue

sxj731533730 avatar Feb 20 '24 01:02 sxj731533730