找不到 PROTOBUF 编译器

Could not find PROTOBUF Compiler

我想用 Caffe 做一个 CMake,但是我的系统找不到 protobuf 编译器。我之前安装过protobuf2.7.0。现在我切换回 2.6.1。我如何配置我的 CMake 以识别 protobuf2.6.1 编译器?

我已经完成了

$ sudo apt-get install  libprotobuf-dev protobuf-compiler
$ protoc --version
libprotoc 2.6.1

但是当我尝试 cmake Caffe 时,它​​仍然给我错误

user@user-computer:~/caffe/build$ cmake -DBLAS=open ..
-- Boost version: 1.58.0
-- Found the following Boost libraries:
--   system
--   thread
--   filesystem
--   chrono
--   date_time
--   atomic
-- Found gflags  (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libgflags.so)
-- Found glog    (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libglog.so)
CMake Error at cmake/ProtoBuf.cmake:13 (message):
  Could not find PROTOBUF Compiler
Call Stack (most recent call first):
  cmake/Dependencies.cmake:43 (include)
  CMakeLists.txt:46 (include)


-- Configuring incomplete, errors occurred!
See also "/home/user/caffe/build/CMakeFiles/CMakeOutput.log".
See also "/home/user/caffe/build/CMakeFiles/CMakeError.log".

以下命令对我有用。

 apt-get install protobuf-compiler

我遇到了同样的问题。我通过运行ning以下命令解决了它:

sudo apt-get remove protobuf-compiler
sudo apt-get install protobuf-compiler

我曾尝试 运行 仅第二个命令,但它不起作用。