next up previous print clean
Next: Build Rules Up: Witten et al.: SCons Previous: Dependency Checking

Compiling with SCons

Because SCons is designed for software development, the amount of code written to generate the SEP SCons compiling enviroment is relatively small. However, in order to remain consistent with the philosophy of automatic generation of build rules for programs that is present in the SEP make environment, some deviation from a standard SCons environment was necessary.

The SEP SCons enviroment scans through C, Fortran77/90/95, Loptran, and Ratfor77/90 files present in the source directory. The source files are then scanned for files which they depend upon (listed in use or include statements) and build rules are automatically generated for all programs and objects in that directory. As such, no manual writing of compiling rules in the SConstruct is necessary, although the user may opt to and turn off the automatic build rule generation.

The current implementation of the build enviroment is contained in two files, SEPDefs.py and SEPProg.py. The first file contains definitions of variables in a build environment that are site-specific, such as the location of the compiler and compile options. The second file contains several subroutine calls that automatically generate the build rules for the code in the source directory.

Current limitations with the scanning of source files mean that there can currently only be one module per file, and the file name must match the name of the module contained in the file. This will change with time, of course.


next up previous print clean
Next: Build Rules Up: Witten et al.: SCons Previous: Dependency Checking
Stanford Exploration Project
5/6/2007