Ubuntu boost不包括/lib目录吗?

Ubuntu boost不包括/lib目录吗?,ubuntu,boost,cmake,Ubuntu,Boost,Cmake,我试图从源代码构建boost1.74.0库,以便使用cmake生成make文件。我不明白:根据boost安装页面,库的构建应该生成lib路径。但是,我只看到libs文件夹。 我使用 ./bootstrap.sh --with-libraries=system sudo apt-get install libbz2-dev ./b2 toolset=gcc cxxflags=-std=gnu++0x 并且得到了输出 Performing configuration checks - d

我试图从源代码构建boost
1.74.0
库,以便使用
cmake
生成make文件。我不明白:根据boost安装页面,库的构建应该生成
lib
路径。但是,我只看到libs文件夹。 我使用

./bootstrap.sh --with-libraries=system
sudo apt-get install libbz2-dev
./b2 toolset=gcc cxxflags=-std=gnu++0x
并且得到了输出

Performing configuration checks

    - default address-model    : 64-bit (cached)
    - default architecture     : x86 (cached)

Building the Boost C++ Libraries.



Component configuration:

    - atomic                   : not building
    - chrono                   : not building
    - container                : not building
    - context                  : not building
    - contract                 : not building
    - coroutine                : not building
    - date_time                : not building
    - exception                : not building
    - fiber                    : not building
    - filesystem               : not building
    - graph                    : not building
    - graph_parallel           : not building
    - headers                  : not building
    - iostreams                : not building
    - locale                   : not building
    - log                      : not building
    - math                     : not building
    - mpi                      : not building
    - nowide                   : not building
    - program_options          : not building
    - python                   : not building
    - random                   : not building
    - regex                    : not building
    - serialization            : not building
    - stacktrace               : not building
    - system                   : building
    - test                     : not building
    - thread                   : not building
    - timer                    : not building
    - type_erasure             : not building
    - wave                     : not building

...found 165 targets...
...updating 10 targets...
boost-install.generate-cmake-config- bin.v2/libs/headers/build/stage/boost_headers-config.cmake
boost-install.generate-cmake-config- bin.v2/libs/system/build/stage/boost_system-config.cmake
boost-install.generate-cmake-config-version- bin.v2/libs/system/build/stage/boost_system-config-version.cmake
common.copy /home/vm-umic/boost/boost_1_74_0/stage/lib/cmake/boost_system-1.74.0/boost_system-config.cmake
common.copy /home/vm-umic/boost/boost_1_74_0/stage/lib/cmake/boost_system-1.74.0/boost_system-config-version.cmake
common.copy /home/vm-umic/boost/boost_1_74_0/stage/lib/cmake/boost_headers-1.74.0/boost_headers-config.cmake
boost-install.generate-cmake-config-version- bin.v2/libs/headers/build/stage/boost_headers-config-version.cmake
common.copy /home/vm-umic/boost/boost_1_74_0/stage/lib/cmake/boost_headers-1.74.0/boost_headers-config-version.cmake
...updated 10 targets...


The Boost C++ Libraries were successfully built!

The following directory should be added to compiler include paths:

    /home/vm-umic/boost/boost_1_74_0

The following directory should be added to linker library paths:

    /home/vm-umic/boost/boost_1_74_0/stage/lib
所以我认为它起作用了。我看到
include
路径。但是我看不到
lib
路径。只有
libs
路径

自由之路在哪里?为什么没有建造呢

编辑: 文件的相关摘录如下。如您所见,它声明在顶层应该有一个lib\path?文档是否有误

boost_1_73_0\ .................The “boost root directory”
   index.htm .........A copy of www.boost.org starts here
   boost\ .........................All Boost Header files
   lib\ .....................precompiled library binaries
   libs\ ............Tests, .cpps, docs, etc., by library
     index.html ........Library documentation starts here
     algorithm\
     any\
     array\
                     …more libraries…
   status\ .........................Boost-wide test suite
   tools\ ...........Utilities, e.g. Boost.Build, quickbook, bcp
   more\ ..........................Policy documents, etc.
   doc\ ...............A subset of all Boost library docs
(这是从文档1.74中获取的,尽管在本摘录的顶部显示了1.73)。
我问这一切的原因是因为我想明确地将不同的文件夹交给
cmake

您找到的
libs
目录是源代码(库、测试、示例和文档)的所在地

仔细观察:

为了确保这一点,请注意其中的
stage/


因此,有路径
/home/vm-umic/boost/boost\u 1\u 74\u 0/stage/libs
,但没有路径
/home/vm-umic/boost/boost\u 1\u 74\u 0/stage/lib
。我对你的问题理解正确吗?@Tszvarev:差不多了。没有
/home/vm-umic/boost/boost\u 1\u 74\u 0/lib
,但是
/home/vm-umic/boost/boost\u 1\u 74\u 0/stage/lib
。为什么?文档是否有误?显示了解压缩归档文件(
tar--bzip2-xf/path/to/boost_1_73_0.tar.bz2
)后会得到什么。如果构建Boost,目录结构可能会有所不同。是否创建
stage/
子目录取决于构建Boost时传递的选项。安装后会发生什么?您现在只需要构建Boost,而不是根据您的命令安装它。可能需要为生成命令指定安装前缀。使用
/b2 install
将boost安装到生成后提供的目录中,请参阅并顺便说一句:完成此操作后,您不需要手动向cmake提供目录,因为安装附带了cmake配置脚本,允许您使用
find_包(Boost COMPONENTS…CONFIG)
,该包应为您提供导入的目标(
Boost::
)只要安装了boost的目录在
CMAKE_PREFIX_PATH
中,就包含信息。添加了一些注释以消除最可能出现的混淆。好的,但文档说明了其他情况,或者我忽略了什么?请参阅我对原始问题的编辑,因为文档中指出,库路径不应位于
/stage/lib
之下,而应直接位于
/lib
之下。如编辑中所述,我需要这些路径来包含
Boost\u INCLUDE\u DIRS
Boost\u LIBRARY\u DIRS
,因为自动查找很不幸无法工作。