c++ - 找不到 Glog(缺少 : GLOG_INCLUDE_DIR GLOG_LIBRARY)

标签 c++ cmake cmake-gui glog

我正在尝试使用 CMAKE 在 Ubuntu 20.04 中安装 openpose,但出现以下错误:

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 打开并检查了所有这些(我没有改变任何东西): enter image description here

错误是:

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 命令安装了 gflags,但我仍然遇到同样的错误。我该如何解决这个问题?

这是 git log 以查看我在哪个版本的 repo 重现错误:

$ 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)

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

enter image description here

最佳答案

$ sudo apt install libgoogle-glog-dev 

此外,

$ sudo apt-get install libgflags-dev
$ sudo apt install libgoogle-glog-dev
$ sudo apt-get install protobuf-compiler libprotobuf-dev

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

关于c++ - 找不到 Glog(缺少 : GLOG_INCLUDE_DIR GLOG_LIBRARY),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65588745/

相关文章:

c++ - wxwidgets:使用 CMake 链接到 wxMediaCtrl

cmake - 只运行一次 CMake superbuild

qt - 如何在 Windows 上使用 cmake find_package 设置 qt5 路径?

c++ - CMake 图形用户界面 : Specify library path for Windows

windows - CMakeGUI 不显示输出日志

c++ - 如何在单个 for 循环中反转链表?

C++从文本文件中读取,双行

c++ - 链接 : fatal error LNK1104: cannot open file 'libcollada14dom21.lib'

python - .build_release/lib/libcaffe.so : undefined reference to `boost::python::import(boost::python::str)'

qt - Ubuntu 13.04 -> opencv 和 qt 安装