Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
674 views
in Technique[技术] by (71.8m points)

c++ - Could NOT find Glog (missing: GLOG_INCLUDE_DIR GLOG_LIBRARY)

I am trying to install openpose in Ubuntu 20.04 using CMAKE and I get the following error:

Could NOT find Glog (missing: GLOG_INCLUDE_DIR GLOG_LIBRARY) 

I am following the instructions here (unfortunately, the screenshots are not available but I just followed the textual commands): https://github.com/CMU-Perceptual-Computing-Lab/openpose/blob/master/doc/installation/README.md

I made a build folder in openpose folder and then ran the cmake-gui .. command.

A GUI opens with all these checked (I don't change anything): enter image description here

and the error is:

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".

Then, I installed gflags using sudo apt-get install libgflags-dev command but I still get the same error. How could I fix this problem?

This is the git log to see which version of repo I am at for reproducing the error:

$ git log
commit a255747af22116ad76004437456bb531dc5d0b23 (HEAD -> master, origin/master, origin/HEAD)
Author: Wlad Meixner <[email protected]>
Date:   Mon Dec 21 22:01:10 2020 +0100

    Fix possible typo (#1802)

The CMakeOutput.log and CMakeError.log can be found here https://github.com/CMU-Perceptual-Computing-Lab/openpose/issues/1814

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

If you have run it from the command line you should have see them...

 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)

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

note: A better way, would be to use FetchContent() when third parties are missing (since they provide a CMake based build), also the command provided is ubuntu only...


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...