Building Software from Source

I would like to write down notes on how to build software from scratch based on Andrew Kelley’s explanation here 🡵. This is a perfect video that I found to learn this stuff and I know I/Someone else will refer to this often and find it useful.

Ways to Obtain Software

Downloading Upstream Binary Distributions

Binaries will be available directly, which we can download and run without building software from scratch. These are built by the project maintainers for all major distributions.

Example: On GitHub, this will mostly be available under the Releases page of the repo.

Downloading from System Package Managers

Binaries can be downloaded by particular system package managers. These will be built by package maintainers and not necessarily by the project maintainers.

Example:

Building Directly from Source

Creating binaries from source is the best way to do it if we want to change the source code and behavior of some specifics and also if we want to configure differently than what upstream/system packages do.

Most of the core software is built in C/C++. Typically, there will be 3 phases to install such software: configure, build, and install.

Best Practices

References

/build/