boost库交叉编译ARM版本

简介: boost库交叉编译ARM版本

1.下载boost源码:

地址:https://sourceforge.net/projects/boost/files/boost/


2.编译:


1)解压,cd 到目录

–show-libraries可查看所有库,如下

Building Boost.Build engine with toolset gcc... tools/build/v2/engine/bin.linuxx86/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:
link.jam: No such file or directory
    - atomic
    - chrono
    - context
    - coroutine
    - date_time
    - exception
    - filesystem
    - graph_parallel
    - iostreams
    - locale
    - log
    - math
    - mpi
    - program_options
    - random
    - regex
    - serialization
    - signals
    - system
    - test
    - thread
    - timer
    - wave


使用 --without-libraries=, , , 逗号隔开去掉不想编译的库,–prefix指定编译后的安装路径

这里去掉了pytho和graph,其他的全部编译

./bootstrap.sh --without-libraries=python,graph --prefix=/home/ubuntu/workplace/asio/boost_lib


生成有 b2 和 bjam ,以及一个 project-config.jam 的文件,修改该文件的一行(指定自己的编译器):

# Boost.Build Configuration
# Automatically generated by bootstrap.sh

import option ;
import feature ;

# Compiler configuration. This definition will be used unless
# you already have defined some toolsets in your user-config.jam
# file.
if ! gcc in [ feature.values <toolset> ]
{
    using gcc : : /opt/hisi-linux/x86-arm/arm-hisiv500-linux/target/bin/arm-hisiv500-linux-gcc ; 
}

project : default-build <toolset>gcc ;

# List of --with-<library> and --without-<library>
# options. If left empty, all libraries will be built.
# Options specified on the command line completely
# override this variable.
libraries =  --without-python --without-graph ;

# These settings are equivivalent to corresponding command-line
# options.
option.set prefix : /home/fens/workplace/asio/boost_lib ;
option.set exec-prefix : /home/fens/workplace/asio/boost_lib ;
option.set libdir : /home/fens/workplace/asio/boost_lib/lib ;
option.set includedir : /home/fens/workplace/asio/boost_lib/include ;

# Stop on first error
option.set keep-going : false ;


注意:这中间是有空格的,如下图标示的地方:


特别是最后一个分号前是有空格的,要不然会出错。


2)执行 ./bjam 即可,这是编译,创建的 lib 文件默认在 stage 文件夹


3)编译完后,执行 ./bjam install 即进行安装到上面 --prefix指定的目录

编译完成的库文件如下(包括静态版本和动态版本):


boost库有80%是只需要引用头文件就可以使用的,比较方便


参考:

boost库交叉编译(Linux生成ARM的库) - findumars - 博客园

https://www.cnblogs.com/findumars/p/7461244.html

目录
相关文章
|
24天前
|
Linux 计算机视觉
Linux交叉编译opencv并移植ARM端
通过以上步骤,你可以在Linux上交叉编译OpenCV,并将生成的库文件和头文件移植到ARM平台上,从而在ARM上使用OpenCV。 买CN2云服务器,免备案服务器,高防服务器,就选蓝易云。百度搜索:蓝易云
48 0
|
29天前
|
JSON Ubuntu Linux
LuaJit交叉编译移植到ARM Linux
LuaJit交叉编译移植到ARM Linux
20 1
|
1月前
|
编译器
正点原子IMX6ULL-安装交叉编译器、编译tslib触摸屏库、编译arm环境qt源代码
正点原子IMX6ULL-安装交叉编译器、编译tslib触摸屏库、编译arm环境qt源代码
|
2月前
|
物联网 编译器 测试技术
【嵌入式 交叉编译器】如何在 ARM 架构下选择和使用高版本交叉编译器
【嵌入式 交叉编译器】如何在 ARM 架构下选择和使用高版本交叉编译器
211 7
STM32CubeIDE移植ARM DSP库
STM32CubeIDE移植ARM DSP库
|
5月前
交叉编译libvisca库ARM版本
交叉编译libvisca库ARM版本
36 0
|
29天前
|
数据处理 编译器 数据库
x64 和 arm64 处理器架构的区别
x64 和 arm64 处理器架构的区别
31 0
【各种问题处理】X86架构和ARM架构的区别
【1月更文挑战第13天】【各种问题处理】X86架构和ARM架构的区别
|
4月前
|
缓存 API Android开发
一起学点ARM的微架构二?
一起学点ARM的微架构二?
77 1
|
11天前
|
敏捷开发 数据可视化 物联网
云效产品使用常见问题之用ARM架构的机器意义不知道如何解决
云效作为一款全面覆盖研发全生命周期管理的云端效能平台,致力于帮助企业实现高效协同、敏捷研发和持续交付。本合集收集整理了用户在使用云效过程中遇到的常见问题,问题涉及项目创建与管理、需求规划与迭代、代码托管与版本控制、自动化测试、持续集成与发布等方面。