build2 | Installation FAQ

Why no (official) binaries?
Are the install scripts secure?
Which compilers are supported?

Linux-specific Issues:
Linux: g++: internal compiler error: killed

Mac OS-specific Issues:
Mac OS: can not execute clang++: too many open files

Windows-specific Issues:
Windows: curl: SSL certificate problem
Windows: strange/other errors

Why no (official) binaries?

Several reasons:

  1. The build2 toolchain has to be compiled with the same compiler as what's available on your machine since it may need to build and dynamically load additional components later.
  2. After the initial installation, the toolchain is normally upgraded from the package repository which requires compiling from source.
  3. If we cannot reliably and reasonably easily build from source on all the major platforms, then we probably shouldn't be making build tools.

As a result, while the initial installation is a bit more involved, upgrades are not much more inconvenient than using the system package manager while being more reliable and timely.

Note also that the build2 binary packages are starting to appear in the official package repositories of some Linux distributions and there are third-party, unofficial binaries available for some platforms. See Other Installation Methods for details.

Are the install scripts secure?

The automated install scripts download everything over HTTPS. They also contain embedded SHA256 checksums which they use to verify every downloaded package. So if you have verified the SHA256 checksum for the script itself, then everything should be reasonably secure.

Which compilers are supported?

GCC 4.9, Clang 3.7, and MSVC 14 (2015) Update 3 or any later versions of these compilers.

The build2-install.sh script allows specifying an alternative C++ compiler with the --cxx option, for example:

$ sh build2-install-X.Y.Z.sh --cxx g++-8

Note also that the compiler you use to build the build2 toolchain and those that you will be using to build your projects don't have to be the same. For example, you can build build2 with MinGW GCC and then use it to build your own projects with MSVC.


Linux-specific Issues:

Linux: g++: internal compiler error: killed

By default build2 uses all the available hardware threads and this error usually indicates that you are running out of memory. Workarounds for this problem include increasing the amount of RAM (for example, if you are building in a virtual machine; 0.5G per thread is a good rule of thumb) or reducing the number of jobs used by the build2 build, for example:

sh build2-install-X.Y.Z.sh -j 1


Mac OS-specific Issues:

Mac OS: can not execute clang++: too many open files

This error appears to be related to the limit on the number of open files in Mac OS. There are both the per-process (ulimit -n) and the per-system (sysctl kern.maxfiles) limits. If the machine is loaded with other tasks and you are building build2 in parallel (the default is to use all the available hardware threads), then you may reach one of these limits (most likely the system-wide). One workaround for this problem is to reduce the number of jobs used by the build2 build, for example:

sh build2-install-X.Y.Z.sh -j 1


Windows-specific Issues:

Windows: curl: SSL certificate problem

This error is normally caused by an overly-restrictive corporate network firewalls. You can either contact your network administrator for assistance or try installing build2 outside the firewall.

Windows: strange/other errors

Sometimes you may encounter strange errors when running the install scripts on Windows. These include the inability to create/copy/move/delete files or directories (usually due to "Access Denied") or certain programs crashing with the cryptic "cygheap base mismatch detected" message. Oftentimes, if you try to perform the same action manually, it succeeds.

While the exact reasons are usually difficult to pinpoint, generally this is believed to be caused by other programs interfering with the files and/or programs we are trying to use. The two well-known offenders are Windows Defender and Windows Search Indexer but third-party anti-virus and anti-spyware programs are also known to cause this.

One possible solution to this problem is to disable all such programs either entirely or for the directories used by build2 (for example, the build directory and the installation directory). If this is not possible/desirable (or does not help), the only other alternative is to keep retrying the installation process, perhaps using different installation and/or build directories.