facebookresearch / robust_cvd

Robust Consistent Video Depth Estimation

Home Page:https://robust-cvd.github.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problem when running `cmake ..` for robust_cvd codebase

kayleeliyx opened this issue · comments

Has anyone met this problem before?

-- Robust Consistent Video Depth Estimation
-- Found glog:
--   (Headers)       /usr/include
--   (Library)       /usr/lib/x86_64-linux-gnu/libglog.so
-- Found pybind11: /home/ubuntu/.conda/envs/depth/include (found version "2.6.2" )
-- Found required Ceres dependency: Eigen version 3.3.9 in /home/ubuntu/.conda/envs/depth/include/eigen3
-- Found required Ceres dependency: glog
-- Found required Ceres dependency: gflags
-- Found Ceres version: 2.0.0 installed in: /home/ubuntu/.conda/envs/depth with components: [EigenSparse, SparseLinearAlgebraLibrary, LAPACK, SuiteSparse, CXSparse, SchurSpecializations, Multithreading]
-- Boost version: 1.65.1
-- Found the following Boost libraries:
--   system
--   filesystem
--   program_options
-- Pybind11 version: 2.6.2
-- Python   version: 3.6
You have called ADD_LIBRARY for library lib_cvd without any source files. This typically indicates a problem with your CMakeLists.txt file
-- Configuring done
CMake Warning at /home/ubuntu/.conda/envs/depth/share/cmake/pybind11/pybind11Tools.cmake:166 (add_library):
  Cannot generate a safe runtime search path for target lib_python because
  files in some directories may conflict with libraries in implicit
  directories:

    runtime library [libglog.so.0] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/ubuntu/.conda/envs/depth/lib

  Some of these libraries may not be found correctly.
Call Stack (most recent call first):
  CMakeLists.txt:53 (pybind11_add_module)


-- Generating done
-- Build files have been written to: /home/ubuntu/Downloads/cvd2/lib/build


What version of Ubuntu are you running?

What version of Ubuntu are you running?

Distributor ID: Ubuntu
Description: Ubuntu 18.04.4 LTS
Release: 18.04

They said "Will switch to git cloning from our public repo soon." May be it make sense to wait.

Hey @karliell, the system for Colab should also be Ubuntu 18.04 LTS. Have you exactly followed the steps as Colab and still encountered these errors?

@semel1 Yep, just updated the notebook to git clone from the github repo.

Hey @karliell, the system for Colab should also be Ubuntu 18.04 LTS. Have you exactly followed the steps as Colab and still encountered these errors?

Everything works perfectly on colab. But I met several problems while installing it on my own PC.

I have the same problem with you @karliell. Do you have any solution? In fact, I have to execute the cp /usr/bin/python3.6m /usr/include/python3.6m manually before that.

I'm on Ubuntu 20.04, Python 3.8 in a conda env.

I kept getting this error when running "cmake ..":

CMake Error at CMakeLists.txt:27 (message):
  glog not found

So I followed the instructions from here: https://stackoverflow.com/questions/65588745/could-not-find-glog-missing-glog-include-dir-glog-library
$ 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

and now I'm seeing this error:


-- Robust Consistent Video Depth Estimation
-- Found glog:
--   (Headers)       /usr/include
--   (Library)       /usr/lib/x86_64-linux-gnu/libglog.so
CMake Error at CMakeLists.txt:30 (find_package):
  By not providing "Findpybind11.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "pybind11",
  but CMake did not find one.

  Could not find a package configuration file provided by "pybind11" with any
  of the following names:

    pybind11Config.cmake
    pybind11-config.cmake

  Add the installation prefix of "pybind11" to CMAKE_PREFIX_PATH or set
  "pybind11_DIR" to a directory containing one of the above files.  If
  "pybind11" provides a separate development package or SDK, be sure it has
  been installed.


-- Configuring incomplete, errors occurred!
See also "/content/cvd2/lib/build/CMakeFiles/CMakeOutput.log".

Any assistance would be great, I'm definitely confused.

commented

Has anyone met this problem before?

