Advertisement

You're blocking ads, which pay for BlenderNation. Read about other ways to support us.

The Big SCons rewrite

2

scons screenshotBy Nathan Letwory

Since 2004 Blender has been buildable with SCons, an accurate build system implemented in Python. Although the first implementation of the scripts worked, over time it became clear that it was hard to maintain and to extend with the bigger new features in Blender.

At the end of summer 2005 Jonathan Jacobs sent in a first overhaul for the scripts as they were, already an improvement over the existing system. It was not until December that I could start a proper rewrite. At first I based my work on Jonathans overhaul. To accomodate for better configuration and easier setup of new scripts, as well as for increased maintainability also the overhaul went into complete rewrite.

The result of the rewrite, which took 2 months of more or less constant development, some large changes in architecture along the way, was finally committed on February the 4th.

The most important features boosted by the rewrite are:

  • better control of (user) configuration options: default platform options are now in a config/ directory in the CVS. Each platform has its own set of options. Through a user-config.py file the user can override any of these default settings. For quick test, these options can also be given on the command-line. Defaults are overridden by user-config, which are overridden by the command-line.
  • improved maintainability: through a few wrapper functions adding new libraries is very easy, changing names of parts is handled in one place only, and the functions keep track of how the structure of the project is.
  • gain in speed: through better and thoughtful implementation, a lot of the SCons overhead has been eliminated, resulting in 35% faster compile times on average.

As some extras there is now colour in the output, to show important parts. Also a quieter output is by default installed. Further, thanks to the internal bookkeeping of the new system, you can tell the system to compile only a specific part, like 'scons BF_QUICK=src' which builds only anything in the src directory if necessary.

For more information, check out the two documents on the new implementation at

There's also a page on the Developers Wiki that covers the Scons Refactoring

About Author

Bart Veldhuizen

I have a LONG history with Blender - I wrote some of the earliest Blender tutorials, worked for Not a Number and helped run the crowdfunding campaign that open sourced Blender (the first one on the internet!). I founded BlenderNation in 2006 and have been editing it every single day since then ;-) I also run the Blender Artists forum and I'm Head of Community at Sketchfab.

2 Comments

  1. Hi Nathan,
    when the MinGW instructions will be published? Launching scons on a standard MinGW installation fails miserably ;-) It is a question of some tools missing for sure. And what about CygWin support? It's going to be discontinued?

  2. Hi Frederico,

    MingW and Cygwin will be worked on in the near future. After two months of hard work I need a small break from developing our SCons system, so I work for a while on the Python Node for the node editor. MingW/Windows is mainly a matter of getting compatible libraries into the CVS, and Cygwin will also be worked on at some point. I also need to get default configurations from the FreeBSD and Solaris maintainers still :)

    /Nathan

Leave A Reply

To add a profile picture to your message, register your email address with Gravatar.com. To protect your email address, create an account on BlenderNation and log in when posting a message.

Advertisement