boost_chrono_FOUND 为 FALSE,因此包 "boost_chrono" 被视为未找到

boost_chrono_FOUND to FALSE so package "boost_chrono" is considered to be NOT FOUND

我正在尝试构建 ripple by following the build guide on GitHub,但 boost 不断抛出一些未知错误。 Boost 已安装并且 运行。我按照构建指南的描述安装了 boost_1_71_0

/home/usman/Downloads/clion-2020.1.2/bin/cmake/linux/bin/cmake -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - Unix Makefiles" /home/usman/Desktop/ripple/rippled
-- Using 4 cores for ExternalProject builds.
-- rippled version: 1.6.0
-- NIH-EP cache path: /home/usman/Desktop/ripple/rippled/.nih_c/unix_makefiles/GNU_9.3.0/Debug
-- using [01bd5a2646cda78ee09d2067c287c8f89872736d] as build container tag...
-- docker local user id: 1000
-- docker local group id: 1000
-- BOOST_ROOT: /usr/local
-- BOOST_LIBRARYDIR: /usr/local/lib/
CMake Error at /usr/local/lib/cmake/Boost-1.71.0/BoostConfig.cmake:117 (find_package):
  Found package configuration file:

    /usr/local/lib/cmake/boost_chrono-1.71.0/boost_chrono-config.cmake

  but it set boost_chrono_FOUND to FALSE so package "boost_chrono" is
  considered to be NOT FOUND.  Reason given by package:

  No suitable build variant has been found.

  The following variants have been tried and rejected:

  * libboost_chrono.so.1.71.0 (shared, Boost_USE_STATIC_LIBS=ON)

  * libboost_chrono.a (shared runtime, Boost_USE_STATIC_RUNTIME=ON)

Call Stack (most recent call first):
  /usr/local/lib/cmake/Boost-1.71.0/BoostConfig.cmake:182 (boost_find_component)
  Builds/CMake/deps/FindBoost.cmake:273 (find_package)
  Builds/CMake/deps/Boost.cmake:50 (find_package)
  CMakeLists.txt:43 (include)


-- Configuring incomplete, errors occurred!
See also "/home/usman/Desktop/ripple/rippled/cmake-build-debug/CMakeFiles/CMakeOutput.log".
See also "/home/usman/Desktop/ripple/rippled/cmake-build-debug/CMakeFiles/CMakeError.log".

[Finished]

有一个类似的问题,但你的问题似乎是相反的。

错误的重要部分在这里:

No suitable build variant has been found.

The following variants have been tried and rejected:

* libboost_chrono.so.1.71.0 (shared, Boost_USE_STATIC_LIBS=ON)

* libboost_chrono.a (shared runtime, Boost_USE_STATIC_RUNTIME=ON)

它向您显示找到了哪些库,甚至给出了为什么它们被拒绝的原因。在您的计算机上找到的所有库都是 shared 库。但是,您的 CMake 配置表明您 不想 使用共享库(Boost_USE_STATIC_LIBS=ONBoost_USE_STATIC_RUNTIME=ON)。要修复错误,您有两个选择:

  1. Boost_USE_STATIC_LIBS 设置为 OFF 并将 Boost_USE_STATIC_RUNTIME 设置为 OFF:

     set(Boost_USE_STATIC_LIBS OFF)
     set(Boost_USE_STATIC_RUNTIME OFF)
     find_package(Boost ... )
    
  2. 同时构建 static Boost 库,因此不仅共享库在您的计算机上可用。