分享

TDA4编译boost

 Baruch 2023-09-16

最近在TDA4上开发系统中间件,用到了一些boost1_58_0的接口,但是TDA4现在的系统库中使用的时boost_1_72_0版本,因此,需要重新编译boost库,在此,记录下编译过程。

  1. 下载源码:
    在https:///projects/boost/files/boost/1.58.0/中选择boost_1_58_0.tar.gz,并下载。
    将boost_1_58_0.tar.gz拷贝到TDA4上,并解压。
  2. 编译boost_1_58_0
cd boost_1_58_0 #./bootstrap.sh ./bootstrap.sh --with-libraries=all --with-toolset=gcc
  • 1
  • 2
  • 3

会生成b2可执行程序,然后执行./b2进行编译。
3. 解决编译错误
在执行./b2命令,会生成bin.v2文件夹,并会报错 error: unrecognized command line option “-m64”。
错误原因为没有指定编译arm版本。
解决方法:修改bin.v2中的project-cache.jam文件:
将'arm-…'和'gcc-…'的改为true

set 'arm-<target-os>linux-<toolset-gcc:version>9.2.1-<toolset>gcc' : 'true' ;
set 'arm-<address-model>64-<target-os>linux-<toolset-gcc:version>9.2.1-<toolset>gcc' : 'true' ;
set 'gcc visibility-<address-model>64-<target-os>linux-<toolset-gcc:version>9.2.1-<toolset>gcc' : 'true' ;
set '64-bit-<target-os>linux-<toolset-gcc:version>arm-<toolset>gcc' : 'true' ;
set 'arm-<target-os>linux-<toolset-gcc:version>arm-<toolset>gcc' : 'true' ;
set 'arm-<address-model>64-<target-os>linux-<toolset-gcc:version>arm-<toolset>gcc' : 'true' ;
set 'gcc visibility-<address-model>64-<architecture>arm-<target-os>linux-<toolset-gcc:version>arm-<toolset>gcc' : 'true' ;
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

然后在执行./b2就开始编译了。
成功后打印出:

The Boost C++ Libraries were successfully built! The following directory should be added to compiler include paths: /../boost_1_58_0 The following directory should be added to linker library paths: /../boost_1_58_0/stage/lib
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10

4.安装
执行命令:

./b2 install
  • 1

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多