SCons Pages:

  1. SCons: An Introduction
  2. Making Builds with SCons
  3. SCons for Developers

Links:

On this page:

Also see:

SCons: An Introduction

ARCHIVED COPY - Obsolete - for current version, click here.

SCons is replacing CMT as the Science Analysis Systems' build tool. Chosen for its cross-platform capabilities, SCons has been described as "an improved, cross-platform substitute for the classic Make utility with integrated functionality similar to autoconf/automake and compiler caches such as ccache".

It is Open Source software using Python scripts to create configuration files. SConscript files are the equivalent of the requirements files currently used with CMT: they define the targets that Scons will create during the build process. (For a more detailed introduction, go to http://scons.org/.)

Notes:

  • Tagging: As of July 28, 2009, the Science Analysis Systems group moved from the CMT tagging convention to the SConscript convention described below.
  • BUILDS locations:
    • CMT versions are on the u30 disk.
    • SCons versions are on the u35 disk.
  • Setting up environment variables is less complicated when using SCons builds; only two are required:
    • GLAST_EXT
    • INST_DIR, and
    • When running on SLAC Public with intent to use an RM build, be sure that the BUILDS variable is pointing to u35.
  • Supported build types: At the time of this writing (May, 2010), the SCons version of ScienceTools builds were available for:

       redhat4-i686-32bit-gcc34
       redhat4-x86_64-64bit-gcc34
       redhat5-i686-32bit-gcc41
       redhat5-x86_64-64bit-gcc41
       tiger-i386-32bit-gcc40
       Windows-i386-32bit-vc71 (LATEST only).
  • Setup scripts _setup.sh and _setup.csh are available for Linux and Mac. Their functionality is analogous to CMT scripts setup.sh and setup.csh. On Windows the comparable thing is _setup.js.

Tagging Convention

With SCons, the vXrYpZ tagging convention is replaced by packageName-XX-YY-ZZ standard. For example, the old tagging convention might apply v1r2p3 to the Likelihood package. Using the new convention, this tag would become Likelihood-01-02-03, adding the package name to the tag and restricting use to 2 digit version numbering. This convention applies to container release tag as well: e.g., CMT version ScienceTools-v9r15p2 now equates to SCons version ScienceTools-09-15-02.

Installer Releases

End-user releases of ScienceTools provide all the binaries and associated files required for running ScienceTools applications.

Note: At this time (May 19, 2010) end-user ScienceTools releases are available for download; GlastRelease releases are not. When GlastRelease end-user release builds are available, the instructions below for ScienceTools will apply.

  • To download ScienceTools releases, most users will find the
    New Installer for SCons Builds or the new command line installer most convenient.

    Note: "CHS" appears as the first choice on the installer's "Select Package:" menu and should be ignored; this container package is of interest to only a few Online developers.

    One can download developer or source code releases as well as end-user releases by means of the stand-alone application RMViewer, documented in the RMViewer Users Guide. RMViewer may be downloaded to your desktop or laptop.

    Note: Currently there is a slight difference in the way the different installers operate. The gui installer will create a subdirectory of the directory you specify named after the release (e.g., ScienceTools-3153 for LATEST build 3153) and install there. RMViewer and the command line installer install directly in the directory specified.
  • To set up the external libraries on a desktop, the gui and command line installers will by default download any external libraries you don't already have in your externals area; you may override the default if you wish. RMViewer has separate menu items for downloading release and downloading externals required by that release.

Release Manager Builds: Directory Structure

SCons builds for the various operating systems currently supported are located in their respective subdirectories of the directory:

/nfs/farm/g/glast/u35/ReleaseManagerBuild/

For example, at the time of this writing, these subdirectories included:

redhat3-i686-32bit (deprecated)
redhat3-i686-32bit-gcc32 (deprecated)

redhat4-i686-32bit (deprecated)
redhat4-i686-32bit-gcc34
redhat4-x86_64-64bit (deprecated)
redhat4-x86_64-64bit-gcc34

redhat5-i686-32bit (deprecated)
redhat5-i686-32bit-gcc41
redhat5-x86_64-64bit-gcc41

tiger-i386-32bit (deprecated)
tiger-i386-32bit-gcc40

The last redhat3 builds were made in February, 2010. SLAC will discontinue all redhat3 support in October, 2010.

No new builds have been created in the subdirectories without compiler indication of the form gccXX since June, 2009.

Within each of these subdirectories are two subdirectories:

Debug Optimized

So, the full path to the ScienceTools-09-15-05 build for redhat4-i686-32bit-gcc34 optimized would be:

/nfs/farm/g/glast/u35/ReleaseManagerBuild/redhat4-i686-32bit-gcc34/Optimized/ScienceTools/09-15-05

The directory contents of the corresponding redhat3 build are:

ScienceTools directory

 

External Libraries: Directory Structure

In moving to SCons, it was decided to modify directory structures for the external libraries in order to provide a structure which includes compiler in its path.  For example, CLHEP's include and lib directories are in:

redhat4-x86_64bit/CLHEP/1.9.2.2/gcc34

The reorganized external libraries are installed at SLAC, and are available for build types as follows (note that the names have been modified to include the compiler name (e.g., redhat4-i686-32bit is now redhat4-i686-32bit-gcc32):

Windows
  V:\Glast_Software\Toaster\GLAST_EXT\Windows-i386-32bit-vc7
  V:\Glast_Software\Toaster\GLAST_EXT\Windows-i386-32bit-vc90

Linux – in /afs/slac/g/glast/ground/GLAST_EXT/  
   redhat4-i686-32bit-gcc34
   redhat5-i686-32bit-gcc41
   redhat4-x86_64-64bit-gcc34
   redhat5-x86_64-64bit-gcc41

Mac – in /afs/slac/g/glast/ground/GLAST_EXT/
   tiger-i386-32bit-gcc40
  coming soon: snow leopard

 

Examples: Setup Scripts for Running SCons-built ScienceTools Executables

You must define values for GLAST_EXT and INST_DIR. The correct values will be determined by

  • where you are running (site, e.g. SLAC)
  • platform (e.g. redhat4 optimized)
  • release (e.g., ScienceTools 09-15-05)
  • debug or optimized (if using RM build at SLAC)

For our SCons builds, there is another concept, called variant, somewhat analogous to the value of CMTCONFIG for CMT. For SCons as for CMT, binaries for different platforms may be created from the same source. The variant fully identifies the binary type (OS, compiler, debug or optimized). Typical values are redhat4-i686-32bit-gcc34-Optimized and XP-i386-32bit-vc71-Debug.

Note: It is an unfortunate fact that, depending on context, variant may have a different meaning, namely just the choice between debug and optimized. For example, the command line installer uses the term variant in this way.

You should also decide which mode of running you prefer: use of wrapper scripts or single setup, after which you may run the executables directly. Wrapper scripts may be found under INST_DIR/bin/variant and the actual executables are under INST_DIR/exe/variant.

Example: C Shell

Example: Bash Shell

Developers Also See:

Making Builds With SCons

SCons for Developers


Owned by: Joanne Bogart, and Heather Kelly

Last updated by: Joanne Bogart 02/10/2011

 

 

02/10/2011