build2 | Installation

The universal way to install or upgrade build2 is using the automated install scripts. Download a version for your platform (see below), verify its checksum, run, and follow the onscreen instructions. The script will prompt for your confirmation before building or installing anything. See the Installation FAQ for common installation questions and Other Installation Methods for alternatives (binary packages, etc).

To build and install build2 all you will need is a reasonably recent C++ compiler. See Which compilers are supported? for details.

You will normally want to keep the build directory around for upgrades or to cleanly uninstall the toolchain. An automated upgrade can be performed from any previous patch release and from the most recent previous minor version.

1UNIX (Linux, Mac OS, FreeBSD)
2Windows with MSVC
3Windows with Clang
4Windows with MinGW
5Other Installation Methods

1 UNIX (Linux, Mac OS, FreeBSD)

The build2 binary packages are available in Fedora, Homebrew, FreeBSD, and several other Linux distributions.

Create the build2 build directory, for example ~/build2-build in your home directory, then run:

$ cd ~/build2-build

$ curl -sSfO https://download.build2.org/0.16.0/build2-install-0.16.0.sh

$ shasum -a 256 -b build2-install-0.16.0.sh

  4d2babfaff6d0412e0ab61a3d3c68a87de54c0779254d62f4569b44a56c6ea08

$ sh build2-install-0.16.0.sh

Or, to upgrade from 0.15.0:

$ sh build2-install-0.16.0.sh --upgrade

To uninstall:

$ sh build2-install-0.16.0.sh --uninstall

See the Installation FAQ for common platform-specific issues and solutions.

2 Windows with MSVC

Create the build2 build directory, for example, C:\build2-build, download build2-install-msvc-0.16.0.bat into it, start the Visual Studio x64 Command Prompt, then run:

> cd C:\build2-build

> certutil -hashfile build2-install-msvc-0.16.0.bat SHA256

  1ae62f46fa2c23abd734d8497abae1909481d48ea74f924a7335887a17a42e21

> build2-install-msvc-0.16.0.bat

If your organization's network security breaks the installation process (often the case on Windows when trying to use curl), then consider installing offline.

Or, to upgrade from 0.15.0:

> build2-install-msvc-0.16.0.bat --upgrade

Note that currently the automated upgrade process does not upgrade the baseutils package. Use the from-scratch installation if you would like to upgrade this package.

To uninstall:

$ build2-install-msvc-0.16.0.bat --uninstall

See the Installation FAQ for common Windows-specific issues and solutions.

3 Windows with Clang

There are two common ways to obtain Clang targeting the MSVC runtime: bundled with the MSVC installation (by selecting the Clang tools component in the Visual Studio installer) or as a separate installation (by getting the installer from the LLVM Download page).

If you are using a separate installation, then the Clang compiler is most likely already in your PATH environment variable and you don't have to use the Visual Studio command prompt below.

Create the build2 build directory, for example, C:\build2-build, download build2-install-clang-0.16.0.bat into it, start the Visual Studio x64 Command Prompt, then run:

> cd C:\build2-build

> certutil -hashfile build2-install-clang-0.16.0.bat SHA256

  282cb2a409dcafb1e841664290b4ff55255852eba15b81b4e03f4e6c61a034a9

> build2-install-clang-0.16.0.bat

If your organization's network security breaks the installation process (often the case on Windows when trying to use curl), then consider installing offline.

Or, to upgrade from 0.15.0:

> build2-install-clang-0.16.0.bat --upgrade

Note that currently the automated upgrade process does not upgrade the baseutils package. Use the from-scratch installation if you would like to upgrade this package.

To uninstall:

$ build2-install-clang-0.16.0.bat --uninstall

See the Installation FAQ for common Windows-specific issues and solutions.

4 Windows with MinGW

Create the build2 build directory, for example, C:\build2-build, download build2-install-mingw-0.16.0.bat into it, start the Command Prompt, then run:

> cd C:\build2-build

> certutil -hashfile build2-install-mingw-0.16.0.bat SHA256

  6c5fef712ebb90055e3d7745dade4125e779a55ba823dedfd063dff7aba3e8b8

> build2-install-mingw-0.16.0.bat

If your organization's network security breaks the installation process (often the case on Windows when trying to use curl), then consider installing offline.

The build2-install-mingw script downloads and installs (into the same directory as build2) a minimal MinGW GCC distribution that is then used to compile build2. If you would prefer to use your own MinGW GCC, see the alternative installation methods below.

Or, to upgrade from 0.15.0:

> build2-install-mingw-0.16.0.bat --upgrade

Note that currently the automated upgrade process does not upgrade the baseutils and mingw packages. Use the from-scratch installation if you would like to upgrade these packages.

To uninstall:

$ build2-install-mingw-0.16.0.bat --uninstall

See the Installation FAQ for common Windows-specific issues and solutions.

5 Other Installation Methods

The steps described above are the preferred way to install build2 for most developers. For alternative from-source installation methods that offer more control see the Installation and Upgrade manual. To manually obtain various components of the build2 toolchain refer to the Download page.

The build2 binary packages are also available in several distribution package repositories, see: Fedora, Homebrew, FreeBSD, Gentoo, and Arch Linux.

There is also the setup-build2 GitHub Action.