【问题标题】:Install Boost specific modules from GitHub从 GitHub 安装 Boost 特定模块
【发布时间】:2016-01-10 22:22:06
【问题描述】:

我正在编写一个克隆 Boost official repository 并仅初始化我需要的模块的脚本。

我阅读了git submodule man page,并找到了一种仅更新某些模块的方法。我什至不需要编译,因为我只使用multi_index

git clone -b boost-1.60.0 https://github.com/boostorg/boost.git boost
cd boost
git submodule update --init libs/multi_index/ tools/build

但我想通过使用模块名称(例如 multi_index.gitsubmodules 中找到)而不是路径(例如 libs\multi_index)来改进我的 git submodule update 命令

我怎样才能做到这一点?

另外,当我想使用该设置时,boost/version.hpp 不见了。
我执行了boostrap.sh./b2 --with-multi_index,但它回复了error: wrong library name 'multi_index' in the --with-<library> option.

如何生成CMake find_package(Boost REQUIRED) 需要的boost/version.hpp

/usr/share/cmake-3.0/Modules/FindBoost.cmake:699(文件)处的 CMake 错误: 文件 字符串文件 “/home/leflou/PROJECTS/tradingsuite/FinancialMarket/Server/boost/libs/boost/version.hpp” 无法读取。 调用堆栈(最近的调用优先): FinancialMarket/Server/CMakeLists.txt:5 (find_package)

【问题讨论】:

    标签: git boost github cmake git-submodules


    【解决方案1】:

    首先,每当更新库时,您都需要在主存储库中使用./b2 headers,因此库头文件的所有符号链接都会在boost/ 子目录中更新。

    您似乎忘记了 Multi Index 依赖于许多其他 boost 库 - 这些库需要在更新中同步。

    例如BMI 使用 MPL、元组和许多其他方法:

     60 boost/mpl
     56 boost/config.hpp
     39 boost/type_traits
     32 boost/detail
     29 boost/preprocessor
     17 boost/serialization
     11 boost/noncopyable.hpp
     10 boost/move
      7 boost/utility
      7 boost/tuple
      6 boost/static_assert.hpp
      5 boost/throw_exception.hpp
      5 boost/call_traits.hpp
      4 boost/operators.hpp
      4 boost/foreach_fwd.hpp
      4 boost/bind.hpp
      4 boost/archive (optional)
      3 boost/iterator
      2 boost/ref.hpp
      2 boost/limits.hpp
      2 boost/functional (for `hash`)
      2 boost/assert.hpp
      1 boost/integer
    

    您应该查看 BCP 以进行正确的提取

    【讨论】:

      猜你喜欢
      • 2016-07-08
      • 1970-01-01
      • 1970-01-01
      • 2017-12-06
      • 2019-03-02
      • 1970-01-01
      • 1970-01-01
      • 2020-02-01
      • 2018-06-25
      相关资源
      最近更新 更多