SCons: Difference between revisions

From Madagascar
Jump to navigation Jump to search
Sfomel (talk | contribs)
Sfomel (talk | contribs)
Line 10: Line 10:


== Data processing flows with <tt>rsf.proj</tt> ==
== Data processing flows with <tt>rsf.proj</tt> ==
The <tt>rsf.proj</tt> module provides SCons rules for Madagascar data processing workflows. An example <tt>SConstruct</tt> file is shown below and can be found in [http://rsf.svn.sourceforge.net/viewvc/rsf/trunk/book/bei/sg/denmark/SConstruct?&view=markup bei/sg/denmark]
<python>
from rsf.proj import *
Fetch('wz.35.H','wz')
Flow('wind','wz.35.H','dd form=native | window n1=400 j1=2 | smooth rect1=3')
Plot('wind','pow pow1=2 | grey')
Flow('mute','wind','mutter v0=0.31 half=n')
Plot('mute','pow pow1=2 | grey')
Result('denmark','wind mute','SideBySideAniso')
End()
</python>
Note that <tt>SConstruct</tt> by itself does not do any job other than setting rules for building different targets. The targets get built when one executes <tt>scons</tt> on the command line.
=== SCons commands ===
===== Fetch =====
===== Flow =====
===== Plot =====
===== Result =====
===== End =====


=== Default targets ===
=== Default targets ===

Revision as of 23:03, 2 August 2010

SCons and Madagascar

SCons (from Software Construction) is a superior alternative to the classic make utility.

SCons is implemented as a Python script, its "configuration files" (SConstruct files) are also Python scripts. Madagascar uses SCons to compile software, to manage data processing flowing, and to assemble reproducible documents.

Compilation

Data processing flows with rsf.proj

The rsf.proj module provides SCons rules for Madagascar data processing workflows. An example SConstruct file is shown below and can be found in bei/sg/denmark <python> from rsf.proj import *

Fetch('wz.35.H','wz')

Flow('wind','wz.35.H','dd form=native | window n1=400 j1=2 | smooth rect1=3') Plot('wind','pow pow1=2 | grey')

Flow('mute','wind','mutter v0=0.31 half=n') Plot('mute','pow pow1=2 | grey')

Result('denmark','wind mute','SideBySideAniso')

End() </python> Note that SConstruct by itself does not do any job other than setting rules for building different targets. The targets get built when one executes scons on the command line.

SCons commands

Fetch
Flow
Plot
Result
End

Default targets

Command-line options

Command-line options
Name Meaning
TIMER Whether to time execution
CHECKPAR Whether to check parameters
ENVIRON Additional environment settings
CLUSTER Nodes available on a cluster
MPIRUN mpirun command

Seismic Unix data processing flows with rsf.suproj

Document creation with rsf.tex

Default targets

Book and report creation with rsf.book