macOS - 安装 b2 (Jamfile)


安装 b2

官方文档 - Installation:https://www.boost.org/doc/libs/1_84_0/tools/build/doc/html/index.html#bbv2.installation


1、下载
前往 github - b2 - releases
https://github.com/bfgroup/b2/releases

这里我下载当前最新的 5.1.0 版本
https://github.com/bfgroup/b2/releases/download/5.1.0/b2-5.1.0.zip

解压zip文件


2、编译

进入解压后的文件夹,输入

./bootstrap.sh

3、安装

你可以设置指定安装文件夹,作为 b2 home,放到 PREFIX 位置

./b2 install --prefix=PREFIX

这里我创建文件夹 /Users/xx/Documents/software/b2

./b2 install --prefix=/Users/user/Documents/software/b2

安装成功,可以打印版本信息试试:

$ /Users/xx/Documents/software/b2/bin/b2 --version
B2 5.1.0 (OS=MACOSX, jobs=8)

4、添加到环境变量


关于 b2


B2 由两部分构成

  • 一个编译引擎,具有其自己的解释语言
  • B2 自身,以该语言实现。

chain of events

The chain of events when you type b2 on the command line is as follows:

  • The B2 executable tries to find B2 modules and loads the top-level module. The exact process is described in the section called “Initialization”
  • The top-level module loads user-defined configuration files, user-config.jam and site-config.jam, which define available toolsets.
  • The Jamfile in the current directory is read. That in turn might cause reading of further Jamfiles. As a result, a tree of projects is created, with targets inside projects.
  • Finally, using the build request specified on the command line, B2 decides which targets should be built and how. That information is passed back to Boost.Jam, which takes care of actually running the scheduled build action commands.

use B2

So, to be able to successfully use B2, you need to know only four things:

  • How to configure B2
  • How to declare targets in Jamfiles
  • How the build process works
  • Some Basics about the Boost.Jam language. See the section called “Boost.Jam Language”.

b2 help

$ b2 --help
B2 4.6-git

Project-specific help:

Project has jamfile at Jamfile

This Jamfile requires boost-build v2 to build.
The version shipped with boost 1.34.0


General command line usage:

b2 [options] [properties] [targets]

Options, properties and targets can be specified in any order.


Important Options:

  • --clean, Remove targets instead of building
  • -,a Rebuild everything
  • -n, Don’t execute the commands, only print them
  • -d+2, Show commands as they are executed
  • -d0, Suppress all informational messages
  • -q, Stop at first error
  • --reconfigure, Rerun all configuration checks
  • --debug-configuration, Diagnose configuration
  • --debug-building, Report which targets are built with what properties
  • --debug-generator, Diagnose generator search/execution

Further Help:

The following options can be used to obtain additional documentation.

  • --help-options, Print more obscure command line options.
  • --help-internal, B2 implementation details.
  • --help-doc-options, Implementation details doc formatting.

…found 1 target…


伊织 2024-03-25(一)
今天茶饮很丰富

相关推荐

  1. macOS - 安装 b2Jamfile

    2024-03-26 06:04:10       41 阅读
  2. MacOS、ubuntu安装libssh、libssh2

    2024-03-26 06:04:10       39 阅读
  3. mac dex2jar安装

    2024-03-26 06:04:10       59 阅读
  4. 【LAMMPS学习】二、LAMMPS安装(2)MacOS和Win安装

    2024-03-26 06:04:10       37 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-03-26 06:04:10       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-03-26 06:04:10       101 阅读
  3. 在Django里面运行非项目文件

    2024-03-26 06:04:10       82 阅读
  4. Python语言-面向对象

    2024-03-26 06:04:10       91 阅读

热门阅读

  1. ffmpeg把一个平面视频,做成左右平面视频

    2024-03-26 06:04:10       41 阅读
  2. ffmpeg重点之时间戳,PTS、DTS、time_base

    2024-03-26 06:04:10       37 阅读
  3. 【电脑装机】笔记本开机启动快捷键汇总

    2024-03-26 06:04:10       38 阅读
  4. centOS校准服务器时间

    2024-03-26 06:04:10       42 阅读
  5. C语言多服务器多播组网框架

    2024-03-26 06:04:10       43 阅读
  6. npm常用命令详解

    2024-03-26 06:04:10       48 阅读
  7. 数据分析面试题(11~20)

    2024-03-26 06:04:10       46 阅读
  8. Web框架开发-BBS项目预备知识

    2024-03-26 06:04:10       36 阅读
  9. linux系统中docker镜像创建、导入导出和执行

    2024-03-26 06:04:10       40 阅读
  10. H3CNE:FTP

    H3CNE:FTP

    2024-03-26 06:04:10      40 阅读