scons is a free, open source build & deployment project written in Python and released under MIT. It has 2,419 GitHub stars, 360 forks and 654 open issues, and was last pushed yesterday. On this registry it ranks #43 of 59 tracked projects in Build & Deployment, with 5 head-to-head comparisons available.

What is scons?

SCons is an open-source, MIT-licensed software construction tool written in Python that orchestrates the building of software and other tangible products by determining which component pieces must be built or rebuilt and then invoking the necessary commands, and it is aimed at developers and build engineers who would rather write their build logic as Python scripts than learn a domain-specific language.

What it is

SCons is a cross-platform build tool whose configuration files are Python scripts, so build problems can be solved with the full power of a real programming language instead of a bespoke build DSL. It ships with built-in support for C, C++, D, Java, FORTRAN, Yacc, Lex, Qt and SWIG, and for building TeX and LaTeX documents, and it can be extended through user-defined Builders for other languages or file types. Dependency analysis for C, C++ and FORTRAN is built in, and it can be extended to other languages or file types through user-defined dependency Scanners. The project requires Python 3.9 or higher to run, and standard SCons has no other dependencies or requirements.

The concrete problem it solves is the brittle, multi-pass workflow of Make-style builds. SCons takes a global view of all dependencies, so there is no need for multiple build passes or for reordering targets to get everything built, and it eliminates the familiar "make depend" and "make clean" steps by analysing dependencies automatically. It also replaces per-directory reasoning with parallel builds that keep multiple jobs running simultaneously regardless of the directory hierarchy, which is the ecosystem of command-line build automation that Unix and cross-platform C, C++ and mixed-language projects live in.

Key capabilities

  • Configuration files are Python scripts, so ordinary Python code can drive the build.
  • Reliable, automatic dependency analysis built in for C, C++ and FORTRAN, extensible through user-defined dependency Scanners.
  • Built-in Builders for C, C++, D, Java, FORTRAN, Yacc, Lex, Qt and SWIG, plus building of TeX and LaTeX documents.
  • Reliable detection of build changes using cryptographic hashes, with optionally configurable algorithms including traditional timestamps.
  • Parallel builds that keep multiple jobs running simultaneously regardless of directory hierarchy.
  • Integrated Autoconf-like support for finding #include files, libraries, functions and typedefs.
  • Built-in support for Microsoft Visual Studio, including generation of .dsp, .dsw, .sln and .vcproj files, and the ability to share built files in a cache to speed up multiple builds.

Who uses it and how

  • Cross-platform projects that must build on Linux, other POSIX systems including AIX, BSD systems, HP/UX, IRIX and Solaris, Windows 7/8/10, MacOS and OS/2 from one set of build definitions.
  • Teams that build from central repositories of source code, of pre-built targets, or of both.
  • Sites that reuse a shared cache of built files to speed up repeated or parallel builds across machines.
  • Mixed-language C, C++, FORTRAN, Java, Qt or SWIG codebases that need automatic dependency tracking rather than hand-maintained dependency lists.
  • Windows developers who want .sln, .vcproj, .dsp or .dsw project files generated as build output, and large trees that benefit from parallel jobs spanning many directories.

Getting started

Install a current SCons package and run it with Python 3.9 or higher; the project's download page is the place to check whether an installed copy is up to date. Some experimental features need extra Python packages, and the Ninja feature currently requires the supporting ninja package.

How it compares

Among the tools named alongside it, Make is the direct point of contrast: SCons removes the "make depend" and "make clean" workflow by analysing dependencies automatically, and it keeps a global view of them instead of requiring multiple passes or reordered targets. Its Autoconf-like detection of #include files, libraries, functions and typedefs covers configuration work that would otherwise sit in a separate toolchain.

When to use it — and when not to

A self-hoster must supply Python 3.9 or higher, although standard SCons needs no other dependencies or requirements, and the optional Ninja feature adds the ninja package. Teams still pinned to older interpreters should note that the last release supporting Python 3.7 or 3.8 is 4.11.0, that the last supporting Python 3.6 is 4.8.1, and that the last supporting Python 3.5 is 4.2.0. The repository carries a large open-issue count (654 against 2,419 stars and 360 forks), and the README excerpt is light on installation and release detail, so newcomers should expect to lean on the documentation page rather than the README alone.

project readme (upstream, from github) — read inline

SCons - a Software Construction Tool ####################################

.. image:: https://img.shields.io/badge/IRC-scons-blue.svg :target: https://web.libera.chat/#scons :alt: IRC

.. image:: https://img.shields.io/sourceforge/dm/scons.svg :target: https://sourceforge.net/projects/scons :alt: Sourceforge Monthly Downloads

.. image:: https://img.shields.io/sourceforge/dt/scons.svg :target: https://sourceforge.net/projects/scons :alt: Sourceforge Total Downloads

.. image:: https://ci.appveyor.com/api/projects/status/github/SCons/scons?svg=true&branch=master :target: https://ci.appveyor.com/project/SCons/scons :alt: AppVeyor CI build Status

.. image:: https://codecov.io/gh/SCons/scons/branch/master/graph/badge.svg :target: https://codecov.io/gh/SCons/scons :alt: CodeCov Coverage Status

.. image:: https://github.com/SCons/scons/workflows/SCons%20Build/badge.svg :target: https://github.com/SCons/scons/actions?query=workflow%3A%22SCons+Build%22 :alt: Github Actions

What is SCons?

SCons is an Open Source software construction tool which orchestrates the construction of software (and other tangible products such as documentation files) by determining which component pieces must be built or rebuilt and invoking the necessary commands to build them.

