ein*_*ica 8 c++ gcc boost c++11 b2
我需要在Fedora 24机器上构建Boost 1.62和1.63,但是使用GCC 4.9.3或GCC 5.4.0(取决于版本CUDA,这就是我需要旧编译器的原因).但是,如果我按照本答案中的描述设置自定义GCC版本并运行
/b2 --toolset=gcc-5.4.0 stage
Run Code Online (Sandbox Code Playgroud)
令我懊恼的是,我现在看到:
- 32-bit : no
- 64-bit : yes
- arm : no
- mips1 : no
- power : no
- sparc : no
- x86 : yes
- symlinks supported : yes
- C++11 mutex : no
- lockfree boost::atomic_flag : yes
- Boost.Config Feature Check: cxx11_auto_declarations : no
- Boost.Config Feature Check: cxx11_constexpr : no
- Boost.Config Feature Check: cxx11_defaulted_functions : no
- Boost.Config Feature Check: cxx11_final : yes
- Boost.Config Feature Check: cxx11_hdr_tuple : no
- Boost.Config Feature Check: cxx11_lambdas : no
- Boost.Config Feature Check: cxx11_noexcept : no
- Boost.Config Feature Check: cxx11_nullptr : no
- Boost.Config Feature Check: cxx11_rvalue_references : no
- Boost.Config Feature Check: cxx11_template_aliases : no
- Boost.Config Feature Check: cxx11_thread_local : no
- Boost.Config Feature Check: cxx11_variadic_templates : yes
Run Code Online (Sandbox Code Playgroud)
据说很多C++ 11的功能都应该丢失,而它们不应该丢失.使用发行版的GCC版本(6.2.1)构建它时不会发生这种情况.
为什么会发生这种情况,我该怎么做才能使Boost构建能够识别我的GCC 5.4.0(或4.9.3)的功能?
使用Boost 1.62.0 + GCC 4.x,Boost 1.62.0 + GCC 5.x和Boost 1.65.1 + GCC 5.x测试以下解决方案.YMMV与其他Boost版本,但我认为没有理由不应该工作.
让我们假设为了这个例子:
/some/where/g++-5.4/path/to/sources/of/boost-1.62.0//dest/path现在:
zlib,bzip2,lzma,zstd,iconv,icu)cd /path/to/sources/of/boost-1.62.0/./bootstrap.shecho "using gcc : 5.4 : /the/path/to/g++-5.4 : <cxxflags>-std=c++11 ;" > ./tools/build/src/user-config.jam./b2 --toolset=gcc-5.4 -j N (N是系统上的核心数)./b2 install --prefix=/dest/path笔记:
c++11使用c++1y,如果你想GCC 5.4.0的(未实施终结)C++ 14的支持.如果您使用的是其他GCC版本,请记住在标准最终确定之前,您实际上并未获得其开关.因此,C++ 11曾经意味着--std=c++1x和C++ 17,--std=c++1z并且随着GCC版本在标准定稿后发布,交换机也会发生变化.我有同样的问题.
看起来,因为你是交叉编译,所以boost构建系统试图检查你的编译器是否支持所有这些c ++ 11特性.问题是,为了做到这一点,构建系统编译一张代码.其中一个文件是这样的:boost_1_62_0/libs/rational/test/constexpr_test.cpp
然后,构建系统执行使用交叉编译器时没有人会想到的...它试图在主机上执行生成的二进制文件...它显然失败了.所有这些cxx11_测试都会发生这种情况.我也遇到了这个问题,这是一个问题.因此,我无法使用OpenWRT为我的Raspberries构建Boost.Fiber.
| 归档时间: |
|
| 查看次数: |
2645 次 |
| 最近记录: |