最近在TDA4上开发系统中间件,用到了一些boost1_58_0的接口,但是TDA4现在的系统库中使用的时boost_1_72_0版本,因此,需要重新编译boost库,在此,记录下编译过程。
- 下载源码:
在https://sourceforge.net/projects/boost/files/boost/1.58.0/中选择boost_1_58_0.tar.gz,并下载。 将boost_1_58_0.tar.gz拷贝到TDA4上,并解压。 - 编译boost_1_58_0
cd boost_1_58_0
./bootstrap.sh --with-libraries=all --with-toolset=gcc
会生成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" ;
然后在执行./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
4.安装 执行命令:
./b2 install
|