在做rk3568开发,默认的文件系统中不带boost库,所以需要自己重新交叉编译boost
交叉编译在ubuntu18.04虚拟机中进行,事先需要安装交叉编译器aarch64-linux-gnu-gcc并下载boost_1_73_0.tar.gz
tar -zxvf boost_1_73_0.tar.gz解压源码文件
进入目录
cd boost_1_73_0
查看可选库
./bootstrap.sh --show-libraries
显示结果
root@ubuntu:/home/ireal/third/boost_1_73_0# ./bootstrap.sh --show-libraries
Building Boost.Build engine with toolset gcc... tools/build/src/engine/b2
The following Boost libraries have portions that require a separate build
and installation step. Any library not listed here can be used by including
the headers only.
The Boost libraries requiring separate building and installation are:
- atomic
- chrono
- container
- context
- contract
- coroutine
- date_time
- exception
- fiber
- filesystem
- graph
- graph_parallel
- headers
- iostreams
- locale
- log
- math
- mpi
- nowide
- program_options
- python
- random
- regex
- serialization
- stacktrace
- system
- test
- thread
- timer
- type_erasure
- wave
配置交叉编译,选择filesystem,system,thread三个库,工具先选gcc
./bootstrap.sh --with-libraries=filesystem,system,thread --with-toolset=gcc
进行配置,成功如下图
之后再修改配置文件project-config.jam
if ! gcc in [ feature.values <toolset> ]
{
using gcc : arm : /usr/local/arm64/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc ;
}
编译
./b2
显示选择的库被编译,其他的不编译
成功如下图
安装
./b2 install --prefix=./aarch64_install
安装完成后在aarch64_install目录空中生产include和lib文件夹
在lib文件夹中有编译生成的库文件,filesystem,system,thread库均已完成