Editing
Adding new programs to Madagascar
(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!
==Tips and tricks== ===Backups=== You may want to back up only your developer directory, not the entire Madagascar source tree. If you do not want to or do not have the permissions to change the backup scripts, you will need to make your RSF user directory a link to somewhere else. To get that to work, you need to modify your <tt>username/SConstruct</tt>. First thing in the file, define <syntaxhighlight lang="python"> RSF_src_root = '/path/to/madagascar/source/root/' </syntaxhighlight> Then, replace <tt>../..</tt> throughout the SConstruct with <syntaxhighlight lang="python"> os.path.join(RSF_src_root,'whatever_followed_after_dotdots') </syntaxhighlight> ===External libraries=== To link your programs to an external library, add to the <tt>env.Prepend</tt> statement in <tt>username/Sconstruct</tt> the paths to its <tt>include</tt> dir, <tt>lib</tt> dir and the name of the library you are linking to. ===Emacs customization=== If you use [http://www.gnu.org/software/emacs/ Emacs], the following might be helpful. * Install the [http://www.emacswiki.org/cgi-bin/wiki/PythonMode python mode] (if you don't have it installed already) and put <syntaxhighlight lang="lisp"> (setq auto-mode-alist (cons '("SConstruct" . python-mode) auto-mode-alist)) </syntaxhighlight> :in your <tt>.emacs</tt> file to enable it on <tt>SConstruct</tt> files. * Put <syntaxhighlight lang="lisp"> (set-default 'compile-command "scons") </syntaxhighlight> :in your <tt>.emacs</tt> file to have <tt>scons</tt> as the default compile command. * Use <syntaxhighlight lang="lisp"> (add-hook 'c-mode-common-hook '(lambda () (c-set-style "linux") (c-set-offset 'case-label 4) (setq c-basic-offset 4))) </syntaxhighlight> :to make sure that the identation in C files follows the previously adopted convention. === Vim customization === To enable syntax highlighting on SConstruct files in vim, add the following to your <tt>~/.vimrc</tt> file: <syntaxhighlight lang="bash"> au BufRead,BufNewFile SConstruct set filetype=python syntax enable </syntaxhighlight>
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