码农知识堂 - 1000bd
  •   Python
  •   PHP
  •   JS/TS
  •   JAVA
  •   C/C++
  •   C#
  •   GO
  •   Kotlin
  •   Swift
  • Mac 安装 boost(bjam)


    文章目录

      • 关于 boost
      • 源码安装
      • 使用 brew 安装
        • 在 xcode 中使用 boost 库


    关于 boost

    Boost provides free peer-reviewed portable C++ source libraries.

    官网:https://www.boost.org


    源码安装

    1、下载源码

    https://www.boost.org/users/download/


    2、Bootstrapping :Building B2 engine

    $ cd .../boost_1_79_0 
    $ ./bootstrap.sh 
    
    # 带选项
    $ ./bootstrap.sh --with-libraries=all --with-toolset=clang
    
    • 1
    • 2
    • 3
    • 4
    • 5

    编译完成后,bjam 会被安装在 tools/build/src/engine/b2 目录下。

    通过编辑 project-config.jam 来使用 --with-toolset 选项或调整配置。


    • 文档
      http://www.boost.org/more/getting_started/unix-variants.html
    • B2 文档
      http://www.boost.org/build/
    • Getting Started on Unix Variants
      https://www.boost.org/doc/libs/1_79_0/more/getting_started/unix-variants.html

    # 查看 bjam 版本
    $ cd tools/build/src/engine 
    $ ./bjam  --version
    B2 4.8-git
     
    # 查看帮助 
    $ ./b2 --help
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8

    3、build

    # 编译, 带上 -j8 命令 ,不然就是单核心编译
    $ ./b2 -j8
    
    # clean
    ./b2 clean -j8
    
    # 生成头文件
    ./b2 headers
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    $ ./b2 -h
    Invalid option: -h
    
    usage: ./b2 [ options ] targets...
    
    -a      Build all targets, even if they are current.
    -dx     Set the debug level to x (0-13,console,mi).
    -fx     Read x instead of bootstrap.
    -jx     Run up to x shell commands concurrently.
    -lx     Limit actions to x number of seconds after which they are stopped.
    -mx     Maximum target output saved (kb), default is to save all output.
    -n      Don't actually execute the updating actions.
    -ox     Mirror all output to file x.
    -px     x=0, pipes action stdout and stderr merged into action output.
    -q      Quit quickly as soon as a target fails.
    -sx=y   Set variable x=y, overriding environment.
    -tx     Rebuild x, even if it is up-to-date.
    -v      Print the version of jam and exit.
    --x     Option is ignored.
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19

    使用 brew 安装

    使用 brew时,bjam 和 boost 是分开安装的。

    $ brew install boost 
    
    $ brew install bjam
    
    • 1
    • 2
    • 3

    安装成功后,安装包地址位于 /usr/local/Cellar/boost/
    并软链接到 /usr/local/include 和 /usr/local/lib
    你可以在 /usr/local/lib 下找到 libboost_* 文件


    在 xcode 中使用 boost 库

    可参考文章:https://huangkx.blog.csdn.net/article/details/80323743


    伊织 2022-06-23(四)

  • 相关阅读:
    论文浅尝 | KR-GCN: 知识感知推理的可解释推荐系统
    rabbitmq的confirm模式获取correlationData为null解决办法
    <vector模拟实现>——《C++初阶》
    异步编程规避Redis的阻塞(下)
    学习scrapy,发现列表返回为空
    vue-router 重复跳转路径报错源码分析和解决方案
    深度学习与总结JVM专辑(五):类加载机制
    解决Maven打包Nacos时插件报错
    Redis各数据类型特定的命令和用法 1.0版本
    Matlab数学建模常用函数
  • 原文地址:https://blog.csdn.net/lovechris00/article/details/125423796
  • 最新文章
  • 攻防演习之三天拿下官网站群
    数据安全治理学习——前期安全规划和安全管理体系建设
    企业安全 | 企业内一次钓鱼演练准备过程
    内网渗透测试 | Kerberos协议及其部分攻击手法
    0day的产生 | 不懂代码的"代码审计"
    安装scrcpy-client模块av模块异常,环境问题解决方案
    leetcode hot100【LeetCode 279. 完全平方数】java实现
    OpenWrt下安装Mosquitto
    AnatoMask论文汇总
    【AI日记】24.11.01 LangChain、openai api和github copilot
  • 热门文章
  • 十款代码表白小特效 一个比一个浪漫 赶紧收藏起来吧!!!
    奉劝各位学弟学妹们,该打造你的技术影响力了!
    五年了,我在 CSDN 的两个一百万。
    Java俄罗斯方块,老程序员花了一个周末,连接中学年代!
    面试官都震惊,你这网络基础可以啊!
    你真的会用百度吗?我不信 — 那些不为人知的搜索引擎语法
    心情不好的时候,用 Python 画棵樱花树送给自己吧
    通宵一晚做出来的一款类似CS的第一人称射击游戏Demo!原来做游戏也不是很难,连憨憨学妹都学会了!
    13 万字 C 语言从入门到精通保姆级教程2021 年版
    10行代码集2000张美女图,Python爬虫120例,再上征途
Copyright © 2022 侵权请联系2656653265@qq.com    京ICP备2022015340号-1
正则表达式工具 cron表达式工具 密码生成工具

京公网安备 11010502049817号