Editing
Tutorial
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Common errors in SConstructs=== There are two common errors that most users will experience when executing SConstructs: missing dependency errors, and misconfiguration errors. We'll demonstrate both of these errors to help new users troubleshoot them below. The first error is caused by missing a dependency in the SConstruct. To introduce this error into your SConstruct modify the sample SConstruct from above to the following: <syntaxhighlight lang="python"> from rsf.proj import * # Remember, this statement comes first... ALWAYS Flow("spike1","spike","sfadd scale=4.0") Flow("noise","spike1","sfnoise") Plot("spike",'sfgraph title="spike" ' ) # Note string nesting Plot("spike1",'sfgraph title="spike1" ') Plot("noise",'sfgraph title="noisy" ') Result("noise",'sfgraph title="noisy" pclip=75 ') End() # Remember, this always ends the script. </syntaxhighlight> Now when you run '''scons''' , you should get an error message: <pre> scons: Reading SConscript files ... scons: done reading SConscript files. scons: Building targets ... scons: *** [spike1.rsf] Source `spike.rsf' not found, needed by target `spike1.rsf'. scons: building terminated because of errors. </pre> In this case, SCons tells you exactly which file is missing and which output file is missing one of its dependencies. To solve this problem, add the '''Flow''' to create 'spike' to the SConstruct. If your SConstruct uses a file that is not created inside the SConstruct, and is complaining about a missing dependency, then make sure the file you are looking for is in a location that the SConstruct can access. The second error, is caused by having a misconfigured command. To demonstrate this type of error change your SConstruct to: <syntaxhighlight lang="python"> from rsf.proj import * # Remember, this statement comes first... ALWAYS '''Flow''' ("spike",None,"sfspike n1=100 k1=50") # None is a trick, see Users 4 for more information '''Flow''' ("spike1","spike","sfasd scale=4.0") # HERE IS THE ERROR, NOTE sfasd instead of sfadd '''Flow''' ("noise","spike1","sfnoise") '''Plot''' ("spike",'sfgraph title="spike" ' ) # Note string nesting '''Plot''' ("spike1",'sfgraph title="spike1" ') '''Plot''' ("noise",'sfgraph title="noisy" ') '''Result''' ("noise",'sfgraph title="noisy" pclip=75 ') End() # Remember, this always ends the script. </syntaxhighlight> In this case, we've introduced a typo into one of our commands. When running scons, the result is: <pre> scons: Reading SConscript files ... scons: done reading SConscript files. scons: Building targets ... /opt/rsf/bin/sfspike n1=100 k1=50 > spike.rsf < spike.rsf sfasd scale=4.0 > spike1.rsf sh: sfasd: command not found scons: *** [spike1.rsf] Error 127 scons: building terminated because of errors. </pre> Again, the error message is pretty descriptive and could help you track down the error relatively quickly. It's important to note that in this case, the error was caught after SCons tried to execute the command and failed to do so, whereas the dependency error was caught before any commands were executed. This means that this typo error would kill a script that's been running a long time without any issues up till that point. Fortunately, SCons would restart the script at the point of failure thereby saving you all the additional time to recompute everything before this point in the script. These are only two of the most common errors that novice users will see. For additional information about debugging SConstructs, or for exceptionally strange errors please consult the [[SCons|online documentation]] or the RSF users mailing list.
Summary:
Please note that all contributions to Madagascar are considered to be released under the GNU Free Documentation License 1.3 or later (see
My wiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
English
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Getting Madagascar
download
Installation
GitHub repository
SEGTeX
Introduction
Package overview
Tutorial
Hands-on tour
Reproducible documents
Hall of Fame
User Documentation
List of programs
Common programs
Popular programs
The RSF file format
Reproducibility with SCons
Developer documentation
Adding programs
Contributing programs
API demo: clipping data
API demo: explicit finite differences
Community
Conferences
User mailing list
Developer mailing list
GitHub organization
LinkedIn group
Development blog
Twitter
Slack
Tools
What links here
Related changes
Special pages
Page information