-- Robust Consistent Video Depth Estimation
-- Found glog:
--   (Headers)       /usr/include
--   (Library)       /usr/lib/x86_64-linux-gnu/libglog.so
-- Found pybind11: /home/ubuntu/.conda/envs/depth/include (found version "2.6.2" )
-- Found required Ceres dependency: Eigen version 3.3.9 in /home/ubuntu/.conda/envs/depth/include/eigen3
-- Found required Ceres dependency: glog
-- Found required Ceres dependency: gflags
-- Found Ceres version: 2.0.0 installed in: /home/ubuntu/.conda/envs/depth with components: [EigenSparse, SparseLinearAlgebraLibrary, LAPACK, SuiteSparse, CXSparse, SchurSpecializations, Multithreading]
-- Boost version: 1.65.1
-- Found the following Boost libraries:
--   system
--   filesystem
--   program_options
-- Pybind11 version: 2.6.2
-- Python   version: 3.6
You have called ADD_LIBRARY for library lib_cvd without any source files. This typically indicates a problem with your CMakeLists.txt file
-- Configuring done
CMake Warning at /home/ubuntu/.conda/envs/depth/share/cmake/pybind11/pybind11Tools.cmake:166 (add_library):
  Cannot generate a safe runtime search path for target lib_python because
  files in some directories may conflict with libraries in implicit
  directories:

    runtime library [libglog.so.0] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/ubuntu/.conda/envs/depth/lib

  Some of these libraries may not be found correctly.
Call Stack (most recent call first):
  CMakeLists.txt:53 (pybind11_add_module)


-- Generating done
-- Build files have been written to: /home/ubuntu/Downloads/cvd2/lib/build

I have this problem too. And solve it in the following ways:

(1) You can view the installation path of glog on the computer through the following command:
$locate glog
As you can see, there are so many glog versions. So you need to specify which version to use.
(2) For me, I want to use the glog installed in /usr/local/include, which is compiled by cmake. It has the same path as the version in the offical colab.

So I changed the CMakeLists.txt file as follows:

cmake_minimum_required(VERSION 3.3)

message(STATUS "Robust Consistent Video Depth Estimation")

project (lib_python)


set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_OUTPUT_EXTENSION_REPLACE 1)
set(CMAKE_CXX_FLAGS_DEBUG "-fPIC")
set(CMAKE_CXX_FLAGS_RELEASE "-fPIC")
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(PYBIND11_CPP_STANDARD -std=c++17)
set(PYBIND11_PYTHON_VERSION 3.6)
set(ENABLE_PRECOMPILED_HEADERS OFF)

# cam change
set(glog_DIR "/usr/local/lib/cmake/glog/")
set(GLOG_INCLUDE_DIR "/usr/local/include/")
set(GLOG_LIBRARY "/usr/local/lib/")
message(STATUS "Found glog:")
message(STATUS "  (Headers)       ${GLOG_INCLUDE_DIR}")
message(STATUS "  (Library)       ${GLOG_LIBRARY}")

find_package(pybind11 REQUIRED)
find_package(OpenCV REQUIRED)
find_package(Eigen3 REQUIRED NO_MODULE)
find_package(gflags REQUIRED)

#cam change
find_package(glog REQUIRED NO_MODULE PATHS /usr/local/include/ NO_DEFAULT_PATH)

find_package(Ceres REQUIRED)
find_package(Boost COMPONENTS system filesystem program_options REQUIRED)
find_package(fmt REQUIRED)

message(STATUS "Pybind11 version: ${pybind11_VERSION}")
message(STATUS "Python   version: ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}")

include_directories(core ${GLOG_INCLUDE_DIR} ${GFLAGS_INCLUDE_DIR} ${CERES_INCLUDE_DIR} ${Boost_INCLUDE_DIRS} ${EIGEN3_INCLUDE_DIR} ${OpenCV_INCLUDE_DIRS})

add_library(lib_cvd STATIC)
file(GLOB SOURCES "*.cpp" "core/*.cpp")
list(FILTER SOURCES EXCLUDE REGEX "PythonBindings.cpp")
target_sources(lib_cvd PUBLIC ${SOURCES})
target_include_directories(lib_cvd
                       PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
                       PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/core
                       )

pybind11_add_module(lib_python PythonBindings.cpp)
target_link_libraries(lib_python PRIVATE lib_cvd fmt::fmt Ceres::ceres ${GLOG_LIBRARY} ${GFLAGS_LIBRARY} ${OpenCV_LIBS} Boost::filesystem Boost::system Boost::program_options Eigen3::Eigen pybind11::embed)`

Enjoy!

I actually just commented out the glob part in the script since it already establishes that it has found the correct library. It works fine luckily but I'm sure the answer by @camCX above is better ;)