-
1 .CMake Unable to find the requested Boost libraries.
CMake Error at /opt/cmake-3.9.1/share/cmake-3.9/Modules/FindBoost.cmake:1879 (message):
Unable to find the requested Boost libraries.
Boost version: 1.58.0
Boost include path: /usr/include
Could not find the following Boost libraries:
boost_program_options
Some (but not all) of the required Boost libraries were found. You may
need to install these additional Boost libraries. Alternatively, set
BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT
to the location of Boost.
Call Stack (most recent call first):
VINS-Mono/camera_model/CMakeLists.txt:16 (find_package)
-- Found installed version of Eigen: /usr/lib/cmake/eigen3
-- Found required Ceres dependency: Eigen version 3.2.92 in /usr/include/eigen3
-- Found required Ceres dependency: glog
-- Found required Ceres dependency: gflags
-- Found Ceres version: 2.0.0 installed in: /usr/local with components: [EigenSparse, SparseLinearAlgebraLibrary, CXSparse, SchurSpecializations]
-- +++ processing catkin package: 'ar_demo'
-- ==> add_subdirectory(VINS-Mono/ar_demo)
-- +++ processing catkin package: 'feature_tracker'
-- ==> add_subdirectory(VINS-Mono/feature_tracker)
-- +++ processing catkin package: 'pose_graph'
-- ==> add_subdirectory(VINS-Mono/pose_graph)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
-- Found installed version of Eigen: /usr/lib/cmake/eigen3
-- Found required Ceres dependency: Eigen version 3.2.92 in /usr/include/eigen3
-- Found required Ceres dependency: glog
-- Found required Ceres dependency: gflags
-- Found Ceres version: 2.0.0 installed in: /usr/local with components: [EigenSparse, SparseLinearAlgebraLibrary, CXSparse, SchurSpecializations]
-- +++ processing catkin package: 'vins_estimator'
-- ==> add_subdirectory(VINS-Mono/vins_estimator)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
-- Found installed version of Eigen: /usr/lib/cmake/eigen3
-- Found required Ceres dependency: Eigen version 3.2.92 in /usr/include/eigen3
-- Found required Ceres dependency: glog
-- Found required Ceres dependency: gflags
-- Found Ceres version: 2.0.0 installed in: /usr/local with components: [EigenSparse, SparseLinearAlgebraLibrary, CXSparse, SchurSpecializations]
-- Configuring incomplete, errors occurred!
See also "/home/sun/VINS-Mono/build/CMakeFiles/CMakeOutput.log".
See also "/home/sun/VINS-Mono/build/CMakeFiles/CMakeError.log".
Invoking "cmake" failed
解决办法:
修改CMakeLIsts:如下
#find_package(Boost REQUIRED COMPONENTS filesystem program_options system)
#include_directories(${Boost_INCLUDE_DIRS})
FIND_PACKAGE(Boost)
IF (Boost_FOUND)
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR})
ADD_DEFINITIONS( "-DHAS_BOOST" )
ENDIF()
参考资料:
【1】https://stackoverflow.com/questions/3808775/cmake-doesnt-find-boost
【2】http://www.it1352.com/323838.html