首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >找不到Glog (缺少: GLOG_INCLUDE_DIR GLOG_LIBRARY)

找不到Glog (缺少: GLOG_INCLUDE_DIR GLOG_LIBRARY)
EN

Stack Overflow用户
提问于 2021-01-06 08:59:11
回答 2查看 3.2K关注 0票数 0

我正在尝试使用CMAKE在Ubuntu 20.04中安装openpose,我得到了以下错误:

代码语言:javascript
复制
Could NOT find Glog (missing: GLOG_INCLUDE_DIR GLOG_LIBRARY) 

我遵循了这里的说明(不幸的是,屏幕截图不可用,但我只是遵循了文本命令):https://github.com/CMU-Perceptual-Computing-Lab/openpose/blob/master/doc/installation/README.md

我在openpose文件夹中创建了一个build文件夹,然后运行cmake-gui ..命令。

将打开GUI,并选中所有这些选项(我不更改任何内容):

错误是:

代码语言:javascript
复制
GCC detected, adding compile flags
GCC detected, adding compile flags
Building with CUDA.
CUDA detected: 10.1
Added CUDA NVCC flags for: sm_75
cuDNN not found
Found gflags  (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libgflags.so)
Could NOT find Glog (missing: GLOG_INCLUDE_DIR GLOG_LIBRARY) 
CMake Warning at /usr/share/cmake-3.16/Modules/FindProtobuf.cmake:499 (message):
  Protobuf compiler version 3.13.0 doesn't match library version 3.6.1
Call Stack (most recent call first):
  CMakeLists.txt:429 (find_package)


Found Protobuf: /usr/lib/x86_64-linux-gnu/libprotobuf.so;-lpthread (found version "3.6.1") 
Found OpenCV: /usr (found version "4.2.0") 
cuDNN not found.
#!/bin/bash

echo "This script assumes Ubuntu 16 or 14 and Nvidia Graphics card up to 10XX. Otherwise, it will fail."

# Install cuDNN 5.1
if [[ $UBUNTU_VERSION == *"14."* ]] || [[ $UBUNTU_VERSION == *"15."* ]] || [[ $UBUNTU_VERSION == *"16."* ]]; then
    CUDNN_URL="http://developer.download.nvidia.com/compute/redist/cudnn/v5.1/cudnn-8.0-linux-x64-v5.1.tgz"
    wget -c ${CUDNN_URL}
    sudo tar -xzf cudnn-8.0-linux-x64-v5.1.tgz -C /usr/local
    rm cudnn-8.0-linux-x64-v5.1.tgz && sudo ldconfig
else
    echo "cuDNN NOT INSTALLED! Ubuntu 16 or 14 not found. Install cuDNN manually from 'https://developer.nvidia.com/cudnn'."
fi

CMake Error at CMakeLists.txt:520 (message):
  Install cuDNN using the above commands.  or turn off cuDNN by setting
  USE_CUDNN to OFF.


Configuring incomplete, errors occurred!
See also "/home/mona/research/code/openpose/build/CMakeFiles/CMakeOutput.log".
See also "/home/mona/research/code/openpose/build/CMakeFiles/CMakeError.log".

然后,我使用sudo apt-get install libgflags-dev命令安装了gflag,但仍然得到相同的错误。我该如何解决这个问题呢?

这是用于查看我在哪个版本的存储库中重现错误的git log

代码语言:javascript
复制
$ git log
commit a255747af22116ad76004437456bb531dc5d0b23 (HEAD -> master, origin/master, origin/HEAD)
Author: Wlad Meixner <9556979+gosticks@users.noreply.github.com>
Date:   Mon Dec 21 22:01:10 2020 +0100

    Fix possible typo (#1802)

可以在https://github.com/CMU-Perceptual-Computing-Lab/openpose/issues/1814中找到CMakeOutput.log和CMakeError.log

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2021-01-06 09:24:34

代码语言:javascript
复制
$ sudo apt install libgoogle-glog-dev 

另外,

代码语言:javascript
复制
$ sudo apt-get install libgflags-dev
$ sudo apt install libgoogle-glog-dev
$ sudo apt-get install protobuf-compiler libprotobuf-dev

因为最初我没有安装其中任何一个。

票数 1
EN

Stack Overflow用户

发布于 2021-01-06 17:23:44

如果你是从命令行运行的,你应该已经看到它们了…

代码语言:javascript
复制
 if (NOT GLOG_FOUND)
    message(FATAL_ERROR "Glog not found. Install Glog from the command line using the command(s) -\
      sudo apt-get install libgoogle-glog-dev")
  endif (NOT GLOG_FOUND)

  if (NOT GFLAGS_FOUND)
    message(FATAL_ERROR "GFlags not found. Install GFlags from the command line using the command(s) --\
      sudo apt-get install libgflags-dev")
  endif (NOT GFLAGS_FOUND)

  if (NOT OpenCV_FOUND)
    message(FATAL_ERROR "OpenCV not found. Install OpenCV from the command line using the command(s) --\
      sudo apt-get install libopencv-dev")
  endif (NOT OpenCV_FOUND)

参考:https://github.com/CMU-Perceptual-Computing-Lab/openpose/blob/5a9acc730915f2171badcf10076aef9213f38e01/CMakeLists.txt#L523-L537

注意:一个更好的方法是在第三方不存在的时候使用FetchContent() (因为他们提供了基于CMake的构建),而且提供的命令也只是ubuntu...

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65588745

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档