SCons build system

From gem5

Jump to: navigation, search

This page provides some tips on using M5's build system.

M5's build system uses SCons, a powerful replacement for make (and autoconf, and ccache). SCons uses standard Python to describe the software build process, enabling some very sophisticated & complex build procedures.

This page is not an attempt to fully document the build system. Because many people aren't familiar with SCons, and because M5's build system in some areas takes advantage of the complexity that SCons enables, this page tries to collect useful pointers that might not otherwise be obvious.

SCons tips

For example, the following command will build both the optimized Alpha syscall emulation and debug MIPS syscall emulation targets using up to 4 concurrent processes:
% scons -j 4 build/ALPHA_SE/m5.opt build/MIPS_SE/m5.debug

M5 build system tips

% scons CC=gcc34 USE_MYSQL=False build/ALPHA_SE/m5.opt
Almost all of these options are sticky, that is, if you specify them once, they remain in force for all future builds in that particular target (e.g., ALPHA_SE) until they are changed explicitly in a future invocation. (The only non-sticky option is update_ref, which, when set, causes the results of any regression tests to overwrite the reference outputs in preparation for being committed as the new reference outputs.)
% scons --default ALPHA_FS USE_MYSQL=False build/ALPHA_FS_NOSQL/m5.debug
% scons --default ALPHA_SE CC=mycc CXX=myc++ build/ALPHA_SE_MYCOMPILERS/m5.debug
The configuration name is actually totally arbitrary, and need not include the ISA name or anything else:
% scons --default MIPS_SE build/FOOBAR/m5.debug
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox