找不到PROTOBUF编译器

时间:2017-10-11 22:04:49

标签: cmake protocol-buffers ubuntu-16.04 caffe

我试图用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

但是当我尝试cofke 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".

2 个答案:

答案 0 :(得分:4)

以下命令对我有用。

def ExtendPaths(paths, outEdges):
newPaths = []
for path in paths:                                              
    nextNodes = GetNextSegment(path[len(path) - 1], outEdges)   
    if len(nextNodes) == 0:
        j=5
    else:
        for node in nextNodes:                                      
            newPath = list(path)                                    
            newPath.append(node)                                    
            newPaths.append(newPath)                    
return newPaths

def ComparePaths(paths, putativeBubbleStartSegment):
length = len(paths)
for path1 in paths:
    for path2 in paths:
        if path2 != path1:
            if len(set(path1).intersection(path2)) > 0:
                #Bubble confirmed

答案 1 :(得分:0)

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

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

我试图只运行第二个命令,但是它不起作用。