Features:

  • Configuration files are Python scripts - use the power of a real programming language to solve build problems; no complex domain-specific language to learn.
  • Reliable, automatic dependency analysis built-in for C, C++ and FORTRAN. No more "make depend" or "make clean" to get all of the dependencies. Dependency analysis is easily extensible through user-defined dependency Scanners for other languages or file types.
  • Built-in support for C, C++, D, Java, FORTRAN, Yacc, Lex, Qt and SWIG, and building TeX and LaTeX documents. Easily extensible through user-defined Builders for other languages or file types.
  • Building from central repositories of source code and/or pre-built targets.
  • Built-in support for Microsoft Visual Studio, including generation of .dsp, .dsw, .sln and .vcproj files.
  • Reliable detection of build changes using cryptographic hashes; optionally can configure other algorithms including traditional timestamps.
  • Support for parallel builds - can keep multiple jobs running simultaneously regardless of directory hierarchy.
  • Integrated Autoconf-like support for finding #include files, libraries, functions and typedefs.
  • Global view of all dependencies - no more multiple build passes or reordering targets to build everything.
  • Ability to share built files in a cache to speed up multiple builds.
  • Designed from the ground up for cross-platform builds, and known to work on Linux, other POSIX systems (including AIX, BSD systems, HP/UX, IRIX and Solaris), Windows 7/8/10, MacOS, and OS/2.
  • Written in Python.

Documentation

See the SCons documentation page _.

Latest Version

If you already have SCons installed, you can check that the package you have is the latest version at the SCons download page _.

Execution Requirements

Running SCons requires Python 3.9 or higher. There should be no other dependencies or requirements to run standard SCons.

The last release to support Python 3.7 or Python 3.8 is 4.11.0. The last release to support Python 3.6 was 4.8.1. The last release to support Python 3.5 was 4.2.0.

Some experimental features may require additional Python packages to be installed - at the moment the Ninja feature requires the supporting ninja package _.

The default SCons configuration assumes use of the Microsoft Visual C++ compiler suite on Win32 systems, and assumes a C compiler named cc, a C++ compiler named c++, and a FORTRAN compiler named gfortran (such as found in the GNU Compiler Collection) on any other type of system. You may override these default values by appropriate configuration of variables in a Construction Environment, or in the case of Cygwin on a Win32 system, by selecting the 'cygwin' platform, which will set some of those Construction Variables for you.

By default, SCons knows how to search for available programming tools on various systems - see the SCons man page _ for details. You can override the default SCons choices made by appropriate configuration of construction variables.

Installation Requirements

SCons has no installation dependencies beyond a compatible version of Python. The tools which will be used to actually construct the project, such as compilers, documentation production tools, etc. should of course be installed by the appropriate means.

Installation

The preferred way to install SCons is through the Python installer, pip (or equivalent alternatives, such as uv or the Anaconda installer, conda). You can install either from a wheel package or from the source directory. To work on a project that builds using SCons, "installing" lets you just use scons as a command and not worry about paths. In this case, we usually suggest using a virtualenv, to isolate the Python environment to that project (some notes on that: Python Packaging User Guide: Creating and using virtual environments _).

Some installation examples::

# to do a system-level install:
$ python -m pip install --user scons

# Windows variant, assuming Python Launcher:
C:\Users\me> py -m pip install --user scons

# inside a virtualenv it's safe to use bare pip:
(myvenv) $ pip install scons

# install in a virtualenv from a wheel file:
(myvenv) $ pip install SCons-4.3.0-py3-none-any.whl

# install in a virtualenv from source directory:
(myvenv) $ pip install --editable .

Note that on Windows, SCons installed via pip puts an executable scons.exe in the script directory of the Python installation, or in a shadow script directory if you did a User Install. To run scons as a command, you'll need this directory in your search path.

Fortunately, pip will warn you about this - pay attention to any messages during installation like this::

WARNING: The scripts scons-configure-cache.exe, scons.exe and sconsign.exe are installed in 'C:\Users\me\AppData\Roaming\Python\Python310\Scripts' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

If you are running on a system which uses a package manager (for example most Linux distributions), you may, at your option, use the package manager (e.g. apt, dnf, yum, zypper, brew, pacman etc.) to install a system-wide version of SCons. Some distributions keep up to date with SCons releases, while others may delay, so the version of SCons you want to run may factor into your choice.

Getting Started Using SCons

If you're new to SCons, the first couple of chapters of the SCons User Guide _ provide an excellent starting spot.

Contributing to SCons

Please see ``_

License

SCons is distributed under the MIT license, a full copy of which is available in the ``_ file.

Reporting Bugs

The SCons project welcomes bug reports and feature requests.

Please make sure you send email with the problem or feature request to the SCons users mailing list, which you can join at https://mail.python.org/mailman3/lists/scons-users.python.org/, or on the SCons Discord server in #scons-help _.

Once you have discussed your issue on the users mailing list and the community has confirmed that it is either a new bug or a duplicate of an existing bug, then please follow the instructions the community provides (including the issue template presented by GitHub) to file a new bug or to add yourself to the CC list for an existing bug.

You can explore the list of existing bugs, which may include workarounds for the problem you've run into, on the GitHub issue tracker _.

Bug-fix Policy

At this time, the application of bug-fix pull requests normally happens at the head of the main branch. In other words fixes are likely to appear in a bugfix to the current release or in the next regular release and there probably won't be a bugfix update to older releases. Consumers are of course free to internally maintain releases on their own by taking submitted patches and applying them.

readme truncated — read the full docs on github

Frequently asked questions

Is scons free to use?

scons is open source under the MIT licence. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does scons do?

SCons - a software construction tool

What is scons written in?

scons is primarily written in Python. Its source is publicly available at https://github.com/SCons/scons, and it has 2,419 GitHub stars.