【问题标题】:How to enable (lockfree boost::atomic_flag : "no (cached)") on Solaris-10 while building Boost如何在构建 Boost 时在 Solaris-10 上启用 (lockfree boost::atomic_flag : "no (cached)")
【发布时间】:2016-12-07 14:21:56
【问题描述】:

我实际上是 Boost 库的新手,目前正在尝试在 Solaris-10 平台上构建 boost 库, 以下命令用于构建 boost:

./bootstrap.sh --with-toolset=sun --with-libraries=atomic,thread,regex

./b2 variant=发布地址-model=64 runtime-link=shared cxxflags="-std=c++11 -m64 -xarch=sparc -mt" linkflags="-std=c++11 -m64 -xarch=sparc -mt" threading=multi toolset=sun stage

在构建 boost 库时看到的唯一问题如下:

  • lockfree boost::atomic_flag : no(缓存)

无锁功能未启用。 任何人都可以帮助我了解我缺少什么以及我需要添加到命令行以启用无外观功能

Boost 库版本 - 1.61 编译器 - SolarisStudio-12.4 CC 编译器 操作系统架构 = 64 位

RedHatLinux-6 上,boost 使用 g++ 编译器构建良好,无需通过命令行设置任何额外的标志,它还显示 lockfree boost::atomic_flag : "**yes(缓存)“**

【问题讨论】:

  • 我已经厌倦了将变量 (BOOST_ATOMIC_FLAG_LOCK_FREE = 1) 值设置为 true,方法是将其作为参数传递给 cxxflags 下的 ./b2 可执行文件="BOOST_ATOMIC_FLAG_LOCK_FREE = 1",现在当我尝试构建它时,它正在被启用,即 "lockfree boost::atomic_flag : yes",但是当我运行一个测试程序时它仍然说程序是 "" NOT LOCK FREE"
  • 哼,这样做对我不起作用。

标签: c++ multithreading c++11 boost solaris-10


【解决方案1】:

您只需要在所有 UNIX 机器上安装 C++11 编译器,因为 Boost 库主要使用 C++11 库 API 调用。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-10-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-06-22
    • 1970-01-01
    相关资源
    最近更新 更多