2

I'm trying to build this project https://github.com/DLuensch/StereoVision-ADCensus, in Windows10 environment. As it tells, I need openCV, boost, libConfig, PCL, OpenMP, Qt 4.8X established. I don't really know what all of those libraries are, but, well, I just follow the instruction provided. When I tried the cmake .. command to build the project, CMake raised error "Unable to find the requested Boost libraries", which is shown as below

E:\>cd E:\Projects\VisualStudioProjects\StereoVision-ADCensus-master\StereoVision-ADCensus-master\ADCensusBM\build

E:\Projects\VisualStudioProjects\StereoVision-ADCensus-master\StereoVision-ADCensus-master\ADCensusBM\build>cmake ..
-- Building for: Visual Studio 15 2017
-- The C compiler identification is MSVC 19.15.26730.0
-- The CXX compiler identification is MSVC 19.15.26730.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.15.26726/bin/Hostx86/x86/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.15.26726/bin/Hostx86/x86/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.15.26726/bin/Hostx86/x86/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.15.26726/bin/Hostx86/x86/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found OpenMP_C: -openmp (found version "2.0")
-- Found OpenMP_CXX: -openmp (found version "2.0")
-- Found OpenMP: TRUE (found version "2.0")
OPENMP FOUND
CMake Warning (dev) at CMakeLists.txt:27 (find_package):
  Policy CMP0074 is not set: find_package uses <PackageName>_ROOT variables.
  Run "cmake --help-policy CMP0074" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.

  Environment variable Boost_ROOT is set to:

    E:\BOOST\boost_1_70_0\boost_1_70_0

  For compatibility, CMake is ignoring the variable.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Error at D:/Applications/CMake/share/cmake-3.14/Modules/FindBoost.cmake:2165 (message):
  Unable to find the requested Boost libraries.

  Boost version: 1.70.0

  Boost include path: E:/BOOST/boost_1_70_0/boost_1_70_0

  Could not find the following static Boost libraries:

          boost_filesystem
          boost_system

  No Boost libraries were found.  You may need to set BOOST_LIBRARYDIR to the
  directory containing Boost libraries or BOOST_ROOT to the location of
  Boost.
Call Stack (most recent call first):
  CMakeLists.txt:27 (find_package)


CMake Error at CMakeLists.txt:36 (find_package):
  By not providing "FindPCL.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "PCL", but
  CMake did not find one.

  Could not find a package configuration file provided by "PCL" (requested
  version 1.2) with any of the following names:

    PCLConfig.cmake
    pcl-config.cmake

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


-- Configuring incomplete, errors occurred!
See also "E:/Projects/VisualStudioProjects/StereoVision-ADCensus-master/StereoVision-ADCensus-master/ADCensusBM/build/CMakeFiles/CMakeOutput.log".

I'm not so familiar about CMake or BOOST. in fact, I hadn't known them until yesterday. So I can't clearly figure out what the problem is.

First I searched the files in the BOOST path, and, yes, there's no file named "boost_filesystem" or "boost_system". I doubt if my boost version is not matching. Then I looked into the "CMakeLists.txt" file. I found statement like

# Under Windows the system variable "BOOST_ROOT" must be set to the location of the root directory of Boost.
if(WIN32)
  set(Boost_USE_STATIC_LIBS ON)
  set(Boost_USE_STATIC ON)
endif(WIN32)
SET(Boost_ADDITIONAL_VERSIONS "1.47" "1.47.0")
set(Boost_NO_BOOST_CMAKE ON)
find_package(Boost 1.40.0 COMPONENTS filesystem system REQUIRED)
set(BOOST_FOUND ${Boost_FOUND})
set(BOOST_INCLUDE_DIRS "${Boost_INCLUDE_DIR}")
set(BOOST_LIBRARY_DIRS "${Boost_LIBRARY_DIRS}")
set(BOOST_LIBRARIES ${Boost_LIBRARIES})
INCLUDE_DIRECTORIES(${BOOST_INCLUDE_DIRS})
SET(LIBS ${LIBS} ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_DATE_TIME_LIBRARY})

Does it means I should use BOOST 1.47.0 (I've downloaded 1.70.0 now)? And, does "set(Boost_NO_BOOST_CMAKE ON)" means I can even build this project without CMake? Since I think the CMake progress is shut down failed because of not the missing of BOOST, but PCL(which I haven't tried to handle yet). If I can skip handling with BOOST problems, I'd like to, because I'm in somewhat a hurry. Or do I have to deal woth it? Hoping for help. Thanks in advance :)

Flicic
  • 109
  • 8
  • The error message `Could not find the following static Boost libraries` is clear: CMake cannot find given static libraries. You may run cmake with additional option `-DBoost_DEBUG=ON`, and it will show you exact filenames which are searched. Check that you have given filenames in your Boost installation. If you haven't, then you need to find Boost installation which contains given files. – Tsyvarev Jul 11 '19 at 07:37
  • I suppose you downloaded the Boost sources and not the binary distribution. See https://sourceforge.net/projects/boost/files/boost-binaries/1.70.0/boost_1_70_0-msvc-14.1-32.exe/download to get the appropriate version for your compiler (MSVC2017) and architecture (32-bit). The site is run by some Boost maintainers and therefore I trust it. https://sourceforge.net/projects/boost/files/boost-binaries/1.70.0/ has all flavors for other architectures and compiler versions. – vre Jul 11 '19 at 07:59

1 Answers1

0

cmake just has an issue that it can't find the boost library files boost_filesystem and boost_system to link with the version of boost that you've installed.

cmake needs BOOST_LIBRARYDIR to be set to the directory where the library files are stored, like you set BOOST_ROOT to the directory where you installed boost.

The boost library files are not built by default when you install boost see: boost: prepare to use a library binary. You can build the libraries yourself, as described here. However, it is easier just to download and install the relevant binary from here.

Note: the CMakeLists.txt file line:

find_package(Boost 1.40.0 COMPONENTS filesystem system REQUIRED)

requires a minimum boost version of 1.40.0. You should be OK with boost version 1.70 unless something has changed which has broken backward compatibility.
Versions 1.40 and 1.47 referenced in the CMakeLists.txt file are very old...

kenba
  • 4,303
  • 1
  • 23
  • 40
  • Thank you. I'll try. I didn't set BOOST_LIBRARYDIR at first because CMake used "or" to connect the instruction of setting those two variables. Then I've forgotten this variable... – Flicic Jul 11 '19 at 11:56