【问题标题】:Boost bjam doesn't put compiler version in filenameBoost bjam 不会将编译器版本放在文件名中
【发布时间】:2019-04-30 09:29:01
【问题描述】:

过去,b2 / bjam 会构建这样命名的库:

libboost_wserialization-gcc48-mt-d-1_60.so(注-gcc48-)

我刚刚从 git 克隆了 boost,并正在尝试使用 G++ 8.3.0 进行编译, 但它生成的库被命名为:

libboost_atomic-gcc-mt-d-x64-1_66.so(注意-gcc-)

我(和 CMake)期待它被命名:

libboost_atomic-gcc83-mt-d-x64-1_66.so (注意 -gcc83-)

为了构建,我做了:

./bootstrap.sh --with-libraries="atomic" --prefix=`pwd`/install
./b2 --layout=versioned link=shared variant=debug threading=multi cflags=-fPIC cxxflags=-fPIC

我尝试用谷歌搜索,但没有发现任何表明我做错了什么,我的理解是 --layout=versioned 应该导致库名称中的编译器和版本号...

谢谢

【问题讨论】:

  • 您是否更新了子模块(如果有)?还要指定您要编译哪个版本?根据我的经验,我发现1.69.0 是最高稳定版本。但我从 boost.org 下载了库。
  • 嗯我没有,所以我做了 git pull; git 子模块更新;现在 b2 说: boost-install.jam: 没有这样的文件或目录...接下来我会尝试编译一个 tarball。
  • 好的,tarball 确实为它添加了一个版本,但还不够... libboost_atomic-gcc8-mt-d-x64-1_70.so 请注意它的 gcc8 不是 gcc83 ... 啊
  • 所以你现在用 tarball 编译它?
  • 是的。焦油 xfv boost_1_70_0.tar.bz2 ; cd boost_1_70_0/; ./bootstrap.sh --with-libraries="atomic" ; ./b2 --layout=versioned link=shared variant=debug threading=multi cflags=-fPIC cxxflags=-fPIC ; ls -l stage/lib === libboost_atomic-gcc8-mt-d-x64-1_70.so

标签: c++ boost bjam


【解决方案1】:

邮件列表中的答案:

Possibly, it's related to the change in GCC 5+ versioning.
This was accommodated in Boost.Build in October 2018
https://github.com/boostorg/build/pull/349
that is, in Boost 1.69
(boostorg/build should use milestones for issues, IMO)


BTW, there are also CMake's issues in FindCMake.cmake
related to the compiler  and architecture tag. So, you may have to
specify  Boost_COMPILER and Boost_ARCHITECTURE hints
in order to help FindBoost.cmake recognise versioned names.

https://lists.boost.org/Archives/boost/2019/04/246127.php

解决方法的提示: https://cmake.org/pipermail/cmake/2018-October/068459.html https://gitlab.kitware.com/cmake/cmake/issues/17701

【讨论】:

    猜你喜欢
    • 2023-02-01
    • 1970-01-01
    • 1970-01-01
    • 2013-12-04
    • 1970-01-01
    • 2017-02-08
    • 1970-01-01
    • 1970-01-01
    • 2015-08-25
    相关资源
    最近更新 更多