<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://ahay.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Karl</id>
	<title>Madagascar - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://ahay.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Karl"/>
	<link rel="alternate" type="text/html" href="https://ahay.org/wiki/Special:Contributions/Karl"/>
	<updated>2026-06-08T01:28:57Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.42.7</generator>
	<entry>
		<id>https://ahay.org/index.php?title=HoustonWW_2018_i&amp;diff=3778</id>
		<title>HoustonWW 2018 i</title>
		<link rel="alternate" type="text/html" href="https://ahay.org/index.php?title=HoustonWW_2018_i&amp;diff=3778"/>
		<updated>2019-06-03T21:37:14Z</updated>

		<summary type="html">&lt;p&gt;Karl: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==This is the invitation invitation to the 2018 working workshop.  The workshop report is at [[HoustonWW2018]] ==&lt;br /&gt;
==SEG Working Workshop - Python and Julia for Geophysics - August 8-11, 2018==&lt;br /&gt;
&lt;br /&gt;
[[Working Workshops]] as opposed to &amp;quot;talking workshops&amp;quot; are meetings where the participants work in small teams to develop new software code or to conduct computational experiments addressing a particular problem.  This workshop asks participants to create small groups to identify and address obstacles to more widespread use of Python and Julia in the geophysical community.  Results will be shared in lighting talks and code repositories.&lt;br /&gt;
&lt;br /&gt;
==Objective==&lt;br /&gt;
Python and Julia are good languages for prototyping and applying selected processing.  Lack of good examples that read geophysical data, interface to legacy processing systems, and implement common algorithms are obstacles to more widespread use of these languages in the geophysical community.  The objective of this working workshop is to identify and address these obstacles and promote more widespread use of the languages.&lt;br /&gt;
&lt;br /&gt;
Small groups of participants will form at the working workshop to address these issues.  You might work on I/O functions or a processing algorithm.  You might work on interfacing to Madagascar or Seismic Unix. You might want to produce examples of importing data into machine learning systems like tensor flow. Come to the workshop with ideas or listen to ideas presented by others. Create a small group and work on the project for three days.  Share your project at the end of the workshop in a lightning talk (a five minute presentation).  You&#039;re likely learn new skills, get some new ideas, and meet some new people that will help you in the future.  The working workshop is open to beginners and professionals.  &lt;br /&gt;
&lt;br /&gt;
Participants are expected to bring laptops with the software and data they will use during the workshop. Wifi internet access will be available.&lt;br /&gt;
&lt;br /&gt;
This working workshop hopes to provide a forum for geophysicist to learn, contribute, and network.&lt;br /&gt;
&lt;br /&gt;
==[https://docs.google.com/forms/d/e/1FAIpQLSc1W25g5phkB0HXnjiMGhBoTSfkCSctBeY_MWNN3oGK12V_uw/viewform?usp=sf_link  Registration]== &lt;br /&gt;
&lt;br /&gt;
The workshop participation is free but requires an application.  Space is limited.  The application deadline is August 1, 2018.&lt;br /&gt;
[https://docs.google.com/forms/d/e/1FAIpQLSc1W25g5phkB0HXnjiMGhBoTSfkCSctBeY_MWNN3oGK12V_uw/viewform?usp=sf_link Link to the application form]&lt;br /&gt;
&lt;br /&gt;
==Draft agenda==&lt;br /&gt;
*Wednesday afternoon August 8, 2017 1:00-6:00 PM. Optional work session to configure your computer and install open seismic software&lt;br /&gt;
**Do you want help getting your computer up to speed before the working workshop?  Come for informal, one-on-one assistance to:&lt;br /&gt;
*** Install Linux on your computer.&lt;br /&gt;
*** Configure Linux/OSX on your computer.&lt;br /&gt;
*** Install Seismic Unix on your computer&lt;br /&gt;
*** Install Madagascar on your computer.&lt;br /&gt;
*** Install Jupyter and python on your computer.  &lt;br /&gt;
*** Install a virtual Linux system on your Windows computer that will allow you to experiment with a Linux development environment. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Thursday  August 9, 2017 (working workshop starts)&lt;br /&gt;
**8:30-9:00 Coffee&lt;br /&gt;
**9:00-10:00 Introductions, project proposals, and team formations&lt;br /&gt;
**10:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
**1:00-2:00 Group discussion&lt;br /&gt;
**2:00-5:30 Breakout into work teams&lt;br /&gt;
&lt;br /&gt;
*Friday  August 10, 2016&lt;br /&gt;
**8:30-9:00 Coffee. Reform teams.&lt;br /&gt;
**9:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
**1:00-2:00 Group discussion&lt;br /&gt;
**2:00-5:30 Breakout into work teams&lt;br /&gt;
**6:00-8:00 Dinner&lt;br /&gt;
&lt;br /&gt;
*Saturday  August 11, 2016&lt;br /&gt;
**8:30-9:00 Coffee. Reform teams.&lt;br /&gt;
**9:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
** 1:00-2:00 Finalize lightning talks&lt;br /&gt;
**1:00-3:00 Lighting talks&lt;br /&gt;
&lt;br /&gt;
==Contact us==&lt;br /&gt;
If you have some ideas about working workshops, tell us about it!  Send email to [mailto:seismic.working.workshop@gmail.com seismic.working.workshop@gmail.com].&lt;br /&gt;
&lt;br /&gt;
==Workshow Location==&lt;br /&gt;
We will meet in room #219 Farish Hall at the University of Houston.  Below are area and campus maps.&lt;br /&gt;
&lt;br /&gt;
[[File:Uhlocation.png  | 500px ]]&lt;br /&gt;
[[File:Uhfarishhall.png  | 500px ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Supporting Organizations==&lt;br /&gt;
===Bureau of Economic Geology, University of Texas at Austin===&lt;br /&gt;
[[Image:Beglogo.jpg]]&lt;br /&gt;
===Society of Exploration Geophysicists===&lt;br /&gt;
[[Image:SEG Logo_Horizontal_SM.png|400px]]&lt;br /&gt;
===SEG Wavelets===&lt;br /&gt;
SEG Wavelets is the University of Houston&#039;s SEG student chapter. It is devoted to promoting education in exploration geophysics. We work with professional organizations, industry professionals, University of Houston faculty, and other student organizations to bring students educational, social, and possible future employment opportunities. More details can be found on our [http://segwavelets.uh.edu/ website].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Karl</name></author>
	</entry>
	<entry>
		<id>https://ahay.org/index.php?title=Advanced_Installation&amp;diff=3757</id>
		<title>Advanced Installation</title>
		<link rel="alternate" type="text/html" href="https://ahay.org/index.php?title=Advanced_Installation&amp;diff=3757"/>
		<updated>2018-12-14T21:55:15Z</updated>

		<summary type="html">&lt;p&gt;Karl: /* Mac OS X */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:Fotolia_419157_XS.jpg|right|]]&lt;br /&gt;
Before reading this document, please familiarize yourself with the [[Installation|short Installation guide]].&lt;br /&gt;
=What the installation process does=&lt;br /&gt;
The term &amp;quot;installation&amp;quot; in the title is used for brevity, and it actually covers all three steps: configuration, build and install.&lt;br /&gt;
# Configure: determine what tools are available on the system and how they should be used to built the software. Creates a layer of abstraction so that the build is platform-independent. Should ideally either solve or flag all problems, so that the build either works, or does not proceed at all.&lt;br /&gt;
# Build: compiles the software and documentation using RSFSRC/build as a &amp;quot;workplace&amp;quot;&lt;br /&gt;
# Install: moves the compiled executables and the documentation to the final locations in $RSFROOT, sometimes changing filenames. Kept separate from build so that it can be done by root, and to avoid build failures leaving junk files all over the system.&lt;br /&gt;
A successful installation will have created in &amp;lt;tt&amp;gt;$RSFROOT&amp;lt;/tt&amp;gt; the following directories:&lt;br /&gt;
* &amp;lt;tt&amp;gt;bin/&amp;lt;/tt&amp;gt;: executable programs&lt;br /&gt;
* &amp;lt;tt&amp;gt;doc/&amp;lt;/tt&amp;gt;: auto-generated HTML documentation&lt;br /&gt;
* &amp;lt;tt&amp;gt;include/&amp;lt;/tt&amp;gt;: header files with info on library procedures; fonts&lt;br /&gt;
* &amp;lt;tt&amp;gt;lib/&amp;lt;/tt&amp;gt;: libraries and Python modules&lt;br /&gt;
&lt;br /&gt;
=Old (1.0 and 1.1) version installation=&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;tt&amp;gt;$RSFROOT/etc/madagascar/&amp;lt;/tt&amp;gt; as the location of &amp;lt;tt&amp;gt;env&amp;lt;/tt&amp;gt; scripts instead of &amp;lt;tt&amp;gt;$RSFROOT/share/madagascar/etc/&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=Old (0.9.9) version installation=&lt;br /&gt;
&lt;br /&gt;
====Environment variables====&lt;br /&gt;
Example configuration for &amp;lt;tt&amp;gt;bash&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
export RSFROOT=/usr/local/rsf # directory where Madagascar will be installed. &lt;br /&gt;
if [ -n &amp;quot;$PYTHONPATH&amp;quot; ]; then&lt;br /&gt;
export PYTHONPATH=${PYTHONPATH}:$RSFROOT/lib&lt;br /&gt;
else&lt;br /&gt;
export PYTHONPATH=$RSFROOT/lib&lt;br /&gt;
fi&lt;br /&gt;
export PATH=$RSFROOT/bin:$PATH&lt;br /&gt;
export DATAPATH=/var/tmp/&lt;br /&gt;
export MANPATH=$RSFROOT/share/man:$(manpath)&lt;br /&gt;
export LD_LIBRARY_PATH=$RSFROOT/lib:$LD_LIBRARY_PATH&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Notice the slash at the end of the &amp;lt;tt&amp;gt;DATAPATH&amp;lt;/tt&amp;gt; variable. &lt;br /&gt;
&lt;br /&gt;
Example configuration for &amp;lt;tt&amp;gt;csh&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;tcsh&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
setenv RSFROOT /usr/local/rsf&lt;br /&gt;
if ($?PYTHONPATH) then&lt;br /&gt;
setenv PYTHONPATH ${PYTHONPATH}:$RSFROOT/lib&lt;br /&gt;
else&lt;br /&gt;
setenv PYTHONPATH $RSFROOT/lib&lt;br /&gt;
endif&lt;br /&gt;
set path = ($RSFROOT/bin $path)&lt;br /&gt;
setenv DATAPATH /var/tmp/&lt;br /&gt;
setenv MANPATH $RSFROOT/share/man:`manpath`&lt;br /&gt;
setenv LD_LIBRARY_PATH $RSFROOT/lib:$LD_LIBRARY_PATH&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Notice the backticks surrounding the call to &amp;lt;tt&amp;gt;manpath&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Be aware that on some systems /var/tmp gets automatically cleaned at some intervals, so if you want to keep your data binaries for a long time, set &amp;lt;tt&amp;gt;DATAPATH&amp;lt;/tt&amp;gt; to another location where you have write access and that allows large files.&lt;br /&gt;
&lt;br /&gt;
====Software construction====&lt;br /&gt;
  &lt;br /&gt;
#Configuration. Change to the top source directory and run &amp;lt;pre&amp;gt;./configure&amp;lt;/pre&amp;gt; You can examine the &amp;lt;tt&amp;gt;config.py&amp;lt;/tt&amp;gt; file that this command generates.  Additional options are available. You can obtain a full list of customizable variables by running &amp;lt;tt&amp;gt;scons -h&amp;lt;/tt&amp;gt;. For example, to install C++ and Fortran-90 API bindings in addition to the basic package, run &amp;lt;pre&amp;gt;./configure API=c++,fortran-90&amp;lt;/pre&amp;gt; &lt;br /&gt;
#Building and installing the package. Run &amp;lt;tt&amp;gt;scons install&amp;lt;/tt&amp;gt; or the following two commands in succession:  &amp;lt;pre&amp;gt;make; make install&amp;lt;/pre&amp;gt; or &amp;lt;pre&amp;gt;scons; scons install&amp;lt;/pre&amp;gt; If you need &amp;quot;root&amp;quot; privileges for installing under &amp;lt;tt&amp;gt;&amp;amp;#36;RSFROOT&amp;lt;/tt&amp;gt;, you may need to run &amp;lt;pre&amp;gt;su; scons install &amp;lt;/pre&amp;gt; or &amp;lt;pre&amp;gt;sudo scons install&amp;lt;/pre&amp;gt;&lt;br /&gt;
#Cleaning. To clean all intermediate files generated by SCons, run &amp;lt;pre&amp;gt;make clean&amp;lt;/pre&amp;gt; or &amp;lt;pre&amp;gt;scons -c&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Prerequisites=&lt;br /&gt;
Basic prerequisites are described in the [[Installation|short Installation guide]]. Here are some additional details. &lt;br /&gt;
==Compilers==&lt;br /&gt;
Madagascar has been built successfully with the following compilers, and possibly with others:&lt;br /&gt;
* gcc&lt;br /&gt;
* Intel (icc/ifort)&lt;br /&gt;
* open64&lt;br /&gt;
* clang&lt;br /&gt;
* cc (Solaris)&lt;br /&gt;
&lt;br /&gt;
==Python and SCons==&lt;br /&gt;
As described below under [[Advanced Installation#Platform-specific installation advice | Platform-specific installation advice]], Madagascar supports the oldest non-deprecated Python version currently supported by the latest stable version of [http://scons.org/ SCons].  If your version of Python is older and you experience problems you should probably [http://www.python.org/ upgrade].&lt;br /&gt;
&lt;br /&gt;
Madagascar includes the latest stable version of SCons and the configure scripts will try to install it for you in RSFROOT if you don&#039;t have it already.  However, if you have an older version of SCons the configure scripts will not try to install the newer version. Your older version might work fine, but Madagascar attempts to support only the latest stable version of SCons, so if you have problems you should upgrade.&lt;br /&gt;
&lt;br /&gt;
To install the SCons bundled with Madagascar go to &amp;lt;tt&amp;gt;RSFSRC/scons&amp;lt;/tt&amp;gt;, unpack the tar file, and type&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
python setup.py install&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will install SCons in the standard location. You might need root privileges. If you don&#039;t have root privileges, or you don&#039;t want to interfere with the system SCons you can install it somewhere else with a --prefix option. A logical choice is to put it in RSFROOT like this:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
python setup.py install --prefix=$RSFROOT&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Location==&lt;br /&gt;
As long as you set the environment variables and directory permissions correctly, it does not matter in what part of your filesystem you place the install. If you have the luxury of installing anywhere, it is good practice to follow the [http://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard Filesystem Hierarchy Standard] and either:&lt;br /&gt;
# Install everything (including &amp;lt;tt&amp;gt;figs&amp;lt;/tt&amp;gt; if you do testing) under &amp;lt;tt&amp;gt;/usr/local/rsf&amp;lt;/tt&amp;gt;, with the source tree in &amp;lt;tt&amp;gt;/usr/local/rsf/src&amp;lt;/tt&amp;gt;, OR &lt;br /&gt;
# Put the source tree in &amp;lt;tt&amp;gt;/usr/local/src/rsf&amp;lt;/tt&amp;gt;, and specify &amp;lt;tt&amp;gt;RSFROOT=/usr/local&amp;lt;/tt&amp;gt;, so that header files and binaries go in &amp;lt;tt&amp;gt;/usr/local/bin&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;/usr/local/include&amp;lt;/tt&amp;gt;. To follow the standard, before installing set &amp;lt;tt&amp;gt;RSFDOC=/usr/local/share/rsf/doc&amp;lt;/tt&amp;gt; and create the appropriate directories. The auto-generated HTML documentation will get put there. Also, if installed, the figs directory for testing should be &amp;lt;tt&amp;gt;/usr/local/share/rsf/figs/&amp;lt;/tt&amp;gt;.&lt;br /&gt;
# Package Madagascar (i.e. build a RPM, etc) and install it in the default locations. For RPMs, those are as like the ones from the previous option, just directly in the &amp;lt;tt&amp;gt;/usr/&amp;lt;/tt&amp;gt; hierarchy, instead of in the &amp;lt;tt&amp;gt;/usr/local/&amp;lt;/tt&amp;gt; one.&lt;br /&gt;
&lt;br /&gt;
==Disk space==&lt;br /&gt;
At present (Feb 2007, r2530), the source directory containing the build tree from the development version was approx. 200Mb, the full installation (&amp;lt;tt&amp;gt;bin/&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;doc/&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;include/&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;lib&amp;lt;/tt&amp;gt;) is 31Mb, and &amp;lt;tt&amp;gt;figs/&amp;lt;/tt&amp;gt; (the optional directory if you want to do testing) is about 10 Gb. The stable version is significantly smaller.&lt;br /&gt;
&lt;br /&gt;
The only Madagascar-related directory where disk space can be an issue is &amp;lt;tt&amp;gt;$DATAPATH&amp;lt;/tt&amp;gt;. Real 3-D seismic datasets can be measured in Terabytes. Buggy programs/processing flows can fill up &amp;lt;tt&amp;gt;$DATAPATH&amp;lt;/tt&amp;gt;. A real problem are &amp;quot;disk memory leaks&amp;quot; -- removing header files with anything else than &amp;lt;tt&amp;gt;sfrm&amp;lt;/tt&amp;gt; will leave the binaries intact. Crashed jobs which start to write to binary but never get to write the header also produce &amp;quot;leaks&amp;quot;. Experience has shown that over time &amp;lt;tt&amp;gt;$DATAPATH&amp;lt;/tt&amp;gt; inexorably fills up. You may need to &lt;br /&gt;
# keep irreplaceable data and expensive results in a separate place;&lt;br /&gt;
# remove the oldest files in &amp;lt;tt&amp;gt;$DATAPATH&amp;lt;/tt&amp;gt; whenever the amount of free space declines under a preset threshold.&lt;br /&gt;
&lt;br /&gt;
==Dependencies==&lt;br /&gt;
Some platforms feature complete lists of dependencies. See [[Advanced Installation#Platform-specific installation advice | Platform-specific installation advice]] for details.&lt;br /&gt;
===C++ API===&lt;br /&gt;
A C++ compiler. SCons is smart and will try to find it for you. If it does not work specify the path to your compiler in the &amp;lt;tt&amp;gt;CXX&amp;lt;/tt&amp;gt; environment variable (can be passed as an option to the configuration script, like the &amp;lt;tt&amp;gt;API&amp;lt;/tt&amp;gt; one).&lt;br /&gt;
===F77 API===&lt;br /&gt;
A Fortran 77 compiler. If SCons does not find one, then you can either specify its path through the &amp;lt;tt&amp;gt;F77&amp;lt;/tt&amp;gt; variable, or if the executable is in your path, add its name to the list of F77 compilers in &amp;lt;tt&amp;gt;RSFSRC/configure.py&amp;lt;/tt&amp;gt; .&lt;br /&gt;
===F90 API===&lt;br /&gt;
Same as for Fortran 77 &amp;amp;ndash; just substitute &amp;lt;tt&amp;gt;F90&amp;lt;/tt&amp;gt;. If using the &amp;lt;tt&amp;gt;gfortran&amp;lt;/tt&amp;gt; compiler, make sure to get [http://gcc.gnu.org/wiki/GFortranBinaries the latest version]. If you have more than one compiler installed on your system, specify the desired one at configuration time:&lt;br /&gt;
&amp;lt;bash&amp;gt;&lt;br /&gt;
./configure API=f90 F90=/path/to/preferred/compiler&lt;br /&gt;
&amp;lt;/bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Java API===&lt;br /&gt;
There are two styles of API, old (1.0 release and previous) and new. The two APIs are not compatible with each other.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;old&amp;quot; interface requires the Mines Java Toolkit for fast Java file IO. The Mines JTK, is an open-source Java package that can be downloaded from [http://inside.mines.edu/~dhale/jtk/ Mines JTK]. Currently, the &amp;quot;old&amp;quot; interface will also build alongside the new one if the MINESJTK environment variable exists, and can be used as was previously.&lt;br /&gt;
&lt;br /&gt;
To install the new API, you need the (Oracle) JDK. Set your JAVA_HOME environment variable to the location of the jdk (on Ubuntu 10.04 this is: /usr/lib/jvm/java-6-openjdk), then reconfigure (./configure API=java ...) and reinstall.  &lt;br /&gt;
&lt;br /&gt;
Ignore the SWIG warnings (there are lots). &lt;br /&gt;
&lt;br /&gt;
Make sure to set your LD_LIBRARY_PATH to $RSFROOT/lib .&lt;br /&gt;
&lt;br /&gt;
If you want to include additional Java packages, you can set them using your shell&#039;s CLASSPATH variable.  This environment variable is now automatically passed onto all Java classes in SCons.&lt;br /&gt;
&lt;br /&gt;
The installation can be tested using the example demonstrating the new API in api/java/test .&lt;br /&gt;
&lt;br /&gt;
===Matlab API===&lt;br /&gt;
Besides Matlab itself, you need Mex, which compiles C code into regular Matlab functions. Use the &amp;lt;tt&amp;gt;MATLAB&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;MEX&amp;lt;/tt&amp;gt; environment variables to specify their paths if they are installed, but not found.&lt;br /&gt;
===Octave API===&lt;br /&gt;
The Octave function compiler (&amp;lt;tt&amp;gt;mkoctfile&amp;lt;/tt&amp;gt;) is sometimes bundled in a separate package, so it may be missing from the Octave installation.&lt;br /&gt;
&lt;br /&gt;
===Python API===&lt;br /&gt;
This API requires [http://www.swig.org/ SWIG], [http://numpy.scipy.org/ numpy] and the Python development kit. Numpy requires Python 2.4 or newer (i.e. RHEL 5 or newer). However, these dependencies are unnecessary for the common case when Python is just used as [http://en.wikipedia.org/wiki/Glue_language glue] to create chains of programs, and it only needs to read the RSF header, and not the binary. To allow Python [http://en.wikipedia.org/wiki/Meta-programs metaprograms] in madagascar to function, and programming in this style to be done, a fallback development kit implementing only the header-related functionality will be installed in the lack of these dependencies.&lt;br /&gt;
&lt;br /&gt;
===Python modules in user space===&lt;br /&gt;
Python is an evolving language. Many large systems have old versions for stability reasons, and administrators of such large systems tend to not install all software users may wish, and to not allow access to rpm either. To install a module in your user space, download the tarball, unzip it, cd into the directory and run: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;python setup.py install --prefix=/path/to/your/place&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The installer will create a subdirectory named &amp;lt;tt&amp;gt;lib&amp;lt;/tt&amp;gt;, or &amp;lt;tt&amp;gt;lib64&amp;lt;/tt&amp;gt; under the directory above. These &amp;lt;tt&amp;gt;lib*&amp;lt;/tt&amp;gt; dirs will have a directory named &amp;lt;tt&amp;gt;python&amp;lt;/tt&amp;gt;, or &amp;lt;tt&amp;gt;python2.3&amp;lt;/tt&amp;gt; for example, and those will have a subdirectory named &amp;lt;tt&amp;gt;site-packages&amp;lt;/tt&amp;gt;. Add all paths to these &amp;lt;tt&amp;gt;site-packages&amp;lt;/tt&amp;gt; subdirectories in your &amp;lt;tt&amp;gt;PYTHONPATH&amp;lt;/tt&amp;gt; environment variable. Some (&amp;lt;tt&amp;gt;numpy&amp;lt;/tt&amp;gt;) may create a &amp;lt;tt&amp;gt;bin&amp;lt;/tt&amp;gt; directory that needs to be added to &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=Environment variables=&lt;br /&gt;
Besides the variables defined in env.sh or env.csh (see the [[Installation|short Installation guide]]), Madagascar programs may read the variables below. They usually have reasonable defaults and were introduced just to provide more power to the advanced user.&lt;br /&gt;
&lt;br /&gt;
For future documentation writers: the environment variables read by Madagascar that have not been documented below can be found by running the script &amp;lt;tt&amp;gt;$RSFSRC/admin/find_env_var.py&amp;lt;/tt&amp;gt;. If the script does not exist or does not work, a summary of all environment variable calls can be obtained by going to $RSFSRC, temporarily moving the directory &amp;lt;tt&amp;gt;build/&amp;lt;/tt&amp;gt; outside RSFSRC, and typing&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
grep environ.get *.py */*.py */*/*.py */*/*/*.py&lt;br /&gt;
grep getenv           */*.c  */*/*.c  */*/*/*.c&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Used by the Madagascar core==&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; style=&amp;quot;background:#ffdead;&amp;quot;|Variables introduced by Madagascar&#039;s non-graphic programs&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Name&#039;&#039;&#039; || &#039;&#039;&#039;Default&#039;&#039;&#039; || Meaning&lt;br /&gt;
|-&lt;br /&gt;
| RSF_DATASERVER || &amp;lt;nowiki&amp;gt;ftp://egl.beg.utexas.edu/&amp;lt;/nowiki&amp;gt; || Data server for benchmark datasets&lt;br /&gt;
|-&lt;br /&gt;
| RSFDOC || $RSFROOT/doc || Directory for the HTML self-doc&lt;br /&gt;
|-&lt;br /&gt;
| RSFFIGS || $RSFROOT/figs || Directory with figures for testing examples in $RSFSRC/book&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| RSFALTFIGS || $RSFFIGS || Alternate directory with figures for testing examples not in $RSFSRC/book&lt;br /&gt;
|-&lt;br /&gt;
| RSFMEMSIZE || 100 || Maximum RAM (Mb) to be used by some programs  &lt;br /&gt;
|-&lt;br /&gt;
| RSFSRC || undefined || Root of the Madagascar source tree&lt;br /&gt;
|-&lt;br /&gt;
| TMPDATAPATH || $DATAPATH || Datapath for temporary files on local disk.&lt;br /&gt;
|-&lt;br /&gt;
| LATEX2HTML || undefined || LateX2HTML customization directory&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; style=&amp;quot;background:#ffdead;&amp;quot;|Variables introduced by Madagascar graphics programs &lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Name&#039;&#039;&#039; || &#039;&#039;&#039;Default&#039;&#039;&#039; || Meaning&lt;br /&gt;
|-&lt;br /&gt;
| DEFAULT_PAPER_SIZE || &amp;quot;letter&amp;quot; || For pspen. Other options: legal, a3, a4, a5.&lt;br /&gt;
|-&lt;br /&gt;
| FATMULT || ? || Fatness multiplication factor. &lt;br /&gt;
|-&lt;br /&gt;
| GIFBORDER || 0.25 || For vplot2gif (spacing)&lt;br /&gt;
|-&lt;br /&gt;
| GIFDELAY || 100 || For vplot2gif (for animations)&lt;br /&gt;
|-&lt;br /&gt;
| IMAGE_TYPE || &#039;png&#039; || Icon type for LateX2HTML &lt;br /&gt;
|-&lt;br /&gt;
| PATTERNMULT || None || Pattern multiplication factor  &lt;br /&gt;
|-&lt;br /&gt;
| PLOTSTYLE || None || Used in vplot&lt;br /&gt;
|-&lt;br /&gt;
| PPI || 75 || For vplot2gif (screen resolution)&lt;br /&gt;
|-&lt;br /&gt;
| PPMSCALE || 1 || For vplot2gif&lt;br /&gt;
|-&lt;br /&gt;
| PSBORDER || 0.05 || For vplot2eps (border around the plot)&lt;br /&gt;
|-&lt;br /&gt;
| PSPRINTER || postscript or colorps || For pspen&lt;br /&gt;
|-&lt;br /&gt;
| PSTEXPENOPTS || color=n fat=1 fatmult=1.5 invras=y || Other vplot2eps options &lt;br /&gt;
|-&lt;br /&gt;
| VPLOTFONTDIR || $RSFROOT/include || Dir with backup fonts in case the runtime-loaded vplot fonts are not found&lt;br /&gt;
|-&lt;br /&gt;
| VPLOTSPOOLDIR || /tmp || Where to put vplot tmp files&lt;br /&gt;
|-&lt;br /&gt;
| WSTYPE || &amp;quot;default&amp;quot; || Workstation type.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:#ffdead;&amp;quot;| Variables set by OS/other apps, read-only to Madagascar&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Name&#039;&#039;&#039; || &#039;&#039;&#039;Primarily used/set by&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| CWPROOT || Seismic Unix&lt;br /&gt;
|-&lt;br /&gt;
| DISPLAY || Operating System (OS)&lt;br /&gt;
|-&lt;br /&gt;
| HOME || OS&lt;br /&gt;
|-&lt;br /&gt;
| LD_LIBRARY_PATH || linker&lt;br /&gt;
|-&lt;br /&gt;
| MATLABPATH || Matlab&lt;br /&gt;
|-&lt;br /&gt;
| XAUTHORITY || X-Windows&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Used by the Madagascar build process and parallelization utilities==&lt;br /&gt;
Type &amp;lt;tt&amp;gt;scons -h&amp;lt;/tt&amp;gt; in RSFSRC to get a list of environment variables that affect the build process, with explanations, defaults and actual values. Below are more detailed explanations for some of them:&lt;br /&gt;
* &amp;lt;tt&amp;gt;RSF_THREADS&amp;lt;/tt&amp;gt;: used by &amp;lt;tt&amp;gt;pscons&amp;lt;/tt&amp;gt; to determine on how many threads to run on the local node, overriding the number of threads detected by Madagascar&lt;br /&gt;
* &amp;lt;tt&amp;gt;RSF_CLUSTER&amp;lt;/tt&amp;gt;: used by &amp;lt;tt&amp;gt;pscons&amp;lt;/tt&amp;gt; to determine on which cluster nodes to run, and on how many CPUs&lt;br /&gt;
&lt;br /&gt;
==Used by the Matlab API==&lt;br /&gt;
To use the Matlab API, you need to add &amp;lt;tt&amp;gt;$RSFROOT/lib&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;MATLABPATH&amp;lt;/tt&amp;gt;&lt;br /&gt;
==Used by the Octave API==&lt;br /&gt;
To use the Octave API, you need to add &amp;lt;tt&amp;gt;$RSFROOT/lib&amp;lt;/tt&amp;gt; to Octave&#039;s path. Determine Octave&#039;s version with&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
octave -v | head -1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
If your version is lower than 2.9.6, type at a Unix command line:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
echo &#039;LOADPATH = &amp;quot;::$RSFROOT/lib/octave&amp;quot;&#039; &amp;gt;&amp;gt; ~/.octaverc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
For later versions, use:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
echo &#039;addpath([getenv(&amp;quot;RSFROOT&amp;quot;) &amp;quot;/lib/octave&amp;quot;])&#039; &amp;gt;&amp;gt; ~/.octaverc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
==Used by the Java API==&lt;br /&gt;
New-style (post-1.0) API: Needs &amp;lt;tt&amp;gt;JAVA_HOME&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Old-style API (1.0 and before): The path to the downloaded Mines JTK must be specified in the MINESJTK environment variable in order to install the Java API. For example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
export MINESJTK=/home/user/edu_mines_jtk.jar&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==RSFROOT for NFS-shared user home directories==&lt;br /&gt;
Heterogeneous networks with user home directories shared through [http://en.wikipedia.org/wiki/Network_File_System_(protocol) NFS] are quite common in many institutions. In addition, even when the architecture is the same (i.e. 64-bit) and the operating system is the same (i.e. [http://en.wikipedia.org/wiki/RHEL RHEL]), the difference between operating system versions may be very significant because clusters may run legacy versions, while desktop workstations may run the latest-and-greatest (even beta), and entirely different Madagascar versions may be needed to support both. &lt;br /&gt;
&lt;br /&gt;
One possible solution of detecting the distribution version and architecture and setting RSFROOT appropriately is shown below. In the example network, all RHEL4 machines have the same architecture, but there are RHEL 3 machines with several architectures:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
REDHAT_RELEASE=`awk -F&#039;release&#039; &#039;{ print $2 }&#039; /etc/redhat-release | awk -F&#039; &#039; &#039;{ print $1 }&#039;`&lt;br /&gt;
&lt;br /&gt;
RSFROOT=/usr/local/rsf/rhel$REDHAT_RELEASE&lt;br /&gt;
&lt;br /&gt;
if [ $REDHAT_RELEASE == &#039;4&#039; ] ; then&lt;br /&gt;
    export RSFROOT&lt;br /&gt;
elif [ $REDHAT_RELEASE == &#039;3&#039; ] ; then&lt;br /&gt;
    export RSFROOT=$RSFROOT/$ARCH&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Of course, the Madagascar administrator will have to download appropriate versions of Madagascar to each $RSFROOT, and compile them on the appropriate system.&lt;br /&gt;
&lt;br /&gt;
If you have many kinds of systems to maintain, with multiple versions of Madagascar, and users have more than one shell, you may find it easy to outsource the complex logic to the easy-to-debug Python, i.e.:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
export RSFROOT=`$M8R_SETUP/get_rsfroot.py`&lt;br /&gt;
export PYTHONPATH=`$M8R_SETUP/edit_pythonpath.py`&lt;br /&gt;
export PATH=`$M8R_SETUP/edit_path.py`&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and similarly for (t)csh. The Python scripts determine the operating system and its version, determine the machine name, and simply print to stdout the desired string.&lt;br /&gt;
&lt;br /&gt;
==Eclipse + Pydev==&lt;br /&gt;
If you use [http://eclipse.org/ Eclipse] with [http://pydev.org/ Pydev], [http://pydev.org/manual_101_interpreter.html#id2 configure the interpreter] by adding &amp;lt;tt&amp;gt;$RSFROOT/lib&amp;lt;/tt&amp;gt; to the &amp;lt;tt&amp;gt;PYTHONPATH&amp;lt;/tt&amp;gt; for your chosen interpreter.&lt;br /&gt;
&lt;br /&gt;
=Platform-specific installation advice=&lt;br /&gt;
==Supported platforms==&lt;br /&gt;
Madagascar attempts to support any [http://en.wikipedia.org/wiki/POSIX POSIX-compliant] operating system demanded by users. For systems that bundle Python (i.e. Linux distributions, BSDs), backwards compatibility will attempt to cover those systems that were bundled with the oldest non-deprecated Python version currently supported by the latest stable version of [http://scons.org/ SCons]. For example, in early 2009 the stable SCons release (1.2) supported Python 2.2 or newer. [http://distrowatch.com/table.php?distribution=redhat Python 2.2 was bundled by RHEL3], so RHEL 3 and newer are supported. &lt;br /&gt;
&lt;br /&gt;
Attempts for backward compatibility with a given operating system are also stopped if the operating system itself becomes unsupported. For example, Python 2.2 was bundled by Fedora 1 and newer, but in January 2010 only Fedora 11 and 12 are actively maintained. Thus, in January 2010 Madagascar was not attempting to support Fedora 1, even though it included Python 2.2.&lt;br /&gt;
&lt;br /&gt;
Please keep in mind that the above statements constitute only general guidelines for what will be attempted, and do not constitute in any way a warranty of support. An application of the above guidelines to some Linux distributions follows:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Support info&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Distribution&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Life Cycle&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Supported versions&lt;br /&gt;
|-&lt;br /&gt;
| RHEL/CentOS/Scientific Linux&lt;br /&gt;
| [https://www.redhat.com/security/updates/errata/ 7 years]&lt;br /&gt;
| &lt;br /&gt;
* 6 until 2017-11-30&lt;br /&gt;
* 5 until 2014-03-31&lt;br /&gt;
|-&lt;br /&gt;
| Fedora&lt;br /&gt;
| [http://fedoraproject.org/wiki/Fedora_Release_Life_Cycle Release X maintained until one month after the release of X+2]&lt;br /&gt;
| &lt;br /&gt;
* 15 until 2012-06-24&lt;br /&gt;
* 14 until 2011-12-02&lt;br /&gt;
|-&lt;br /&gt;
| Ubuntu&lt;br /&gt;
| [https://wiki.ubuntu.com/Releases Releases every 6 mo, maintained for 1.5 yrs; LTS versions every 2 yrs, maintained for 5 yrs]&lt;br /&gt;
| &lt;br /&gt;
* 15.10 until July 2016&lt;br /&gt;
* 14.04 LTS until end of April 2019&lt;br /&gt;
* 12.04.4 LTS until end of April 2017&lt;br /&gt;
|-&lt;br /&gt;
| Debian&lt;br /&gt;
| [http://wiki.debian.org/DebianLenny Usually: stable releases every 1.5-3 yrs, release X maintained 1 yr after release X+1]&lt;br /&gt;
| &lt;br /&gt;
* 6 until its TBD end of life (approx. 2014)&lt;br /&gt;
* 5 until 2012-04&lt;br /&gt;
|- &lt;br /&gt;
| openSUSE&lt;br /&gt;
| [http://en.opensuse.org/Lifetime openSUSE releases Lifetime of 1.5-2.5 years]&lt;br /&gt;
| &lt;br /&gt;
* 11.4 until 2012-09-10&lt;br /&gt;
* 11.3 until 2012-01-15&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Ubuntu==&lt;br /&gt;
In &#039;&#039;&#039;Ubuntu 18.04&#039;&#039;&#039;, you can install the essential Madagascar depenency by running&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install libxaw7-dev freeglut3-dev libnetpbm10-dev libgd-dev libplplot-dev \&lt;br /&gt;
libavcodec-dev libcairo2-dev libjpeg-dev swig python-dev python-numpy g++ gfortran \&lt;br /&gt;
libopenmpi-dev libfftw3-dev libsuitesparse-dev python-epydoc scons git emacs25&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In &#039;&#039;&#039;Ubuntu 15.10 &#039;&#039;Wily Werewolf&#039;&#039;&#039;&#039;&#039; (as well as some previous versions), you can install the essential Madagascar depenency by running&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install libxaw7-dev &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and (optionally) all of Madagascar&#039;s dependencies by running&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install libxaw7-dev freeglut3-dev libnetpbm10-dev libgd-dev libplplot-dev \&lt;br /&gt;
libavcodec-dev libcairo2-dev libjpeg-dev swig python-dev python-numpy g++ gfortran \&lt;br /&gt;
libopenmpi-dev libfftw3-dev libsuitesparse-dev python-epydoc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In Ubuntu 13.04 &#039;&#039;Raring Ringtail&#039;&#039;, you can install all of Madagascar&#039;s dependencies by running&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install freeglut3-dev g++ gfortran libgd2-xpm-dev libx11-dev libxaw7-dev \&lt;br /&gt;
libnetpbm10-dev swig python-dev python-numpy libblas-dev libcairo2-dev liblapack-dev \&lt;br /&gt;
libavcodec-dev python-epydoc scons&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In Ubuntu 12.10 &#039;&#039;Quantal Quetzal&#039;&#039;, you can install all of Madagascar&#039;s dependencies by running&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install freeglut3-dev g++ gfortran libgd2-xpm-dev libx11-dev libxaw7-dev \&lt;br /&gt;
libnetpbm10-dev swig python-dev python-numpy libblas-dev libcairo2-dev liblapack-dev \&lt;br /&gt;
libavcodec-dev python-epydoc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In Ubuntu 12.04 &#039;&#039;Precise Pangolin&#039;&#039;, you can install all of Madagascar&#039;s dependencies by running&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install scons openmpi-bin libopenmpi-dev freeglut3-dev g++ gfortran libgd2-xpm-dev \&lt;br /&gt;
libglew1.6-dev libx11-dev libxaw7-dev libnetpbm10-dev swig python-dev python-scipy python-numpy \&lt;br /&gt;
libtiff4-dev scons units libblas-dev libcairo2-dev liblapack-dev libavcodec-dev python-epydoc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In Ubuntu 10.10 &#039;&#039;Maverick Meerkat&#039;&#039;, you can install all of Madagascar&#039;s dependencies by running &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install freeglut3-dev g++ gfortran libgd2-xpm-dev libglew1.5-dev libjpeg62-dev \&lt;br /&gt;
libx11-dev libxaw7-dev libnetpbm10-dev swig python-dev python-scipy python-numpy libtiff4-dev \&lt;br /&gt;
scons units libblas-dev libcairo2-dev libavcodec-dev libplplot-dev &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In Ubuntu 9.04 &#039;&#039;Jaunty Jackalope&#039;&#039;, the corresponding command is&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install freeglut3-dev g++ gfortran libc6-dev libgd2-xpm-dev libglew1.5-dev libjpeg62-dev \&lt;br /&gt;
libx11-dev libxaw7-dev libnetpbm10-dev swig python-dev python-scipy python-numpy libtiff4-dev scons units &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Earlier versions may work with&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install mesa-libGL-devel g++ g77 libc6-dev libgd2-xpm-dev libglew-dev libjpeg62-dev \&lt;br /&gt;
libx11-dev libxaw7-dev libnetpbm10-dev swig python-dev python-scipy python-numpy libtiff4-dev scons units &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If working with the development version, you will also need &amp;lt;tt&amp;gt;git&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;subversion&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Fedora, RedHat, CentOS, Scientific Linux, openSUSE==&lt;br /&gt;
&lt;br /&gt;
Install essential Madagascar dependencies with&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo yum install gcc libXaw-devel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dependency package names, sorted by Linux distribution and Madagascar feature they provide. Packages that are not included in the standard distro repositories are hyperlinked to their providers. The tables below cover build dependencies. &lt;br /&gt;
&lt;br /&gt;
Names of packages that are runtime dependencies are &#039;&#039;&#039;highlighted&#039;&#039;&#039; in the tables below (task under construction).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note: In the future, it should be possible for the configuration scripts to output the dependency tables below, so that they are guaranteed to be in synch with a given Madagascar version&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Minimal install (&amp;quot;Core&amp;quot;), publishing and development&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Core&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | LaTeX&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Development version&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | C++ API&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | F77 API, F90 API&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Python API&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Java API&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Octave API&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Matlab API&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Fedora 15&lt;br /&gt;
| binutils, gcc, glibc-headers, python&lt;br /&gt;
| texlive-latex&lt;br /&gt;
| subversion&lt;br /&gt;
| gcc-c++&lt;br /&gt;
| gcc-gfortran&lt;br /&gt;
| numpy, swig, python-devel&lt;br /&gt;
| Java (Sun&#039;s? IcedTea?)&lt;br /&gt;
| octave, octave-devel&lt;br /&gt;
| [http://www.mathworks.com/ Matlab] with Mex&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Fedora 14&lt;br /&gt;
| binutils, gcc, glibc-headers, python&lt;br /&gt;
| texlive-latex&lt;br /&gt;
| subversion&lt;br /&gt;
| gcc-c++&lt;br /&gt;
| gcc-gfortran&lt;br /&gt;
| numpy, swig&lt;br /&gt;
| Java (Sun&#039;s? IcedTea?)&lt;br /&gt;
| octave, octave-devel&lt;br /&gt;
| [http://www.mathworks.com/ Matlab] with Mex&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Fedora 13&lt;br /&gt;
| binutils, gcc, glibc-headers, python&lt;br /&gt;
| texlive-latex&lt;br /&gt;
| subversion&lt;br /&gt;
| gcc-c++&lt;br /&gt;
| gcc-gfortran&lt;br /&gt;
| numpy, swig&lt;br /&gt;
| Java (Sun&#039;s? IcedTea?)&lt;br /&gt;
| octave, octave-devel&lt;br /&gt;
| [http://www.mathworks.com/ Matlab]&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | CentOS 5&lt;br /&gt;
| binutils, gcc, glibc-headers; python (needs [http://dag.wieers.com/rpm/FAQ.php#B2 RPMforge&#039;s RHEL5 repository])&lt;br /&gt;
| ?&lt;br /&gt;
| subversion&lt;br /&gt;
| gcc-c++&lt;br /&gt;
| gcc-gfortran&lt;br /&gt;
| numpy, swig&lt;br /&gt;
| Java (Sun&#039;s? IcedTea?), [http://inside.mines.edu/~dhale/jtk/ Mines JTK]&lt;br /&gt;
| [http://www.gnu.org/software/octave/ Octave, octave-devel]&lt;br /&gt;
| [http://www.mathworks.com/ Matlab]&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | openSUSE 11.0&lt;br /&gt;
| gcc, python&lt;br /&gt;
| texlive-latex&lt;br /&gt;
| subversion&lt;br /&gt;
| gcc-c++&lt;br /&gt;
| gcc-fortran&lt;br /&gt;
| [http://numpy.scipy.org/ NumPy], swig&lt;br /&gt;
| Java (Sun&#039;s? IcedTea?), [http://inside.mines.edu/~dhale/jtk/ Mines JTK]&lt;br /&gt;
| [http://www.gnu.org/software/octave/ Octave]&lt;br /&gt;
| [http://www.mathworks.com/ Matlab]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Graphics and visualization&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The minimum requirement is X11 graphics for running &#039;&#039;&#039;xtpen&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | X11 graphics&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | vplot2gif&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | vplot2avi&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Some sort of movies?&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | TIFF output&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | JPEG output&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | PLplot graphics&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | OpenGL graphics&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | ppm (?)&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | unknown&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Fedora 13&lt;br /&gt;
| libXaw-devel&lt;br /&gt;
| gifsicle&lt;br /&gt;
| ffmpeg (needs the [http://rpmfusion.org/ RPM Fusion] repository enabled)&lt;br /&gt;
| ffmpeg-devel (needs the [http://rpmfusion.org/ RPM Fusion] repository enabled)&lt;br /&gt;
| libtiff-devel&lt;br /&gt;
| libjpeg-devel&lt;br /&gt;
| plplot-devel&lt;br /&gt;
| mesa-libGL-devel, freeglut, freeglut-devel&lt;br /&gt;
| netpbm-devel&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | openSUSE 11.0&lt;br /&gt;
| xorg-x11-devel&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
| libtiff-devel&lt;br /&gt;
| libjpeg-devel&lt;br /&gt;
| plplot-devel&lt;br /&gt;
| mesa-libGL-devel, freeglut, freeglut-devel&lt;br /&gt;
| netpbm-devel&lt;br /&gt;
| cairo-devel, gd-devel, glew-devel&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Numerical and file manipulation utilities&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | OpenMP&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | MPI&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | BLAS/ATLAS&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Interface to the Fast Discrete Curvelet Transform&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | sfunits&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Fedora 13&lt;br /&gt;
| libgomp&lt;br /&gt;
| openmpi, openmpi-devel; openmpi-libs (?)&lt;br /&gt;
| blas, blas-devel, atlas, atlas-devel&lt;br /&gt;
| [https://wave.eos.ubc.ca/Software/Licenced/ pyct]&lt;br /&gt;
| units&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | CentOS 5&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
| [https://wave.eos.ubc.ca/Software/Licenced/ pyct]&lt;br /&gt;
| [http://www.gnu.org/software/units/units.html Gnu Units]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Other&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Inclusions from Seismic Unix&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Fedora 14, 15&lt;br /&gt;
| [http://www.cwp.mines.edu/cwpcodes/ Seismic Unix]&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | CentOS 5&lt;br /&gt;
| [http://www.cwp.mines.edu/cwpcodes/ Seismic Unix]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Command to install all dependencies present in the public repositories&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Usually package management software will not install again a package that is already installed, so it should be safe to copy and paste the command below to a command line:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Fedora 15&lt;br /&gt;
| &#039;&#039;&#039;yum -y install&#039;&#039;&#039; binutils gcc glibc-headers scons texlive-latex subversion gcc-c++ gcc-gfortran numpy python python-devel swig octave octave-devel libgomp openmpi openmpi-devel blas blas-devel atlas atlas-devel units gifsicle ffmpeg ffmpeg-devel libtiff-devel libjpeg-devel plplot-devel mesa-libGL-devel freeglut freeglut-devel libXaw-devel netpbm-devel&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Fedora 13&lt;br /&gt;
| &#039;&#039;&#039;yum -y install&#039;&#039;&#039; binutils gcc glibc-headers scons texlive-latex subversion gcc-c++ gcc-gfortran numpy python swig octave octave-devel libgomp openmpi openmpi-devel blas blas-devel atlas atlas-devel units gifsicle ffmpeg ffmpeg-devel libtiff-devel libjpeg-devel plplot-devel mesa-libGL-devel freeglut freeglut-devel libXaw-devel netpbm-devel&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | CentOS 5&lt;br /&gt;
| &#039;&#039;&#039;yum -y install&#039;&#039;&#039; binutils freeglut freeglut-devel gcc gcc-c++ gcc-gfortran glibc-headers libjpeg-devel libXaw-devel netpbm-devel&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | openSUSE 11.0&lt;br /&gt;
| &#039;&#039;&#039;zypper install&#039;&#039;&#039; cairo-devel gcc gcc-c++ gcc-fortran gd-devel glew-devel libjpeg-devel libtiff-devel octave scons subversion texlive-latex xorg-x11-devel&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;List of runtime dependencies only&#039;&#039;&#039;&lt;br /&gt;
(needed by packagers of Madagascar in order to properly list dependencies):&lt;br /&gt;
UNDER CONSTRUCTION&lt;br /&gt;
&lt;br /&gt;
===Fedora 25===&lt;br /&gt;
The following explains how to install madagascar on Fedora 25.&lt;br /&gt;
&lt;br /&gt;
We use the following compiler: &amp;lt;code&amp;gt;gcc&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;g++&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;gfortran&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* Install some packages&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; inline style=&amp;quot;white-space:wrap&amp;quot;&amp;gt;sudo dnf install scons lapack-static lapack64-static atlas-static fftw-static gd gd-devel libtool-ltdl-devel \&lt;br /&gt;
libXaw-devel mesa-libGL-devel freeglut-devel netpbm-devel plplot-devel ffmpeg-devel swig openmpi openmpi-devel suitesparse-devel&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This installed the following packages:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
scons-2.5.1-1.fc25.noarch&lt;br /&gt;
lapack-static-3.6.1-2.fc25.x86_64&lt;br /&gt;
lapack64-static-3.6.1-2.fc25.x86_64&lt;br /&gt;
atlas-static-3.10.2-14.fc25.x86_64&lt;br /&gt;
fftw-static-3.3.5-3.fc25.x86_64&lt;br /&gt;
gd-2.2.4-1.fc25.x86_64&lt;br /&gt;
gd-devel-2.2.4-1.fc25.x86_64&lt;br /&gt;
libtool-ltdl-devel-2.4.6-13.fc25.x86_64&lt;br /&gt;
libXaw-devel-1.0.13-4.fc25.x86_64&lt;br /&gt;
mesa-libGL-devel-17.0.5-3.fc25.x86_64&lt;br /&gt;
freeglut-devel-3.0.0-3.fc24.x86_64&lt;br /&gt;
netpbm-devel-10.78.00-1.fc25.x86_64&lt;br /&gt;
plplot-devel-5.11.1-13.fc25.x86_64&lt;br /&gt;
ffmpeg-devel-3.1.9-1.fc25.x86_64&lt;br /&gt;
swig-3.0.11-1.fc25.x86_64&lt;br /&gt;
openmpi-1.10.5-1.fc25.x86_64&lt;br /&gt;
openmpi-devel-1.10.5-1.fc25.x86_64&lt;br /&gt;
suitesparse-devel-4.4.6-7.fc25.x86_64&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and many other dependencies.&lt;br /&gt;
&lt;br /&gt;
* Get the sources from the git repository&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;git clone https://github.com/ahay/src&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you run now the &amp;lt;code&amp;gt;configure&amp;lt;/code&amp;gt; script, you will get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
checking for Python ... /usr/bin/python&lt;br /&gt;
checking Python version ... 2.7.13&lt;br /&gt;
checking for RSFROOT ... /usr/local/rsf&lt;br /&gt;
checking for SCons ... /usr/bin/scons&lt;br /&gt;
checking SCons version ... v2.5.1.rel_2.5.1:3735:9dc6cee5c168[MODIFIED]&lt;br /&gt;
Running RSFROOT=/usr/local/rsf /usr/bin/scons  config ...&lt;br /&gt;
------------------------&lt;br /&gt;
scons: Reading SConscript files ...&lt;br /&gt;
checking platform ... (cached) linux [fedora]&lt;br /&gt;
checking for C compiler ... (cached) gcc&lt;br /&gt;
checking if gcc works ... yes&lt;br /&gt;
checking if gcc accepts &#039;-x c -std=gnu99 -Wall -pedantic&#039; ... yes&lt;br /&gt;
checking for ar ... (cached) ar&lt;br /&gt;
checking for libraries ... [&#039;m&#039;]&lt;br /&gt;
checking complex support ... yes&lt;br /&gt;
checking for X11 headers ... /usr/include&lt;br /&gt;
checking for X11 libraries ... /usr/lib&lt;br /&gt;
checking for OpenGL ... yes&lt;br /&gt;
checking for sfpen ... (cached) xtpen&lt;br /&gt;
checking for ppm ... yes&lt;br /&gt;
checking for tiff ... yes&lt;br /&gt;
checking for GD (PNG) ... yes&lt;br /&gt;
checking for GD (GIF) ... yes&lt;br /&gt;
checking for plplot ... no&lt;br /&gt;
&lt;br /&gt;
  Optional package: plplot-devel&lt;br /&gt;
checking for ffmpeg ... yes&lt;br /&gt;
checking for cairo (PNG) ... yes&lt;br /&gt;
checking for cairo (SVG) ... yes&lt;br /&gt;
checking for cairo (PDF) ... yes&lt;br /&gt;
checking for jpeg ... yes&lt;br /&gt;
checking for BLAS ... yes&lt;br /&gt;
checking for LAPACK ... no&lt;br /&gt;
&lt;br /&gt;
  Optional package: blas + blas-devel + atlas + atlas-devel&lt;br /&gt;
checking for SWIG ... (cached) /usr/bin/swig&lt;br /&gt;
checking for numpy ... (cached) yes&lt;br /&gt;
checking API options ... (cached) []&lt;br /&gt;
checking for C++ compiler ... (cached) g++&lt;br /&gt;
checking if g++ works ... yes&lt;br /&gt;
checking if g++ accepts &#039;-std=c++11 -U__STRICT_ANSI__ -Wall -pedantic&#039; ... yes&lt;br /&gt;
checking for MPICC ... (cached) /usr/lib64/openmpi/bin/mpicc&lt;br /&gt;
checking if /usr/lib64/openmpi/bin/mpicc works ... yes&lt;br /&gt;
checking for MPICXX ... (cached) /usr/lib64/openmpi/bin/mpicxx&lt;br /&gt;
checking if /usr/lib64/openmpi/bin/mpicxx works ... yes&lt;br /&gt;
checking for MPIRUN ... (cached) /usr/lib64/openmpi/bin/mpirun&lt;br /&gt;
checking for Posix threads ... yes&lt;br /&gt;
checking for OpenMP ... yes&lt;br /&gt;
checking for CUDA ... (cached) no&lt;br /&gt;
checking for FFTW ... yes&lt;br /&gt;
checking if FFTW supports threads ... yes&lt;br /&gt;
checking for SuiteSparse ... yes&lt;br /&gt;
checking for pfft ... no&lt;br /&gt;
scons: done reading SConscript files.&lt;br /&gt;
scons: Building targets ...&lt;br /&gt;
shell_script([&amp;quot;env.sh&amp;quot;], [])&lt;br /&gt;
shell_script([&amp;quot;env.csh&amp;quot;], [])&lt;br /&gt;
scons: done building targets.&lt;br /&gt;
------------------------&lt;br /&gt;
Done with configuration.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Libraries &amp;lt;code&amp;gt;plplot&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;lapack&amp;lt;/code&amp;gt; are not found. File &amp;lt;code&amp;gt;config.log&amp;lt;/code&amp;gt; says&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/bin/ld: cannot find -lplplotd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gcc -o .sconf_temp/sfconftest_21 .sconf_temp/conftest_21.o -L/usr/lib64/atlas -lm -lf77blas -lcblas -latlas -llapack -lcblas&lt;br /&gt;
/usr/lib64/atlas/liblapack.a(dgesv.o): In function `dgesv_&#039;:&lt;br /&gt;
(.text+0x69): undefined reference to `xerbla_&#039;&lt;br /&gt;
/usr/lib64/atlas/liblapack.a(ATL_f77wrap_dgesv.o): In function `atl_f77wrap_dgesv_&#039;:&lt;br /&gt;
(.text+0x10d): undefined reference to `ATL_xerbla&#039;&lt;br /&gt;
/usr/lib64/atlas/liblapack.a(ATL_dgetf2.o): In function `ATL_dgetf2&#039;:&lt;br /&gt;
(.text+0x184): undefined reference to `ATL_dger&#039;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So library &amp;lt;code&amp;gt;plplotd&amp;lt;/code&amp;gt; doesn&#039;t exist on Fedora 25 and the &amp;lt;code&amp;gt;configure&amp;lt;/code&amp;gt; script is looking for the wrong &amp;lt;code&amp;gt;lapack&amp;lt;/code&amp;gt; library.&lt;br /&gt;
&lt;br /&gt;
If compiling now, 2 other libraries won&#039;t be found: &amp;lt;code&amp;gt;gfortran&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;quadmath&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Regarding the &amp;lt;code&amp;gt;plplotd&amp;lt;/code&amp;gt; library, edit file &amp;lt;code&amp;gt;framework/configure.py&amp;lt;/code&amp;gt; and change the line 724:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line start=&amp;quot;724&amp;quot;&amp;gt;plplot = context.env.get(&#039;PLPLOT&#039;,&#039;plplotd&#039;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
to&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line start=&amp;quot;724&amp;quot;&amp;gt;plplot = context.env.get(&#039;PLPLOT&#039;,&#039;plplot&#039;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* As for the libraries&lt;br /&gt;
** &amp;lt;code&amp;gt;lapack&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;gfortran&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;quadmath&amp;lt;/code&amp;gt;&lt;br /&gt;
We must use the &amp;lt;code&amp;gt;lapack&amp;lt;/code&amp;gt; library installed in &amp;lt;code&amp;gt;/usr/lib64&amp;lt;/code&amp;gt;, not the one installed in &amp;lt;code&amp;gt;/usr/lib64/atlas&amp;lt;/code&amp;gt;. And libraries &amp;lt;code&amp;gt;gfortran&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;quadmath&amp;lt;/code&amp;gt; are installed in &amp;lt;code&amp;gt;/usr/lib/gcc/x86_64-redhat-linux/6.3.1/&amp;lt;/code&amp;gt;.&lt;br /&gt;
Edit file &amp;lt;code&amp;gt;framework/configure.py&amp;lt;/code&amp;gt; and add the following 4 lines:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[&#039;/usr/lib/gcc/x86_64-redhat-linux/6.3.1/&#039;,&lt;br /&gt;
 &#039;/usr/lib64/&#039;,&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LIBS.append(&#039;gfortran&#039;)&lt;br /&gt;
LIBS.append(&#039;quadmath&#039;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
so that we end up with the following &amp;lt;code&amp;gt;blas&amp;lt;/code&amp;gt; function: &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line start=&amp;quot;971&amp;quot;&amp;gt;def blas(context):&lt;br /&gt;
    context.Message(&amp;quot;checking for BLAS ... &amp;quot;)&lt;br /&gt;
    text = &#039;&#039;&#039;&lt;br /&gt;
    #ifdef __APPLE__&lt;br /&gt;
    #include &amp;lt;Accelerate/Accelerate.h&amp;gt;&lt;br /&gt;
    #else&lt;br /&gt;
    #ifdef HAVE_MKL&lt;br /&gt;
    #include &amp;lt;mkl.h&amp;gt;&lt;br /&gt;
    #else&lt;br /&gt;
    #include &amp;lt;cblas.h&amp;gt;&lt;br /&gt;
    #endif&lt;br /&gt;
    #endif&lt;br /&gt;
    int main(int argc,char* argv[]) {&lt;br /&gt;
    float d, x[]={1.,2.,3.}, y[]={3.,2.,1.};&lt;br /&gt;
    d = cblas_sdot(3,x,1,y,1);&lt;br /&gt;
    return 0;&lt;br /&gt;
    }\n&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    if plat[&#039;OS&#039;] == &#039;cygwin&#039;:&lt;br /&gt;
        context.env[&#039;ENV&#039;][&#039;PATH&#039;] = context.env[&#039;ENV&#039;][&#039;PATH&#039;] + \&lt;br /&gt;
                                         &#039;:/lib/lapack&#039;&lt;br /&gt;
&lt;br /&gt;
    res = context.TryLink(text,&#039;.c&#039;)&lt;br /&gt;
    if res: &lt;br /&gt;
        context.Result(res)&lt;br /&gt;
        context.env[&#039;BLAS&#039;] = True &lt;br /&gt;
    else:&lt;br /&gt;
        # first try blas&lt;br /&gt;
        LIBS = path_get(context,&#039;LIBS&#039;)&lt;br /&gt;
        blas = context.env.get(&#039;BLAS&#039;,&#039;blas&#039;)&lt;br /&gt;
        LIBS.append(blas)&lt;br /&gt;
        res = context.TryLink(text,&#039;.c&#039;)&lt;br /&gt;
        if res: &lt;br /&gt;
            context.Result(res)&lt;br /&gt;
            context.env[&#039;LIBS&#039;] = LIBS &lt;br /&gt;
            context.env[&#039;BLAS&#039;] = blas &lt;br /&gt;
        else:&lt;br /&gt;
            # some systems require cblas and atlas&lt;br /&gt;
            for atlas_dir in filter(os.path.isdir,&lt;br /&gt;
                                    [&#039;/usr/lib/gcc/x86_64-redhat-linux/6.3.1/&#039;,  # &amp;lt;--- add this line&lt;br /&gt;
                                     &#039;/usr/lib64/&#039;,                              # &amp;lt;--- add this line&lt;br /&gt;
                                     &#039;/usr/lib64/atlas/&#039;,&lt;br /&gt;
                                     &#039;/usr/lib/atlas/&#039;]):&lt;br /&gt;
                context.env[&#039;LIBPATH&#039;].append(atlas_dir)&lt;br /&gt;
            LIBS.pop()&lt;br /&gt;
            LIBS.append(&#039;f77blas&#039;)&lt;br /&gt;
            LIBS.append(&#039;cblas&#039;)&lt;br /&gt;
            LIBS.append(&#039;atlas&#039;)&lt;br /&gt;
            LIBS.append(&#039;gfortran&#039;)  # &amp;lt;----------------------------------------------- add this line&lt;br /&gt;
            LIBS.append(&#039;quadmath&#039;)  # &amp;lt;----------------------------------------------- add this line&lt;br /&gt;
            res = context.TryLink(text,&#039;.c&#039;)&lt;br /&gt;
            if res: &lt;br /&gt;
                context.Result(res)&lt;br /&gt;
                context.env[&#039;LIBS&#039;] = LIBS &lt;br /&gt;
                context.env[&#039;BLAS&#039;] = &#039;cblas&#039;&lt;br /&gt;
            else:&lt;br /&gt;
                context.Result(context_failure)&lt;br /&gt;
                context.env[&#039;CPPDEFINES&#039;] = \&lt;br /&gt;
                    path_get(context,&#039;CPPDEFINES&#039;,&#039;NO_BLAS&#039;)&lt;br /&gt;
                LIBS.pop()&lt;br /&gt;
                LIBS.pop()&lt;br /&gt;
                LIBS.pop()&lt;br /&gt;
                context.env[&#039;BLAS&#039;] = None &lt;br /&gt;
                need_pkg(&#039;blas&#039;, fatal=False)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* Run the &amp;lt;code&amp;gt;configure&amp;lt;/code&amp;gt; script, for example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;./configure --prefix=/usr/local/rsf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Output should give:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
checking for Python ... /usr/bin/python&lt;br /&gt;
checking Python version ... 2.7.13&lt;br /&gt;
checking for RSFROOT ... /usr/local/rsf&lt;br /&gt;
checking for SCons ... /usr/bin/scons&lt;br /&gt;
checking SCons version ... v2.5.1.rel_2.5.1:3735:9dc6cee5c168[MODIFIED]&lt;br /&gt;
Running RSFROOT=/usr/local/rsf /usr/bin/scons  config ...&lt;br /&gt;
------------------------&lt;br /&gt;
scons: Reading SConscript files ...&lt;br /&gt;
checking platform ... (cached) linux [fedora]&lt;br /&gt;
checking for C compiler ... (cached) gcc&lt;br /&gt;
checking if gcc works ... yes&lt;br /&gt;
checking if gcc accepts &#039;-x c -std=gnu99 -Wall -pedantic&#039; ... yes&lt;br /&gt;
checking for ar ... (cached) ar&lt;br /&gt;
checking for libraries ... [&#039;m&#039;]&lt;br /&gt;
checking complex support ... yes&lt;br /&gt;
checking for X11 headers ... /usr/include&lt;br /&gt;
checking for X11 libraries ... /usr/lib&lt;br /&gt;
checking for OpenGL ... yes&lt;br /&gt;
checking for sfpen ... (cached) xtpen&lt;br /&gt;
checking for ppm ... yes&lt;br /&gt;
checking for tiff ... yes&lt;br /&gt;
checking for GD (PNG) ... yes&lt;br /&gt;
checking for GD (GIF) ... yes&lt;br /&gt;
checking for plplot ... yes&lt;br /&gt;
checking for ffmpeg ... yes&lt;br /&gt;
checking for cairo (PNG) ... yes&lt;br /&gt;
checking for cairo (SVG) ... yes&lt;br /&gt;
checking for cairo (PDF) ... yes&lt;br /&gt;
checking for jpeg ... yes&lt;br /&gt;
checking for BLAS ... yes&lt;br /&gt;
checking for LAPACK ... yes&lt;br /&gt;
checking for SWIG ... (cached) /usr/bin/swig&lt;br /&gt;
checking for numpy ... (cached) yes&lt;br /&gt;
checking API options ... (cached) []&lt;br /&gt;
checking for C++ compiler ... (cached) g++&lt;br /&gt;
checking if g++ works ... yes&lt;br /&gt;
checking if g++ accepts &#039;-std=c++11 -U__STRICT_ANSI__ -Wall -pedantic&#039; ... yes&lt;br /&gt;
checking for MPICC ... (cached) /usr/lib64/openmpi/bin/mpicc&lt;br /&gt;
checking if /usr/lib64/openmpi/bin/mpicc works ... yes&lt;br /&gt;
checking for MPICXX ... (cached) /usr/lib64/openmpi/bin/mpicxx&lt;br /&gt;
checking if /usr/lib64/openmpi/bin/mpicxx works ... yes&lt;br /&gt;
checking for MPIRUN ... (cached) /usr/lib64/openmpi/bin/mpirun&lt;br /&gt;
checking for Posix threads ... yes&lt;br /&gt;
checking for OpenMP ... yes&lt;br /&gt;
checking for CUDA ... (cached) no&lt;br /&gt;
checking for FFTW ... yes&lt;br /&gt;
checking if FFTW supports threads ... yes&lt;br /&gt;
checking for SuiteSparse ... yes&lt;br /&gt;
checking for pfft ... no&lt;br /&gt;
scons: done reading SConscript files.&lt;br /&gt;
scons: Building targets ...&lt;br /&gt;
shell_script([&amp;quot;env.sh&amp;quot;], [])&lt;br /&gt;
shell_script([&amp;quot;env.csh&amp;quot;], [])&lt;br /&gt;
scons: done building targets.&lt;br /&gt;
------------------------&lt;br /&gt;
Done with configuration.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* Then run the compilation:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;make&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* and finally the installation&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;sudo make install&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Debian 5==&lt;br /&gt;
Specific dependencies:&lt;br /&gt;
* Debian 5.0 (&amp;quot;Lenny&amp;quot;): Please make sure you have the &amp;lt;tt&amp;gt;libc6-dev&amp;lt;/tt&amp;gt; package before trying to compile from source. The &amp;lt;tt&amp;gt;libXaw7-dev&amp;lt;/tt&amp;gt; package might be a dependency for &amp;lt;tt&amp;gt;xtpen&amp;lt;/tt&amp;gt; (was in Debian 4.0)&lt;br /&gt;
&lt;br /&gt;
==Yellow Dog Linux 6.1 on Sony PlayStation 3==&lt;br /&gt;
See [http://www.reproducibility.org/rsflog/uploads/Friday_Seminar_Madagascar_on_PS3.ppt Will Burnett&#039;s guide (PowerPoint)]&lt;br /&gt;
&lt;br /&gt;
==Mac OS X==&lt;br /&gt;
&lt;br /&gt;
Install necessary Mac OS X applications using:&lt;br /&gt;
* [http://www.macports.org/ MacPorts], an easy-to-use system for compiling, installing, and upgrading open-source software on Mac OS X.&lt;br /&gt;
* [http://www.finkproject.org/ Fink], a tool that brings the full world of Unix Open Source software to Mac OS X. &lt;br /&gt;
&lt;br /&gt;
Installation on Mac OS X Mountain Lion requires the following:&lt;br /&gt;
# &amp;lt;b&amp;gt;Xcode&amp;lt;/b&amp;gt;: Download and install [https://developer.apple.com/xcode/ XCode] from Apple using App Store application. In Xcode, make sure to enable and install the command-line tools in Xcode/Preferences/Downloads &lt;br /&gt;
# (Optionally) &amp;lt;b&amp;gt;X11&amp;lt;/b&amp;gt;: Install X11 libraries from [http://xquartz.macosforge.org Xquartz]. &lt;br /&gt;
# (Optionally) &amp;lt;b&amp;gt;gcc&amp;lt;/b&amp;gt;: Install the Gnu C compiler from [http://hpc.sourceforge.net HPC Mac OS X]. &lt;br /&gt;
# (Optionally) [[SEGTeX]]: To use &amp;lt;b&amp;gt;SEGTeX&amp;lt;/b&amp;gt;, you may need [http://www.tug.org/texlive/ TeX Live]. &amp;lt;b&amp;gt;MacPorts&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;Fink&amp;lt;/b&amp;gt; provide an easy way to install it with commands &amp;lt;pre&amp;gt;sudo port install texlive&amp;lt;/pre&amp;gt; or &amp;lt;pre&amp;gt;sudo fink install texlive&amp;lt;/pre&amp;gt;&lt;br /&gt;
# (Optionally) &amp;lt;b&amp;gt;FFTW&amp;lt;/b&amp;gt;: Using &amp;lt;b&amp;gt;MacPorts&amp;lt;/b&amp;gt;, run &amp;lt;pre&amp;gt;sudo port install fftw-3-single&amp;lt;/pre&amp;gt;&amp;lt;pre&amp;gt;sudo port install fftw-3 +gfortran&amp;lt;/pre&amp;gt;&lt;br /&gt;
# (Optionally) &amp;lt;b&amp;gt;MPI&amp;lt;/b&amp;gt;: Using &amp;lt;b&amp;gt;MacPorts&amp;lt;/b&amp;gt;, run &amp;lt;pre&amp;gt;sudo port install openmpi&amp;lt;/pre&amp;gt;&amp;lt;pre&amp;gt;sudo port select --set mpi openmpi-mp-fortran&amp;lt;/pre&amp;gt;&lt;br /&gt;
# (Optionally) &amp;lt;b&amp;gt;ppmpen&amp;lt;/b&amp;gt;: Using &amp;lt;b&amp;gt;MacPorts&amp;lt;/b&amp;gt;, run &amp;lt;pre&amp;gt;sudo port install libnetpbm&amp;lt;/pre&amp;gt;&lt;br /&gt;
# (Optionally) &amp;lt;b&amp;gt;Open vplots using double click&amp;lt;/b&amp;gt;: [[machacks|Instructions]].&lt;br /&gt;
# Install python with libraries including jupyter and  ipython.  I recommend the Anaconda distribution.  which is available at https://www.anaconda.com/download&lt;br /&gt;
# (Optionally) &amp;lt;b&amp;gt;SWIG&amp;lt;/b&amp;gt; is required for some of the options of the Python api (used if you are coding in Python).  run  &amp;lt;pre&amp;gt;conda install swig&amp;lt;/pre&amp;gt; . I had to run&amp;lt;pre&amp;gt;cp `which swig` /usr/local/bin&amp;lt;/pre&amp;gt; to get ./configure to find swig. &lt;br /&gt;
#Proceed with configuration and installation following the normal procedure.  You may need to use Apple&#039;s compiler (clang) instead of gcc.  Use one of these commands in the $RSFSRC directory &amp;lt;pre&amp;gt;./configure CC=clang CXX=clang++&amp;lt;/pre&amp;gt; or &amp;lt;pre&amp;gt;./configure CC=clang CXX=clang++ API=python --prefix=`pwd`&amp;lt;/pre&amp;gt;&lt;br /&gt;
#build the system with: &amp;lt;pre&amp;gt;make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
#After installing a new version of python you must run: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./configure &lt;br /&gt;
make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In summer of 2018 on a new MacBook Pro running Mac OS 10.14.1 (Mojave) I encountered an &amp;quot;abort trap: 6&amp;quot; error message when running sfpen from command line.  I do not &lt;br /&gt;
have a problem running sfpen inside scons. I changed to use xtpen from the command line.  I continue to use this work around.&lt;br /&gt;
&lt;br /&gt;
==OpenSolaris==&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;tt&amp;gt;pkg&amp;lt;/tt&amp;gt; to install missing components such as X11 headers.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
pfexec pkg install SUNWxorg-headers&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==MS Windows==&lt;br /&gt;
Due to its size, this topic has been assigned [[Windows | its own Wiki page]].&lt;br /&gt;
&lt;br /&gt;
==How to adapt Madagascar to a new platform==&lt;br /&gt;
The most laborious part of adapting madagascar to a new platform is finding the proper dependency names. This usually proceeds as follows: dependency X fails with a &amp;quot;missing file&amp;quot; error either as a header file in &amp;lt;tt&amp;gt;config.log&amp;lt;/tt&amp;gt;, or a missing library during the build step. Possible package names are found through an internet search for the missing file name and the distribution name or by using specific [http://rpm.pbone.net/ rpm search tools]. Packages are installed and the configure (and, if necessary) build processes are repeated until the error goes away.&lt;br /&gt;
&lt;br /&gt;
=Multi-user installs=&lt;br /&gt;
Some organizations may find it desirable to deny write access of some users to all RSFSRC/RSFROOT except their own user directory. Fortunately, this can be easily done by placing the restricted user dirs outside RSFSRC/RSFROOT, i.e. in their home dirs, say /home/joe/rsfsrc. In order to move a user&#039;s directory out of RSFSRC, you must:&lt;br /&gt;
* &amp;quot;tell&amp;quot; the SConstruct in the user&#039;s dir where to find RSFSRC so that when the user builds in his directory, it can import &amp;lt;tt&amp;gt;configure.py&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;config.py&amp;lt;/tt&amp;gt; You do that by setting the environment variable RSFSRC to the absolute path of the Madagascar source root, and by making sure that lines 2 and 3 in the users&#039; SConstruct files are&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
srcroot = os.environ.get(&#039;RSFSRC&#039;, &#039;../..&#039;)&lt;br /&gt;
sys.path.append(srcroot)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
and then replace &amp;lt;tt&amp;gt;../..&amp;lt;/tt&amp;gt; throughout the SConstruct using &amp;lt;tt&amp;gt;os.path.join&amp;lt;/tt&amp;gt; and the &amp;lt;tt&amp;gt;srcroot&amp;lt;/tt&amp;gt; variable.&lt;br /&gt;
* &amp;quot;tell&amp;quot; the build scripts about the user&#039;s dir, so that it is included in the builds launched from RSFSRC. You do that with a symbolic link:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ln -s /home/joe/rsfsrc $RSFSRC/user/joe&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&#039;&#039;When the link exists&#039;&#039;, those of Joe&#039;s programs that are mentioned in the &amp;quot;prog&amp;quot; string in SConstruct get included in the distribution, complete with self-doc. If Joe is just learning how to code and his stuff breaks the build, just remove the symbolic link. Even if build+installs are done after the link is removed, his stable programs and self-doc will continue to remain installed system-wide as long as the admin does not type &amp;lt;tt&amp;gt;scons -c install&amp;lt;/tt&amp;gt; (not likely).&lt;br /&gt;
* point the user&#039;s RSFDOC environment variable to a location where the user has write access&lt;br /&gt;
* edit the users&#039; SConstruct so that it uses the RSF library and headers already installed in $RSFROOT/lib and $RSFROOT/include , instead of building again the whole &amp;lt;tt&amp;gt;librsf&amp;lt;/tt&amp;gt; with user-specific flags in &amp;lt;tt&amp;gt;RSFSRC/filt/lib/&amp;lt;/tt&amp;gt;. To do that, replace in the user&#039;s SConstruct the env.Prepend statement with&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
rsfroot = os.environ.get(&#039;RSFROOT&#039;,&#039;/usr/local/rsf&#039;)&lt;br /&gt;
&lt;br /&gt;
env.Prepend(CPPPATH=[os.path.join(rsfroot,&#039;include&#039;)],&lt;br /&gt;
            LIBPATH=[os.path.join(rsfroot,&#039;lib&#039;)],&lt;br /&gt;
            LIBS=[&#039;rsf&#039;])&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* If the link from RSFSRC to Joe&#039;s directory was not made, add Joe&#039;s directory to his own path so that he can execute his own binaries.&lt;br /&gt;
&lt;br /&gt;
To understand how $DATAPATH disk space issues may become an issue in a multi-user environment, refer to the [[Advanced_Installation#Disk_space|Disk Space subsection]] at the beginning of this document.&lt;br /&gt;
&lt;br /&gt;
=Keeping your stuff separate=&lt;br /&gt;
A user may add his own programs and recipes to the Madagascar system. He may also create his own computational examples, data, and locked figures for testing. All of these components can be placed in their default locations, but it is not necessary to make them public. To keep these items private simply do not add them to the repository.&lt;br /&gt;
&lt;br /&gt;
However, it might be desirable to keep these components in separate places. For example, if you keep your private programs in RSFSRC/user you will have to remember to make a copy somewhere else if you ever want to delete the Madagascar installation to perform a fresh install. Yup, I deleted all my programs that way once. Good thing I had a back up! Fortunately, it is easy to keep each of these components in a separate place if desired.&lt;br /&gt;
&lt;br /&gt;
==Keeping programs separate==&lt;br /&gt;
User programs are ordinarily kept in a subdirectory of RSFSRC/user.  However, if you want to keep your programs separate all you have to do is put your subdirectory somewhere else and make a link to it in RSFSRC/user:&lt;br /&gt;
&amp;lt;bash&amp;gt;&lt;br /&gt;
ln -s path_to_my_programs $RSFSRC/user/my_programs&lt;br /&gt;
&amp;lt;/bash&amp;gt;&lt;br /&gt;
The additional instructions above for &amp;quot;multi-user installs&amp;quot; are for the case where the other users do not have write access to RSFSRC.  However, if you have full write access and only want to keep the programs in a separate place the link is the only thing you need.&lt;br /&gt;
&lt;br /&gt;
===Problems when symbolic linking and using SVN=== &lt;br /&gt;
If you decide to use a symbolic link e.g. &amp;quot;ln -s ...&amp;quot; as above, you will have difficulties checking in your code into the SVN repository.  SVN typically does not follow the symbolic link but will only the save the symbolic link.   &lt;br /&gt;
&lt;br /&gt;
See this answer from Stackoverflow (http://stackoverflow.com/questions/24850844/follow-symlinks-in-svn)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If I understand your problem, you have:&lt;br /&gt;
&lt;br /&gt;
project1/&lt;br /&gt;
project1/link1 -&amp;gt; ../../some/where/else&lt;br /&gt;
&lt;br /&gt;
If you do a simple svn add link1 it adds a symlink entry to the subversion repository, but what you&#039;re trying to accomplish is getting the stuff under somewhere else into the tree.&lt;br /&gt;
&lt;br /&gt;
If this is the case, then you&#039;re fighting in the wrong direction, you should make the real files and directories under link1, and make the target locations symlinks into the link1 directory. That would be a simple solution to the problem.&lt;br /&gt;
&lt;br /&gt;
Another solution would be to make the location ../../some/where/else an svn location in it&#039;s own right, and make link1 an externals definition to that location. When you commit in the main directory, the externals would be committed at the same time which would achieve storing the information; however to ensure that the other location was kept in sync, you would have to make sure to update it to the same version as the stored data.&lt;br /&gt;
&lt;br /&gt;
In my case, on my desktop, I have a settings directory:&lt;br /&gt;
&lt;br /&gt;
$HOME/settings&lt;br /&gt;
&lt;br /&gt;
This is a checked out copy of a directory containing .bashrc, .profile, .vimrc, .vim, etc. files and folders from an svn repo. All my profile files and directories were symlinks into this folder, so for example .profile -&amp;gt; settings/.profile, etc. When I make changes, they are reflected in the svn tree, which I can commit back to in order to ensure that I don&#039;t lose my config settings when I go to another system.&lt;br /&gt;
&lt;br /&gt;
If you really want svn to follow symlinks as hardlinks (You can&#039;t make directory hardlinks because it would be a bad thing™), then you&#039;ll have to hack the svn client source so that it did what you wanted; but this would be a maintenance nightmare.&lt;br /&gt;
&lt;br /&gt;
You could get away with making the symlink into a bind mount point directed at the target, but that has it&#039;s own issues - you would need to be root to accomplish this, and it ends up leaving funny entries in your /proc/mounts to accomplish this:&lt;br /&gt;
&lt;br /&gt;
mount --bind /absolute/path/to/some/where/else project1/link1&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Keeping recipes separate==&lt;br /&gt;
Computational recipes written in Python and imported by the SConstruct file of a workflow are normally stored in RSFSRC/book/Recipes.  The install process copies these recipes to a directory like $RSFROOT/lib/python2.5/site-packages/rsf/recipes and adds this directory to your PYTHONPATH so that Python can find them.&lt;br /&gt;
&lt;br /&gt;
However, you can put you own recipes anywhere you want.  You only have to add that place to your PYTHONPATH like this (bash):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
export PYTHONPATH=${PYTHONPATH}:path_to_my_recipes&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Or like this (csh):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
setenv PYTHONPATH ${PYTHONPATH}:path_to_my_recipes&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Keeping examples separate==&lt;br /&gt;
Madagascar&#039;s public collection of example workflows are stored in RSFSRC/book, but you can put your private workflows anywhere you want.  No special instructions are required.&lt;br /&gt;
&lt;br /&gt;
However, Madagascar assumes that the workflows are organized into a three-level book/chapter/section directory hierarchy when it creates a directory tree for the data and locked figures associated with your workflow. It is not required, but it might be easier to find the data and locked figures if you put your workflows in a three-level directory tree something like this: path_to_my_book/chapter/section/SConstruct.&lt;br /&gt;
&lt;br /&gt;
==Keeping data separate==&lt;br /&gt;
The location of the data portion of your *.rsf files is controlled by your DATAPATH environment variable.  However, you may want to keep the data for your private workflows in a different place, or several different places, than the data created by the public examples in RSFSRC/book.  The way to do that is to temporarily change the DATAPATH variable in the SConstruct &#039;&#039;before&#039;&#039; importing rsf.proj like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import os&lt;br /&gt;
os.environ[&#039;DATAPATH&#039;] = &#039;path_to_my_private_data&#039;&lt;br /&gt;
&lt;br /&gt;
from rsf.proj import *&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Keeping locked figures separate==&lt;br /&gt;
The command &amp;quot;scons lock&amp;quot; in the directory of a workflow will store a &amp;quot;locked&amp;quot; copy of your figures for regression testing.  Normally these figures are stored in the location pointed to by your RSFFIGS variable, and that is where the figures from the figures repository should be stored for testing in RSFSRC/book.&lt;br /&gt;
&lt;br /&gt;
However, you may want to keep your private figures in a different place.  The way to do that is to temporarily change the RSFFIGS variable in the SConstruct &#039;&#039;before&#039;&#039; importing rsf.proj like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import os&lt;br /&gt;
os.environ[&#039;RSFFIGS&#039;] = &#039;path_to_my_private_figures&#039;&lt;br /&gt;
&lt;br /&gt;
from rsf.proj import *&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
If you also create a RSFALTFIGS environment variable pointing to path_to_my_private_figures, then the testing script sffiglist will automatically test your figures against those in RSFALTFIGS when the sffiglist command is executed from a location outside of RSFSRC/book.&lt;br /&gt;
&lt;br /&gt;
=Capturing error and warning messages=&lt;br /&gt;
The messages during configuration are few and their importance quite high, so they should be watched &amp;quot;in person&amp;quot;. A complete log of the configuration process is recorded in RSFSRC/configure.log&lt;br /&gt;
&lt;br /&gt;
Console messages generated during the build step can be captured to a log file and observed at the same time with a command like this (tcsh):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
nice +10 nohup /usr/bin/time -p scons -k |&amp;amp; tee log_build.asc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The log file can be of course named otherwise than &amp;lt;tt&amp;gt;log_build.asc&amp;lt;/tt&amp;gt;. The file can be later grepped for error and warnings with commands such as:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
grep -c error log_build.asc&lt;br /&gt;
grep error log_build.asc | awk &#039;/error.c/ {next}; /error.h/ {next}; /error.o/ {next}; {print}&#039;&lt;br /&gt;
grep -c warning log_build.asc&lt;br /&gt;
grep warning log_build.asc | awk &#039;/imaginary constants are a GCC extension/ {next}; {print}&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Advanced troubleshooting=&lt;br /&gt;
* If you removed one of your programs or changed its name, and &amp;lt;tt&amp;gt;scons install&amp;lt;/tt&amp;gt; fails with &amp;quot;Source &amp;lt;tt&amp;gt;oldprogname&amp;lt;/tt&amp;gt; not found, needed by target install&amp;quot;, and you cleaned everything there was to clean but still get this message, remove &amp;lt;tt&amp;gt;RSFSRC/.sconsign*&amp;lt;/tt&amp;gt;&lt;br /&gt;
* If during &amp;lt;tt&amp;gt;scons install&amp;lt;/tt&amp;gt; you get a &amp;lt;tt&amp;gt;DBAccessError : (13, &#039;Permission denied&#039;)&amp;lt;/tt&amp;gt; in some reproducible papers, check permissions in your &amp;lt;tt&amp;gt;$DATAPATH&amp;lt;/tt&amp;gt; directory. This is where SCons places database &amp;quot;.sconsign&amp;quot; files for its dependencies (according to the rules in &amp;lt;tt&amp;gt;rsf.proj&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;rsf.tex&amp;lt;/tt&amp;gt;).&lt;br /&gt;
* If &amp;lt;tt&amp;gt;scons&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;scons install&amp;lt;/tt&amp;gt; fail due to an a bug introduced in a tool you are certain you will not use, a quick workaround for the problem is already built into scons: the &amp;lt;tt&amp;gt;-k&amp;lt;/tt&amp;gt; option, which means &amp;quot;keep going&amp;quot;. Thus, if you use &amp;lt;tt&amp;gt;scons -k&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;scons -k install&amp;lt;/tt&amp;gt;, SCons will not be able to build the failed component, or anything that depends on it, but it will keep going and make everything else that it can.&lt;br /&gt;
&lt;br /&gt;
=Further support=&lt;br /&gt;
Subscribe to the [https://lists.sourceforge.net/lists/listinfo/rsf-user rsf-user mailing list].&lt;/div&gt;</summary>
		<author><name>Karl</name></author>
	</entry>
	<entry>
		<id>https://ahay.org/index.php?title=Advanced_Installation&amp;diff=3756</id>
		<title>Advanced Installation</title>
		<link rel="alternate" type="text/html" href="https://ahay.org/index.php?title=Advanced_Installation&amp;diff=3756"/>
		<updated>2018-12-14T21:53:44Z</updated>

		<summary type="html">&lt;p&gt;Karl: /* Mac OS X */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:Fotolia_419157_XS.jpg|right|]]&lt;br /&gt;
Before reading this document, please familiarize yourself with the [[Installation|short Installation guide]].&lt;br /&gt;
=What the installation process does=&lt;br /&gt;
The term &amp;quot;installation&amp;quot; in the title is used for brevity, and it actually covers all three steps: configuration, build and install.&lt;br /&gt;
# Configure: determine what tools are available on the system and how they should be used to built the software. Creates a layer of abstraction so that the build is platform-independent. Should ideally either solve or flag all problems, so that the build either works, or does not proceed at all.&lt;br /&gt;
# Build: compiles the software and documentation using RSFSRC/build as a &amp;quot;workplace&amp;quot;&lt;br /&gt;
# Install: moves the compiled executables and the documentation to the final locations in $RSFROOT, sometimes changing filenames. Kept separate from build so that it can be done by root, and to avoid build failures leaving junk files all over the system.&lt;br /&gt;
A successful installation will have created in &amp;lt;tt&amp;gt;$RSFROOT&amp;lt;/tt&amp;gt; the following directories:&lt;br /&gt;
* &amp;lt;tt&amp;gt;bin/&amp;lt;/tt&amp;gt;: executable programs&lt;br /&gt;
* &amp;lt;tt&amp;gt;doc/&amp;lt;/tt&amp;gt;: auto-generated HTML documentation&lt;br /&gt;
* &amp;lt;tt&amp;gt;include/&amp;lt;/tt&amp;gt;: header files with info on library procedures; fonts&lt;br /&gt;
* &amp;lt;tt&amp;gt;lib/&amp;lt;/tt&amp;gt;: libraries and Python modules&lt;br /&gt;
&lt;br /&gt;
=Old (1.0 and 1.1) version installation=&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;tt&amp;gt;$RSFROOT/etc/madagascar/&amp;lt;/tt&amp;gt; as the location of &amp;lt;tt&amp;gt;env&amp;lt;/tt&amp;gt; scripts instead of &amp;lt;tt&amp;gt;$RSFROOT/share/madagascar/etc/&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=Old (0.9.9) version installation=&lt;br /&gt;
&lt;br /&gt;
====Environment variables====&lt;br /&gt;
Example configuration for &amp;lt;tt&amp;gt;bash&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
export RSFROOT=/usr/local/rsf # directory where Madagascar will be installed. &lt;br /&gt;
if [ -n &amp;quot;$PYTHONPATH&amp;quot; ]; then&lt;br /&gt;
export PYTHONPATH=${PYTHONPATH}:$RSFROOT/lib&lt;br /&gt;
else&lt;br /&gt;
export PYTHONPATH=$RSFROOT/lib&lt;br /&gt;
fi&lt;br /&gt;
export PATH=$RSFROOT/bin:$PATH&lt;br /&gt;
export DATAPATH=/var/tmp/&lt;br /&gt;
export MANPATH=$RSFROOT/share/man:$(manpath)&lt;br /&gt;
export LD_LIBRARY_PATH=$RSFROOT/lib:$LD_LIBRARY_PATH&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Notice the slash at the end of the &amp;lt;tt&amp;gt;DATAPATH&amp;lt;/tt&amp;gt; variable. &lt;br /&gt;
&lt;br /&gt;
Example configuration for &amp;lt;tt&amp;gt;csh&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;tcsh&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
setenv RSFROOT /usr/local/rsf&lt;br /&gt;
if ($?PYTHONPATH) then&lt;br /&gt;
setenv PYTHONPATH ${PYTHONPATH}:$RSFROOT/lib&lt;br /&gt;
else&lt;br /&gt;
setenv PYTHONPATH $RSFROOT/lib&lt;br /&gt;
endif&lt;br /&gt;
set path = ($RSFROOT/bin $path)&lt;br /&gt;
setenv DATAPATH /var/tmp/&lt;br /&gt;
setenv MANPATH $RSFROOT/share/man:`manpath`&lt;br /&gt;
setenv LD_LIBRARY_PATH $RSFROOT/lib:$LD_LIBRARY_PATH&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Notice the backticks surrounding the call to &amp;lt;tt&amp;gt;manpath&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Be aware that on some systems /var/tmp gets automatically cleaned at some intervals, so if you want to keep your data binaries for a long time, set &amp;lt;tt&amp;gt;DATAPATH&amp;lt;/tt&amp;gt; to another location where you have write access and that allows large files.&lt;br /&gt;
&lt;br /&gt;
====Software construction====&lt;br /&gt;
  &lt;br /&gt;
#Configuration. Change to the top source directory and run &amp;lt;pre&amp;gt;./configure&amp;lt;/pre&amp;gt; You can examine the &amp;lt;tt&amp;gt;config.py&amp;lt;/tt&amp;gt; file that this command generates.  Additional options are available. You can obtain a full list of customizable variables by running &amp;lt;tt&amp;gt;scons -h&amp;lt;/tt&amp;gt;. For example, to install C++ and Fortran-90 API bindings in addition to the basic package, run &amp;lt;pre&amp;gt;./configure API=c++,fortran-90&amp;lt;/pre&amp;gt; &lt;br /&gt;
#Building and installing the package. Run &amp;lt;tt&amp;gt;scons install&amp;lt;/tt&amp;gt; or the following two commands in succession:  &amp;lt;pre&amp;gt;make; make install&amp;lt;/pre&amp;gt; or &amp;lt;pre&amp;gt;scons; scons install&amp;lt;/pre&amp;gt; If you need &amp;quot;root&amp;quot; privileges for installing under &amp;lt;tt&amp;gt;&amp;amp;#36;RSFROOT&amp;lt;/tt&amp;gt;, you may need to run &amp;lt;pre&amp;gt;su; scons install &amp;lt;/pre&amp;gt; or &amp;lt;pre&amp;gt;sudo scons install&amp;lt;/pre&amp;gt;&lt;br /&gt;
#Cleaning. To clean all intermediate files generated by SCons, run &amp;lt;pre&amp;gt;make clean&amp;lt;/pre&amp;gt; or &amp;lt;pre&amp;gt;scons -c&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Prerequisites=&lt;br /&gt;
Basic prerequisites are described in the [[Installation|short Installation guide]]. Here are some additional details. &lt;br /&gt;
==Compilers==&lt;br /&gt;
Madagascar has been built successfully with the following compilers, and possibly with others:&lt;br /&gt;
* gcc&lt;br /&gt;
* Intel (icc/ifort)&lt;br /&gt;
* open64&lt;br /&gt;
* clang&lt;br /&gt;
* cc (Solaris)&lt;br /&gt;
&lt;br /&gt;
==Python and SCons==&lt;br /&gt;
As described below under [[Advanced Installation#Platform-specific installation advice | Platform-specific installation advice]], Madagascar supports the oldest non-deprecated Python version currently supported by the latest stable version of [http://scons.org/ SCons].  If your version of Python is older and you experience problems you should probably [http://www.python.org/ upgrade].&lt;br /&gt;
&lt;br /&gt;
Madagascar includes the latest stable version of SCons and the configure scripts will try to install it for you in RSFROOT if you don&#039;t have it already.  However, if you have an older version of SCons the configure scripts will not try to install the newer version. Your older version might work fine, but Madagascar attempts to support only the latest stable version of SCons, so if you have problems you should upgrade.&lt;br /&gt;
&lt;br /&gt;
To install the SCons bundled with Madagascar go to &amp;lt;tt&amp;gt;RSFSRC/scons&amp;lt;/tt&amp;gt;, unpack the tar file, and type&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
python setup.py install&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will install SCons in the standard location. You might need root privileges. If you don&#039;t have root privileges, or you don&#039;t want to interfere with the system SCons you can install it somewhere else with a --prefix option. A logical choice is to put it in RSFROOT like this:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
python setup.py install --prefix=$RSFROOT&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Location==&lt;br /&gt;
As long as you set the environment variables and directory permissions correctly, it does not matter in what part of your filesystem you place the install. If you have the luxury of installing anywhere, it is good practice to follow the [http://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard Filesystem Hierarchy Standard] and either:&lt;br /&gt;
# Install everything (including &amp;lt;tt&amp;gt;figs&amp;lt;/tt&amp;gt; if you do testing) under &amp;lt;tt&amp;gt;/usr/local/rsf&amp;lt;/tt&amp;gt;, with the source tree in &amp;lt;tt&amp;gt;/usr/local/rsf/src&amp;lt;/tt&amp;gt;, OR &lt;br /&gt;
# Put the source tree in &amp;lt;tt&amp;gt;/usr/local/src/rsf&amp;lt;/tt&amp;gt;, and specify &amp;lt;tt&amp;gt;RSFROOT=/usr/local&amp;lt;/tt&amp;gt;, so that header files and binaries go in &amp;lt;tt&amp;gt;/usr/local/bin&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;/usr/local/include&amp;lt;/tt&amp;gt;. To follow the standard, before installing set &amp;lt;tt&amp;gt;RSFDOC=/usr/local/share/rsf/doc&amp;lt;/tt&amp;gt; and create the appropriate directories. The auto-generated HTML documentation will get put there. Also, if installed, the figs directory for testing should be &amp;lt;tt&amp;gt;/usr/local/share/rsf/figs/&amp;lt;/tt&amp;gt;.&lt;br /&gt;
# Package Madagascar (i.e. build a RPM, etc) and install it in the default locations. For RPMs, those are as like the ones from the previous option, just directly in the &amp;lt;tt&amp;gt;/usr/&amp;lt;/tt&amp;gt; hierarchy, instead of in the &amp;lt;tt&amp;gt;/usr/local/&amp;lt;/tt&amp;gt; one.&lt;br /&gt;
&lt;br /&gt;
==Disk space==&lt;br /&gt;
At present (Feb 2007, r2530), the source directory containing the build tree from the development version was approx. 200Mb, the full installation (&amp;lt;tt&amp;gt;bin/&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;doc/&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;include/&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;lib&amp;lt;/tt&amp;gt;) is 31Mb, and &amp;lt;tt&amp;gt;figs/&amp;lt;/tt&amp;gt; (the optional directory if you want to do testing) is about 10 Gb. The stable version is significantly smaller.&lt;br /&gt;
&lt;br /&gt;
The only Madagascar-related directory where disk space can be an issue is &amp;lt;tt&amp;gt;$DATAPATH&amp;lt;/tt&amp;gt;. Real 3-D seismic datasets can be measured in Terabytes. Buggy programs/processing flows can fill up &amp;lt;tt&amp;gt;$DATAPATH&amp;lt;/tt&amp;gt;. A real problem are &amp;quot;disk memory leaks&amp;quot; -- removing header files with anything else than &amp;lt;tt&amp;gt;sfrm&amp;lt;/tt&amp;gt; will leave the binaries intact. Crashed jobs which start to write to binary but never get to write the header also produce &amp;quot;leaks&amp;quot;. Experience has shown that over time &amp;lt;tt&amp;gt;$DATAPATH&amp;lt;/tt&amp;gt; inexorably fills up. You may need to &lt;br /&gt;
# keep irreplaceable data and expensive results in a separate place;&lt;br /&gt;
# remove the oldest files in &amp;lt;tt&amp;gt;$DATAPATH&amp;lt;/tt&amp;gt; whenever the amount of free space declines under a preset threshold.&lt;br /&gt;
&lt;br /&gt;
==Dependencies==&lt;br /&gt;
Some platforms feature complete lists of dependencies. See [[Advanced Installation#Platform-specific installation advice | Platform-specific installation advice]] for details.&lt;br /&gt;
===C++ API===&lt;br /&gt;
A C++ compiler. SCons is smart and will try to find it for you. If it does not work specify the path to your compiler in the &amp;lt;tt&amp;gt;CXX&amp;lt;/tt&amp;gt; environment variable (can be passed as an option to the configuration script, like the &amp;lt;tt&amp;gt;API&amp;lt;/tt&amp;gt; one).&lt;br /&gt;
===F77 API===&lt;br /&gt;
A Fortran 77 compiler. If SCons does not find one, then you can either specify its path through the &amp;lt;tt&amp;gt;F77&amp;lt;/tt&amp;gt; variable, or if the executable is in your path, add its name to the list of F77 compilers in &amp;lt;tt&amp;gt;RSFSRC/configure.py&amp;lt;/tt&amp;gt; .&lt;br /&gt;
===F90 API===&lt;br /&gt;
Same as for Fortran 77 &amp;amp;ndash; just substitute &amp;lt;tt&amp;gt;F90&amp;lt;/tt&amp;gt;. If using the &amp;lt;tt&amp;gt;gfortran&amp;lt;/tt&amp;gt; compiler, make sure to get [http://gcc.gnu.org/wiki/GFortranBinaries the latest version]. If you have more than one compiler installed on your system, specify the desired one at configuration time:&lt;br /&gt;
&amp;lt;bash&amp;gt;&lt;br /&gt;
./configure API=f90 F90=/path/to/preferred/compiler&lt;br /&gt;
&amp;lt;/bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Java API===&lt;br /&gt;
There are two styles of API, old (1.0 release and previous) and new. The two APIs are not compatible with each other.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;old&amp;quot; interface requires the Mines Java Toolkit for fast Java file IO. The Mines JTK, is an open-source Java package that can be downloaded from [http://inside.mines.edu/~dhale/jtk/ Mines JTK]. Currently, the &amp;quot;old&amp;quot; interface will also build alongside the new one if the MINESJTK environment variable exists, and can be used as was previously.&lt;br /&gt;
&lt;br /&gt;
To install the new API, you need the (Oracle) JDK. Set your JAVA_HOME environment variable to the location of the jdk (on Ubuntu 10.04 this is: /usr/lib/jvm/java-6-openjdk), then reconfigure (./configure API=java ...) and reinstall.  &lt;br /&gt;
&lt;br /&gt;
Ignore the SWIG warnings (there are lots). &lt;br /&gt;
&lt;br /&gt;
Make sure to set your LD_LIBRARY_PATH to $RSFROOT/lib .&lt;br /&gt;
&lt;br /&gt;
If you want to include additional Java packages, you can set them using your shell&#039;s CLASSPATH variable.  This environment variable is now automatically passed onto all Java classes in SCons.&lt;br /&gt;
&lt;br /&gt;
The installation can be tested using the example demonstrating the new API in api/java/test .&lt;br /&gt;
&lt;br /&gt;
===Matlab API===&lt;br /&gt;
Besides Matlab itself, you need Mex, which compiles C code into regular Matlab functions. Use the &amp;lt;tt&amp;gt;MATLAB&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;MEX&amp;lt;/tt&amp;gt; environment variables to specify their paths if they are installed, but not found.&lt;br /&gt;
===Octave API===&lt;br /&gt;
The Octave function compiler (&amp;lt;tt&amp;gt;mkoctfile&amp;lt;/tt&amp;gt;) is sometimes bundled in a separate package, so it may be missing from the Octave installation.&lt;br /&gt;
&lt;br /&gt;
===Python API===&lt;br /&gt;
This API requires [http://www.swig.org/ SWIG], [http://numpy.scipy.org/ numpy] and the Python development kit. Numpy requires Python 2.4 or newer (i.e. RHEL 5 or newer). However, these dependencies are unnecessary for the common case when Python is just used as [http://en.wikipedia.org/wiki/Glue_language glue] to create chains of programs, and it only needs to read the RSF header, and not the binary. To allow Python [http://en.wikipedia.org/wiki/Meta-programs metaprograms] in madagascar to function, and programming in this style to be done, a fallback development kit implementing only the header-related functionality will be installed in the lack of these dependencies.&lt;br /&gt;
&lt;br /&gt;
===Python modules in user space===&lt;br /&gt;
Python is an evolving language. Many large systems have old versions for stability reasons, and administrators of such large systems tend to not install all software users may wish, and to not allow access to rpm either. To install a module in your user space, download the tarball, unzip it, cd into the directory and run: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;python setup.py install --prefix=/path/to/your/place&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The installer will create a subdirectory named &amp;lt;tt&amp;gt;lib&amp;lt;/tt&amp;gt;, or &amp;lt;tt&amp;gt;lib64&amp;lt;/tt&amp;gt; under the directory above. These &amp;lt;tt&amp;gt;lib*&amp;lt;/tt&amp;gt; dirs will have a directory named &amp;lt;tt&amp;gt;python&amp;lt;/tt&amp;gt;, or &amp;lt;tt&amp;gt;python2.3&amp;lt;/tt&amp;gt; for example, and those will have a subdirectory named &amp;lt;tt&amp;gt;site-packages&amp;lt;/tt&amp;gt;. Add all paths to these &amp;lt;tt&amp;gt;site-packages&amp;lt;/tt&amp;gt; subdirectories in your &amp;lt;tt&amp;gt;PYTHONPATH&amp;lt;/tt&amp;gt; environment variable. Some (&amp;lt;tt&amp;gt;numpy&amp;lt;/tt&amp;gt;) may create a &amp;lt;tt&amp;gt;bin&amp;lt;/tt&amp;gt; directory that needs to be added to &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=Environment variables=&lt;br /&gt;
Besides the variables defined in env.sh or env.csh (see the [[Installation|short Installation guide]]), Madagascar programs may read the variables below. They usually have reasonable defaults and were introduced just to provide more power to the advanced user.&lt;br /&gt;
&lt;br /&gt;
For future documentation writers: the environment variables read by Madagascar that have not been documented below can be found by running the script &amp;lt;tt&amp;gt;$RSFSRC/admin/find_env_var.py&amp;lt;/tt&amp;gt;. If the script does not exist or does not work, a summary of all environment variable calls can be obtained by going to $RSFSRC, temporarily moving the directory &amp;lt;tt&amp;gt;build/&amp;lt;/tt&amp;gt; outside RSFSRC, and typing&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
grep environ.get *.py */*.py */*/*.py */*/*/*.py&lt;br /&gt;
grep getenv           */*.c  */*/*.c  */*/*/*.c&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Used by the Madagascar core==&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; style=&amp;quot;background:#ffdead;&amp;quot;|Variables introduced by Madagascar&#039;s non-graphic programs&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Name&#039;&#039;&#039; || &#039;&#039;&#039;Default&#039;&#039;&#039; || Meaning&lt;br /&gt;
|-&lt;br /&gt;
| RSF_DATASERVER || &amp;lt;nowiki&amp;gt;ftp://egl.beg.utexas.edu/&amp;lt;/nowiki&amp;gt; || Data server for benchmark datasets&lt;br /&gt;
|-&lt;br /&gt;
| RSFDOC || $RSFROOT/doc || Directory for the HTML self-doc&lt;br /&gt;
|-&lt;br /&gt;
| RSFFIGS || $RSFROOT/figs || Directory with figures for testing examples in $RSFSRC/book&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| RSFALTFIGS || $RSFFIGS || Alternate directory with figures for testing examples not in $RSFSRC/book&lt;br /&gt;
|-&lt;br /&gt;
| RSFMEMSIZE || 100 || Maximum RAM (Mb) to be used by some programs  &lt;br /&gt;
|-&lt;br /&gt;
| RSFSRC || undefined || Root of the Madagascar source tree&lt;br /&gt;
|-&lt;br /&gt;
| TMPDATAPATH || $DATAPATH || Datapath for temporary files on local disk.&lt;br /&gt;
|-&lt;br /&gt;
| LATEX2HTML || undefined || LateX2HTML customization directory&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; style=&amp;quot;background:#ffdead;&amp;quot;|Variables introduced by Madagascar graphics programs &lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Name&#039;&#039;&#039; || &#039;&#039;&#039;Default&#039;&#039;&#039; || Meaning&lt;br /&gt;
|-&lt;br /&gt;
| DEFAULT_PAPER_SIZE || &amp;quot;letter&amp;quot; || For pspen. Other options: legal, a3, a4, a5.&lt;br /&gt;
|-&lt;br /&gt;
| FATMULT || ? || Fatness multiplication factor. &lt;br /&gt;
|-&lt;br /&gt;
| GIFBORDER || 0.25 || For vplot2gif (spacing)&lt;br /&gt;
|-&lt;br /&gt;
| GIFDELAY || 100 || For vplot2gif (for animations)&lt;br /&gt;
|-&lt;br /&gt;
| IMAGE_TYPE || &#039;png&#039; || Icon type for LateX2HTML &lt;br /&gt;
|-&lt;br /&gt;
| PATTERNMULT || None || Pattern multiplication factor  &lt;br /&gt;
|-&lt;br /&gt;
| PLOTSTYLE || None || Used in vplot&lt;br /&gt;
|-&lt;br /&gt;
| PPI || 75 || For vplot2gif (screen resolution)&lt;br /&gt;
|-&lt;br /&gt;
| PPMSCALE || 1 || For vplot2gif&lt;br /&gt;
|-&lt;br /&gt;
| PSBORDER || 0.05 || For vplot2eps (border around the plot)&lt;br /&gt;
|-&lt;br /&gt;
| PSPRINTER || postscript or colorps || For pspen&lt;br /&gt;
|-&lt;br /&gt;
| PSTEXPENOPTS || color=n fat=1 fatmult=1.5 invras=y || Other vplot2eps options &lt;br /&gt;
|-&lt;br /&gt;
| VPLOTFONTDIR || $RSFROOT/include || Dir with backup fonts in case the runtime-loaded vplot fonts are not found&lt;br /&gt;
|-&lt;br /&gt;
| VPLOTSPOOLDIR || /tmp || Where to put vplot tmp files&lt;br /&gt;
|-&lt;br /&gt;
| WSTYPE || &amp;quot;default&amp;quot; || Workstation type.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:#ffdead;&amp;quot;| Variables set by OS/other apps, read-only to Madagascar&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Name&#039;&#039;&#039; || &#039;&#039;&#039;Primarily used/set by&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| CWPROOT || Seismic Unix&lt;br /&gt;
|-&lt;br /&gt;
| DISPLAY || Operating System (OS)&lt;br /&gt;
|-&lt;br /&gt;
| HOME || OS&lt;br /&gt;
|-&lt;br /&gt;
| LD_LIBRARY_PATH || linker&lt;br /&gt;
|-&lt;br /&gt;
| MATLABPATH || Matlab&lt;br /&gt;
|-&lt;br /&gt;
| XAUTHORITY || X-Windows&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Used by the Madagascar build process and parallelization utilities==&lt;br /&gt;
Type &amp;lt;tt&amp;gt;scons -h&amp;lt;/tt&amp;gt; in RSFSRC to get a list of environment variables that affect the build process, with explanations, defaults and actual values. Below are more detailed explanations for some of them:&lt;br /&gt;
* &amp;lt;tt&amp;gt;RSF_THREADS&amp;lt;/tt&amp;gt;: used by &amp;lt;tt&amp;gt;pscons&amp;lt;/tt&amp;gt; to determine on how many threads to run on the local node, overriding the number of threads detected by Madagascar&lt;br /&gt;
* &amp;lt;tt&amp;gt;RSF_CLUSTER&amp;lt;/tt&amp;gt;: used by &amp;lt;tt&amp;gt;pscons&amp;lt;/tt&amp;gt; to determine on which cluster nodes to run, and on how many CPUs&lt;br /&gt;
&lt;br /&gt;
==Used by the Matlab API==&lt;br /&gt;
To use the Matlab API, you need to add &amp;lt;tt&amp;gt;$RSFROOT/lib&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;MATLABPATH&amp;lt;/tt&amp;gt;&lt;br /&gt;
==Used by the Octave API==&lt;br /&gt;
To use the Octave API, you need to add &amp;lt;tt&amp;gt;$RSFROOT/lib&amp;lt;/tt&amp;gt; to Octave&#039;s path. Determine Octave&#039;s version with&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
octave -v | head -1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
If your version is lower than 2.9.6, type at a Unix command line:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
echo &#039;LOADPATH = &amp;quot;::$RSFROOT/lib/octave&amp;quot;&#039; &amp;gt;&amp;gt; ~/.octaverc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
For later versions, use:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
echo &#039;addpath([getenv(&amp;quot;RSFROOT&amp;quot;) &amp;quot;/lib/octave&amp;quot;])&#039; &amp;gt;&amp;gt; ~/.octaverc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
==Used by the Java API==&lt;br /&gt;
New-style (post-1.0) API: Needs &amp;lt;tt&amp;gt;JAVA_HOME&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Old-style API (1.0 and before): The path to the downloaded Mines JTK must be specified in the MINESJTK environment variable in order to install the Java API. For example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
export MINESJTK=/home/user/edu_mines_jtk.jar&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==RSFROOT for NFS-shared user home directories==&lt;br /&gt;
Heterogeneous networks with user home directories shared through [http://en.wikipedia.org/wiki/Network_File_System_(protocol) NFS] are quite common in many institutions. In addition, even when the architecture is the same (i.e. 64-bit) and the operating system is the same (i.e. [http://en.wikipedia.org/wiki/RHEL RHEL]), the difference between operating system versions may be very significant because clusters may run legacy versions, while desktop workstations may run the latest-and-greatest (even beta), and entirely different Madagascar versions may be needed to support both. &lt;br /&gt;
&lt;br /&gt;
One possible solution of detecting the distribution version and architecture and setting RSFROOT appropriately is shown below. In the example network, all RHEL4 machines have the same architecture, but there are RHEL 3 machines with several architectures:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
REDHAT_RELEASE=`awk -F&#039;release&#039; &#039;{ print $2 }&#039; /etc/redhat-release | awk -F&#039; &#039; &#039;{ print $1 }&#039;`&lt;br /&gt;
&lt;br /&gt;
RSFROOT=/usr/local/rsf/rhel$REDHAT_RELEASE&lt;br /&gt;
&lt;br /&gt;
if [ $REDHAT_RELEASE == &#039;4&#039; ] ; then&lt;br /&gt;
    export RSFROOT&lt;br /&gt;
elif [ $REDHAT_RELEASE == &#039;3&#039; ] ; then&lt;br /&gt;
    export RSFROOT=$RSFROOT/$ARCH&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Of course, the Madagascar administrator will have to download appropriate versions of Madagascar to each $RSFROOT, and compile them on the appropriate system.&lt;br /&gt;
&lt;br /&gt;
If you have many kinds of systems to maintain, with multiple versions of Madagascar, and users have more than one shell, you may find it easy to outsource the complex logic to the easy-to-debug Python, i.e.:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
export RSFROOT=`$M8R_SETUP/get_rsfroot.py`&lt;br /&gt;
export PYTHONPATH=`$M8R_SETUP/edit_pythonpath.py`&lt;br /&gt;
export PATH=`$M8R_SETUP/edit_path.py`&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and similarly for (t)csh. The Python scripts determine the operating system and its version, determine the machine name, and simply print to stdout the desired string.&lt;br /&gt;
&lt;br /&gt;
==Eclipse + Pydev==&lt;br /&gt;
If you use [http://eclipse.org/ Eclipse] with [http://pydev.org/ Pydev], [http://pydev.org/manual_101_interpreter.html#id2 configure the interpreter] by adding &amp;lt;tt&amp;gt;$RSFROOT/lib&amp;lt;/tt&amp;gt; to the &amp;lt;tt&amp;gt;PYTHONPATH&amp;lt;/tt&amp;gt; for your chosen interpreter.&lt;br /&gt;
&lt;br /&gt;
=Platform-specific installation advice=&lt;br /&gt;
==Supported platforms==&lt;br /&gt;
Madagascar attempts to support any [http://en.wikipedia.org/wiki/POSIX POSIX-compliant] operating system demanded by users. For systems that bundle Python (i.e. Linux distributions, BSDs), backwards compatibility will attempt to cover those systems that were bundled with the oldest non-deprecated Python version currently supported by the latest stable version of [http://scons.org/ SCons]. For example, in early 2009 the stable SCons release (1.2) supported Python 2.2 or newer. [http://distrowatch.com/table.php?distribution=redhat Python 2.2 was bundled by RHEL3], so RHEL 3 and newer are supported. &lt;br /&gt;
&lt;br /&gt;
Attempts for backward compatibility with a given operating system are also stopped if the operating system itself becomes unsupported. For example, Python 2.2 was bundled by Fedora 1 and newer, but in January 2010 only Fedora 11 and 12 are actively maintained. Thus, in January 2010 Madagascar was not attempting to support Fedora 1, even though it included Python 2.2.&lt;br /&gt;
&lt;br /&gt;
Please keep in mind that the above statements constitute only general guidelines for what will be attempted, and do not constitute in any way a warranty of support. An application of the above guidelines to some Linux distributions follows:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Support info&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Distribution&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Life Cycle&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Supported versions&lt;br /&gt;
|-&lt;br /&gt;
| RHEL/CentOS/Scientific Linux&lt;br /&gt;
| [https://www.redhat.com/security/updates/errata/ 7 years]&lt;br /&gt;
| &lt;br /&gt;
* 6 until 2017-11-30&lt;br /&gt;
* 5 until 2014-03-31&lt;br /&gt;
|-&lt;br /&gt;
| Fedora&lt;br /&gt;
| [http://fedoraproject.org/wiki/Fedora_Release_Life_Cycle Release X maintained until one month after the release of X+2]&lt;br /&gt;
| &lt;br /&gt;
* 15 until 2012-06-24&lt;br /&gt;
* 14 until 2011-12-02&lt;br /&gt;
|-&lt;br /&gt;
| Ubuntu&lt;br /&gt;
| [https://wiki.ubuntu.com/Releases Releases every 6 mo, maintained for 1.5 yrs; LTS versions every 2 yrs, maintained for 5 yrs]&lt;br /&gt;
| &lt;br /&gt;
* 15.10 until July 2016&lt;br /&gt;
* 14.04 LTS until end of April 2019&lt;br /&gt;
* 12.04.4 LTS until end of April 2017&lt;br /&gt;
|-&lt;br /&gt;
| Debian&lt;br /&gt;
| [http://wiki.debian.org/DebianLenny Usually: stable releases every 1.5-3 yrs, release X maintained 1 yr after release X+1]&lt;br /&gt;
| &lt;br /&gt;
* 6 until its TBD end of life (approx. 2014)&lt;br /&gt;
* 5 until 2012-04&lt;br /&gt;
|- &lt;br /&gt;
| openSUSE&lt;br /&gt;
| [http://en.opensuse.org/Lifetime openSUSE releases Lifetime of 1.5-2.5 years]&lt;br /&gt;
| &lt;br /&gt;
* 11.4 until 2012-09-10&lt;br /&gt;
* 11.3 until 2012-01-15&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Ubuntu==&lt;br /&gt;
In &#039;&#039;&#039;Ubuntu 18.04&#039;&#039;&#039;, you can install the essential Madagascar depenency by running&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install libxaw7-dev freeglut3-dev libnetpbm10-dev libgd-dev libplplot-dev \&lt;br /&gt;
libavcodec-dev libcairo2-dev libjpeg-dev swig python-dev python-numpy g++ gfortran \&lt;br /&gt;
libopenmpi-dev libfftw3-dev libsuitesparse-dev python-epydoc scons git emacs25&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In &#039;&#039;&#039;Ubuntu 15.10 &#039;&#039;Wily Werewolf&#039;&#039;&#039;&#039;&#039; (as well as some previous versions), you can install the essential Madagascar depenency by running&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install libxaw7-dev &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and (optionally) all of Madagascar&#039;s dependencies by running&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install libxaw7-dev freeglut3-dev libnetpbm10-dev libgd-dev libplplot-dev \&lt;br /&gt;
libavcodec-dev libcairo2-dev libjpeg-dev swig python-dev python-numpy g++ gfortran \&lt;br /&gt;
libopenmpi-dev libfftw3-dev libsuitesparse-dev python-epydoc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In Ubuntu 13.04 &#039;&#039;Raring Ringtail&#039;&#039;, you can install all of Madagascar&#039;s dependencies by running&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install freeglut3-dev g++ gfortran libgd2-xpm-dev libx11-dev libxaw7-dev \&lt;br /&gt;
libnetpbm10-dev swig python-dev python-numpy libblas-dev libcairo2-dev liblapack-dev \&lt;br /&gt;
libavcodec-dev python-epydoc scons&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In Ubuntu 12.10 &#039;&#039;Quantal Quetzal&#039;&#039;, you can install all of Madagascar&#039;s dependencies by running&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install freeglut3-dev g++ gfortran libgd2-xpm-dev libx11-dev libxaw7-dev \&lt;br /&gt;
libnetpbm10-dev swig python-dev python-numpy libblas-dev libcairo2-dev liblapack-dev \&lt;br /&gt;
libavcodec-dev python-epydoc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In Ubuntu 12.04 &#039;&#039;Precise Pangolin&#039;&#039;, you can install all of Madagascar&#039;s dependencies by running&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install scons openmpi-bin libopenmpi-dev freeglut3-dev g++ gfortran libgd2-xpm-dev \&lt;br /&gt;
libglew1.6-dev libx11-dev libxaw7-dev libnetpbm10-dev swig python-dev python-scipy python-numpy \&lt;br /&gt;
libtiff4-dev scons units libblas-dev libcairo2-dev liblapack-dev libavcodec-dev python-epydoc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In Ubuntu 10.10 &#039;&#039;Maverick Meerkat&#039;&#039;, you can install all of Madagascar&#039;s dependencies by running &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install freeglut3-dev g++ gfortran libgd2-xpm-dev libglew1.5-dev libjpeg62-dev \&lt;br /&gt;
libx11-dev libxaw7-dev libnetpbm10-dev swig python-dev python-scipy python-numpy libtiff4-dev \&lt;br /&gt;
scons units libblas-dev libcairo2-dev libavcodec-dev libplplot-dev &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In Ubuntu 9.04 &#039;&#039;Jaunty Jackalope&#039;&#039;, the corresponding command is&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install freeglut3-dev g++ gfortran libc6-dev libgd2-xpm-dev libglew1.5-dev libjpeg62-dev \&lt;br /&gt;
libx11-dev libxaw7-dev libnetpbm10-dev swig python-dev python-scipy python-numpy libtiff4-dev scons units &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Earlier versions may work with&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install mesa-libGL-devel g++ g77 libc6-dev libgd2-xpm-dev libglew-dev libjpeg62-dev \&lt;br /&gt;
libx11-dev libxaw7-dev libnetpbm10-dev swig python-dev python-scipy python-numpy libtiff4-dev scons units &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If working with the development version, you will also need &amp;lt;tt&amp;gt;git&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;subversion&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Fedora, RedHat, CentOS, Scientific Linux, openSUSE==&lt;br /&gt;
&lt;br /&gt;
Install essential Madagascar dependencies with&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo yum install gcc libXaw-devel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dependency package names, sorted by Linux distribution and Madagascar feature they provide. Packages that are not included in the standard distro repositories are hyperlinked to their providers. The tables below cover build dependencies. &lt;br /&gt;
&lt;br /&gt;
Names of packages that are runtime dependencies are &#039;&#039;&#039;highlighted&#039;&#039;&#039; in the tables below (task under construction).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note: In the future, it should be possible for the configuration scripts to output the dependency tables below, so that they are guaranteed to be in synch with a given Madagascar version&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Minimal install (&amp;quot;Core&amp;quot;), publishing and development&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Core&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | LaTeX&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Development version&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | C++ API&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | F77 API, F90 API&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Python API&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Java API&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Octave API&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Matlab API&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Fedora 15&lt;br /&gt;
| binutils, gcc, glibc-headers, python&lt;br /&gt;
| texlive-latex&lt;br /&gt;
| subversion&lt;br /&gt;
| gcc-c++&lt;br /&gt;
| gcc-gfortran&lt;br /&gt;
| numpy, swig, python-devel&lt;br /&gt;
| Java (Sun&#039;s? IcedTea?)&lt;br /&gt;
| octave, octave-devel&lt;br /&gt;
| [http://www.mathworks.com/ Matlab] with Mex&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Fedora 14&lt;br /&gt;
| binutils, gcc, glibc-headers, python&lt;br /&gt;
| texlive-latex&lt;br /&gt;
| subversion&lt;br /&gt;
| gcc-c++&lt;br /&gt;
| gcc-gfortran&lt;br /&gt;
| numpy, swig&lt;br /&gt;
| Java (Sun&#039;s? IcedTea?)&lt;br /&gt;
| octave, octave-devel&lt;br /&gt;
| [http://www.mathworks.com/ Matlab] with Mex&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Fedora 13&lt;br /&gt;
| binutils, gcc, glibc-headers, python&lt;br /&gt;
| texlive-latex&lt;br /&gt;
| subversion&lt;br /&gt;
| gcc-c++&lt;br /&gt;
| gcc-gfortran&lt;br /&gt;
| numpy, swig&lt;br /&gt;
| Java (Sun&#039;s? IcedTea?)&lt;br /&gt;
| octave, octave-devel&lt;br /&gt;
| [http://www.mathworks.com/ Matlab]&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | CentOS 5&lt;br /&gt;
| binutils, gcc, glibc-headers; python (needs [http://dag.wieers.com/rpm/FAQ.php#B2 RPMforge&#039;s RHEL5 repository])&lt;br /&gt;
| ?&lt;br /&gt;
| subversion&lt;br /&gt;
| gcc-c++&lt;br /&gt;
| gcc-gfortran&lt;br /&gt;
| numpy, swig&lt;br /&gt;
| Java (Sun&#039;s? IcedTea?), [http://inside.mines.edu/~dhale/jtk/ Mines JTK]&lt;br /&gt;
| [http://www.gnu.org/software/octave/ Octave, octave-devel]&lt;br /&gt;
| [http://www.mathworks.com/ Matlab]&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | openSUSE 11.0&lt;br /&gt;
| gcc, python&lt;br /&gt;
| texlive-latex&lt;br /&gt;
| subversion&lt;br /&gt;
| gcc-c++&lt;br /&gt;
| gcc-fortran&lt;br /&gt;
| [http://numpy.scipy.org/ NumPy], swig&lt;br /&gt;
| Java (Sun&#039;s? IcedTea?), [http://inside.mines.edu/~dhale/jtk/ Mines JTK]&lt;br /&gt;
| [http://www.gnu.org/software/octave/ Octave]&lt;br /&gt;
| [http://www.mathworks.com/ Matlab]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Graphics and visualization&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The minimum requirement is X11 graphics for running &#039;&#039;&#039;xtpen&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | X11 graphics&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | vplot2gif&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | vplot2avi&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Some sort of movies?&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | TIFF output&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | JPEG output&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | PLplot graphics&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | OpenGL graphics&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | ppm (?)&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | unknown&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Fedora 13&lt;br /&gt;
| libXaw-devel&lt;br /&gt;
| gifsicle&lt;br /&gt;
| ffmpeg (needs the [http://rpmfusion.org/ RPM Fusion] repository enabled)&lt;br /&gt;
| ffmpeg-devel (needs the [http://rpmfusion.org/ RPM Fusion] repository enabled)&lt;br /&gt;
| libtiff-devel&lt;br /&gt;
| libjpeg-devel&lt;br /&gt;
| plplot-devel&lt;br /&gt;
| mesa-libGL-devel, freeglut, freeglut-devel&lt;br /&gt;
| netpbm-devel&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | openSUSE 11.0&lt;br /&gt;
| xorg-x11-devel&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
| libtiff-devel&lt;br /&gt;
| libjpeg-devel&lt;br /&gt;
| plplot-devel&lt;br /&gt;
| mesa-libGL-devel, freeglut, freeglut-devel&lt;br /&gt;
| netpbm-devel&lt;br /&gt;
| cairo-devel, gd-devel, glew-devel&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Numerical and file manipulation utilities&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | OpenMP&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | MPI&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | BLAS/ATLAS&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Interface to the Fast Discrete Curvelet Transform&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | sfunits&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Fedora 13&lt;br /&gt;
| libgomp&lt;br /&gt;
| openmpi, openmpi-devel; openmpi-libs (?)&lt;br /&gt;
| blas, blas-devel, atlas, atlas-devel&lt;br /&gt;
| [https://wave.eos.ubc.ca/Software/Licenced/ pyct]&lt;br /&gt;
| units&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | CentOS 5&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
| [https://wave.eos.ubc.ca/Software/Licenced/ pyct]&lt;br /&gt;
| [http://www.gnu.org/software/units/units.html Gnu Units]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Other&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Inclusions from Seismic Unix&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Fedora 14, 15&lt;br /&gt;
| [http://www.cwp.mines.edu/cwpcodes/ Seismic Unix]&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | CentOS 5&lt;br /&gt;
| [http://www.cwp.mines.edu/cwpcodes/ Seismic Unix]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Command to install all dependencies present in the public repositories&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Usually package management software will not install again a package that is already installed, so it should be safe to copy and paste the command below to a command line:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Fedora 15&lt;br /&gt;
| &#039;&#039;&#039;yum -y install&#039;&#039;&#039; binutils gcc glibc-headers scons texlive-latex subversion gcc-c++ gcc-gfortran numpy python python-devel swig octave octave-devel libgomp openmpi openmpi-devel blas blas-devel atlas atlas-devel units gifsicle ffmpeg ffmpeg-devel libtiff-devel libjpeg-devel plplot-devel mesa-libGL-devel freeglut freeglut-devel libXaw-devel netpbm-devel&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Fedora 13&lt;br /&gt;
| &#039;&#039;&#039;yum -y install&#039;&#039;&#039; binutils gcc glibc-headers scons texlive-latex subversion gcc-c++ gcc-gfortran numpy python swig octave octave-devel libgomp openmpi openmpi-devel blas blas-devel atlas atlas-devel units gifsicle ffmpeg ffmpeg-devel libtiff-devel libjpeg-devel plplot-devel mesa-libGL-devel freeglut freeglut-devel libXaw-devel netpbm-devel&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | CentOS 5&lt;br /&gt;
| &#039;&#039;&#039;yum -y install&#039;&#039;&#039; binutils freeglut freeglut-devel gcc gcc-c++ gcc-gfortran glibc-headers libjpeg-devel libXaw-devel netpbm-devel&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | openSUSE 11.0&lt;br /&gt;
| &#039;&#039;&#039;zypper install&#039;&#039;&#039; cairo-devel gcc gcc-c++ gcc-fortran gd-devel glew-devel libjpeg-devel libtiff-devel octave scons subversion texlive-latex xorg-x11-devel&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;List of runtime dependencies only&#039;&#039;&#039;&lt;br /&gt;
(needed by packagers of Madagascar in order to properly list dependencies):&lt;br /&gt;
UNDER CONSTRUCTION&lt;br /&gt;
&lt;br /&gt;
===Fedora 25===&lt;br /&gt;
The following explains how to install madagascar on Fedora 25.&lt;br /&gt;
&lt;br /&gt;
We use the following compiler: &amp;lt;code&amp;gt;gcc&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;g++&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;gfortran&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* Install some packages&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; inline style=&amp;quot;white-space:wrap&amp;quot;&amp;gt;sudo dnf install scons lapack-static lapack64-static atlas-static fftw-static gd gd-devel libtool-ltdl-devel \&lt;br /&gt;
libXaw-devel mesa-libGL-devel freeglut-devel netpbm-devel plplot-devel ffmpeg-devel swig openmpi openmpi-devel suitesparse-devel&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This installed the following packages:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
scons-2.5.1-1.fc25.noarch&lt;br /&gt;
lapack-static-3.6.1-2.fc25.x86_64&lt;br /&gt;
lapack64-static-3.6.1-2.fc25.x86_64&lt;br /&gt;
atlas-static-3.10.2-14.fc25.x86_64&lt;br /&gt;
fftw-static-3.3.5-3.fc25.x86_64&lt;br /&gt;
gd-2.2.4-1.fc25.x86_64&lt;br /&gt;
gd-devel-2.2.4-1.fc25.x86_64&lt;br /&gt;
libtool-ltdl-devel-2.4.6-13.fc25.x86_64&lt;br /&gt;
libXaw-devel-1.0.13-4.fc25.x86_64&lt;br /&gt;
mesa-libGL-devel-17.0.5-3.fc25.x86_64&lt;br /&gt;
freeglut-devel-3.0.0-3.fc24.x86_64&lt;br /&gt;
netpbm-devel-10.78.00-1.fc25.x86_64&lt;br /&gt;
plplot-devel-5.11.1-13.fc25.x86_64&lt;br /&gt;
ffmpeg-devel-3.1.9-1.fc25.x86_64&lt;br /&gt;
swig-3.0.11-1.fc25.x86_64&lt;br /&gt;
openmpi-1.10.5-1.fc25.x86_64&lt;br /&gt;
openmpi-devel-1.10.5-1.fc25.x86_64&lt;br /&gt;
suitesparse-devel-4.4.6-7.fc25.x86_64&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and many other dependencies.&lt;br /&gt;
&lt;br /&gt;
* Get the sources from the git repository&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;git clone https://github.com/ahay/src&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you run now the &amp;lt;code&amp;gt;configure&amp;lt;/code&amp;gt; script, you will get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
checking for Python ... /usr/bin/python&lt;br /&gt;
checking Python version ... 2.7.13&lt;br /&gt;
checking for RSFROOT ... /usr/local/rsf&lt;br /&gt;
checking for SCons ... /usr/bin/scons&lt;br /&gt;
checking SCons version ... v2.5.1.rel_2.5.1:3735:9dc6cee5c168[MODIFIED]&lt;br /&gt;
Running RSFROOT=/usr/local/rsf /usr/bin/scons  config ...&lt;br /&gt;
------------------------&lt;br /&gt;
scons: Reading SConscript files ...&lt;br /&gt;
checking platform ... (cached) linux [fedora]&lt;br /&gt;
checking for C compiler ... (cached) gcc&lt;br /&gt;
checking if gcc works ... yes&lt;br /&gt;
checking if gcc accepts &#039;-x c -std=gnu99 -Wall -pedantic&#039; ... yes&lt;br /&gt;
checking for ar ... (cached) ar&lt;br /&gt;
checking for libraries ... [&#039;m&#039;]&lt;br /&gt;
checking complex support ... yes&lt;br /&gt;
checking for X11 headers ... /usr/include&lt;br /&gt;
checking for X11 libraries ... /usr/lib&lt;br /&gt;
checking for OpenGL ... yes&lt;br /&gt;
checking for sfpen ... (cached) xtpen&lt;br /&gt;
checking for ppm ... yes&lt;br /&gt;
checking for tiff ... yes&lt;br /&gt;
checking for GD (PNG) ... yes&lt;br /&gt;
checking for GD (GIF) ... yes&lt;br /&gt;
checking for plplot ... no&lt;br /&gt;
&lt;br /&gt;
  Optional package: plplot-devel&lt;br /&gt;
checking for ffmpeg ... yes&lt;br /&gt;
checking for cairo (PNG) ... yes&lt;br /&gt;
checking for cairo (SVG) ... yes&lt;br /&gt;
checking for cairo (PDF) ... yes&lt;br /&gt;
checking for jpeg ... yes&lt;br /&gt;
checking for BLAS ... yes&lt;br /&gt;
checking for LAPACK ... no&lt;br /&gt;
&lt;br /&gt;
  Optional package: blas + blas-devel + atlas + atlas-devel&lt;br /&gt;
checking for SWIG ... (cached) /usr/bin/swig&lt;br /&gt;
checking for numpy ... (cached) yes&lt;br /&gt;
checking API options ... (cached) []&lt;br /&gt;
checking for C++ compiler ... (cached) g++&lt;br /&gt;
checking if g++ works ... yes&lt;br /&gt;
checking if g++ accepts &#039;-std=c++11 -U__STRICT_ANSI__ -Wall -pedantic&#039; ... yes&lt;br /&gt;
checking for MPICC ... (cached) /usr/lib64/openmpi/bin/mpicc&lt;br /&gt;
checking if /usr/lib64/openmpi/bin/mpicc works ... yes&lt;br /&gt;
checking for MPICXX ... (cached) /usr/lib64/openmpi/bin/mpicxx&lt;br /&gt;
checking if /usr/lib64/openmpi/bin/mpicxx works ... yes&lt;br /&gt;
checking for MPIRUN ... (cached) /usr/lib64/openmpi/bin/mpirun&lt;br /&gt;
checking for Posix threads ... yes&lt;br /&gt;
checking for OpenMP ... yes&lt;br /&gt;
checking for CUDA ... (cached) no&lt;br /&gt;
checking for FFTW ... yes&lt;br /&gt;
checking if FFTW supports threads ... yes&lt;br /&gt;
checking for SuiteSparse ... yes&lt;br /&gt;
checking for pfft ... no&lt;br /&gt;
scons: done reading SConscript files.&lt;br /&gt;
scons: Building targets ...&lt;br /&gt;
shell_script([&amp;quot;env.sh&amp;quot;], [])&lt;br /&gt;
shell_script([&amp;quot;env.csh&amp;quot;], [])&lt;br /&gt;
scons: done building targets.&lt;br /&gt;
------------------------&lt;br /&gt;
Done with configuration.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Libraries &amp;lt;code&amp;gt;plplot&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;lapack&amp;lt;/code&amp;gt; are not found. File &amp;lt;code&amp;gt;config.log&amp;lt;/code&amp;gt; says&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/bin/ld: cannot find -lplplotd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gcc -o .sconf_temp/sfconftest_21 .sconf_temp/conftest_21.o -L/usr/lib64/atlas -lm -lf77blas -lcblas -latlas -llapack -lcblas&lt;br /&gt;
/usr/lib64/atlas/liblapack.a(dgesv.o): In function `dgesv_&#039;:&lt;br /&gt;
(.text+0x69): undefined reference to `xerbla_&#039;&lt;br /&gt;
/usr/lib64/atlas/liblapack.a(ATL_f77wrap_dgesv.o): In function `atl_f77wrap_dgesv_&#039;:&lt;br /&gt;
(.text+0x10d): undefined reference to `ATL_xerbla&#039;&lt;br /&gt;
/usr/lib64/atlas/liblapack.a(ATL_dgetf2.o): In function `ATL_dgetf2&#039;:&lt;br /&gt;
(.text+0x184): undefined reference to `ATL_dger&#039;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So library &amp;lt;code&amp;gt;plplotd&amp;lt;/code&amp;gt; doesn&#039;t exist on Fedora 25 and the &amp;lt;code&amp;gt;configure&amp;lt;/code&amp;gt; script is looking for the wrong &amp;lt;code&amp;gt;lapack&amp;lt;/code&amp;gt; library.&lt;br /&gt;
&lt;br /&gt;
If compiling now, 2 other libraries won&#039;t be found: &amp;lt;code&amp;gt;gfortran&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;quadmath&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Regarding the &amp;lt;code&amp;gt;plplotd&amp;lt;/code&amp;gt; library, edit file &amp;lt;code&amp;gt;framework/configure.py&amp;lt;/code&amp;gt; and change the line 724:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line start=&amp;quot;724&amp;quot;&amp;gt;plplot = context.env.get(&#039;PLPLOT&#039;,&#039;plplotd&#039;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
to&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line start=&amp;quot;724&amp;quot;&amp;gt;plplot = context.env.get(&#039;PLPLOT&#039;,&#039;plplot&#039;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* As for the libraries&lt;br /&gt;
** &amp;lt;code&amp;gt;lapack&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;gfortran&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;quadmath&amp;lt;/code&amp;gt;&lt;br /&gt;
We must use the &amp;lt;code&amp;gt;lapack&amp;lt;/code&amp;gt; library installed in &amp;lt;code&amp;gt;/usr/lib64&amp;lt;/code&amp;gt;, not the one installed in &amp;lt;code&amp;gt;/usr/lib64/atlas&amp;lt;/code&amp;gt;. And libraries &amp;lt;code&amp;gt;gfortran&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;quadmath&amp;lt;/code&amp;gt; are installed in &amp;lt;code&amp;gt;/usr/lib/gcc/x86_64-redhat-linux/6.3.1/&amp;lt;/code&amp;gt;.&lt;br /&gt;
Edit file &amp;lt;code&amp;gt;framework/configure.py&amp;lt;/code&amp;gt; and add the following 4 lines:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[&#039;/usr/lib/gcc/x86_64-redhat-linux/6.3.1/&#039;,&lt;br /&gt;
 &#039;/usr/lib64/&#039;,&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LIBS.append(&#039;gfortran&#039;)&lt;br /&gt;
LIBS.append(&#039;quadmath&#039;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
so that we end up with the following &amp;lt;code&amp;gt;blas&amp;lt;/code&amp;gt; function: &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line start=&amp;quot;971&amp;quot;&amp;gt;def blas(context):&lt;br /&gt;
    context.Message(&amp;quot;checking for BLAS ... &amp;quot;)&lt;br /&gt;
    text = &#039;&#039;&#039;&lt;br /&gt;
    #ifdef __APPLE__&lt;br /&gt;
    #include &amp;lt;Accelerate/Accelerate.h&amp;gt;&lt;br /&gt;
    #else&lt;br /&gt;
    #ifdef HAVE_MKL&lt;br /&gt;
    #include &amp;lt;mkl.h&amp;gt;&lt;br /&gt;
    #else&lt;br /&gt;
    #include &amp;lt;cblas.h&amp;gt;&lt;br /&gt;
    #endif&lt;br /&gt;
    #endif&lt;br /&gt;
    int main(int argc,char* argv[]) {&lt;br /&gt;
    float d, x[]={1.,2.,3.}, y[]={3.,2.,1.};&lt;br /&gt;
    d = cblas_sdot(3,x,1,y,1);&lt;br /&gt;
    return 0;&lt;br /&gt;
    }\n&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    if plat[&#039;OS&#039;] == &#039;cygwin&#039;:&lt;br /&gt;
        context.env[&#039;ENV&#039;][&#039;PATH&#039;] = context.env[&#039;ENV&#039;][&#039;PATH&#039;] + \&lt;br /&gt;
                                         &#039;:/lib/lapack&#039;&lt;br /&gt;
&lt;br /&gt;
    res = context.TryLink(text,&#039;.c&#039;)&lt;br /&gt;
    if res: &lt;br /&gt;
        context.Result(res)&lt;br /&gt;
        context.env[&#039;BLAS&#039;] = True &lt;br /&gt;
    else:&lt;br /&gt;
        # first try blas&lt;br /&gt;
        LIBS = path_get(context,&#039;LIBS&#039;)&lt;br /&gt;
        blas = context.env.get(&#039;BLAS&#039;,&#039;blas&#039;)&lt;br /&gt;
        LIBS.append(blas)&lt;br /&gt;
        res = context.TryLink(text,&#039;.c&#039;)&lt;br /&gt;
        if res: &lt;br /&gt;
            context.Result(res)&lt;br /&gt;
            context.env[&#039;LIBS&#039;] = LIBS &lt;br /&gt;
            context.env[&#039;BLAS&#039;] = blas &lt;br /&gt;
        else:&lt;br /&gt;
            # some systems require cblas and atlas&lt;br /&gt;
            for atlas_dir in filter(os.path.isdir,&lt;br /&gt;
                                    [&#039;/usr/lib/gcc/x86_64-redhat-linux/6.3.1/&#039;,  # &amp;lt;--- add this line&lt;br /&gt;
                                     &#039;/usr/lib64/&#039;,                              # &amp;lt;--- add this line&lt;br /&gt;
                                     &#039;/usr/lib64/atlas/&#039;,&lt;br /&gt;
                                     &#039;/usr/lib/atlas/&#039;]):&lt;br /&gt;
                context.env[&#039;LIBPATH&#039;].append(atlas_dir)&lt;br /&gt;
            LIBS.pop()&lt;br /&gt;
            LIBS.append(&#039;f77blas&#039;)&lt;br /&gt;
            LIBS.append(&#039;cblas&#039;)&lt;br /&gt;
            LIBS.append(&#039;atlas&#039;)&lt;br /&gt;
            LIBS.append(&#039;gfortran&#039;)  # &amp;lt;----------------------------------------------- add this line&lt;br /&gt;
            LIBS.append(&#039;quadmath&#039;)  # &amp;lt;----------------------------------------------- add this line&lt;br /&gt;
            res = context.TryLink(text,&#039;.c&#039;)&lt;br /&gt;
            if res: &lt;br /&gt;
                context.Result(res)&lt;br /&gt;
                context.env[&#039;LIBS&#039;] = LIBS &lt;br /&gt;
                context.env[&#039;BLAS&#039;] = &#039;cblas&#039;&lt;br /&gt;
            else:&lt;br /&gt;
                context.Result(context_failure)&lt;br /&gt;
                context.env[&#039;CPPDEFINES&#039;] = \&lt;br /&gt;
                    path_get(context,&#039;CPPDEFINES&#039;,&#039;NO_BLAS&#039;)&lt;br /&gt;
                LIBS.pop()&lt;br /&gt;
                LIBS.pop()&lt;br /&gt;
                LIBS.pop()&lt;br /&gt;
                context.env[&#039;BLAS&#039;] = None &lt;br /&gt;
                need_pkg(&#039;blas&#039;, fatal=False)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* Run the &amp;lt;code&amp;gt;configure&amp;lt;/code&amp;gt; script, for example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;./configure --prefix=/usr/local/rsf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Output should give:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
checking for Python ... /usr/bin/python&lt;br /&gt;
checking Python version ... 2.7.13&lt;br /&gt;
checking for RSFROOT ... /usr/local/rsf&lt;br /&gt;
checking for SCons ... /usr/bin/scons&lt;br /&gt;
checking SCons version ... v2.5.1.rel_2.5.1:3735:9dc6cee5c168[MODIFIED]&lt;br /&gt;
Running RSFROOT=/usr/local/rsf /usr/bin/scons  config ...&lt;br /&gt;
------------------------&lt;br /&gt;
scons: Reading SConscript files ...&lt;br /&gt;
checking platform ... (cached) linux [fedora]&lt;br /&gt;
checking for C compiler ... (cached) gcc&lt;br /&gt;
checking if gcc works ... yes&lt;br /&gt;
checking if gcc accepts &#039;-x c -std=gnu99 -Wall -pedantic&#039; ... yes&lt;br /&gt;
checking for ar ... (cached) ar&lt;br /&gt;
checking for libraries ... [&#039;m&#039;]&lt;br /&gt;
checking complex support ... yes&lt;br /&gt;
checking for X11 headers ... /usr/include&lt;br /&gt;
checking for X11 libraries ... /usr/lib&lt;br /&gt;
checking for OpenGL ... yes&lt;br /&gt;
checking for sfpen ... (cached) xtpen&lt;br /&gt;
checking for ppm ... yes&lt;br /&gt;
checking for tiff ... yes&lt;br /&gt;
checking for GD (PNG) ... yes&lt;br /&gt;
checking for GD (GIF) ... yes&lt;br /&gt;
checking for plplot ... yes&lt;br /&gt;
checking for ffmpeg ... yes&lt;br /&gt;
checking for cairo (PNG) ... yes&lt;br /&gt;
checking for cairo (SVG) ... yes&lt;br /&gt;
checking for cairo (PDF) ... yes&lt;br /&gt;
checking for jpeg ... yes&lt;br /&gt;
checking for BLAS ... yes&lt;br /&gt;
checking for LAPACK ... yes&lt;br /&gt;
checking for SWIG ... (cached) /usr/bin/swig&lt;br /&gt;
checking for numpy ... (cached) yes&lt;br /&gt;
checking API options ... (cached) []&lt;br /&gt;
checking for C++ compiler ... (cached) g++&lt;br /&gt;
checking if g++ works ... yes&lt;br /&gt;
checking if g++ accepts &#039;-std=c++11 -U__STRICT_ANSI__ -Wall -pedantic&#039; ... yes&lt;br /&gt;
checking for MPICC ... (cached) /usr/lib64/openmpi/bin/mpicc&lt;br /&gt;
checking if /usr/lib64/openmpi/bin/mpicc works ... yes&lt;br /&gt;
checking for MPICXX ... (cached) /usr/lib64/openmpi/bin/mpicxx&lt;br /&gt;
checking if /usr/lib64/openmpi/bin/mpicxx works ... yes&lt;br /&gt;
checking for MPIRUN ... (cached) /usr/lib64/openmpi/bin/mpirun&lt;br /&gt;
checking for Posix threads ... yes&lt;br /&gt;
checking for OpenMP ... yes&lt;br /&gt;
checking for CUDA ... (cached) no&lt;br /&gt;
checking for FFTW ... yes&lt;br /&gt;
checking if FFTW supports threads ... yes&lt;br /&gt;
checking for SuiteSparse ... yes&lt;br /&gt;
checking for pfft ... no&lt;br /&gt;
scons: done reading SConscript files.&lt;br /&gt;
scons: Building targets ...&lt;br /&gt;
shell_script([&amp;quot;env.sh&amp;quot;], [])&lt;br /&gt;
shell_script([&amp;quot;env.csh&amp;quot;], [])&lt;br /&gt;
scons: done building targets.&lt;br /&gt;
------------------------&lt;br /&gt;
Done with configuration.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* Then run the compilation:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;make&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* and finally the installation&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;sudo make install&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Debian 5==&lt;br /&gt;
Specific dependencies:&lt;br /&gt;
* Debian 5.0 (&amp;quot;Lenny&amp;quot;): Please make sure you have the &amp;lt;tt&amp;gt;libc6-dev&amp;lt;/tt&amp;gt; package before trying to compile from source. The &amp;lt;tt&amp;gt;libXaw7-dev&amp;lt;/tt&amp;gt; package might be a dependency for &amp;lt;tt&amp;gt;xtpen&amp;lt;/tt&amp;gt; (was in Debian 4.0)&lt;br /&gt;
&lt;br /&gt;
==Yellow Dog Linux 6.1 on Sony PlayStation 3==&lt;br /&gt;
See [http://www.reproducibility.org/rsflog/uploads/Friday_Seminar_Madagascar_on_PS3.ppt Will Burnett&#039;s guide (PowerPoint)]&lt;br /&gt;
&lt;br /&gt;
==Mac OS X==&lt;br /&gt;
&lt;br /&gt;
Install necessary Mac OS X applications using:&lt;br /&gt;
* [http://www.macports.org/ MacPorts], an easy-to-use system for compiling, installing, and upgrading open-source software on Mac OS X.&lt;br /&gt;
* [http://www.finkproject.org/ Fink], a tool that brings the full world of Unix Open Source software to Mac OS X. &lt;br /&gt;
&lt;br /&gt;
Installation on Mac OS X Mountain Lion requires the following:&lt;br /&gt;
# &amp;lt;b&amp;gt;Xcode&amp;lt;/b&amp;gt;: Download and install [https://developer.apple.com/xcode/ XCode] from Apple using App Store application. In Xcode, make sure to enable and install the command-line tools in Xcode/Preferences/Downloads &lt;br /&gt;
# (Optionally) &amp;lt;b&amp;gt;X11&amp;lt;/b&amp;gt;: Install X11 libraries from [http://xquartz.macosforge.org Xquartz]. &lt;br /&gt;
# (Optionally) &amp;lt;b&amp;gt;gcc&amp;lt;/b&amp;gt;: Install the Gnu C compiler from [http://hpc.sourceforge.net HPC Mac OS X]. &lt;br /&gt;
# (Optionally) [[SEGTeX]]: To use &amp;lt;b&amp;gt;SEGTeX&amp;lt;/b&amp;gt;, you may need [http://www.tug.org/texlive/ TeX Live]. &amp;lt;b&amp;gt;MacPorts&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;Fink&amp;lt;/b&amp;gt; provide an easy way to install it with commands &amp;lt;pre&amp;gt;sudo port install texlive&amp;lt;/pre&amp;gt; or &amp;lt;pre&amp;gt;sudo fink install texlive&amp;lt;/pre&amp;gt;&lt;br /&gt;
# (Optionally) &amp;lt;b&amp;gt;FFTW&amp;lt;/b&amp;gt;: Using &amp;lt;b&amp;gt;MacPorts&amp;lt;/b&amp;gt;, run &amp;lt;pre&amp;gt;sudo port install fftw-3-single&amp;lt;/pre&amp;gt;&amp;lt;pre&amp;gt;sudo port install fftw-3 +gfortran&amp;lt;/pre&amp;gt;&lt;br /&gt;
# (Optionally) &amp;lt;b&amp;gt;MPI&amp;lt;/b&amp;gt;: Using &amp;lt;b&amp;gt;MacPorts&amp;lt;/b&amp;gt;, run &amp;lt;pre&amp;gt;sudo port install openmpi&amp;lt;/pre&amp;gt;&amp;lt;pre&amp;gt;sudo port select --set mpi openmpi-mp-fortran&amp;lt;/pre&amp;gt;&lt;br /&gt;
# (Optionally) &amp;lt;b&amp;gt;ppmpen&amp;lt;/b&amp;gt;: Using &amp;lt;b&amp;gt;MacPorts&amp;lt;/b&amp;gt;, run &amp;lt;pre&amp;gt;sudo port install libnetpbm&amp;lt;/pre&amp;gt;&lt;br /&gt;
# (Optionally) &amp;lt;b&amp;gt;Open vplots using double click&amp;lt;/b&amp;gt;: [[machacks|Instructions]].&lt;br /&gt;
# Install python with libraries including jupyter and  ipython.  I recommend the Anaconda distribution.  which is available at https://www.anaconda.com/download&lt;br /&gt;
# (Optionally) &amp;lt;b&amp;gt;SWIG&amp;lt;/b&amp;gt; is required for some of the options of the Python api (used if you are coding in Python).  run  &amp;lt;pre&amp;gt;conda install swig&amp;lt;/pre&amp;gt; . I had to run&amp;lt;pre&amp;gt;cp `which siwg` /usr/local/bin&amp;lt;/pre&amp;gt; to get ./configure to find swig. &lt;br /&gt;
#Proceed with configuration and installation following the normal procedure.  You may need to use Apple&#039;s compiler (clang) instead of gcc.  Use one of these commands in the $RSFSRC directory &amp;lt;pre&amp;gt;./configure CC=clang CXX=clang++&amp;lt;/pre&amp;gt; or &amp;lt;pre&amp;gt;./configure CC=clang CXX=clang++ API=python --prefix=`pwd`&amp;lt;/pre&amp;gt;&lt;br /&gt;
#build the system with: &amp;lt;pre&amp;gt;make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
#After installing a new version of python you must run: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./configure &lt;br /&gt;
make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In summer of 2018 on a new MacBook Pro running Mac OS 10.14.1 (Mojave) I encountered an &amp;quot;abort trap: 6&amp;quot; error message when running sfpen from command line.  I do not &lt;br /&gt;
have a problem running sfpen inside scons. I changed to use xtpen from the command line.  I continue to use this work around.&lt;br /&gt;
&lt;br /&gt;
==OpenSolaris==&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;tt&amp;gt;pkg&amp;lt;/tt&amp;gt; to install missing components such as X11 headers.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
pfexec pkg install SUNWxorg-headers&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==MS Windows==&lt;br /&gt;
Due to its size, this topic has been assigned [[Windows | its own Wiki page]].&lt;br /&gt;
&lt;br /&gt;
==How to adapt Madagascar to a new platform==&lt;br /&gt;
The most laborious part of adapting madagascar to a new platform is finding the proper dependency names. This usually proceeds as follows: dependency X fails with a &amp;quot;missing file&amp;quot; error either as a header file in &amp;lt;tt&amp;gt;config.log&amp;lt;/tt&amp;gt;, or a missing library during the build step. Possible package names are found through an internet search for the missing file name and the distribution name or by using specific [http://rpm.pbone.net/ rpm search tools]. Packages are installed and the configure (and, if necessary) build processes are repeated until the error goes away.&lt;br /&gt;
&lt;br /&gt;
=Multi-user installs=&lt;br /&gt;
Some organizations may find it desirable to deny write access of some users to all RSFSRC/RSFROOT except their own user directory. Fortunately, this can be easily done by placing the restricted user dirs outside RSFSRC/RSFROOT, i.e. in their home dirs, say /home/joe/rsfsrc. In order to move a user&#039;s directory out of RSFSRC, you must:&lt;br /&gt;
* &amp;quot;tell&amp;quot; the SConstruct in the user&#039;s dir where to find RSFSRC so that when the user builds in his directory, it can import &amp;lt;tt&amp;gt;configure.py&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;config.py&amp;lt;/tt&amp;gt; You do that by setting the environment variable RSFSRC to the absolute path of the Madagascar source root, and by making sure that lines 2 and 3 in the users&#039; SConstruct files are&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
srcroot = os.environ.get(&#039;RSFSRC&#039;, &#039;../..&#039;)&lt;br /&gt;
sys.path.append(srcroot)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
and then replace &amp;lt;tt&amp;gt;../..&amp;lt;/tt&amp;gt; throughout the SConstruct using &amp;lt;tt&amp;gt;os.path.join&amp;lt;/tt&amp;gt; and the &amp;lt;tt&amp;gt;srcroot&amp;lt;/tt&amp;gt; variable.&lt;br /&gt;
* &amp;quot;tell&amp;quot; the build scripts about the user&#039;s dir, so that it is included in the builds launched from RSFSRC. You do that with a symbolic link:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ln -s /home/joe/rsfsrc $RSFSRC/user/joe&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&#039;&#039;When the link exists&#039;&#039;, those of Joe&#039;s programs that are mentioned in the &amp;quot;prog&amp;quot; string in SConstruct get included in the distribution, complete with self-doc. If Joe is just learning how to code and his stuff breaks the build, just remove the symbolic link. Even if build+installs are done after the link is removed, his stable programs and self-doc will continue to remain installed system-wide as long as the admin does not type &amp;lt;tt&amp;gt;scons -c install&amp;lt;/tt&amp;gt; (not likely).&lt;br /&gt;
* point the user&#039;s RSFDOC environment variable to a location where the user has write access&lt;br /&gt;
* edit the users&#039; SConstruct so that it uses the RSF library and headers already installed in $RSFROOT/lib and $RSFROOT/include , instead of building again the whole &amp;lt;tt&amp;gt;librsf&amp;lt;/tt&amp;gt; with user-specific flags in &amp;lt;tt&amp;gt;RSFSRC/filt/lib/&amp;lt;/tt&amp;gt;. To do that, replace in the user&#039;s SConstruct the env.Prepend statement with&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
rsfroot = os.environ.get(&#039;RSFROOT&#039;,&#039;/usr/local/rsf&#039;)&lt;br /&gt;
&lt;br /&gt;
env.Prepend(CPPPATH=[os.path.join(rsfroot,&#039;include&#039;)],&lt;br /&gt;
            LIBPATH=[os.path.join(rsfroot,&#039;lib&#039;)],&lt;br /&gt;
            LIBS=[&#039;rsf&#039;])&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* If the link from RSFSRC to Joe&#039;s directory was not made, add Joe&#039;s directory to his own path so that he can execute his own binaries.&lt;br /&gt;
&lt;br /&gt;
To understand how $DATAPATH disk space issues may become an issue in a multi-user environment, refer to the [[Advanced_Installation#Disk_space|Disk Space subsection]] at the beginning of this document.&lt;br /&gt;
&lt;br /&gt;
=Keeping your stuff separate=&lt;br /&gt;
A user may add his own programs and recipes to the Madagascar system. He may also create his own computational examples, data, and locked figures for testing. All of these components can be placed in their default locations, but it is not necessary to make them public. To keep these items private simply do not add them to the repository.&lt;br /&gt;
&lt;br /&gt;
However, it might be desirable to keep these components in separate places. For example, if you keep your private programs in RSFSRC/user you will have to remember to make a copy somewhere else if you ever want to delete the Madagascar installation to perform a fresh install. Yup, I deleted all my programs that way once. Good thing I had a back up! Fortunately, it is easy to keep each of these components in a separate place if desired.&lt;br /&gt;
&lt;br /&gt;
==Keeping programs separate==&lt;br /&gt;
User programs are ordinarily kept in a subdirectory of RSFSRC/user.  However, if you want to keep your programs separate all you have to do is put your subdirectory somewhere else and make a link to it in RSFSRC/user:&lt;br /&gt;
&amp;lt;bash&amp;gt;&lt;br /&gt;
ln -s path_to_my_programs $RSFSRC/user/my_programs&lt;br /&gt;
&amp;lt;/bash&amp;gt;&lt;br /&gt;
The additional instructions above for &amp;quot;multi-user installs&amp;quot; are for the case where the other users do not have write access to RSFSRC.  However, if you have full write access and only want to keep the programs in a separate place the link is the only thing you need.&lt;br /&gt;
&lt;br /&gt;
===Problems when symbolic linking and using SVN=== &lt;br /&gt;
If you decide to use a symbolic link e.g. &amp;quot;ln -s ...&amp;quot; as above, you will have difficulties checking in your code into the SVN repository.  SVN typically does not follow the symbolic link but will only the save the symbolic link.   &lt;br /&gt;
&lt;br /&gt;
See this answer from Stackoverflow (http://stackoverflow.com/questions/24850844/follow-symlinks-in-svn)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If I understand your problem, you have:&lt;br /&gt;
&lt;br /&gt;
project1/&lt;br /&gt;
project1/link1 -&amp;gt; ../../some/where/else&lt;br /&gt;
&lt;br /&gt;
If you do a simple svn add link1 it adds a symlink entry to the subversion repository, but what you&#039;re trying to accomplish is getting the stuff under somewhere else into the tree.&lt;br /&gt;
&lt;br /&gt;
If this is the case, then you&#039;re fighting in the wrong direction, you should make the real files and directories under link1, and make the target locations symlinks into the link1 directory. That would be a simple solution to the problem.&lt;br /&gt;
&lt;br /&gt;
Another solution would be to make the location ../../some/where/else an svn location in it&#039;s own right, and make link1 an externals definition to that location. When you commit in the main directory, the externals would be committed at the same time which would achieve storing the information; however to ensure that the other location was kept in sync, you would have to make sure to update it to the same version as the stored data.&lt;br /&gt;
&lt;br /&gt;
In my case, on my desktop, I have a settings directory:&lt;br /&gt;
&lt;br /&gt;
$HOME/settings&lt;br /&gt;
&lt;br /&gt;
This is a checked out copy of a directory containing .bashrc, .profile, .vimrc, .vim, etc. files and folders from an svn repo. All my profile files and directories were symlinks into this folder, so for example .profile -&amp;gt; settings/.profile, etc. When I make changes, they are reflected in the svn tree, which I can commit back to in order to ensure that I don&#039;t lose my config settings when I go to another system.&lt;br /&gt;
&lt;br /&gt;
If you really want svn to follow symlinks as hardlinks (You can&#039;t make directory hardlinks because it would be a bad thing™), then you&#039;ll have to hack the svn client source so that it did what you wanted; but this would be a maintenance nightmare.&lt;br /&gt;
&lt;br /&gt;
You could get away with making the symlink into a bind mount point directed at the target, but that has it&#039;s own issues - you would need to be root to accomplish this, and it ends up leaving funny entries in your /proc/mounts to accomplish this:&lt;br /&gt;
&lt;br /&gt;
mount --bind /absolute/path/to/some/where/else project1/link1&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Keeping recipes separate==&lt;br /&gt;
Computational recipes written in Python and imported by the SConstruct file of a workflow are normally stored in RSFSRC/book/Recipes.  The install process copies these recipes to a directory like $RSFROOT/lib/python2.5/site-packages/rsf/recipes and adds this directory to your PYTHONPATH so that Python can find them.&lt;br /&gt;
&lt;br /&gt;
However, you can put you own recipes anywhere you want.  You only have to add that place to your PYTHONPATH like this (bash):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
export PYTHONPATH=${PYTHONPATH}:path_to_my_recipes&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Or like this (csh):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
setenv PYTHONPATH ${PYTHONPATH}:path_to_my_recipes&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Keeping examples separate==&lt;br /&gt;
Madagascar&#039;s public collection of example workflows are stored in RSFSRC/book, but you can put your private workflows anywhere you want.  No special instructions are required.&lt;br /&gt;
&lt;br /&gt;
However, Madagascar assumes that the workflows are organized into a three-level book/chapter/section directory hierarchy when it creates a directory tree for the data and locked figures associated with your workflow. It is not required, but it might be easier to find the data and locked figures if you put your workflows in a three-level directory tree something like this: path_to_my_book/chapter/section/SConstruct.&lt;br /&gt;
&lt;br /&gt;
==Keeping data separate==&lt;br /&gt;
The location of the data portion of your *.rsf files is controlled by your DATAPATH environment variable.  However, you may want to keep the data for your private workflows in a different place, or several different places, than the data created by the public examples in RSFSRC/book.  The way to do that is to temporarily change the DATAPATH variable in the SConstruct &#039;&#039;before&#039;&#039; importing rsf.proj like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import os&lt;br /&gt;
os.environ[&#039;DATAPATH&#039;] = &#039;path_to_my_private_data&#039;&lt;br /&gt;
&lt;br /&gt;
from rsf.proj import *&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Keeping locked figures separate==&lt;br /&gt;
The command &amp;quot;scons lock&amp;quot; in the directory of a workflow will store a &amp;quot;locked&amp;quot; copy of your figures for regression testing.  Normally these figures are stored in the location pointed to by your RSFFIGS variable, and that is where the figures from the figures repository should be stored for testing in RSFSRC/book.&lt;br /&gt;
&lt;br /&gt;
However, you may want to keep your private figures in a different place.  The way to do that is to temporarily change the RSFFIGS variable in the SConstruct &#039;&#039;before&#039;&#039; importing rsf.proj like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import os&lt;br /&gt;
os.environ[&#039;RSFFIGS&#039;] = &#039;path_to_my_private_figures&#039;&lt;br /&gt;
&lt;br /&gt;
from rsf.proj import *&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
If you also create a RSFALTFIGS environment variable pointing to path_to_my_private_figures, then the testing script sffiglist will automatically test your figures against those in RSFALTFIGS when the sffiglist command is executed from a location outside of RSFSRC/book.&lt;br /&gt;
&lt;br /&gt;
=Capturing error and warning messages=&lt;br /&gt;
The messages during configuration are few and their importance quite high, so they should be watched &amp;quot;in person&amp;quot;. A complete log of the configuration process is recorded in RSFSRC/configure.log&lt;br /&gt;
&lt;br /&gt;
Console messages generated during the build step can be captured to a log file and observed at the same time with a command like this (tcsh):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
nice +10 nohup /usr/bin/time -p scons -k |&amp;amp; tee log_build.asc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The log file can be of course named otherwise than &amp;lt;tt&amp;gt;log_build.asc&amp;lt;/tt&amp;gt;. The file can be later grepped for error and warnings with commands such as:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
grep -c error log_build.asc&lt;br /&gt;
grep error log_build.asc | awk &#039;/error.c/ {next}; /error.h/ {next}; /error.o/ {next}; {print}&#039;&lt;br /&gt;
grep -c warning log_build.asc&lt;br /&gt;
grep warning log_build.asc | awk &#039;/imaginary constants are a GCC extension/ {next}; {print}&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Advanced troubleshooting=&lt;br /&gt;
* If you removed one of your programs or changed its name, and &amp;lt;tt&amp;gt;scons install&amp;lt;/tt&amp;gt; fails with &amp;quot;Source &amp;lt;tt&amp;gt;oldprogname&amp;lt;/tt&amp;gt; not found, needed by target install&amp;quot;, and you cleaned everything there was to clean but still get this message, remove &amp;lt;tt&amp;gt;RSFSRC/.sconsign*&amp;lt;/tt&amp;gt;&lt;br /&gt;
* If during &amp;lt;tt&amp;gt;scons install&amp;lt;/tt&amp;gt; you get a &amp;lt;tt&amp;gt;DBAccessError : (13, &#039;Permission denied&#039;)&amp;lt;/tt&amp;gt; in some reproducible papers, check permissions in your &amp;lt;tt&amp;gt;$DATAPATH&amp;lt;/tt&amp;gt; directory. This is where SCons places database &amp;quot;.sconsign&amp;quot; files for its dependencies (according to the rules in &amp;lt;tt&amp;gt;rsf.proj&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;rsf.tex&amp;lt;/tt&amp;gt;).&lt;br /&gt;
* If &amp;lt;tt&amp;gt;scons&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;scons install&amp;lt;/tt&amp;gt; fail due to an a bug introduced in a tool you are certain you will not use, a quick workaround for the problem is already built into scons: the &amp;lt;tt&amp;gt;-k&amp;lt;/tt&amp;gt; option, which means &amp;quot;keep going&amp;quot;. Thus, if you use &amp;lt;tt&amp;gt;scons -k&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;scons -k install&amp;lt;/tt&amp;gt;, SCons will not be able to build the failed component, or anything that depends on it, but it will keep going and make everything else that it can.&lt;br /&gt;
&lt;br /&gt;
=Further support=&lt;br /&gt;
Subscribe to the [https://lists.sourceforge.net/lists/listinfo/rsf-user rsf-user mailing list].&lt;/div&gt;</summary>
		<author><name>Karl</name></author>
	</entry>
	<entry>
		<id>https://ahay.org/index.php?title=Advanced_Installation&amp;diff=3755</id>
		<title>Advanced Installation</title>
		<link rel="alternate" type="text/html" href="https://ahay.org/index.php?title=Advanced_Installation&amp;diff=3755"/>
		<updated>2018-12-14T21:44:20Z</updated>

		<summary type="html">&lt;p&gt;Karl: /* Mac OS X */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:Fotolia_419157_XS.jpg|right|]]&lt;br /&gt;
Before reading this document, please familiarize yourself with the [[Installation|short Installation guide]].&lt;br /&gt;
=What the installation process does=&lt;br /&gt;
The term &amp;quot;installation&amp;quot; in the title is used for brevity, and it actually covers all three steps: configuration, build and install.&lt;br /&gt;
# Configure: determine what tools are available on the system and how they should be used to built the software. Creates a layer of abstraction so that the build is platform-independent. Should ideally either solve or flag all problems, so that the build either works, or does not proceed at all.&lt;br /&gt;
# Build: compiles the software and documentation using RSFSRC/build as a &amp;quot;workplace&amp;quot;&lt;br /&gt;
# Install: moves the compiled executables and the documentation to the final locations in $RSFROOT, sometimes changing filenames. Kept separate from build so that it can be done by root, and to avoid build failures leaving junk files all over the system.&lt;br /&gt;
A successful installation will have created in &amp;lt;tt&amp;gt;$RSFROOT&amp;lt;/tt&amp;gt; the following directories:&lt;br /&gt;
* &amp;lt;tt&amp;gt;bin/&amp;lt;/tt&amp;gt;: executable programs&lt;br /&gt;
* &amp;lt;tt&amp;gt;doc/&amp;lt;/tt&amp;gt;: auto-generated HTML documentation&lt;br /&gt;
* &amp;lt;tt&amp;gt;include/&amp;lt;/tt&amp;gt;: header files with info on library procedures; fonts&lt;br /&gt;
* &amp;lt;tt&amp;gt;lib/&amp;lt;/tt&amp;gt;: libraries and Python modules&lt;br /&gt;
&lt;br /&gt;
=Old (1.0 and 1.1) version installation=&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;tt&amp;gt;$RSFROOT/etc/madagascar/&amp;lt;/tt&amp;gt; as the location of &amp;lt;tt&amp;gt;env&amp;lt;/tt&amp;gt; scripts instead of &amp;lt;tt&amp;gt;$RSFROOT/share/madagascar/etc/&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=Old (0.9.9) version installation=&lt;br /&gt;
&lt;br /&gt;
====Environment variables====&lt;br /&gt;
Example configuration for &amp;lt;tt&amp;gt;bash&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
export RSFROOT=/usr/local/rsf # directory where Madagascar will be installed. &lt;br /&gt;
if [ -n &amp;quot;$PYTHONPATH&amp;quot; ]; then&lt;br /&gt;
export PYTHONPATH=${PYTHONPATH}:$RSFROOT/lib&lt;br /&gt;
else&lt;br /&gt;
export PYTHONPATH=$RSFROOT/lib&lt;br /&gt;
fi&lt;br /&gt;
export PATH=$RSFROOT/bin:$PATH&lt;br /&gt;
export DATAPATH=/var/tmp/&lt;br /&gt;
export MANPATH=$RSFROOT/share/man:$(manpath)&lt;br /&gt;
export LD_LIBRARY_PATH=$RSFROOT/lib:$LD_LIBRARY_PATH&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Notice the slash at the end of the &amp;lt;tt&amp;gt;DATAPATH&amp;lt;/tt&amp;gt; variable. &lt;br /&gt;
&lt;br /&gt;
Example configuration for &amp;lt;tt&amp;gt;csh&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;tcsh&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
setenv RSFROOT /usr/local/rsf&lt;br /&gt;
if ($?PYTHONPATH) then&lt;br /&gt;
setenv PYTHONPATH ${PYTHONPATH}:$RSFROOT/lib&lt;br /&gt;
else&lt;br /&gt;
setenv PYTHONPATH $RSFROOT/lib&lt;br /&gt;
endif&lt;br /&gt;
set path = ($RSFROOT/bin $path)&lt;br /&gt;
setenv DATAPATH /var/tmp/&lt;br /&gt;
setenv MANPATH $RSFROOT/share/man:`manpath`&lt;br /&gt;
setenv LD_LIBRARY_PATH $RSFROOT/lib:$LD_LIBRARY_PATH&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Notice the backticks surrounding the call to &amp;lt;tt&amp;gt;manpath&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Be aware that on some systems /var/tmp gets automatically cleaned at some intervals, so if you want to keep your data binaries for a long time, set &amp;lt;tt&amp;gt;DATAPATH&amp;lt;/tt&amp;gt; to another location where you have write access and that allows large files.&lt;br /&gt;
&lt;br /&gt;
====Software construction====&lt;br /&gt;
  &lt;br /&gt;
#Configuration. Change to the top source directory and run &amp;lt;pre&amp;gt;./configure&amp;lt;/pre&amp;gt; You can examine the &amp;lt;tt&amp;gt;config.py&amp;lt;/tt&amp;gt; file that this command generates.  Additional options are available. You can obtain a full list of customizable variables by running &amp;lt;tt&amp;gt;scons -h&amp;lt;/tt&amp;gt;. For example, to install C++ and Fortran-90 API bindings in addition to the basic package, run &amp;lt;pre&amp;gt;./configure API=c++,fortran-90&amp;lt;/pre&amp;gt; &lt;br /&gt;
#Building and installing the package. Run &amp;lt;tt&amp;gt;scons install&amp;lt;/tt&amp;gt; or the following two commands in succession:  &amp;lt;pre&amp;gt;make; make install&amp;lt;/pre&amp;gt; or &amp;lt;pre&amp;gt;scons; scons install&amp;lt;/pre&amp;gt; If you need &amp;quot;root&amp;quot; privileges for installing under &amp;lt;tt&amp;gt;&amp;amp;#36;RSFROOT&amp;lt;/tt&amp;gt;, you may need to run &amp;lt;pre&amp;gt;su; scons install &amp;lt;/pre&amp;gt; or &amp;lt;pre&amp;gt;sudo scons install&amp;lt;/pre&amp;gt;&lt;br /&gt;
#Cleaning. To clean all intermediate files generated by SCons, run &amp;lt;pre&amp;gt;make clean&amp;lt;/pre&amp;gt; or &amp;lt;pre&amp;gt;scons -c&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Prerequisites=&lt;br /&gt;
Basic prerequisites are described in the [[Installation|short Installation guide]]. Here are some additional details. &lt;br /&gt;
==Compilers==&lt;br /&gt;
Madagascar has been built successfully with the following compilers, and possibly with others:&lt;br /&gt;
* gcc&lt;br /&gt;
* Intel (icc/ifort)&lt;br /&gt;
* open64&lt;br /&gt;
* clang&lt;br /&gt;
* cc (Solaris)&lt;br /&gt;
&lt;br /&gt;
==Python and SCons==&lt;br /&gt;
As described below under [[Advanced Installation#Platform-specific installation advice | Platform-specific installation advice]], Madagascar supports the oldest non-deprecated Python version currently supported by the latest stable version of [http://scons.org/ SCons].  If your version of Python is older and you experience problems you should probably [http://www.python.org/ upgrade].&lt;br /&gt;
&lt;br /&gt;
Madagascar includes the latest stable version of SCons and the configure scripts will try to install it for you in RSFROOT if you don&#039;t have it already.  However, if you have an older version of SCons the configure scripts will not try to install the newer version. Your older version might work fine, but Madagascar attempts to support only the latest stable version of SCons, so if you have problems you should upgrade.&lt;br /&gt;
&lt;br /&gt;
To install the SCons bundled with Madagascar go to &amp;lt;tt&amp;gt;RSFSRC/scons&amp;lt;/tt&amp;gt;, unpack the tar file, and type&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
python setup.py install&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will install SCons in the standard location. You might need root privileges. If you don&#039;t have root privileges, or you don&#039;t want to interfere with the system SCons you can install it somewhere else with a --prefix option. A logical choice is to put it in RSFROOT like this:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
python setup.py install --prefix=$RSFROOT&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Location==&lt;br /&gt;
As long as you set the environment variables and directory permissions correctly, it does not matter in what part of your filesystem you place the install. If you have the luxury of installing anywhere, it is good practice to follow the [http://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard Filesystem Hierarchy Standard] and either:&lt;br /&gt;
# Install everything (including &amp;lt;tt&amp;gt;figs&amp;lt;/tt&amp;gt; if you do testing) under &amp;lt;tt&amp;gt;/usr/local/rsf&amp;lt;/tt&amp;gt;, with the source tree in &amp;lt;tt&amp;gt;/usr/local/rsf/src&amp;lt;/tt&amp;gt;, OR &lt;br /&gt;
# Put the source tree in &amp;lt;tt&amp;gt;/usr/local/src/rsf&amp;lt;/tt&amp;gt;, and specify &amp;lt;tt&amp;gt;RSFROOT=/usr/local&amp;lt;/tt&amp;gt;, so that header files and binaries go in &amp;lt;tt&amp;gt;/usr/local/bin&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;/usr/local/include&amp;lt;/tt&amp;gt;. To follow the standard, before installing set &amp;lt;tt&amp;gt;RSFDOC=/usr/local/share/rsf/doc&amp;lt;/tt&amp;gt; and create the appropriate directories. The auto-generated HTML documentation will get put there. Also, if installed, the figs directory for testing should be &amp;lt;tt&amp;gt;/usr/local/share/rsf/figs/&amp;lt;/tt&amp;gt;.&lt;br /&gt;
# Package Madagascar (i.e. build a RPM, etc) and install it in the default locations. For RPMs, those are as like the ones from the previous option, just directly in the &amp;lt;tt&amp;gt;/usr/&amp;lt;/tt&amp;gt; hierarchy, instead of in the &amp;lt;tt&amp;gt;/usr/local/&amp;lt;/tt&amp;gt; one.&lt;br /&gt;
&lt;br /&gt;
==Disk space==&lt;br /&gt;
At present (Feb 2007, r2530), the source directory containing the build tree from the development version was approx. 200Mb, the full installation (&amp;lt;tt&amp;gt;bin/&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;doc/&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;include/&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;lib&amp;lt;/tt&amp;gt;) is 31Mb, and &amp;lt;tt&amp;gt;figs/&amp;lt;/tt&amp;gt; (the optional directory if you want to do testing) is about 10 Gb. The stable version is significantly smaller.&lt;br /&gt;
&lt;br /&gt;
The only Madagascar-related directory where disk space can be an issue is &amp;lt;tt&amp;gt;$DATAPATH&amp;lt;/tt&amp;gt;. Real 3-D seismic datasets can be measured in Terabytes. Buggy programs/processing flows can fill up &amp;lt;tt&amp;gt;$DATAPATH&amp;lt;/tt&amp;gt;. A real problem are &amp;quot;disk memory leaks&amp;quot; -- removing header files with anything else than &amp;lt;tt&amp;gt;sfrm&amp;lt;/tt&amp;gt; will leave the binaries intact. Crashed jobs which start to write to binary but never get to write the header also produce &amp;quot;leaks&amp;quot;. Experience has shown that over time &amp;lt;tt&amp;gt;$DATAPATH&amp;lt;/tt&amp;gt; inexorably fills up. You may need to &lt;br /&gt;
# keep irreplaceable data and expensive results in a separate place;&lt;br /&gt;
# remove the oldest files in &amp;lt;tt&amp;gt;$DATAPATH&amp;lt;/tt&amp;gt; whenever the amount of free space declines under a preset threshold.&lt;br /&gt;
&lt;br /&gt;
==Dependencies==&lt;br /&gt;
Some platforms feature complete lists of dependencies. See [[Advanced Installation#Platform-specific installation advice | Platform-specific installation advice]] for details.&lt;br /&gt;
===C++ API===&lt;br /&gt;
A C++ compiler. SCons is smart and will try to find it for you. If it does not work specify the path to your compiler in the &amp;lt;tt&amp;gt;CXX&amp;lt;/tt&amp;gt; environment variable (can be passed as an option to the configuration script, like the &amp;lt;tt&amp;gt;API&amp;lt;/tt&amp;gt; one).&lt;br /&gt;
===F77 API===&lt;br /&gt;
A Fortran 77 compiler. If SCons does not find one, then you can either specify its path through the &amp;lt;tt&amp;gt;F77&amp;lt;/tt&amp;gt; variable, or if the executable is in your path, add its name to the list of F77 compilers in &amp;lt;tt&amp;gt;RSFSRC/configure.py&amp;lt;/tt&amp;gt; .&lt;br /&gt;
===F90 API===&lt;br /&gt;
Same as for Fortran 77 &amp;amp;ndash; just substitute &amp;lt;tt&amp;gt;F90&amp;lt;/tt&amp;gt;. If using the &amp;lt;tt&amp;gt;gfortran&amp;lt;/tt&amp;gt; compiler, make sure to get [http://gcc.gnu.org/wiki/GFortranBinaries the latest version]. If you have more than one compiler installed on your system, specify the desired one at configuration time:&lt;br /&gt;
&amp;lt;bash&amp;gt;&lt;br /&gt;
./configure API=f90 F90=/path/to/preferred/compiler&lt;br /&gt;
&amp;lt;/bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Java API===&lt;br /&gt;
There are two styles of API, old (1.0 release and previous) and new. The two APIs are not compatible with each other.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;old&amp;quot; interface requires the Mines Java Toolkit for fast Java file IO. The Mines JTK, is an open-source Java package that can be downloaded from [http://inside.mines.edu/~dhale/jtk/ Mines JTK]. Currently, the &amp;quot;old&amp;quot; interface will also build alongside the new one if the MINESJTK environment variable exists, and can be used as was previously.&lt;br /&gt;
&lt;br /&gt;
To install the new API, you need the (Oracle) JDK. Set your JAVA_HOME environment variable to the location of the jdk (on Ubuntu 10.04 this is: /usr/lib/jvm/java-6-openjdk), then reconfigure (./configure API=java ...) and reinstall.  &lt;br /&gt;
&lt;br /&gt;
Ignore the SWIG warnings (there are lots). &lt;br /&gt;
&lt;br /&gt;
Make sure to set your LD_LIBRARY_PATH to $RSFROOT/lib .&lt;br /&gt;
&lt;br /&gt;
If you want to include additional Java packages, you can set them using your shell&#039;s CLASSPATH variable.  This environment variable is now automatically passed onto all Java classes in SCons.&lt;br /&gt;
&lt;br /&gt;
The installation can be tested using the example demonstrating the new API in api/java/test .&lt;br /&gt;
&lt;br /&gt;
===Matlab API===&lt;br /&gt;
Besides Matlab itself, you need Mex, which compiles C code into regular Matlab functions. Use the &amp;lt;tt&amp;gt;MATLAB&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;MEX&amp;lt;/tt&amp;gt; environment variables to specify their paths if they are installed, but not found.&lt;br /&gt;
===Octave API===&lt;br /&gt;
The Octave function compiler (&amp;lt;tt&amp;gt;mkoctfile&amp;lt;/tt&amp;gt;) is sometimes bundled in a separate package, so it may be missing from the Octave installation.&lt;br /&gt;
&lt;br /&gt;
===Python API===&lt;br /&gt;
This API requires [http://www.swig.org/ SWIG], [http://numpy.scipy.org/ numpy] and the Python development kit. Numpy requires Python 2.4 or newer (i.e. RHEL 5 or newer). However, these dependencies are unnecessary for the common case when Python is just used as [http://en.wikipedia.org/wiki/Glue_language glue] to create chains of programs, and it only needs to read the RSF header, and not the binary. To allow Python [http://en.wikipedia.org/wiki/Meta-programs metaprograms] in madagascar to function, and programming in this style to be done, a fallback development kit implementing only the header-related functionality will be installed in the lack of these dependencies.&lt;br /&gt;
&lt;br /&gt;
===Python modules in user space===&lt;br /&gt;
Python is an evolving language. Many large systems have old versions for stability reasons, and administrators of such large systems tend to not install all software users may wish, and to not allow access to rpm either. To install a module in your user space, download the tarball, unzip it, cd into the directory and run: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;python setup.py install --prefix=/path/to/your/place&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The installer will create a subdirectory named &amp;lt;tt&amp;gt;lib&amp;lt;/tt&amp;gt;, or &amp;lt;tt&amp;gt;lib64&amp;lt;/tt&amp;gt; under the directory above. These &amp;lt;tt&amp;gt;lib*&amp;lt;/tt&amp;gt; dirs will have a directory named &amp;lt;tt&amp;gt;python&amp;lt;/tt&amp;gt;, or &amp;lt;tt&amp;gt;python2.3&amp;lt;/tt&amp;gt; for example, and those will have a subdirectory named &amp;lt;tt&amp;gt;site-packages&amp;lt;/tt&amp;gt;. Add all paths to these &amp;lt;tt&amp;gt;site-packages&amp;lt;/tt&amp;gt; subdirectories in your &amp;lt;tt&amp;gt;PYTHONPATH&amp;lt;/tt&amp;gt; environment variable. Some (&amp;lt;tt&amp;gt;numpy&amp;lt;/tt&amp;gt;) may create a &amp;lt;tt&amp;gt;bin&amp;lt;/tt&amp;gt; directory that needs to be added to &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=Environment variables=&lt;br /&gt;
Besides the variables defined in env.sh or env.csh (see the [[Installation|short Installation guide]]), Madagascar programs may read the variables below. They usually have reasonable defaults and were introduced just to provide more power to the advanced user.&lt;br /&gt;
&lt;br /&gt;
For future documentation writers: the environment variables read by Madagascar that have not been documented below can be found by running the script &amp;lt;tt&amp;gt;$RSFSRC/admin/find_env_var.py&amp;lt;/tt&amp;gt;. If the script does not exist or does not work, a summary of all environment variable calls can be obtained by going to $RSFSRC, temporarily moving the directory &amp;lt;tt&amp;gt;build/&amp;lt;/tt&amp;gt; outside RSFSRC, and typing&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
grep environ.get *.py */*.py */*/*.py */*/*/*.py&lt;br /&gt;
grep getenv           */*.c  */*/*.c  */*/*/*.c&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Used by the Madagascar core==&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; style=&amp;quot;background:#ffdead;&amp;quot;|Variables introduced by Madagascar&#039;s non-graphic programs&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Name&#039;&#039;&#039; || &#039;&#039;&#039;Default&#039;&#039;&#039; || Meaning&lt;br /&gt;
|-&lt;br /&gt;
| RSF_DATASERVER || &amp;lt;nowiki&amp;gt;ftp://egl.beg.utexas.edu/&amp;lt;/nowiki&amp;gt; || Data server for benchmark datasets&lt;br /&gt;
|-&lt;br /&gt;
| RSFDOC || $RSFROOT/doc || Directory for the HTML self-doc&lt;br /&gt;
|-&lt;br /&gt;
| RSFFIGS || $RSFROOT/figs || Directory with figures for testing examples in $RSFSRC/book&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| RSFALTFIGS || $RSFFIGS || Alternate directory with figures for testing examples not in $RSFSRC/book&lt;br /&gt;
|-&lt;br /&gt;
| RSFMEMSIZE || 100 || Maximum RAM (Mb) to be used by some programs  &lt;br /&gt;
|-&lt;br /&gt;
| RSFSRC || undefined || Root of the Madagascar source tree&lt;br /&gt;
|-&lt;br /&gt;
| TMPDATAPATH || $DATAPATH || Datapath for temporary files on local disk.&lt;br /&gt;
|-&lt;br /&gt;
| LATEX2HTML || undefined || LateX2HTML customization directory&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; style=&amp;quot;background:#ffdead;&amp;quot;|Variables introduced by Madagascar graphics programs &lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Name&#039;&#039;&#039; || &#039;&#039;&#039;Default&#039;&#039;&#039; || Meaning&lt;br /&gt;
|-&lt;br /&gt;
| DEFAULT_PAPER_SIZE || &amp;quot;letter&amp;quot; || For pspen. Other options: legal, a3, a4, a5.&lt;br /&gt;
|-&lt;br /&gt;
| FATMULT || ? || Fatness multiplication factor. &lt;br /&gt;
|-&lt;br /&gt;
| GIFBORDER || 0.25 || For vplot2gif (spacing)&lt;br /&gt;
|-&lt;br /&gt;
| GIFDELAY || 100 || For vplot2gif (for animations)&lt;br /&gt;
|-&lt;br /&gt;
| IMAGE_TYPE || &#039;png&#039; || Icon type for LateX2HTML &lt;br /&gt;
|-&lt;br /&gt;
| PATTERNMULT || None || Pattern multiplication factor  &lt;br /&gt;
|-&lt;br /&gt;
| PLOTSTYLE || None || Used in vplot&lt;br /&gt;
|-&lt;br /&gt;
| PPI || 75 || For vplot2gif (screen resolution)&lt;br /&gt;
|-&lt;br /&gt;
| PPMSCALE || 1 || For vplot2gif&lt;br /&gt;
|-&lt;br /&gt;
| PSBORDER || 0.05 || For vplot2eps (border around the plot)&lt;br /&gt;
|-&lt;br /&gt;
| PSPRINTER || postscript or colorps || For pspen&lt;br /&gt;
|-&lt;br /&gt;
| PSTEXPENOPTS || color=n fat=1 fatmult=1.5 invras=y || Other vplot2eps options &lt;br /&gt;
|-&lt;br /&gt;
| VPLOTFONTDIR || $RSFROOT/include || Dir with backup fonts in case the runtime-loaded vplot fonts are not found&lt;br /&gt;
|-&lt;br /&gt;
| VPLOTSPOOLDIR || /tmp || Where to put vplot tmp files&lt;br /&gt;
|-&lt;br /&gt;
| WSTYPE || &amp;quot;default&amp;quot; || Workstation type.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:#ffdead;&amp;quot;| Variables set by OS/other apps, read-only to Madagascar&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Name&#039;&#039;&#039; || &#039;&#039;&#039;Primarily used/set by&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| CWPROOT || Seismic Unix&lt;br /&gt;
|-&lt;br /&gt;
| DISPLAY || Operating System (OS)&lt;br /&gt;
|-&lt;br /&gt;
| HOME || OS&lt;br /&gt;
|-&lt;br /&gt;
| LD_LIBRARY_PATH || linker&lt;br /&gt;
|-&lt;br /&gt;
| MATLABPATH || Matlab&lt;br /&gt;
|-&lt;br /&gt;
| XAUTHORITY || X-Windows&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Used by the Madagascar build process and parallelization utilities==&lt;br /&gt;
Type &amp;lt;tt&amp;gt;scons -h&amp;lt;/tt&amp;gt; in RSFSRC to get a list of environment variables that affect the build process, with explanations, defaults and actual values. Below are more detailed explanations for some of them:&lt;br /&gt;
* &amp;lt;tt&amp;gt;RSF_THREADS&amp;lt;/tt&amp;gt;: used by &amp;lt;tt&amp;gt;pscons&amp;lt;/tt&amp;gt; to determine on how many threads to run on the local node, overriding the number of threads detected by Madagascar&lt;br /&gt;
* &amp;lt;tt&amp;gt;RSF_CLUSTER&amp;lt;/tt&amp;gt;: used by &amp;lt;tt&amp;gt;pscons&amp;lt;/tt&amp;gt; to determine on which cluster nodes to run, and on how many CPUs&lt;br /&gt;
&lt;br /&gt;
==Used by the Matlab API==&lt;br /&gt;
To use the Matlab API, you need to add &amp;lt;tt&amp;gt;$RSFROOT/lib&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;MATLABPATH&amp;lt;/tt&amp;gt;&lt;br /&gt;
==Used by the Octave API==&lt;br /&gt;
To use the Octave API, you need to add &amp;lt;tt&amp;gt;$RSFROOT/lib&amp;lt;/tt&amp;gt; to Octave&#039;s path. Determine Octave&#039;s version with&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
octave -v | head -1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
If your version is lower than 2.9.6, type at a Unix command line:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
echo &#039;LOADPATH = &amp;quot;::$RSFROOT/lib/octave&amp;quot;&#039; &amp;gt;&amp;gt; ~/.octaverc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
For later versions, use:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
echo &#039;addpath([getenv(&amp;quot;RSFROOT&amp;quot;) &amp;quot;/lib/octave&amp;quot;])&#039; &amp;gt;&amp;gt; ~/.octaverc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
==Used by the Java API==&lt;br /&gt;
New-style (post-1.0) API: Needs &amp;lt;tt&amp;gt;JAVA_HOME&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Old-style API (1.0 and before): The path to the downloaded Mines JTK must be specified in the MINESJTK environment variable in order to install the Java API. For example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
export MINESJTK=/home/user/edu_mines_jtk.jar&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==RSFROOT for NFS-shared user home directories==&lt;br /&gt;
Heterogeneous networks with user home directories shared through [http://en.wikipedia.org/wiki/Network_File_System_(protocol) NFS] are quite common in many institutions. In addition, even when the architecture is the same (i.e. 64-bit) and the operating system is the same (i.e. [http://en.wikipedia.org/wiki/RHEL RHEL]), the difference between operating system versions may be very significant because clusters may run legacy versions, while desktop workstations may run the latest-and-greatest (even beta), and entirely different Madagascar versions may be needed to support both. &lt;br /&gt;
&lt;br /&gt;
One possible solution of detecting the distribution version and architecture and setting RSFROOT appropriately is shown below. In the example network, all RHEL4 machines have the same architecture, but there are RHEL 3 machines with several architectures:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
REDHAT_RELEASE=`awk -F&#039;release&#039; &#039;{ print $2 }&#039; /etc/redhat-release | awk -F&#039; &#039; &#039;{ print $1 }&#039;`&lt;br /&gt;
&lt;br /&gt;
RSFROOT=/usr/local/rsf/rhel$REDHAT_RELEASE&lt;br /&gt;
&lt;br /&gt;
if [ $REDHAT_RELEASE == &#039;4&#039; ] ; then&lt;br /&gt;
    export RSFROOT&lt;br /&gt;
elif [ $REDHAT_RELEASE == &#039;3&#039; ] ; then&lt;br /&gt;
    export RSFROOT=$RSFROOT/$ARCH&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Of course, the Madagascar administrator will have to download appropriate versions of Madagascar to each $RSFROOT, and compile them on the appropriate system.&lt;br /&gt;
&lt;br /&gt;
If you have many kinds of systems to maintain, with multiple versions of Madagascar, and users have more than one shell, you may find it easy to outsource the complex logic to the easy-to-debug Python, i.e.:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
export RSFROOT=`$M8R_SETUP/get_rsfroot.py`&lt;br /&gt;
export PYTHONPATH=`$M8R_SETUP/edit_pythonpath.py`&lt;br /&gt;
export PATH=`$M8R_SETUP/edit_path.py`&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and similarly for (t)csh. The Python scripts determine the operating system and its version, determine the machine name, and simply print to stdout the desired string.&lt;br /&gt;
&lt;br /&gt;
==Eclipse + Pydev==&lt;br /&gt;
If you use [http://eclipse.org/ Eclipse] with [http://pydev.org/ Pydev], [http://pydev.org/manual_101_interpreter.html#id2 configure the interpreter] by adding &amp;lt;tt&amp;gt;$RSFROOT/lib&amp;lt;/tt&amp;gt; to the &amp;lt;tt&amp;gt;PYTHONPATH&amp;lt;/tt&amp;gt; for your chosen interpreter.&lt;br /&gt;
&lt;br /&gt;
=Platform-specific installation advice=&lt;br /&gt;
==Supported platforms==&lt;br /&gt;
Madagascar attempts to support any [http://en.wikipedia.org/wiki/POSIX POSIX-compliant] operating system demanded by users. For systems that bundle Python (i.e. Linux distributions, BSDs), backwards compatibility will attempt to cover those systems that were bundled with the oldest non-deprecated Python version currently supported by the latest stable version of [http://scons.org/ SCons]. For example, in early 2009 the stable SCons release (1.2) supported Python 2.2 or newer. [http://distrowatch.com/table.php?distribution=redhat Python 2.2 was bundled by RHEL3], so RHEL 3 and newer are supported. &lt;br /&gt;
&lt;br /&gt;
Attempts for backward compatibility with a given operating system are also stopped if the operating system itself becomes unsupported. For example, Python 2.2 was bundled by Fedora 1 and newer, but in January 2010 only Fedora 11 and 12 are actively maintained. Thus, in January 2010 Madagascar was not attempting to support Fedora 1, even though it included Python 2.2.&lt;br /&gt;
&lt;br /&gt;
Please keep in mind that the above statements constitute only general guidelines for what will be attempted, and do not constitute in any way a warranty of support. An application of the above guidelines to some Linux distributions follows:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Support info&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Distribution&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Life Cycle&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Supported versions&lt;br /&gt;
|-&lt;br /&gt;
| RHEL/CentOS/Scientific Linux&lt;br /&gt;
| [https://www.redhat.com/security/updates/errata/ 7 years]&lt;br /&gt;
| &lt;br /&gt;
* 6 until 2017-11-30&lt;br /&gt;
* 5 until 2014-03-31&lt;br /&gt;
|-&lt;br /&gt;
| Fedora&lt;br /&gt;
| [http://fedoraproject.org/wiki/Fedora_Release_Life_Cycle Release X maintained until one month after the release of X+2]&lt;br /&gt;
| &lt;br /&gt;
* 15 until 2012-06-24&lt;br /&gt;
* 14 until 2011-12-02&lt;br /&gt;
|-&lt;br /&gt;
| Ubuntu&lt;br /&gt;
| [https://wiki.ubuntu.com/Releases Releases every 6 mo, maintained for 1.5 yrs; LTS versions every 2 yrs, maintained for 5 yrs]&lt;br /&gt;
| &lt;br /&gt;
* 15.10 until July 2016&lt;br /&gt;
* 14.04 LTS until end of April 2019&lt;br /&gt;
* 12.04.4 LTS until end of April 2017&lt;br /&gt;
|-&lt;br /&gt;
| Debian&lt;br /&gt;
| [http://wiki.debian.org/DebianLenny Usually: stable releases every 1.5-3 yrs, release X maintained 1 yr after release X+1]&lt;br /&gt;
| &lt;br /&gt;
* 6 until its TBD end of life (approx. 2014)&lt;br /&gt;
* 5 until 2012-04&lt;br /&gt;
|- &lt;br /&gt;
| openSUSE&lt;br /&gt;
| [http://en.opensuse.org/Lifetime openSUSE releases Lifetime of 1.5-2.5 years]&lt;br /&gt;
| &lt;br /&gt;
* 11.4 until 2012-09-10&lt;br /&gt;
* 11.3 until 2012-01-15&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Ubuntu==&lt;br /&gt;
In &#039;&#039;&#039;Ubuntu 18.04&#039;&#039;&#039;, you can install the essential Madagascar depenency by running&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install libxaw7-dev freeglut3-dev libnetpbm10-dev libgd-dev libplplot-dev \&lt;br /&gt;
libavcodec-dev libcairo2-dev libjpeg-dev swig python-dev python-numpy g++ gfortran \&lt;br /&gt;
libopenmpi-dev libfftw3-dev libsuitesparse-dev python-epydoc scons git emacs25&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In &#039;&#039;&#039;Ubuntu 15.10 &#039;&#039;Wily Werewolf&#039;&#039;&#039;&#039;&#039; (as well as some previous versions), you can install the essential Madagascar depenency by running&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install libxaw7-dev &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and (optionally) all of Madagascar&#039;s dependencies by running&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install libxaw7-dev freeglut3-dev libnetpbm10-dev libgd-dev libplplot-dev \&lt;br /&gt;
libavcodec-dev libcairo2-dev libjpeg-dev swig python-dev python-numpy g++ gfortran \&lt;br /&gt;
libopenmpi-dev libfftw3-dev libsuitesparse-dev python-epydoc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In Ubuntu 13.04 &#039;&#039;Raring Ringtail&#039;&#039;, you can install all of Madagascar&#039;s dependencies by running&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install freeglut3-dev g++ gfortran libgd2-xpm-dev libx11-dev libxaw7-dev \&lt;br /&gt;
libnetpbm10-dev swig python-dev python-numpy libblas-dev libcairo2-dev liblapack-dev \&lt;br /&gt;
libavcodec-dev python-epydoc scons&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In Ubuntu 12.10 &#039;&#039;Quantal Quetzal&#039;&#039;, you can install all of Madagascar&#039;s dependencies by running&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install freeglut3-dev g++ gfortran libgd2-xpm-dev libx11-dev libxaw7-dev \&lt;br /&gt;
libnetpbm10-dev swig python-dev python-numpy libblas-dev libcairo2-dev liblapack-dev \&lt;br /&gt;
libavcodec-dev python-epydoc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In Ubuntu 12.04 &#039;&#039;Precise Pangolin&#039;&#039;, you can install all of Madagascar&#039;s dependencies by running&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install scons openmpi-bin libopenmpi-dev freeglut3-dev g++ gfortran libgd2-xpm-dev \&lt;br /&gt;
libglew1.6-dev libx11-dev libxaw7-dev libnetpbm10-dev swig python-dev python-scipy python-numpy \&lt;br /&gt;
libtiff4-dev scons units libblas-dev libcairo2-dev liblapack-dev libavcodec-dev python-epydoc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In Ubuntu 10.10 &#039;&#039;Maverick Meerkat&#039;&#039;, you can install all of Madagascar&#039;s dependencies by running &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install freeglut3-dev g++ gfortran libgd2-xpm-dev libglew1.5-dev libjpeg62-dev \&lt;br /&gt;
libx11-dev libxaw7-dev libnetpbm10-dev swig python-dev python-scipy python-numpy libtiff4-dev \&lt;br /&gt;
scons units libblas-dev libcairo2-dev libavcodec-dev libplplot-dev &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In Ubuntu 9.04 &#039;&#039;Jaunty Jackalope&#039;&#039;, the corresponding command is&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install freeglut3-dev g++ gfortran libc6-dev libgd2-xpm-dev libglew1.5-dev libjpeg62-dev \&lt;br /&gt;
libx11-dev libxaw7-dev libnetpbm10-dev swig python-dev python-scipy python-numpy libtiff4-dev scons units &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Earlier versions may work with&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install mesa-libGL-devel g++ g77 libc6-dev libgd2-xpm-dev libglew-dev libjpeg62-dev \&lt;br /&gt;
libx11-dev libxaw7-dev libnetpbm10-dev swig python-dev python-scipy python-numpy libtiff4-dev scons units &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If working with the development version, you will also need &amp;lt;tt&amp;gt;git&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;subversion&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Fedora, RedHat, CentOS, Scientific Linux, openSUSE==&lt;br /&gt;
&lt;br /&gt;
Install essential Madagascar dependencies with&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo yum install gcc libXaw-devel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dependency package names, sorted by Linux distribution and Madagascar feature they provide. Packages that are not included in the standard distro repositories are hyperlinked to their providers. The tables below cover build dependencies. &lt;br /&gt;
&lt;br /&gt;
Names of packages that are runtime dependencies are &#039;&#039;&#039;highlighted&#039;&#039;&#039; in the tables below (task under construction).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note: In the future, it should be possible for the configuration scripts to output the dependency tables below, so that they are guaranteed to be in synch with a given Madagascar version&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Minimal install (&amp;quot;Core&amp;quot;), publishing and development&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Core&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | LaTeX&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Development version&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | C++ API&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | F77 API, F90 API&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Python API&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Java API&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Octave API&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Matlab API&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Fedora 15&lt;br /&gt;
| binutils, gcc, glibc-headers, python&lt;br /&gt;
| texlive-latex&lt;br /&gt;
| subversion&lt;br /&gt;
| gcc-c++&lt;br /&gt;
| gcc-gfortran&lt;br /&gt;
| numpy, swig, python-devel&lt;br /&gt;
| Java (Sun&#039;s? IcedTea?)&lt;br /&gt;
| octave, octave-devel&lt;br /&gt;
| [http://www.mathworks.com/ Matlab] with Mex&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Fedora 14&lt;br /&gt;
| binutils, gcc, glibc-headers, python&lt;br /&gt;
| texlive-latex&lt;br /&gt;
| subversion&lt;br /&gt;
| gcc-c++&lt;br /&gt;
| gcc-gfortran&lt;br /&gt;
| numpy, swig&lt;br /&gt;
| Java (Sun&#039;s? IcedTea?)&lt;br /&gt;
| octave, octave-devel&lt;br /&gt;
| [http://www.mathworks.com/ Matlab] with Mex&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Fedora 13&lt;br /&gt;
| binutils, gcc, glibc-headers, python&lt;br /&gt;
| texlive-latex&lt;br /&gt;
| subversion&lt;br /&gt;
| gcc-c++&lt;br /&gt;
| gcc-gfortran&lt;br /&gt;
| numpy, swig&lt;br /&gt;
| Java (Sun&#039;s? IcedTea?)&lt;br /&gt;
| octave, octave-devel&lt;br /&gt;
| [http://www.mathworks.com/ Matlab]&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | CentOS 5&lt;br /&gt;
| binutils, gcc, glibc-headers; python (needs [http://dag.wieers.com/rpm/FAQ.php#B2 RPMforge&#039;s RHEL5 repository])&lt;br /&gt;
| ?&lt;br /&gt;
| subversion&lt;br /&gt;
| gcc-c++&lt;br /&gt;
| gcc-gfortran&lt;br /&gt;
| numpy, swig&lt;br /&gt;
| Java (Sun&#039;s? IcedTea?), [http://inside.mines.edu/~dhale/jtk/ Mines JTK]&lt;br /&gt;
| [http://www.gnu.org/software/octave/ Octave, octave-devel]&lt;br /&gt;
| [http://www.mathworks.com/ Matlab]&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | openSUSE 11.0&lt;br /&gt;
| gcc, python&lt;br /&gt;
| texlive-latex&lt;br /&gt;
| subversion&lt;br /&gt;
| gcc-c++&lt;br /&gt;
| gcc-fortran&lt;br /&gt;
| [http://numpy.scipy.org/ NumPy], swig&lt;br /&gt;
| Java (Sun&#039;s? IcedTea?), [http://inside.mines.edu/~dhale/jtk/ Mines JTK]&lt;br /&gt;
| [http://www.gnu.org/software/octave/ Octave]&lt;br /&gt;
| [http://www.mathworks.com/ Matlab]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Graphics and visualization&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The minimum requirement is X11 graphics for running &#039;&#039;&#039;xtpen&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | X11 graphics&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | vplot2gif&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | vplot2avi&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Some sort of movies?&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | TIFF output&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | JPEG output&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | PLplot graphics&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | OpenGL graphics&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | ppm (?)&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | unknown&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Fedora 13&lt;br /&gt;
| libXaw-devel&lt;br /&gt;
| gifsicle&lt;br /&gt;
| ffmpeg (needs the [http://rpmfusion.org/ RPM Fusion] repository enabled)&lt;br /&gt;
| ffmpeg-devel (needs the [http://rpmfusion.org/ RPM Fusion] repository enabled)&lt;br /&gt;
| libtiff-devel&lt;br /&gt;
| libjpeg-devel&lt;br /&gt;
| plplot-devel&lt;br /&gt;
| mesa-libGL-devel, freeglut, freeglut-devel&lt;br /&gt;
| netpbm-devel&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | openSUSE 11.0&lt;br /&gt;
| xorg-x11-devel&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
| libtiff-devel&lt;br /&gt;
| libjpeg-devel&lt;br /&gt;
| plplot-devel&lt;br /&gt;
| mesa-libGL-devel, freeglut, freeglut-devel&lt;br /&gt;
| netpbm-devel&lt;br /&gt;
| cairo-devel, gd-devel, glew-devel&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Numerical and file manipulation utilities&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | OpenMP&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | MPI&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | BLAS/ATLAS&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Interface to the Fast Discrete Curvelet Transform&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | sfunits&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Fedora 13&lt;br /&gt;
| libgomp&lt;br /&gt;
| openmpi, openmpi-devel; openmpi-libs (?)&lt;br /&gt;
| blas, blas-devel, atlas, atlas-devel&lt;br /&gt;
| [https://wave.eos.ubc.ca/Software/Licenced/ pyct]&lt;br /&gt;
| units&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | CentOS 5&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
| [https://wave.eos.ubc.ca/Software/Licenced/ pyct]&lt;br /&gt;
| [http://www.gnu.org/software/units/units.html Gnu Units]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Other&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Inclusions from Seismic Unix&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Fedora 14, 15&lt;br /&gt;
| [http://www.cwp.mines.edu/cwpcodes/ Seismic Unix]&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | CentOS 5&lt;br /&gt;
| [http://www.cwp.mines.edu/cwpcodes/ Seismic Unix]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Command to install all dependencies present in the public repositories&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Usually package management software will not install again a package that is already installed, so it should be safe to copy and paste the command below to a command line:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Fedora 15&lt;br /&gt;
| &#039;&#039;&#039;yum -y install&#039;&#039;&#039; binutils gcc glibc-headers scons texlive-latex subversion gcc-c++ gcc-gfortran numpy python python-devel swig octave octave-devel libgomp openmpi openmpi-devel blas blas-devel atlas atlas-devel units gifsicle ffmpeg ffmpeg-devel libtiff-devel libjpeg-devel plplot-devel mesa-libGL-devel freeglut freeglut-devel libXaw-devel netpbm-devel&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Fedora 13&lt;br /&gt;
| &#039;&#039;&#039;yum -y install&#039;&#039;&#039; binutils gcc glibc-headers scons texlive-latex subversion gcc-c++ gcc-gfortran numpy python swig octave octave-devel libgomp openmpi openmpi-devel blas blas-devel atlas atlas-devel units gifsicle ffmpeg ffmpeg-devel libtiff-devel libjpeg-devel plplot-devel mesa-libGL-devel freeglut freeglut-devel libXaw-devel netpbm-devel&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | CentOS 5&lt;br /&gt;
| &#039;&#039;&#039;yum -y install&#039;&#039;&#039; binutils freeglut freeglut-devel gcc gcc-c++ gcc-gfortran glibc-headers libjpeg-devel libXaw-devel netpbm-devel&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | openSUSE 11.0&lt;br /&gt;
| &#039;&#039;&#039;zypper install&#039;&#039;&#039; cairo-devel gcc gcc-c++ gcc-fortran gd-devel glew-devel libjpeg-devel libtiff-devel octave scons subversion texlive-latex xorg-x11-devel&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;List of runtime dependencies only&#039;&#039;&#039;&lt;br /&gt;
(needed by packagers of Madagascar in order to properly list dependencies):&lt;br /&gt;
UNDER CONSTRUCTION&lt;br /&gt;
&lt;br /&gt;
===Fedora 25===&lt;br /&gt;
The following explains how to install madagascar on Fedora 25.&lt;br /&gt;
&lt;br /&gt;
We use the following compiler: &amp;lt;code&amp;gt;gcc&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;g++&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;gfortran&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* Install some packages&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; inline style=&amp;quot;white-space:wrap&amp;quot;&amp;gt;sudo dnf install scons lapack-static lapack64-static atlas-static fftw-static gd gd-devel libtool-ltdl-devel \&lt;br /&gt;
libXaw-devel mesa-libGL-devel freeglut-devel netpbm-devel plplot-devel ffmpeg-devel swig openmpi openmpi-devel suitesparse-devel&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This installed the following packages:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
scons-2.5.1-1.fc25.noarch&lt;br /&gt;
lapack-static-3.6.1-2.fc25.x86_64&lt;br /&gt;
lapack64-static-3.6.1-2.fc25.x86_64&lt;br /&gt;
atlas-static-3.10.2-14.fc25.x86_64&lt;br /&gt;
fftw-static-3.3.5-3.fc25.x86_64&lt;br /&gt;
gd-2.2.4-1.fc25.x86_64&lt;br /&gt;
gd-devel-2.2.4-1.fc25.x86_64&lt;br /&gt;
libtool-ltdl-devel-2.4.6-13.fc25.x86_64&lt;br /&gt;
libXaw-devel-1.0.13-4.fc25.x86_64&lt;br /&gt;
mesa-libGL-devel-17.0.5-3.fc25.x86_64&lt;br /&gt;
freeglut-devel-3.0.0-3.fc24.x86_64&lt;br /&gt;
netpbm-devel-10.78.00-1.fc25.x86_64&lt;br /&gt;
plplot-devel-5.11.1-13.fc25.x86_64&lt;br /&gt;
ffmpeg-devel-3.1.9-1.fc25.x86_64&lt;br /&gt;
swig-3.0.11-1.fc25.x86_64&lt;br /&gt;
openmpi-1.10.5-1.fc25.x86_64&lt;br /&gt;
openmpi-devel-1.10.5-1.fc25.x86_64&lt;br /&gt;
suitesparse-devel-4.4.6-7.fc25.x86_64&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and many other dependencies.&lt;br /&gt;
&lt;br /&gt;
* Get the sources from the git repository&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;git clone https://github.com/ahay/src&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you run now the &amp;lt;code&amp;gt;configure&amp;lt;/code&amp;gt; script, you will get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
checking for Python ... /usr/bin/python&lt;br /&gt;
checking Python version ... 2.7.13&lt;br /&gt;
checking for RSFROOT ... /usr/local/rsf&lt;br /&gt;
checking for SCons ... /usr/bin/scons&lt;br /&gt;
checking SCons version ... v2.5.1.rel_2.5.1:3735:9dc6cee5c168[MODIFIED]&lt;br /&gt;
Running RSFROOT=/usr/local/rsf /usr/bin/scons  config ...&lt;br /&gt;
------------------------&lt;br /&gt;
scons: Reading SConscript files ...&lt;br /&gt;
checking platform ... (cached) linux [fedora]&lt;br /&gt;
checking for C compiler ... (cached) gcc&lt;br /&gt;
checking if gcc works ... yes&lt;br /&gt;
checking if gcc accepts &#039;-x c -std=gnu99 -Wall -pedantic&#039; ... yes&lt;br /&gt;
checking for ar ... (cached) ar&lt;br /&gt;
checking for libraries ... [&#039;m&#039;]&lt;br /&gt;
checking complex support ... yes&lt;br /&gt;
checking for X11 headers ... /usr/include&lt;br /&gt;
checking for X11 libraries ... /usr/lib&lt;br /&gt;
checking for OpenGL ... yes&lt;br /&gt;
checking for sfpen ... (cached) xtpen&lt;br /&gt;
checking for ppm ... yes&lt;br /&gt;
checking for tiff ... yes&lt;br /&gt;
checking for GD (PNG) ... yes&lt;br /&gt;
checking for GD (GIF) ... yes&lt;br /&gt;
checking for plplot ... no&lt;br /&gt;
&lt;br /&gt;
  Optional package: plplot-devel&lt;br /&gt;
checking for ffmpeg ... yes&lt;br /&gt;
checking for cairo (PNG) ... yes&lt;br /&gt;
checking for cairo (SVG) ... yes&lt;br /&gt;
checking for cairo (PDF) ... yes&lt;br /&gt;
checking for jpeg ... yes&lt;br /&gt;
checking for BLAS ... yes&lt;br /&gt;
checking for LAPACK ... no&lt;br /&gt;
&lt;br /&gt;
  Optional package: blas + blas-devel + atlas + atlas-devel&lt;br /&gt;
checking for SWIG ... (cached) /usr/bin/swig&lt;br /&gt;
checking for numpy ... (cached) yes&lt;br /&gt;
checking API options ... (cached) []&lt;br /&gt;
checking for C++ compiler ... (cached) g++&lt;br /&gt;
checking if g++ works ... yes&lt;br /&gt;
checking if g++ accepts &#039;-std=c++11 -U__STRICT_ANSI__ -Wall -pedantic&#039; ... yes&lt;br /&gt;
checking for MPICC ... (cached) /usr/lib64/openmpi/bin/mpicc&lt;br /&gt;
checking if /usr/lib64/openmpi/bin/mpicc works ... yes&lt;br /&gt;
checking for MPICXX ... (cached) /usr/lib64/openmpi/bin/mpicxx&lt;br /&gt;
checking if /usr/lib64/openmpi/bin/mpicxx works ... yes&lt;br /&gt;
checking for MPIRUN ... (cached) /usr/lib64/openmpi/bin/mpirun&lt;br /&gt;
checking for Posix threads ... yes&lt;br /&gt;
checking for OpenMP ... yes&lt;br /&gt;
checking for CUDA ... (cached) no&lt;br /&gt;
checking for FFTW ... yes&lt;br /&gt;
checking if FFTW supports threads ... yes&lt;br /&gt;
checking for SuiteSparse ... yes&lt;br /&gt;
checking for pfft ... no&lt;br /&gt;
scons: done reading SConscript files.&lt;br /&gt;
scons: Building targets ...&lt;br /&gt;
shell_script([&amp;quot;env.sh&amp;quot;], [])&lt;br /&gt;
shell_script([&amp;quot;env.csh&amp;quot;], [])&lt;br /&gt;
scons: done building targets.&lt;br /&gt;
------------------------&lt;br /&gt;
Done with configuration.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Libraries &amp;lt;code&amp;gt;plplot&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;lapack&amp;lt;/code&amp;gt; are not found. File &amp;lt;code&amp;gt;config.log&amp;lt;/code&amp;gt; says&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/bin/ld: cannot find -lplplotd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gcc -o .sconf_temp/sfconftest_21 .sconf_temp/conftest_21.o -L/usr/lib64/atlas -lm -lf77blas -lcblas -latlas -llapack -lcblas&lt;br /&gt;
/usr/lib64/atlas/liblapack.a(dgesv.o): In function `dgesv_&#039;:&lt;br /&gt;
(.text+0x69): undefined reference to `xerbla_&#039;&lt;br /&gt;
/usr/lib64/atlas/liblapack.a(ATL_f77wrap_dgesv.o): In function `atl_f77wrap_dgesv_&#039;:&lt;br /&gt;
(.text+0x10d): undefined reference to `ATL_xerbla&#039;&lt;br /&gt;
/usr/lib64/atlas/liblapack.a(ATL_dgetf2.o): In function `ATL_dgetf2&#039;:&lt;br /&gt;
(.text+0x184): undefined reference to `ATL_dger&#039;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So library &amp;lt;code&amp;gt;plplotd&amp;lt;/code&amp;gt; doesn&#039;t exist on Fedora 25 and the &amp;lt;code&amp;gt;configure&amp;lt;/code&amp;gt; script is looking for the wrong &amp;lt;code&amp;gt;lapack&amp;lt;/code&amp;gt; library.&lt;br /&gt;
&lt;br /&gt;
If compiling now, 2 other libraries won&#039;t be found: &amp;lt;code&amp;gt;gfortran&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;quadmath&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Regarding the &amp;lt;code&amp;gt;plplotd&amp;lt;/code&amp;gt; library, edit file &amp;lt;code&amp;gt;framework/configure.py&amp;lt;/code&amp;gt; and change the line 724:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line start=&amp;quot;724&amp;quot;&amp;gt;plplot = context.env.get(&#039;PLPLOT&#039;,&#039;plplotd&#039;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
to&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line start=&amp;quot;724&amp;quot;&amp;gt;plplot = context.env.get(&#039;PLPLOT&#039;,&#039;plplot&#039;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* As for the libraries&lt;br /&gt;
** &amp;lt;code&amp;gt;lapack&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;gfortran&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;quadmath&amp;lt;/code&amp;gt;&lt;br /&gt;
We must use the &amp;lt;code&amp;gt;lapack&amp;lt;/code&amp;gt; library installed in &amp;lt;code&amp;gt;/usr/lib64&amp;lt;/code&amp;gt;, not the one installed in &amp;lt;code&amp;gt;/usr/lib64/atlas&amp;lt;/code&amp;gt;. And libraries &amp;lt;code&amp;gt;gfortran&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;quadmath&amp;lt;/code&amp;gt; are installed in &amp;lt;code&amp;gt;/usr/lib/gcc/x86_64-redhat-linux/6.3.1/&amp;lt;/code&amp;gt;.&lt;br /&gt;
Edit file &amp;lt;code&amp;gt;framework/configure.py&amp;lt;/code&amp;gt; and add the following 4 lines:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[&#039;/usr/lib/gcc/x86_64-redhat-linux/6.3.1/&#039;,&lt;br /&gt;
 &#039;/usr/lib64/&#039;,&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LIBS.append(&#039;gfortran&#039;)&lt;br /&gt;
LIBS.append(&#039;quadmath&#039;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
so that we end up with the following &amp;lt;code&amp;gt;blas&amp;lt;/code&amp;gt; function: &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line start=&amp;quot;971&amp;quot;&amp;gt;def blas(context):&lt;br /&gt;
    context.Message(&amp;quot;checking for BLAS ... &amp;quot;)&lt;br /&gt;
    text = &#039;&#039;&#039;&lt;br /&gt;
    #ifdef __APPLE__&lt;br /&gt;
    #include &amp;lt;Accelerate/Accelerate.h&amp;gt;&lt;br /&gt;
    #else&lt;br /&gt;
    #ifdef HAVE_MKL&lt;br /&gt;
    #include &amp;lt;mkl.h&amp;gt;&lt;br /&gt;
    #else&lt;br /&gt;
    #include &amp;lt;cblas.h&amp;gt;&lt;br /&gt;
    #endif&lt;br /&gt;
    #endif&lt;br /&gt;
    int main(int argc,char* argv[]) {&lt;br /&gt;
    float d, x[]={1.,2.,3.}, y[]={3.,2.,1.};&lt;br /&gt;
    d = cblas_sdot(3,x,1,y,1);&lt;br /&gt;
    return 0;&lt;br /&gt;
    }\n&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    if plat[&#039;OS&#039;] == &#039;cygwin&#039;:&lt;br /&gt;
        context.env[&#039;ENV&#039;][&#039;PATH&#039;] = context.env[&#039;ENV&#039;][&#039;PATH&#039;] + \&lt;br /&gt;
                                         &#039;:/lib/lapack&#039;&lt;br /&gt;
&lt;br /&gt;
    res = context.TryLink(text,&#039;.c&#039;)&lt;br /&gt;
    if res: &lt;br /&gt;
        context.Result(res)&lt;br /&gt;
        context.env[&#039;BLAS&#039;] = True &lt;br /&gt;
    else:&lt;br /&gt;
        # first try blas&lt;br /&gt;
        LIBS = path_get(context,&#039;LIBS&#039;)&lt;br /&gt;
        blas = context.env.get(&#039;BLAS&#039;,&#039;blas&#039;)&lt;br /&gt;
        LIBS.append(blas)&lt;br /&gt;
        res = context.TryLink(text,&#039;.c&#039;)&lt;br /&gt;
        if res: &lt;br /&gt;
            context.Result(res)&lt;br /&gt;
            context.env[&#039;LIBS&#039;] = LIBS &lt;br /&gt;
            context.env[&#039;BLAS&#039;] = blas &lt;br /&gt;
        else:&lt;br /&gt;
            # some systems require cblas and atlas&lt;br /&gt;
            for atlas_dir in filter(os.path.isdir,&lt;br /&gt;
                                    [&#039;/usr/lib/gcc/x86_64-redhat-linux/6.3.1/&#039;,  # &amp;lt;--- add this line&lt;br /&gt;
                                     &#039;/usr/lib64/&#039;,                              # &amp;lt;--- add this line&lt;br /&gt;
                                     &#039;/usr/lib64/atlas/&#039;,&lt;br /&gt;
                                     &#039;/usr/lib/atlas/&#039;]):&lt;br /&gt;
                context.env[&#039;LIBPATH&#039;].append(atlas_dir)&lt;br /&gt;
            LIBS.pop()&lt;br /&gt;
            LIBS.append(&#039;f77blas&#039;)&lt;br /&gt;
            LIBS.append(&#039;cblas&#039;)&lt;br /&gt;
            LIBS.append(&#039;atlas&#039;)&lt;br /&gt;
            LIBS.append(&#039;gfortran&#039;)  # &amp;lt;----------------------------------------------- add this line&lt;br /&gt;
            LIBS.append(&#039;quadmath&#039;)  # &amp;lt;----------------------------------------------- add this line&lt;br /&gt;
            res = context.TryLink(text,&#039;.c&#039;)&lt;br /&gt;
            if res: &lt;br /&gt;
                context.Result(res)&lt;br /&gt;
                context.env[&#039;LIBS&#039;] = LIBS &lt;br /&gt;
                context.env[&#039;BLAS&#039;] = &#039;cblas&#039;&lt;br /&gt;
            else:&lt;br /&gt;
                context.Result(context_failure)&lt;br /&gt;
                context.env[&#039;CPPDEFINES&#039;] = \&lt;br /&gt;
                    path_get(context,&#039;CPPDEFINES&#039;,&#039;NO_BLAS&#039;)&lt;br /&gt;
                LIBS.pop()&lt;br /&gt;
                LIBS.pop()&lt;br /&gt;
                LIBS.pop()&lt;br /&gt;
                context.env[&#039;BLAS&#039;] = None &lt;br /&gt;
                need_pkg(&#039;blas&#039;, fatal=False)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* Run the &amp;lt;code&amp;gt;configure&amp;lt;/code&amp;gt; script, for example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;./configure --prefix=/usr/local/rsf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Output should give:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
checking for Python ... /usr/bin/python&lt;br /&gt;
checking Python version ... 2.7.13&lt;br /&gt;
checking for RSFROOT ... /usr/local/rsf&lt;br /&gt;
checking for SCons ... /usr/bin/scons&lt;br /&gt;
checking SCons version ... v2.5.1.rel_2.5.1:3735:9dc6cee5c168[MODIFIED]&lt;br /&gt;
Running RSFROOT=/usr/local/rsf /usr/bin/scons  config ...&lt;br /&gt;
------------------------&lt;br /&gt;
scons: Reading SConscript files ...&lt;br /&gt;
checking platform ... (cached) linux [fedora]&lt;br /&gt;
checking for C compiler ... (cached) gcc&lt;br /&gt;
checking if gcc works ... yes&lt;br /&gt;
checking if gcc accepts &#039;-x c -std=gnu99 -Wall -pedantic&#039; ... yes&lt;br /&gt;
checking for ar ... (cached) ar&lt;br /&gt;
checking for libraries ... [&#039;m&#039;]&lt;br /&gt;
checking complex support ... yes&lt;br /&gt;
checking for X11 headers ... /usr/include&lt;br /&gt;
checking for X11 libraries ... /usr/lib&lt;br /&gt;
checking for OpenGL ... yes&lt;br /&gt;
checking for sfpen ... (cached) xtpen&lt;br /&gt;
checking for ppm ... yes&lt;br /&gt;
checking for tiff ... yes&lt;br /&gt;
checking for GD (PNG) ... yes&lt;br /&gt;
checking for GD (GIF) ... yes&lt;br /&gt;
checking for plplot ... yes&lt;br /&gt;
checking for ffmpeg ... yes&lt;br /&gt;
checking for cairo (PNG) ... yes&lt;br /&gt;
checking for cairo (SVG) ... yes&lt;br /&gt;
checking for cairo (PDF) ... yes&lt;br /&gt;
checking for jpeg ... yes&lt;br /&gt;
checking for BLAS ... yes&lt;br /&gt;
checking for LAPACK ... yes&lt;br /&gt;
checking for SWIG ... (cached) /usr/bin/swig&lt;br /&gt;
checking for numpy ... (cached) yes&lt;br /&gt;
checking API options ... (cached) []&lt;br /&gt;
checking for C++ compiler ... (cached) g++&lt;br /&gt;
checking if g++ works ... yes&lt;br /&gt;
checking if g++ accepts &#039;-std=c++11 -U__STRICT_ANSI__ -Wall -pedantic&#039; ... yes&lt;br /&gt;
checking for MPICC ... (cached) /usr/lib64/openmpi/bin/mpicc&lt;br /&gt;
checking if /usr/lib64/openmpi/bin/mpicc works ... yes&lt;br /&gt;
checking for MPICXX ... (cached) /usr/lib64/openmpi/bin/mpicxx&lt;br /&gt;
checking if /usr/lib64/openmpi/bin/mpicxx works ... yes&lt;br /&gt;
checking for MPIRUN ... (cached) /usr/lib64/openmpi/bin/mpirun&lt;br /&gt;
checking for Posix threads ... yes&lt;br /&gt;
checking for OpenMP ... yes&lt;br /&gt;
checking for CUDA ... (cached) no&lt;br /&gt;
checking for FFTW ... yes&lt;br /&gt;
checking if FFTW supports threads ... yes&lt;br /&gt;
checking for SuiteSparse ... yes&lt;br /&gt;
checking for pfft ... no&lt;br /&gt;
scons: done reading SConscript files.&lt;br /&gt;
scons: Building targets ...&lt;br /&gt;
shell_script([&amp;quot;env.sh&amp;quot;], [])&lt;br /&gt;
shell_script([&amp;quot;env.csh&amp;quot;], [])&lt;br /&gt;
scons: done building targets.&lt;br /&gt;
------------------------&lt;br /&gt;
Done with configuration.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* Then run the compilation:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;make&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* and finally the installation&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;sudo make install&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Debian 5==&lt;br /&gt;
Specific dependencies:&lt;br /&gt;
* Debian 5.0 (&amp;quot;Lenny&amp;quot;): Please make sure you have the &amp;lt;tt&amp;gt;libc6-dev&amp;lt;/tt&amp;gt; package before trying to compile from source. The &amp;lt;tt&amp;gt;libXaw7-dev&amp;lt;/tt&amp;gt; package might be a dependency for &amp;lt;tt&amp;gt;xtpen&amp;lt;/tt&amp;gt; (was in Debian 4.0)&lt;br /&gt;
&lt;br /&gt;
==Yellow Dog Linux 6.1 on Sony PlayStation 3==&lt;br /&gt;
See [http://www.reproducibility.org/rsflog/uploads/Friday_Seminar_Madagascar_on_PS3.ppt Will Burnett&#039;s guide (PowerPoint)]&lt;br /&gt;
&lt;br /&gt;
==Mac OS X==&lt;br /&gt;
&lt;br /&gt;
Install necessary Mac OS X applications using:&lt;br /&gt;
* [http://www.macports.org/ MacPorts], an easy-to-use system for compiling, installing, and upgrading open-source software on Mac OS X.&lt;br /&gt;
* [http://www.finkproject.org/ Fink], a tool that brings the full world of Unix Open Source software to Mac OS X. &lt;br /&gt;
&lt;br /&gt;
Installation on Mac OS X Mountain Lion requires the following:&lt;br /&gt;
# &amp;lt;b&amp;gt;Xcode&amp;lt;/b&amp;gt;: Download and install [https://developer.apple.com/xcode/ XCode] from Apple using App Store application. In Xcode, make sure to enable and install the command-line tools in Xcode/Preferences/Downloads &lt;br /&gt;
# (Optionally) &amp;lt;b&amp;gt;X11&amp;lt;/b&amp;gt;: Install X11 libraries from [http://xquartz.macosforge.org Xquartz]. &lt;br /&gt;
# (Optionally) &amp;lt;b&amp;gt;gcc&amp;lt;/b&amp;gt;: Install the Gnu C compiler from [http://hpc.sourceforge.net HPC Mac OS X]. &lt;br /&gt;
# (Optionally) [[SEGTeX]]: To use &amp;lt;b&amp;gt;SEGTeX&amp;lt;/b&amp;gt;, you may need [http://www.tug.org/texlive/ TeX Live]. &amp;lt;b&amp;gt;MacPorts&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;Fink&amp;lt;/b&amp;gt; provide an easy way to install it with commands &amp;lt;pre&amp;gt;sudo port install texlive&amp;lt;/pre&amp;gt; or &amp;lt;pre&amp;gt;sudo fink install texlive&amp;lt;/pre&amp;gt;&lt;br /&gt;
# (Optionally) &amp;lt;b&amp;gt;FFTW&amp;lt;/b&amp;gt;: Using &amp;lt;b&amp;gt;MacPorts&amp;lt;/b&amp;gt;, run &amp;lt;pre&amp;gt;sudo port install fftw-3-single&amp;lt;/pre&amp;gt;&amp;lt;pre&amp;gt;sudo port install fftw-3 +gfortran&amp;lt;/pre&amp;gt;&lt;br /&gt;
# (Optionally) &amp;lt;b&amp;gt;MPI&amp;lt;/b&amp;gt;: Using &amp;lt;b&amp;gt;MacPorts&amp;lt;/b&amp;gt;, run &amp;lt;pre&amp;gt;sudo port install openmpi&amp;lt;/pre&amp;gt;&amp;lt;pre&amp;gt;sudo port select --set mpi openmpi-mp-fortran&amp;lt;/pre&amp;gt;&lt;br /&gt;
# (Optionally) &amp;lt;b&amp;gt;ppmpen&amp;lt;/b&amp;gt;: Using &amp;lt;b&amp;gt;MacPorts&amp;lt;/b&amp;gt;, run &amp;lt;pre&amp;gt;sudo port install libnetpbm&amp;lt;/pre&amp;gt;&lt;br /&gt;
# (Optionally) &amp;lt;b&amp;gt;Open vplots using double click&amp;lt;/b&amp;gt;: [[machacks|Instructions]].&lt;br /&gt;
# Install python with libraries including jupyter and  ipython.  I recommend the Anaconda distribution.  which is available at https://www.anaconda.com/download&lt;br /&gt;
# (Optionally) &amp;lt;b&amp;gt;SWIG&amp;lt;/b&amp;gt; is required for some of the options of the Python api (used if you are coding in Python).  run  &amp;lt;pre&amp;gt;conda install swig&amp;lt;/pre&amp;gt; . I had to run&amp;lt;pre&amp;gt;cp `which siwg` /usr/local/bin&amp;lt;/pre&amp;gt; to get ./configure to find swig. &lt;br /&gt;
#Proceed with configuration and installation following the normal procedure.  You may need to use Apple&#039;s compiler (clang) instead of gcc.  Use one of these commands in the $RSFSRC directory &amp;lt;pre&amp;gt;./configure CC=clang CXX=clang++&amp;lt;/pre&amp;gt; or &amp;lt;pre&amp;gt;./configure CC=clang CXX=clang++ API=python --prefix=`pwd`&amp;lt;/pre&amp;gt;&lt;br /&gt;
#build the system with: &amp;lt;pre&amp;gt;make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
#After installing a new version of python you must run: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./configure &lt;br /&gt;
make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In summer of 2018 on a new MacBook Pro running Mac OS 10.14.1 (Mojave) I encountered en abort trap: 6 error message when running sfpen from command line.  I do not &lt;br /&gt;
have a problem running sfpen inside scons. I changed to use xtpen from the command line.  I continue to use this work around.&lt;br /&gt;
&lt;br /&gt;
==OpenSolaris==&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;tt&amp;gt;pkg&amp;lt;/tt&amp;gt; to install missing components such as X11 headers.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
pfexec pkg install SUNWxorg-headers&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==MS Windows==&lt;br /&gt;
Due to its size, this topic has been assigned [[Windows | its own Wiki page]].&lt;br /&gt;
&lt;br /&gt;
==How to adapt Madagascar to a new platform==&lt;br /&gt;
The most laborious part of adapting madagascar to a new platform is finding the proper dependency names. This usually proceeds as follows: dependency X fails with a &amp;quot;missing file&amp;quot; error either as a header file in &amp;lt;tt&amp;gt;config.log&amp;lt;/tt&amp;gt;, or a missing library during the build step. Possible package names are found through an internet search for the missing file name and the distribution name or by using specific [http://rpm.pbone.net/ rpm search tools]. Packages are installed and the configure (and, if necessary) build processes are repeated until the error goes away.&lt;br /&gt;
&lt;br /&gt;
=Multi-user installs=&lt;br /&gt;
Some organizations may find it desirable to deny write access of some users to all RSFSRC/RSFROOT except their own user directory. Fortunately, this can be easily done by placing the restricted user dirs outside RSFSRC/RSFROOT, i.e. in their home dirs, say /home/joe/rsfsrc. In order to move a user&#039;s directory out of RSFSRC, you must:&lt;br /&gt;
* &amp;quot;tell&amp;quot; the SConstruct in the user&#039;s dir where to find RSFSRC so that when the user builds in his directory, it can import &amp;lt;tt&amp;gt;configure.py&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;config.py&amp;lt;/tt&amp;gt; You do that by setting the environment variable RSFSRC to the absolute path of the Madagascar source root, and by making sure that lines 2 and 3 in the users&#039; SConstruct files are&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
srcroot = os.environ.get(&#039;RSFSRC&#039;, &#039;../..&#039;)&lt;br /&gt;
sys.path.append(srcroot)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
and then replace &amp;lt;tt&amp;gt;../..&amp;lt;/tt&amp;gt; throughout the SConstruct using &amp;lt;tt&amp;gt;os.path.join&amp;lt;/tt&amp;gt; and the &amp;lt;tt&amp;gt;srcroot&amp;lt;/tt&amp;gt; variable.&lt;br /&gt;
* &amp;quot;tell&amp;quot; the build scripts about the user&#039;s dir, so that it is included in the builds launched from RSFSRC. You do that with a symbolic link:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ln -s /home/joe/rsfsrc $RSFSRC/user/joe&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&#039;&#039;When the link exists&#039;&#039;, those of Joe&#039;s programs that are mentioned in the &amp;quot;prog&amp;quot; string in SConstruct get included in the distribution, complete with self-doc. If Joe is just learning how to code and his stuff breaks the build, just remove the symbolic link. Even if build+installs are done after the link is removed, his stable programs and self-doc will continue to remain installed system-wide as long as the admin does not type &amp;lt;tt&amp;gt;scons -c install&amp;lt;/tt&amp;gt; (not likely).&lt;br /&gt;
* point the user&#039;s RSFDOC environment variable to a location where the user has write access&lt;br /&gt;
* edit the users&#039; SConstruct so that it uses the RSF library and headers already installed in $RSFROOT/lib and $RSFROOT/include , instead of building again the whole &amp;lt;tt&amp;gt;librsf&amp;lt;/tt&amp;gt; with user-specific flags in &amp;lt;tt&amp;gt;RSFSRC/filt/lib/&amp;lt;/tt&amp;gt;. To do that, replace in the user&#039;s SConstruct the env.Prepend statement with&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
rsfroot = os.environ.get(&#039;RSFROOT&#039;,&#039;/usr/local/rsf&#039;)&lt;br /&gt;
&lt;br /&gt;
env.Prepend(CPPPATH=[os.path.join(rsfroot,&#039;include&#039;)],&lt;br /&gt;
            LIBPATH=[os.path.join(rsfroot,&#039;lib&#039;)],&lt;br /&gt;
            LIBS=[&#039;rsf&#039;])&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* If the link from RSFSRC to Joe&#039;s directory was not made, add Joe&#039;s directory to his own path so that he can execute his own binaries.&lt;br /&gt;
&lt;br /&gt;
To understand how $DATAPATH disk space issues may become an issue in a multi-user environment, refer to the [[Advanced_Installation#Disk_space|Disk Space subsection]] at the beginning of this document.&lt;br /&gt;
&lt;br /&gt;
=Keeping your stuff separate=&lt;br /&gt;
A user may add his own programs and recipes to the Madagascar system. He may also create his own computational examples, data, and locked figures for testing. All of these components can be placed in their default locations, but it is not necessary to make them public. To keep these items private simply do not add them to the repository.&lt;br /&gt;
&lt;br /&gt;
However, it might be desirable to keep these components in separate places. For example, if you keep your private programs in RSFSRC/user you will have to remember to make a copy somewhere else if you ever want to delete the Madagascar installation to perform a fresh install. Yup, I deleted all my programs that way once. Good thing I had a back up! Fortunately, it is easy to keep each of these components in a separate place if desired.&lt;br /&gt;
&lt;br /&gt;
==Keeping programs separate==&lt;br /&gt;
User programs are ordinarily kept in a subdirectory of RSFSRC/user.  However, if you want to keep your programs separate all you have to do is put your subdirectory somewhere else and make a link to it in RSFSRC/user:&lt;br /&gt;
&amp;lt;bash&amp;gt;&lt;br /&gt;
ln -s path_to_my_programs $RSFSRC/user/my_programs&lt;br /&gt;
&amp;lt;/bash&amp;gt;&lt;br /&gt;
The additional instructions above for &amp;quot;multi-user installs&amp;quot; are for the case where the other users do not have write access to RSFSRC.  However, if you have full write access and only want to keep the programs in a separate place the link is the only thing you need.&lt;br /&gt;
&lt;br /&gt;
===Problems when symbolic linking and using SVN=== &lt;br /&gt;
If you decide to use a symbolic link e.g. &amp;quot;ln -s ...&amp;quot; as above, you will have difficulties checking in your code into the SVN repository.  SVN typically does not follow the symbolic link but will only the save the symbolic link.   &lt;br /&gt;
&lt;br /&gt;
See this answer from Stackoverflow (http://stackoverflow.com/questions/24850844/follow-symlinks-in-svn)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If I understand your problem, you have:&lt;br /&gt;
&lt;br /&gt;
project1/&lt;br /&gt;
project1/link1 -&amp;gt; ../../some/where/else&lt;br /&gt;
&lt;br /&gt;
If you do a simple svn add link1 it adds a symlink entry to the subversion repository, but what you&#039;re trying to accomplish is getting the stuff under somewhere else into the tree.&lt;br /&gt;
&lt;br /&gt;
If this is the case, then you&#039;re fighting in the wrong direction, you should make the real files and directories under link1, and make the target locations symlinks into the link1 directory. That would be a simple solution to the problem.&lt;br /&gt;
&lt;br /&gt;
Another solution would be to make the location ../../some/where/else an svn location in it&#039;s own right, and make link1 an externals definition to that location. When you commit in the main directory, the externals would be committed at the same time which would achieve storing the information; however to ensure that the other location was kept in sync, you would have to make sure to update it to the same version as the stored data.&lt;br /&gt;
&lt;br /&gt;
In my case, on my desktop, I have a settings directory:&lt;br /&gt;
&lt;br /&gt;
$HOME/settings&lt;br /&gt;
&lt;br /&gt;
This is a checked out copy of a directory containing .bashrc, .profile, .vimrc, .vim, etc. files and folders from an svn repo. All my profile files and directories were symlinks into this folder, so for example .profile -&amp;gt; settings/.profile, etc. When I make changes, they are reflected in the svn tree, which I can commit back to in order to ensure that I don&#039;t lose my config settings when I go to another system.&lt;br /&gt;
&lt;br /&gt;
If you really want svn to follow symlinks as hardlinks (You can&#039;t make directory hardlinks because it would be a bad thing™), then you&#039;ll have to hack the svn client source so that it did what you wanted; but this would be a maintenance nightmare.&lt;br /&gt;
&lt;br /&gt;
You could get away with making the symlink into a bind mount point directed at the target, but that has it&#039;s own issues - you would need to be root to accomplish this, and it ends up leaving funny entries in your /proc/mounts to accomplish this:&lt;br /&gt;
&lt;br /&gt;
mount --bind /absolute/path/to/some/where/else project1/link1&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Keeping recipes separate==&lt;br /&gt;
Computational recipes written in Python and imported by the SConstruct file of a workflow are normally stored in RSFSRC/book/Recipes.  The install process copies these recipes to a directory like $RSFROOT/lib/python2.5/site-packages/rsf/recipes and adds this directory to your PYTHONPATH so that Python can find them.&lt;br /&gt;
&lt;br /&gt;
However, you can put you own recipes anywhere you want.  You only have to add that place to your PYTHONPATH like this (bash):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
export PYTHONPATH=${PYTHONPATH}:path_to_my_recipes&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Or like this (csh):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
setenv PYTHONPATH ${PYTHONPATH}:path_to_my_recipes&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Keeping examples separate==&lt;br /&gt;
Madagascar&#039;s public collection of example workflows are stored in RSFSRC/book, but you can put your private workflows anywhere you want.  No special instructions are required.&lt;br /&gt;
&lt;br /&gt;
However, Madagascar assumes that the workflows are organized into a three-level book/chapter/section directory hierarchy when it creates a directory tree for the data and locked figures associated with your workflow. It is not required, but it might be easier to find the data and locked figures if you put your workflows in a three-level directory tree something like this: path_to_my_book/chapter/section/SConstruct.&lt;br /&gt;
&lt;br /&gt;
==Keeping data separate==&lt;br /&gt;
The location of the data portion of your *.rsf files is controlled by your DATAPATH environment variable.  However, you may want to keep the data for your private workflows in a different place, or several different places, than the data created by the public examples in RSFSRC/book.  The way to do that is to temporarily change the DATAPATH variable in the SConstruct &#039;&#039;before&#039;&#039; importing rsf.proj like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import os&lt;br /&gt;
os.environ[&#039;DATAPATH&#039;] = &#039;path_to_my_private_data&#039;&lt;br /&gt;
&lt;br /&gt;
from rsf.proj import *&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Keeping locked figures separate==&lt;br /&gt;
The command &amp;quot;scons lock&amp;quot; in the directory of a workflow will store a &amp;quot;locked&amp;quot; copy of your figures for regression testing.  Normally these figures are stored in the location pointed to by your RSFFIGS variable, and that is where the figures from the figures repository should be stored for testing in RSFSRC/book.&lt;br /&gt;
&lt;br /&gt;
However, you may want to keep your private figures in a different place.  The way to do that is to temporarily change the RSFFIGS variable in the SConstruct &#039;&#039;before&#039;&#039; importing rsf.proj like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import os&lt;br /&gt;
os.environ[&#039;RSFFIGS&#039;] = &#039;path_to_my_private_figures&#039;&lt;br /&gt;
&lt;br /&gt;
from rsf.proj import *&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
If you also create a RSFALTFIGS environment variable pointing to path_to_my_private_figures, then the testing script sffiglist will automatically test your figures against those in RSFALTFIGS when the sffiglist command is executed from a location outside of RSFSRC/book.&lt;br /&gt;
&lt;br /&gt;
=Capturing error and warning messages=&lt;br /&gt;
The messages during configuration are few and their importance quite high, so they should be watched &amp;quot;in person&amp;quot;. A complete log of the configuration process is recorded in RSFSRC/configure.log&lt;br /&gt;
&lt;br /&gt;
Console messages generated during the build step can be captured to a log file and observed at the same time with a command like this (tcsh):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
nice +10 nohup /usr/bin/time -p scons -k |&amp;amp; tee log_build.asc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The log file can be of course named otherwise than &amp;lt;tt&amp;gt;log_build.asc&amp;lt;/tt&amp;gt;. The file can be later grepped for error and warnings with commands such as:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
grep -c error log_build.asc&lt;br /&gt;
grep error log_build.asc | awk &#039;/error.c/ {next}; /error.h/ {next}; /error.o/ {next}; {print}&#039;&lt;br /&gt;
grep -c warning log_build.asc&lt;br /&gt;
grep warning log_build.asc | awk &#039;/imaginary constants are a GCC extension/ {next}; {print}&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Advanced troubleshooting=&lt;br /&gt;
* If you removed one of your programs or changed its name, and &amp;lt;tt&amp;gt;scons install&amp;lt;/tt&amp;gt; fails with &amp;quot;Source &amp;lt;tt&amp;gt;oldprogname&amp;lt;/tt&amp;gt; not found, needed by target install&amp;quot;, and you cleaned everything there was to clean but still get this message, remove &amp;lt;tt&amp;gt;RSFSRC/.sconsign*&amp;lt;/tt&amp;gt;&lt;br /&gt;
* If during &amp;lt;tt&amp;gt;scons install&amp;lt;/tt&amp;gt; you get a &amp;lt;tt&amp;gt;DBAccessError : (13, &#039;Permission denied&#039;)&amp;lt;/tt&amp;gt; in some reproducible papers, check permissions in your &amp;lt;tt&amp;gt;$DATAPATH&amp;lt;/tt&amp;gt; directory. This is where SCons places database &amp;quot;.sconsign&amp;quot; files for its dependencies (according to the rules in &amp;lt;tt&amp;gt;rsf.proj&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;rsf.tex&amp;lt;/tt&amp;gt;).&lt;br /&gt;
* If &amp;lt;tt&amp;gt;scons&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;scons install&amp;lt;/tt&amp;gt; fail due to an a bug introduced in a tool you are certain you will not use, a quick workaround for the problem is already built into scons: the &amp;lt;tt&amp;gt;-k&amp;lt;/tt&amp;gt; option, which means &amp;quot;keep going&amp;quot;. Thus, if you use &amp;lt;tt&amp;gt;scons -k&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;scons -k install&amp;lt;/tt&amp;gt;, SCons will not be able to build the failed component, or anything that depends on it, but it will keep going and make everything else that it can.&lt;br /&gt;
&lt;br /&gt;
=Further support=&lt;br /&gt;
Subscribe to the [https://lists.sourceforge.net/lists/listinfo/rsf-user rsf-user mailing list].&lt;/div&gt;</summary>
		<author><name>Karl</name></author>
	</entry>
	<entry>
		<id>https://ahay.org/index.php?title=Advanced_Installation&amp;diff=3754</id>
		<title>Advanced Installation</title>
		<link rel="alternate" type="text/html" href="https://ahay.org/index.php?title=Advanced_Installation&amp;diff=3754"/>
		<updated>2018-12-14T21:43:45Z</updated>

		<summary type="html">&lt;p&gt;Karl: /* Mac OS X */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:Fotolia_419157_XS.jpg|right|]]&lt;br /&gt;
Before reading this document, please familiarize yourself with the [[Installation|short Installation guide]].&lt;br /&gt;
=What the installation process does=&lt;br /&gt;
The term &amp;quot;installation&amp;quot; in the title is used for brevity, and it actually covers all three steps: configuration, build and install.&lt;br /&gt;
# Configure: determine what tools are available on the system and how they should be used to built the software. Creates a layer of abstraction so that the build is platform-independent. Should ideally either solve or flag all problems, so that the build either works, or does not proceed at all.&lt;br /&gt;
# Build: compiles the software and documentation using RSFSRC/build as a &amp;quot;workplace&amp;quot;&lt;br /&gt;
# Install: moves the compiled executables and the documentation to the final locations in $RSFROOT, sometimes changing filenames. Kept separate from build so that it can be done by root, and to avoid build failures leaving junk files all over the system.&lt;br /&gt;
A successful installation will have created in &amp;lt;tt&amp;gt;$RSFROOT&amp;lt;/tt&amp;gt; the following directories:&lt;br /&gt;
* &amp;lt;tt&amp;gt;bin/&amp;lt;/tt&amp;gt;: executable programs&lt;br /&gt;
* &amp;lt;tt&amp;gt;doc/&amp;lt;/tt&amp;gt;: auto-generated HTML documentation&lt;br /&gt;
* &amp;lt;tt&amp;gt;include/&amp;lt;/tt&amp;gt;: header files with info on library procedures; fonts&lt;br /&gt;
* &amp;lt;tt&amp;gt;lib/&amp;lt;/tt&amp;gt;: libraries and Python modules&lt;br /&gt;
&lt;br /&gt;
=Old (1.0 and 1.1) version installation=&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;tt&amp;gt;$RSFROOT/etc/madagascar/&amp;lt;/tt&amp;gt; as the location of &amp;lt;tt&amp;gt;env&amp;lt;/tt&amp;gt; scripts instead of &amp;lt;tt&amp;gt;$RSFROOT/share/madagascar/etc/&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=Old (0.9.9) version installation=&lt;br /&gt;
&lt;br /&gt;
====Environment variables====&lt;br /&gt;
Example configuration for &amp;lt;tt&amp;gt;bash&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
export RSFROOT=/usr/local/rsf # directory where Madagascar will be installed. &lt;br /&gt;
if [ -n &amp;quot;$PYTHONPATH&amp;quot; ]; then&lt;br /&gt;
export PYTHONPATH=${PYTHONPATH}:$RSFROOT/lib&lt;br /&gt;
else&lt;br /&gt;
export PYTHONPATH=$RSFROOT/lib&lt;br /&gt;
fi&lt;br /&gt;
export PATH=$RSFROOT/bin:$PATH&lt;br /&gt;
export DATAPATH=/var/tmp/&lt;br /&gt;
export MANPATH=$RSFROOT/share/man:$(manpath)&lt;br /&gt;
export LD_LIBRARY_PATH=$RSFROOT/lib:$LD_LIBRARY_PATH&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Notice the slash at the end of the &amp;lt;tt&amp;gt;DATAPATH&amp;lt;/tt&amp;gt; variable. &lt;br /&gt;
&lt;br /&gt;
Example configuration for &amp;lt;tt&amp;gt;csh&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;tcsh&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
setenv RSFROOT /usr/local/rsf&lt;br /&gt;
if ($?PYTHONPATH) then&lt;br /&gt;
setenv PYTHONPATH ${PYTHONPATH}:$RSFROOT/lib&lt;br /&gt;
else&lt;br /&gt;
setenv PYTHONPATH $RSFROOT/lib&lt;br /&gt;
endif&lt;br /&gt;
set path = ($RSFROOT/bin $path)&lt;br /&gt;
setenv DATAPATH /var/tmp/&lt;br /&gt;
setenv MANPATH $RSFROOT/share/man:`manpath`&lt;br /&gt;
setenv LD_LIBRARY_PATH $RSFROOT/lib:$LD_LIBRARY_PATH&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Notice the backticks surrounding the call to &amp;lt;tt&amp;gt;manpath&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Be aware that on some systems /var/tmp gets automatically cleaned at some intervals, so if you want to keep your data binaries for a long time, set &amp;lt;tt&amp;gt;DATAPATH&amp;lt;/tt&amp;gt; to another location where you have write access and that allows large files.&lt;br /&gt;
&lt;br /&gt;
====Software construction====&lt;br /&gt;
  &lt;br /&gt;
#Configuration. Change to the top source directory and run &amp;lt;pre&amp;gt;./configure&amp;lt;/pre&amp;gt; You can examine the &amp;lt;tt&amp;gt;config.py&amp;lt;/tt&amp;gt; file that this command generates.  Additional options are available. You can obtain a full list of customizable variables by running &amp;lt;tt&amp;gt;scons -h&amp;lt;/tt&amp;gt;. For example, to install C++ and Fortran-90 API bindings in addition to the basic package, run &amp;lt;pre&amp;gt;./configure API=c++,fortran-90&amp;lt;/pre&amp;gt; &lt;br /&gt;
#Building and installing the package. Run &amp;lt;tt&amp;gt;scons install&amp;lt;/tt&amp;gt; or the following two commands in succession:  &amp;lt;pre&amp;gt;make; make install&amp;lt;/pre&amp;gt; or &amp;lt;pre&amp;gt;scons; scons install&amp;lt;/pre&amp;gt; If you need &amp;quot;root&amp;quot; privileges for installing under &amp;lt;tt&amp;gt;&amp;amp;#36;RSFROOT&amp;lt;/tt&amp;gt;, you may need to run &amp;lt;pre&amp;gt;su; scons install &amp;lt;/pre&amp;gt; or &amp;lt;pre&amp;gt;sudo scons install&amp;lt;/pre&amp;gt;&lt;br /&gt;
#Cleaning. To clean all intermediate files generated by SCons, run &amp;lt;pre&amp;gt;make clean&amp;lt;/pre&amp;gt; or &amp;lt;pre&amp;gt;scons -c&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Prerequisites=&lt;br /&gt;
Basic prerequisites are described in the [[Installation|short Installation guide]]. Here are some additional details. &lt;br /&gt;
==Compilers==&lt;br /&gt;
Madagascar has been built successfully with the following compilers, and possibly with others:&lt;br /&gt;
* gcc&lt;br /&gt;
* Intel (icc/ifort)&lt;br /&gt;
* open64&lt;br /&gt;
* clang&lt;br /&gt;
* cc (Solaris)&lt;br /&gt;
&lt;br /&gt;
==Python and SCons==&lt;br /&gt;
As described below under [[Advanced Installation#Platform-specific installation advice | Platform-specific installation advice]], Madagascar supports the oldest non-deprecated Python version currently supported by the latest stable version of [http://scons.org/ SCons].  If your version of Python is older and you experience problems you should probably [http://www.python.org/ upgrade].&lt;br /&gt;
&lt;br /&gt;
Madagascar includes the latest stable version of SCons and the configure scripts will try to install it for you in RSFROOT if you don&#039;t have it already.  However, if you have an older version of SCons the configure scripts will not try to install the newer version. Your older version might work fine, but Madagascar attempts to support only the latest stable version of SCons, so if you have problems you should upgrade.&lt;br /&gt;
&lt;br /&gt;
To install the SCons bundled with Madagascar go to &amp;lt;tt&amp;gt;RSFSRC/scons&amp;lt;/tt&amp;gt;, unpack the tar file, and type&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
python setup.py install&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will install SCons in the standard location. You might need root privileges. If you don&#039;t have root privileges, or you don&#039;t want to interfere with the system SCons you can install it somewhere else with a --prefix option. A logical choice is to put it in RSFROOT like this:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
python setup.py install --prefix=$RSFROOT&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Location==&lt;br /&gt;
As long as you set the environment variables and directory permissions correctly, it does not matter in what part of your filesystem you place the install. If you have the luxury of installing anywhere, it is good practice to follow the [http://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard Filesystem Hierarchy Standard] and either:&lt;br /&gt;
# Install everything (including &amp;lt;tt&amp;gt;figs&amp;lt;/tt&amp;gt; if you do testing) under &amp;lt;tt&amp;gt;/usr/local/rsf&amp;lt;/tt&amp;gt;, with the source tree in &amp;lt;tt&amp;gt;/usr/local/rsf/src&amp;lt;/tt&amp;gt;, OR &lt;br /&gt;
# Put the source tree in &amp;lt;tt&amp;gt;/usr/local/src/rsf&amp;lt;/tt&amp;gt;, and specify &amp;lt;tt&amp;gt;RSFROOT=/usr/local&amp;lt;/tt&amp;gt;, so that header files and binaries go in &amp;lt;tt&amp;gt;/usr/local/bin&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;/usr/local/include&amp;lt;/tt&amp;gt;. To follow the standard, before installing set &amp;lt;tt&amp;gt;RSFDOC=/usr/local/share/rsf/doc&amp;lt;/tt&amp;gt; and create the appropriate directories. The auto-generated HTML documentation will get put there. Also, if installed, the figs directory for testing should be &amp;lt;tt&amp;gt;/usr/local/share/rsf/figs/&amp;lt;/tt&amp;gt;.&lt;br /&gt;
# Package Madagascar (i.e. build a RPM, etc) and install it in the default locations. For RPMs, those are as like the ones from the previous option, just directly in the &amp;lt;tt&amp;gt;/usr/&amp;lt;/tt&amp;gt; hierarchy, instead of in the &amp;lt;tt&amp;gt;/usr/local/&amp;lt;/tt&amp;gt; one.&lt;br /&gt;
&lt;br /&gt;
==Disk space==&lt;br /&gt;
At present (Feb 2007, r2530), the source directory containing the build tree from the development version was approx. 200Mb, the full installation (&amp;lt;tt&amp;gt;bin/&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;doc/&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;include/&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;lib&amp;lt;/tt&amp;gt;) is 31Mb, and &amp;lt;tt&amp;gt;figs/&amp;lt;/tt&amp;gt; (the optional directory if you want to do testing) is about 10 Gb. The stable version is significantly smaller.&lt;br /&gt;
&lt;br /&gt;
The only Madagascar-related directory where disk space can be an issue is &amp;lt;tt&amp;gt;$DATAPATH&amp;lt;/tt&amp;gt;. Real 3-D seismic datasets can be measured in Terabytes. Buggy programs/processing flows can fill up &amp;lt;tt&amp;gt;$DATAPATH&amp;lt;/tt&amp;gt;. A real problem are &amp;quot;disk memory leaks&amp;quot; -- removing header files with anything else than &amp;lt;tt&amp;gt;sfrm&amp;lt;/tt&amp;gt; will leave the binaries intact. Crashed jobs which start to write to binary but never get to write the header also produce &amp;quot;leaks&amp;quot;. Experience has shown that over time &amp;lt;tt&amp;gt;$DATAPATH&amp;lt;/tt&amp;gt; inexorably fills up. You may need to &lt;br /&gt;
# keep irreplaceable data and expensive results in a separate place;&lt;br /&gt;
# remove the oldest files in &amp;lt;tt&amp;gt;$DATAPATH&amp;lt;/tt&amp;gt; whenever the amount of free space declines under a preset threshold.&lt;br /&gt;
&lt;br /&gt;
==Dependencies==&lt;br /&gt;
Some platforms feature complete lists of dependencies. See [[Advanced Installation#Platform-specific installation advice | Platform-specific installation advice]] for details.&lt;br /&gt;
===C++ API===&lt;br /&gt;
A C++ compiler. SCons is smart and will try to find it for you. If it does not work specify the path to your compiler in the &amp;lt;tt&amp;gt;CXX&amp;lt;/tt&amp;gt; environment variable (can be passed as an option to the configuration script, like the &amp;lt;tt&amp;gt;API&amp;lt;/tt&amp;gt; one).&lt;br /&gt;
===F77 API===&lt;br /&gt;
A Fortran 77 compiler. If SCons does not find one, then you can either specify its path through the &amp;lt;tt&amp;gt;F77&amp;lt;/tt&amp;gt; variable, or if the executable is in your path, add its name to the list of F77 compilers in &amp;lt;tt&amp;gt;RSFSRC/configure.py&amp;lt;/tt&amp;gt; .&lt;br /&gt;
===F90 API===&lt;br /&gt;
Same as for Fortran 77 &amp;amp;ndash; just substitute &amp;lt;tt&amp;gt;F90&amp;lt;/tt&amp;gt;. If using the &amp;lt;tt&amp;gt;gfortran&amp;lt;/tt&amp;gt; compiler, make sure to get [http://gcc.gnu.org/wiki/GFortranBinaries the latest version]. If you have more than one compiler installed on your system, specify the desired one at configuration time:&lt;br /&gt;
&amp;lt;bash&amp;gt;&lt;br /&gt;
./configure API=f90 F90=/path/to/preferred/compiler&lt;br /&gt;
&amp;lt;/bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Java API===&lt;br /&gt;
There are two styles of API, old (1.0 release and previous) and new. The two APIs are not compatible with each other.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;old&amp;quot; interface requires the Mines Java Toolkit for fast Java file IO. The Mines JTK, is an open-source Java package that can be downloaded from [http://inside.mines.edu/~dhale/jtk/ Mines JTK]. Currently, the &amp;quot;old&amp;quot; interface will also build alongside the new one if the MINESJTK environment variable exists, and can be used as was previously.&lt;br /&gt;
&lt;br /&gt;
To install the new API, you need the (Oracle) JDK. Set your JAVA_HOME environment variable to the location of the jdk (on Ubuntu 10.04 this is: /usr/lib/jvm/java-6-openjdk), then reconfigure (./configure API=java ...) and reinstall.  &lt;br /&gt;
&lt;br /&gt;
Ignore the SWIG warnings (there are lots). &lt;br /&gt;
&lt;br /&gt;
Make sure to set your LD_LIBRARY_PATH to $RSFROOT/lib .&lt;br /&gt;
&lt;br /&gt;
If you want to include additional Java packages, you can set them using your shell&#039;s CLASSPATH variable.  This environment variable is now automatically passed onto all Java classes in SCons.&lt;br /&gt;
&lt;br /&gt;
The installation can be tested using the example demonstrating the new API in api/java/test .&lt;br /&gt;
&lt;br /&gt;
===Matlab API===&lt;br /&gt;
Besides Matlab itself, you need Mex, which compiles C code into regular Matlab functions. Use the &amp;lt;tt&amp;gt;MATLAB&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;MEX&amp;lt;/tt&amp;gt; environment variables to specify their paths if they are installed, but not found.&lt;br /&gt;
===Octave API===&lt;br /&gt;
The Octave function compiler (&amp;lt;tt&amp;gt;mkoctfile&amp;lt;/tt&amp;gt;) is sometimes bundled in a separate package, so it may be missing from the Octave installation.&lt;br /&gt;
&lt;br /&gt;
===Python API===&lt;br /&gt;
This API requires [http://www.swig.org/ SWIG], [http://numpy.scipy.org/ numpy] and the Python development kit. Numpy requires Python 2.4 or newer (i.e. RHEL 5 or newer). However, these dependencies are unnecessary for the common case when Python is just used as [http://en.wikipedia.org/wiki/Glue_language glue] to create chains of programs, and it only needs to read the RSF header, and not the binary. To allow Python [http://en.wikipedia.org/wiki/Meta-programs metaprograms] in madagascar to function, and programming in this style to be done, a fallback development kit implementing only the header-related functionality will be installed in the lack of these dependencies.&lt;br /&gt;
&lt;br /&gt;
===Python modules in user space===&lt;br /&gt;
Python is an evolving language. Many large systems have old versions for stability reasons, and administrators of such large systems tend to not install all software users may wish, and to not allow access to rpm either. To install a module in your user space, download the tarball, unzip it, cd into the directory and run: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;python setup.py install --prefix=/path/to/your/place&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The installer will create a subdirectory named &amp;lt;tt&amp;gt;lib&amp;lt;/tt&amp;gt;, or &amp;lt;tt&amp;gt;lib64&amp;lt;/tt&amp;gt; under the directory above. These &amp;lt;tt&amp;gt;lib*&amp;lt;/tt&amp;gt; dirs will have a directory named &amp;lt;tt&amp;gt;python&amp;lt;/tt&amp;gt;, or &amp;lt;tt&amp;gt;python2.3&amp;lt;/tt&amp;gt; for example, and those will have a subdirectory named &amp;lt;tt&amp;gt;site-packages&amp;lt;/tt&amp;gt;. Add all paths to these &amp;lt;tt&amp;gt;site-packages&amp;lt;/tt&amp;gt; subdirectories in your &amp;lt;tt&amp;gt;PYTHONPATH&amp;lt;/tt&amp;gt; environment variable. Some (&amp;lt;tt&amp;gt;numpy&amp;lt;/tt&amp;gt;) may create a &amp;lt;tt&amp;gt;bin&amp;lt;/tt&amp;gt; directory that needs to be added to &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=Environment variables=&lt;br /&gt;
Besides the variables defined in env.sh or env.csh (see the [[Installation|short Installation guide]]), Madagascar programs may read the variables below. They usually have reasonable defaults and were introduced just to provide more power to the advanced user.&lt;br /&gt;
&lt;br /&gt;
For future documentation writers: the environment variables read by Madagascar that have not been documented below can be found by running the script &amp;lt;tt&amp;gt;$RSFSRC/admin/find_env_var.py&amp;lt;/tt&amp;gt;. If the script does not exist or does not work, a summary of all environment variable calls can be obtained by going to $RSFSRC, temporarily moving the directory &amp;lt;tt&amp;gt;build/&amp;lt;/tt&amp;gt; outside RSFSRC, and typing&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
grep environ.get *.py */*.py */*/*.py */*/*/*.py&lt;br /&gt;
grep getenv           */*.c  */*/*.c  */*/*/*.c&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Used by the Madagascar core==&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; style=&amp;quot;background:#ffdead;&amp;quot;|Variables introduced by Madagascar&#039;s non-graphic programs&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Name&#039;&#039;&#039; || &#039;&#039;&#039;Default&#039;&#039;&#039; || Meaning&lt;br /&gt;
|-&lt;br /&gt;
| RSF_DATASERVER || &amp;lt;nowiki&amp;gt;ftp://egl.beg.utexas.edu/&amp;lt;/nowiki&amp;gt; || Data server for benchmark datasets&lt;br /&gt;
|-&lt;br /&gt;
| RSFDOC || $RSFROOT/doc || Directory for the HTML self-doc&lt;br /&gt;
|-&lt;br /&gt;
| RSFFIGS || $RSFROOT/figs || Directory with figures for testing examples in $RSFSRC/book&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| RSFALTFIGS || $RSFFIGS || Alternate directory with figures for testing examples not in $RSFSRC/book&lt;br /&gt;
|-&lt;br /&gt;
| RSFMEMSIZE || 100 || Maximum RAM (Mb) to be used by some programs  &lt;br /&gt;
|-&lt;br /&gt;
| RSFSRC || undefined || Root of the Madagascar source tree&lt;br /&gt;
|-&lt;br /&gt;
| TMPDATAPATH || $DATAPATH || Datapath for temporary files on local disk.&lt;br /&gt;
|-&lt;br /&gt;
| LATEX2HTML || undefined || LateX2HTML customization directory&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; style=&amp;quot;background:#ffdead;&amp;quot;|Variables introduced by Madagascar graphics programs &lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Name&#039;&#039;&#039; || &#039;&#039;&#039;Default&#039;&#039;&#039; || Meaning&lt;br /&gt;
|-&lt;br /&gt;
| DEFAULT_PAPER_SIZE || &amp;quot;letter&amp;quot; || For pspen. Other options: legal, a3, a4, a5.&lt;br /&gt;
|-&lt;br /&gt;
| FATMULT || ? || Fatness multiplication factor. &lt;br /&gt;
|-&lt;br /&gt;
| GIFBORDER || 0.25 || For vplot2gif (spacing)&lt;br /&gt;
|-&lt;br /&gt;
| GIFDELAY || 100 || For vplot2gif (for animations)&lt;br /&gt;
|-&lt;br /&gt;
| IMAGE_TYPE || &#039;png&#039; || Icon type for LateX2HTML &lt;br /&gt;
|-&lt;br /&gt;
| PATTERNMULT || None || Pattern multiplication factor  &lt;br /&gt;
|-&lt;br /&gt;
| PLOTSTYLE || None || Used in vplot&lt;br /&gt;
|-&lt;br /&gt;
| PPI || 75 || For vplot2gif (screen resolution)&lt;br /&gt;
|-&lt;br /&gt;
| PPMSCALE || 1 || For vplot2gif&lt;br /&gt;
|-&lt;br /&gt;
| PSBORDER || 0.05 || For vplot2eps (border around the plot)&lt;br /&gt;
|-&lt;br /&gt;
| PSPRINTER || postscript or colorps || For pspen&lt;br /&gt;
|-&lt;br /&gt;
| PSTEXPENOPTS || color=n fat=1 fatmult=1.5 invras=y || Other vplot2eps options &lt;br /&gt;
|-&lt;br /&gt;
| VPLOTFONTDIR || $RSFROOT/include || Dir with backup fonts in case the runtime-loaded vplot fonts are not found&lt;br /&gt;
|-&lt;br /&gt;
| VPLOTSPOOLDIR || /tmp || Where to put vplot tmp files&lt;br /&gt;
|-&lt;br /&gt;
| WSTYPE || &amp;quot;default&amp;quot; || Workstation type.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:#ffdead;&amp;quot;| Variables set by OS/other apps, read-only to Madagascar&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Name&#039;&#039;&#039; || &#039;&#039;&#039;Primarily used/set by&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| CWPROOT || Seismic Unix&lt;br /&gt;
|-&lt;br /&gt;
| DISPLAY || Operating System (OS)&lt;br /&gt;
|-&lt;br /&gt;
| HOME || OS&lt;br /&gt;
|-&lt;br /&gt;
| LD_LIBRARY_PATH || linker&lt;br /&gt;
|-&lt;br /&gt;
| MATLABPATH || Matlab&lt;br /&gt;
|-&lt;br /&gt;
| XAUTHORITY || X-Windows&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Used by the Madagascar build process and parallelization utilities==&lt;br /&gt;
Type &amp;lt;tt&amp;gt;scons -h&amp;lt;/tt&amp;gt; in RSFSRC to get a list of environment variables that affect the build process, with explanations, defaults and actual values. Below are more detailed explanations for some of them:&lt;br /&gt;
* &amp;lt;tt&amp;gt;RSF_THREADS&amp;lt;/tt&amp;gt;: used by &amp;lt;tt&amp;gt;pscons&amp;lt;/tt&amp;gt; to determine on how many threads to run on the local node, overriding the number of threads detected by Madagascar&lt;br /&gt;
* &amp;lt;tt&amp;gt;RSF_CLUSTER&amp;lt;/tt&amp;gt;: used by &amp;lt;tt&amp;gt;pscons&amp;lt;/tt&amp;gt; to determine on which cluster nodes to run, and on how many CPUs&lt;br /&gt;
&lt;br /&gt;
==Used by the Matlab API==&lt;br /&gt;
To use the Matlab API, you need to add &amp;lt;tt&amp;gt;$RSFROOT/lib&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;MATLABPATH&amp;lt;/tt&amp;gt;&lt;br /&gt;
==Used by the Octave API==&lt;br /&gt;
To use the Octave API, you need to add &amp;lt;tt&amp;gt;$RSFROOT/lib&amp;lt;/tt&amp;gt; to Octave&#039;s path. Determine Octave&#039;s version with&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
octave -v | head -1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
If your version is lower than 2.9.6, type at a Unix command line:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
echo &#039;LOADPATH = &amp;quot;::$RSFROOT/lib/octave&amp;quot;&#039; &amp;gt;&amp;gt; ~/.octaverc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
For later versions, use:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
echo &#039;addpath([getenv(&amp;quot;RSFROOT&amp;quot;) &amp;quot;/lib/octave&amp;quot;])&#039; &amp;gt;&amp;gt; ~/.octaverc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
==Used by the Java API==&lt;br /&gt;
New-style (post-1.0) API: Needs &amp;lt;tt&amp;gt;JAVA_HOME&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Old-style API (1.0 and before): The path to the downloaded Mines JTK must be specified in the MINESJTK environment variable in order to install the Java API. For example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
export MINESJTK=/home/user/edu_mines_jtk.jar&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==RSFROOT for NFS-shared user home directories==&lt;br /&gt;
Heterogeneous networks with user home directories shared through [http://en.wikipedia.org/wiki/Network_File_System_(protocol) NFS] are quite common in many institutions. In addition, even when the architecture is the same (i.e. 64-bit) and the operating system is the same (i.e. [http://en.wikipedia.org/wiki/RHEL RHEL]), the difference between operating system versions may be very significant because clusters may run legacy versions, while desktop workstations may run the latest-and-greatest (even beta), and entirely different Madagascar versions may be needed to support both. &lt;br /&gt;
&lt;br /&gt;
One possible solution of detecting the distribution version and architecture and setting RSFROOT appropriately is shown below. In the example network, all RHEL4 machines have the same architecture, but there are RHEL 3 machines with several architectures:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
REDHAT_RELEASE=`awk -F&#039;release&#039; &#039;{ print $2 }&#039; /etc/redhat-release | awk -F&#039; &#039; &#039;{ print $1 }&#039;`&lt;br /&gt;
&lt;br /&gt;
RSFROOT=/usr/local/rsf/rhel$REDHAT_RELEASE&lt;br /&gt;
&lt;br /&gt;
if [ $REDHAT_RELEASE == &#039;4&#039; ] ; then&lt;br /&gt;
    export RSFROOT&lt;br /&gt;
elif [ $REDHAT_RELEASE == &#039;3&#039; ] ; then&lt;br /&gt;
    export RSFROOT=$RSFROOT/$ARCH&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Of course, the Madagascar administrator will have to download appropriate versions of Madagascar to each $RSFROOT, and compile them on the appropriate system.&lt;br /&gt;
&lt;br /&gt;
If you have many kinds of systems to maintain, with multiple versions of Madagascar, and users have more than one shell, you may find it easy to outsource the complex logic to the easy-to-debug Python, i.e.:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
export RSFROOT=`$M8R_SETUP/get_rsfroot.py`&lt;br /&gt;
export PYTHONPATH=`$M8R_SETUP/edit_pythonpath.py`&lt;br /&gt;
export PATH=`$M8R_SETUP/edit_path.py`&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and similarly for (t)csh. The Python scripts determine the operating system and its version, determine the machine name, and simply print to stdout the desired string.&lt;br /&gt;
&lt;br /&gt;
==Eclipse + Pydev==&lt;br /&gt;
If you use [http://eclipse.org/ Eclipse] with [http://pydev.org/ Pydev], [http://pydev.org/manual_101_interpreter.html#id2 configure the interpreter] by adding &amp;lt;tt&amp;gt;$RSFROOT/lib&amp;lt;/tt&amp;gt; to the &amp;lt;tt&amp;gt;PYTHONPATH&amp;lt;/tt&amp;gt; for your chosen interpreter.&lt;br /&gt;
&lt;br /&gt;
=Platform-specific installation advice=&lt;br /&gt;
==Supported platforms==&lt;br /&gt;
Madagascar attempts to support any [http://en.wikipedia.org/wiki/POSIX POSIX-compliant] operating system demanded by users. For systems that bundle Python (i.e. Linux distributions, BSDs), backwards compatibility will attempt to cover those systems that were bundled with the oldest non-deprecated Python version currently supported by the latest stable version of [http://scons.org/ SCons]. For example, in early 2009 the stable SCons release (1.2) supported Python 2.2 or newer. [http://distrowatch.com/table.php?distribution=redhat Python 2.2 was bundled by RHEL3], so RHEL 3 and newer are supported. &lt;br /&gt;
&lt;br /&gt;
Attempts for backward compatibility with a given operating system are also stopped if the operating system itself becomes unsupported. For example, Python 2.2 was bundled by Fedora 1 and newer, but in January 2010 only Fedora 11 and 12 are actively maintained. Thus, in January 2010 Madagascar was not attempting to support Fedora 1, even though it included Python 2.2.&lt;br /&gt;
&lt;br /&gt;
Please keep in mind that the above statements constitute only general guidelines for what will be attempted, and do not constitute in any way a warranty of support. An application of the above guidelines to some Linux distributions follows:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Support info&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Distribution&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Life Cycle&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Supported versions&lt;br /&gt;
|-&lt;br /&gt;
| RHEL/CentOS/Scientific Linux&lt;br /&gt;
| [https://www.redhat.com/security/updates/errata/ 7 years]&lt;br /&gt;
| &lt;br /&gt;
* 6 until 2017-11-30&lt;br /&gt;
* 5 until 2014-03-31&lt;br /&gt;
|-&lt;br /&gt;
| Fedora&lt;br /&gt;
| [http://fedoraproject.org/wiki/Fedora_Release_Life_Cycle Release X maintained until one month after the release of X+2]&lt;br /&gt;
| &lt;br /&gt;
* 15 until 2012-06-24&lt;br /&gt;
* 14 until 2011-12-02&lt;br /&gt;
|-&lt;br /&gt;
| Ubuntu&lt;br /&gt;
| [https://wiki.ubuntu.com/Releases Releases every 6 mo, maintained for 1.5 yrs; LTS versions every 2 yrs, maintained for 5 yrs]&lt;br /&gt;
| &lt;br /&gt;
* 15.10 until July 2016&lt;br /&gt;
* 14.04 LTS until end of April 2019&lt;br /&gt;
* 12.04.4 LTS until end of April 2017&lt;br /&gt;
|-&lt;br /&gt;
| Debian&lt;br /&gt;
| [http://wiki.debian.org/DebianLenny Usually: stable releases every 1.5-3 yrs, release X maintained 1 yr after release X+1]&lt;br /&gt;
| &lt;br /&gt;
* 6 until its TBD end of life (approx. 2014)&lt;br /&gt;
* 5 until 2012-04&lt;br /&gt;
|- &lt;br /&gt;
| openSUSE&lt;br /&gt;
| [http://en.opensuse.org/Lifetime openSUSE releases Lifetime of 1.5-2.5 years]&lt;br /&gt;
| &lt;br /&gt;
* 11.4 until 2012-09-10&lt;br /&gt;
* 11.3 until 2012-01-15&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Ubuntu==&lt;br /&gt;
In &#039;&#039;&#039;Ubuntu 18.04&#039;&#039;&#039;, you can install the essential Madagascar depenency by running&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install libxaw7-dev freeglut3-dev libnetpbm10-dev libgd-dev libplplot-dev \&lt;br /&gt;
libavcodec-dev libcairo2-dev libjpeg-dev swig python-dev python-numpy g++ gfortran \&lt;br /&gt;
libopenmpi-dev libfftw3-dev libsuitesparse-dev python-epydoc scons git emacs25&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In &#039;&#039;&#039;Ubuntu 15.10 &#039;&#039;Wily Werewolf&#039;&#039;&#039;&#039;&#039; (as well as some previous versions), you can install the essential Madagascar depenency by running&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install libxaw7-dev &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and (optionally) all of Madagascar&#039;s dependencies by running&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install libxaw7-dev freeglut3-dev libnetpbm10-dev libgd-dev libplplot-dev \&lt;br /&gt;
libavcodec-dev libcairo2-dev libjpeg-dev swig python-dev python-numpy g++ gfortran \&lt;br /&gt;
libopenmpi-dev libfftw3-dev libsuitesparse-dev python-epydoc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In Ubuntu 13.04 &#039;&#039;Raring Ringtail&#039;&#039;, you can install all of Madagascar&#039;s dependencies by running&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install freeglut3-dev g++ gfortran libgd2-xpm-dev libx11-dev libxaw7-dev \&lt;br /&gt;
libnetpbm10-dev swig python-dev python-numpy libblas-dev libcairo2-dev liblapack-dev \&lt;br /&gt;
libavcodec-dev python-epydoc scons&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In Ubuntu 12.10 &#039;&#039;Quantal Quetzal&#039;&#039;, you can install all of Madagascar&#039;s dependencies by running&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install freeglut3-dev g++ gfortran libgd2-xpm-dev libx11-dev libxaw7-dev \&lt;br /&gt;
libnetpbm10-dev swig python-dev python-numpy libblas-dev libcairo2-dev liblapack-dev \&lt;br /&gt;
libavcodec-dev python-epydoc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In Ubuntu 12.04 &#039;&#039;Precise Pangolin&#039;&#039;, you can install all of Madagascar&#039;s dependencies by running&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install scons openmpi-bin libopenmpi-dev freeglut3-dev g++ gfortran libgd2-xpm-dev \&lt;br /&gt;
libglew1.6-dev libx11-dev libxaw7-dev libnetpbm10-dev swig python-dev python-scipy python-numpy \&lt;br /&gt;
libtiff4-dev scons units libblas-dev libcairo2-dev liblapack-dev libavcodec-dev python-epydoc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In Ubuntu 10.10 &#039;&#039;Maverick Meerkat&#039;&#039;, you can install all of Madagascar&#039;s dependencies by running &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install freeglut3-dev g++ gfortran libgd2-xpm-dev libglew1.5-dev libjpeg62-dev \&lt;br /&gt;
libx11-dev libxaw7-dev libnetpbm10-dev swig python-dev python-scipy python-numpy libtiff4-dev \&lt;br /&gt;
scons units libblas-dev libcairo2-dev libavcodec-dev libplplot-dev &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In Ubuntu 9.04 &#039;&#039;Jaunty Jackalope&#039;&#039;, the corresponding command is&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install freeglut3-dev g++ gfortran libc6-dev libgd2-xpm-dev libglew1.5-dev libjpeg62-dev \&lt;br /&gt;
libx11-dev libxaw7-dev libnetpbm10-dev swig python-dev python-scipy python-numpy libtiff4-dev scons units &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Earlier versions may work with&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install mesa-libGL-devel g++ g77 libc6-dev libgd2-xpm-dev libglew-dev libjpeg62-dev \&lt;br /&gt;
libx11-dev libxaw7-dev libnetpbm10-dev swig python-dev python-scipy python-numpy libtiff4-dev scons units &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If working with the development version, you will also need &amp;lt;tt&amp;gt;git&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;subversion&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Fedora, RedHat, CentOS, Scientific Linux, openSUSE==&lt;br /&gt;
&lt;br /&gt;
Install essential Madagascar dependencies with&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo yum install gcc libXaw-devel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dependency package names, sorted by Linux distribution and Madagascar feature they provide. Packages that are not included in the standard distro repositories are hyperlinked to their providers. The tables below cover build dependencies. &lt;br /&gt;
&lt;br /&gt;
Names of packages that are runtime dependencies are &#039;&#039;&#039;highlighted&#039;&#039;&#039; in the tables below (task under construction).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note: In the future, it should be possible for the configuration scripts to output the dependency tables below, so that they are guaranteed to be in synch with a given Madagascar version&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Minimal install (&amp;quot;Core&amp;quot;), publishing and development&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Core&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | LaTeX&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Development version&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | C++ API&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | F77 API, F90 API&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Python API&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Java API&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Octave API&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Matlab API&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Fedora 15&lt;br /&gt;
| binutils, gcc, glibc-headers, python&lt;br /&gt;
| texlive-latex&lt;br /&gt;
| subversion&lt;br /&gt;
| gcc-c++&lt;br /&gt;
| gcc-gfortran&lt;br /&gt;
| numpy, swig, python-devel&lt;br /&gt;
| Java (Sun&#039;s? IcedTea?)&lt;br /&gt;
| octave, octave-devel&lt;br /&gt;
| [http://www.mathworks.com/ Matlab] with Mex&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Fedora 14&lt;br /&gt;
| binutils, gcc, glibc-headers, python&lt;br /&gt;
| texlive-latex&lt;br /&gt;
| subversion&lt;br /&gt;
| gcc-c++&lt;br /&gt;
| gcc-gfortran&lt;br /&gt;
| numpy, swig&lt;br /&gt;
| Java (Sun&#039;s? IcedTea?)&lt;br /&gt;
| octave, octave-devel&lt;br /&gt;
| [http://www.mathworks.com/ Matlab] with Mex&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Fedora 13&lt;br /&gt;
| binutils, gcc, glibc-headers, python&lt;br /&gt;
| texlive-latex&lt;br /&gt;
| subversion&lt;br /&gt;
| gcc-c++&lt;br /&gt;
| gcc-gfortran&lt;br /&gt;
| numpy, swig&lt;br /&gt;
| Java (Sun&#039;s? IcedTea?)&lt;br /&gt;
| octave, octave-devel&lt;br /&gt;
| [http://www.mathworks.com/ Matlab]&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | CentOS 5&lt;br /&gt;
| binutils, gcc, glibc-headers; python (needs [http://dag.wieers.com/rpm/FAQ.php#B2 RPMforge&#039;s RHEL5 repository])&lt;br /&gt;
| ?&lt;br /&gt;
| subversion&lt;br /&gt;
| gcc-c++&lt;br /&gt;
| gcc-gfortran&lt;br /&gt;
| numpy, swig&lt;br /&gt;
| Java (Sun&#039;s? IcedTea?), [http://inside.mines.edu/~dhale/jtk/ Mines JTK]&lt;br /&gt;
| [http://www.gnu.org/software/octave/ Octave, octave-devel]&lt;br /&gt;
| [http://www.mathworks.com/ Matlab]&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | openSUSE 11.0&lt;br /&gt;
| gcc, python&lt;br /&gt;
| texlive-latex&lt;br /&gt;
| subversion&lt;br /&gt;
| gcc-c++&lt;br /&gt;
| gcc-fortran&lt;br /&gt;
| [http://numpy.scipy.org/ NumPy], swig&lt;br /&gt;
| Java (Sun&#039;s? IcedTea?), [http://inside.mines.edu/~dhale/jtk/ Mines JTK]&lt;br /&gt;
| [http://www.gnu.org/software/octave/ Octave]&lt;br /&gt;
| [http://www.mathworks.com/ Matlab]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Graphics and visualization&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The minimum requirement is X11 graphics for running &#039;&#039;&#039;xtpen&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | X11 graphics&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | vplot2gif&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | vplot2avi&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Some sort of movies?&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | TIFF output&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | JPEG output&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | PLplot graphics&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | OpenGL graphics&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | ppm (?)&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | unknown&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Fedora 13&lt;br /&gt;
| libXaw-devel&lt;br /&gt;
| gifsicle&lt;br /&gt;
| ffmpeg (needs the [http://rpmfusion.org/ RPM Fusion] repository enabled)&lt;br /&gt;
| ffmpeg-devel (needs the [http://rpmfusion.org/ RPM Fusion] repository enabled)&lt;br /&gt;
| libtiff-devel&lt;br /&gt;
| libjpeg-devel&lt;br /&gt;
| plplot-devel&lt;br /&gt;
| mesa-libGL-devel, freeglut, freeglut-devel&lt;br /&gt;
| netpbm-devel&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | openSUSE 11.0&lt;br /&gt;
| xorg-x11-devel&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
| libtiff-devel&lt;br /&gt;
| libjpeg-devel&lt;br /&gt;
| plplot-devel&lt;br /&gt;
| mesa-libGL-devel, freeglut, freeglut-devel&lt;br /&gt;
| netpbm-devel&lt;br /&gt;
| cairo-devel, gd-devel, glew-devel&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Numerical and file manipulation utilities&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | OpenMP&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | MPI&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | BLAS/ATLAS&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Interface to the Fast Discrete Curvelet Transform&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | sfunits&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Fedora 13&lt;br /&gt;
| libgomp&lt;br /&gt;
| openmpi, openmpi-devel; openmpi-libs (?)&lt;br /&gt;
| blas, blas-devel, atlas, atlas-devel&lt;br /&gt;
| [https://wave.eos.ubc.ca/Software/Licenced/ pyct]&lt;br /&gt;
| units&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | CentOS 5&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
| [https://wave.eos.ubc.ca/Software/Licenced/ pyct]&lt;br /&gt;
| [http://www.gnu.org/software/units/units.html Gnu Units]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Other&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Inclusions from Seismic Unix&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Fedora 14, 15&lt;br /&gt;
| [http://www.cwp.mines.edu/cwpcodes/ Seismic Unix]&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | CentOS 5&lt;br /&gt;
| [http://www.cwp.mines.edu/cwpcodes/ Seismic Unix]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Command to install all dependencies present in the public repositories&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Usually package management software will not install again a package that is already installed, so it should be safe to copy and paste the command below to a command line:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Fedora 15&lt;br /&gt;
| &#039;&#039;&#039;yum -y install&#039;&#039;&#039; binutils gcc glibc-headers scons texlive-latex subversion gcc-c++ gcc-gfortran numpy python python-devel swig octave octave-devel libgomp openmpi openmpi-devel blas blas-devel atlas atlas-devel units gifsicle ffmpeg ffmpeg-devel libtiff-devel libjpeg-devel plplot-devel mesa-libGL-devel freeglut freeglut-devel libXaw-devel netpbm-devel&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Fedora 13&lt;br /&gt;
| &#039;&#039;&#039;yum -y install&#039;&#039;&#039; binutils gcc glibc-headers scons texlive-latex subversion gcc-c++ gcc-gfortran numpy python swig octave octave-devel libgomp openmpi openmpi-devel blas blas-devel atlas atlas-devel units gifsicle ffmpeg ffmpeg-devel libtiff-devel libjpeg-devel plplot-devel mesa-libGL-devel freeglut freeglut-devel libXaw-devel netpbm-devel&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | CentOS 5&lt;br /&gt;
| &#039;&#039;&#039;yum -y install&#039;&#039;&#039; binutils freeglut freeglut-devel gcc gcc-c++ gcc-gfortran glibc-headers libjpeg-devel libXaw-devel netpbm-devel&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | openSUSE 11.0&lt;br /&gt;
| &#039;&#039;&#039;zypper install&#039;&#039;&#039; cairo-devel gcc gcc-c++ gcc-fortran gd-devel glew-devel libjpeg-devel libtiff-devel octave scons subversion texlive-latex xorg-x11-devel&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;List of runtime dependencies only&#039;&#039;&#039;&lt;br /&gt;
(needed by packagers of Madagascar in order to properly list dependencies):&lt;br /&gt;
UNDER CONSTRUCTION&lt;br /&gt;
&lt;br /&gt;
===Fedora 25===&lt;br /&gt;
The following explains how to install madagascar on Fedora 25.&lt;br /&gt;
&lt;br /&gt;
We use the following compiler: &amp;lt;code&amp;gt;gcc&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;g++&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;gfortran&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* Install some packages&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; inline style=&amp;quot;white-space:wrap&amp;quot;&amp;gt;sudo dnf install scons lapack-static lapack64-static atlas-static fftw-static gd gd-devel libtool-ltdl-devel \&lt;br /&gt;
libXaw-devel mesa-libGL-devel freeglut-devel netpbm-devel plplot-devel ffmpeg-devel swig openmpi openmpi-devel suitesparse-devel&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This installed the following packages:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
scons-2.5.1-1.fc25.noarch&lt;br /&gt;
lapack-static-3.6.1-2.fc25.x86_64&lt;br /&gt;
lapack64-static-3.6.1-2.fc25.x86_64&lt;br /&gt;
atlas-static-3.10.2-14.fc25.x86_64&lt;br /&gt;
fftw-static-3.3.5-3.fc25.x86_64&lt;br /&gt;
gd-2.2.4-1.fc25.x86_64&lt;br /&gt;
gd-devel-2.2.4-1.fc25.x86_64&lt;br /&gt;
libtool-ltdl-devel-2.4.6-13.fc25.x86_64&lt;br /&gt;
libXaw-devel-1.0.13-4.fc25.x86_64&lt;br /&gt;
mesa-libGL-devel-17.0.5-3.fc25.x86_64&lt;br /&gt;
freeglut-devel-3.0.0-3.fc24.x86_64&lt;br /&gt;
netpbm-devel-10.78.00-1.fc25.x86_64&lt;br /&gt;
plplot-devel-5.11.1-13.fc25.x86_64&lt;br /&gt;
ffmpeg-devel-3.1.9-1.fc25.x86_64&lt;br /&gt;
swig-3.0.11-1.fc25.x86_64&lt;br /&gt;
openmpi-1.10.5-1.fc25.x86_64&lt;br /&gt;
openmpi-devel-1.10.5-1.fc25.x86_64&lt;br /&gt;
suitesparse-devel-4.4.6-7.fc25.x86_64&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and many other dependencies.&lt;br /&gt;
&lt;br /&gt;
* Get the sources from the git repository&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;git clone https://github.com/ahay/src&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you run now the &amp;lt;code&amp;gt;configure&amp;lt;/code&amp;gt; script, you will get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
checking for Python ... /usr/bin/python&lt;br /&gt;
checking Python version ... 2.7.13&lt;br /&gt;
checking for RSFROOT ... /usr/local/rsf&lt;br /&gt;
checking for SCons ... /usr/bin/scons&lt;br /&gt;
checking SCons version ... v2.5.1.rel_2.5.1:3735:9dc6cee5c168[MODIFIED]&lt;br /&gt;
Running RSFROOT=/usr/local/rsf /usr/bin/scons  config ...&lt;br /&gt;
------------------------&lt;br /&gt;
scons: Reading SConscript files ...&lt;br /&gt;
checking platform ... (cached) linux [fedora]&lt;br /&gt;
checking for C compiler ... (cached) gcc&lt;br /&gt;
checking if gcc works ... yes&lt;br /&gt;
checking if gcc accepts &#039;-x c -std=gnu99 -Wall -pedantic&#039; ... yes&lt;br /&gt;
checking for ar ... (cached) ar&lt;br /&gt;
checking for libraries ... [&#039;m&#039;]&lt;br /&gt;
checking complex support ... yes&lt;br /&gt;
checking for X11 headers ... /usr/include&lt;br /&gt;
checking for X11 libraries ... /usr/lib&lt;br /&gt;
checking for OpenGL ... yes&lt;br /&gt;
checking for sfpen ... (cached) xtpen&lt;br /&gt;
checking for ppm ... yes&lt;br /&gt;
checking for tiff ... yes&lt;br /&gt;
checking for GD (PNG) ... yes&lt;br /&gt;
checking for GD (GIF) ... yes&lt;br /&gt;
checking for plplot ... no&lt;br /&gt;
&lt;br /&gt;
  Optional package: plplot-devel&lt;br /&gt;
checking for ffmpeg ... yes&lt;br /&gt;
checking for cairo (PNG) ... yes&lt;br /&gt;
checking for cairo (SVG) ... yes&lt;br /&gt;
checking for cairo (PDF) ... yes&lt;br /&gt;
checking for jpeg ... yes&lt;br /&gt;
checking for BLAS ... yes&lt;br /&gt;
checking for LAPACK ... no&lt;br /&gt;
&lt;br /&gt;
  Optional package: blas + blas-devel + atlas + atlas-devel&lt;br /&gt;
checking for SWIG ... (cached) /usr/bin/swig&lt;br /&gt;
checking for numpy ... (cached) yes&lt;br /&gt;
checking API options ... (cached) []&lt;br /&gt;
checking for C++ compiler ... (cached) g++&lt;br /&gt;
checking if g++ works ... yes&lt;br /&gt;
checking if g++ accepts &#039;-std=c++11 -U__STRICT_ANSI__ -Wall -pedantic&#039; ... yes&lt;br /&gt;
checking for MPICC ... (cached) /usr/lib64/openmpi/bin/mpicc&lt;br /&gt;
checking if /usr/lib64/openmpi/bin/mpicc works ... yes&lt;br /&gt;
checking for MPICXX ... (cached) /usr/lib64/openmpi/bin/mpicxx&lt;br /&gt;
checking if /usr/lib64/openmpi/bin/mpicxx works ... yes&lt;br /&gt;
checking for MPIRUN ... (cached) /usr/lib64/openmpi/bin/mpirun&lt;br /&gt;
checking for Posix threads ... yes&lt;br /&gt;
checking for OpenMP ... yes&lt;br /&gt;
checking for CUDA ... (cached) no&lt;br /&gt;
checking for FFTW ... yes&lt;br /&gt;
checking if FFTW supports threads ... yes&lt;br /&gt;
checking for SuiteSparse ... yes&lt;br /&gt;
checking for pfft ... no&lt;br /&gt;
scons: done reading SConscript files.&lt;br /&gt;
scons: Building targets ...&lt;br /&gt;
shell_script([&amp;quot;env.sh&amp;quot;], [])&lt;br /&gt;
shell_script([&amp;quot;env.csh&amp;quot;], [])&lt;br /&gt;
scons: done building targets.&lt;br /&gt;
------------------------&lt;br /&gt;
Done with configuration.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Libraries &amp;lt;code&amp;gt;plplot&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;lapack&amp;lt;/code&amp;gt; are not found. File &amp;lt;code&amp;gt;config.log&amp;lt;/code&amp;gt; says&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/bin/ld: cannot find -lplplotd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gcc -o .sconf_temp/sfconftest_21 .sconf_temp/conftest_21.o -L/usr/lib64/atlas -lm -lf77blas -lcblas -latlas -llapack -lcblas&lt;br /&gt;
/usr/lib64/atlas/liblapack.a(dgesv.o): In function `dgesv_&#039;:&lt;br /&gt;
(.text+0x69): undefined reference to `xerbla_&#039;&lt;br /&gt;
/usr/lib64/atlas/liblapack.a(ATL_f77wrap_dgesv.o): In function `atl_f77wrap_dgesv_&#039;:&lt;br /&gt;
(.text+0x10d): undefined reference to `ATL_xerbla&#039;&lt;br /&gt;
/usr/lib64/atlas/liblapack.a(ATL_dgetf2.o): In function `ATL_dgetf2&#039;:&lt;br /&gt;
(.text+0x184): undefined reference to `ATL_dger&#039;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So library &amp;lt;code&amp;gt;plplotd&amp;lt;/code&amp;gt; doesn&#039;t exist on Fedora 25 and the &amp;lt;code&amp;gt;configure&amp;lt;/code&amp;gt; script is looking for the wrong &amp;lt;code&amp;gt;lapack&amp;lt;/code&amp;gt; library.&lt;br /&gt;
&lt;br /&gt;
If compiling now, 2 other libraries won&#039;t be found: &amp;lt;code&amp;gt;gfortran&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;quadmath&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Regarding the &amp;lt;code&amp;gt;plplotd&amp;lt;/code&amp;gt; library, edit file &amp;lt;code&amp;gt;framework/configure.py&amp;lt;/code&amp;gt; and change the line 724:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line start=&amp;quot;724&amp;quot;&amp;gt;plplot = context.env.get(&#039;PLPLOT&#039;,&#039;plplotd&#039;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
to&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line start=&amp;quot;724&amp;quot;&amp;gt;plplot = context.env.get(&#039;PLPLOT&#039;,&#039;plplot&#039;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* As for the libraries&lt;br /&gt;
** &amp;lt;code&amp;gt;lapack&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;gfortran&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;quadmath&amp;lt;/code&amp;gt;&lt;br /&gt;
We must use the &amp;lt;code&amp;gt;lapack&amp;lt;/code&amp;gt; library installed in &amp;lt;code&amp;gt;/usr/lib64&amp;lt;/code&amp;gt;, not the one installed in &amp;lt;code&amp;gt;/usr/lib64/atlas&amp;lt;/code&amp;gt;. And libraries &amp;lt;code&amp;gt;gfortran&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;quadmath&amp;lt;/code&amp;gt; are installed in &amp;lt;code&amp;gt;/usr/lib/gcc/x86_64-redhat-linux/6.3.1/&amp;lt;/code&amp;gt;.&lt;br /&gt;
Edit file &amp;lt;code&amp;gt;framework/configure.py&amp;lt;/code&amp;gt; and add the following 4 lines:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[&#039;/usr/lib/gcc/x86_64-redhat-linux/6.3.1/&#039;,&lt;br /&gt;
 &#039;/usr/lib64/&#039;,&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LIBS.append(&#039;gfortran&#039;)&lt;br /&gt;
LIBS.append(&#039;quadmath&#039;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
so that we end up with the following &amp;lt;code&amp;gt;blas&amp;lt;/code&amp;gt; function: &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line start=&amp;quot;971&amp;quot;&amp;gt;def blas(context):&lt;br /&gt;
    context.Message(&amp;quot;checking for BLAS ... &amp;quot;)&lt;br /&gt;
    text = &#039;&#039;&#039;&lt;br /&gt;
    #ifdef __APPLE__&lt;br /&gt;
    #include &amp;lt;Accelerate/Accelerate.h&amp;gt;&lt;br /&gt;
    #else&lt;br /&gt;
    #ifdef HAVE_MKL&lt;br /&gt;
    #include &amp;lt;mkl.h&amp;gt;&lt;br /&gt;
    #else&lt;br /&gt;
    #include &amp;lt;cblas.h&amp;gt;&lt;br /&gt;
    #endif&lt;br /&gt;
    #endif&lt;br /&gt;
    int main(int argc,char* argv[]) {&lt;br /&gt;
    float d, x[]={1.,2.,3.}, y[]={3.,2.,1.};&lt;br /&gt;
    d = cblas_sdot(3,x,1,y,1);&lt;br /&gt;
    return 0;&lt;br /&gt;
    }\n&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    if plat[&#039;OS&#039;] == &#039;cygwin&#039;:&lt;br /&gt;
        context.env[&#039;ENV&#039;][&#039;PATH&#039;] = context.env[&#039;ENV&#039;][&#039;PATH&#039;] + \&lt;br /&gt;
                                         &#039;:/lib/lapack&#039;&lt;br /&gt;
&lt;br /&gt;
    res = context.TryLink(text,&#039;.c&#039;)&lt;br /&gt;
    if res: &lt;br /&gt;
        context.Result(res)&lt;br /&gt;
        context.env[&#039;BLAS&#039;] = True &lt;br /&gt;
    else:&lt;br /&gt;
        # first try blas&lt;br /&gt;
        LIBS = path_get(context,&#039;LIBS&#039;)&lt;br /&gt;
        blas = context.env.get(&#039;BLAS&#039;,&#039;blas&#039;)&lt;br /&gt;
        LIBS.append(blas)&lt;br /&gt;
        res = context.TryLink(text,&#039;.c&#039;)&lt;br /&gt;
        if res: &lt;br /&gt;
            context.Result(res)&lt;br /&gt;
            context.env[&#039;LIBS&#039;] = LIBS &lt;br /&gt;
            context.env[&#039;BLAS&#039;] = blas &lt;br /&gt;
        else:&lt;br /&gt;
            # some systems require cblas and atlas&lt;br /&gt;
            for atlas_dir in filter(os.path.isdir,&lt;br /&gt;
                                    [&#039;/usr/lib/gcc/x86_64-redhat-linux/6.3.1/&#039;,  # &amp;lt;--- add this line&lt;br /&gt;
                                     &#039;/usr/lib64/&#039;,                              # &amp;lt;--- add this line&lt;br /&gt;
                                     &#039;/usr/lib64/atlas/&#039;,&lt;br /&gt;
                                     &#039;/usr/lib/atlas/&#039;]):&lt;br /&gt;
                context.env[&#039;LIBPATH&#039;].append(atlas_dir)&lt;br /&gt;
            LIBS.pop()&lt;br /&gt;
            LIBS.append(&#039;f77blas&#039;)&lt;br /&gt;
            LIBS.append(&#039;cblas&#039;)&lt;br /&gt;
            LIBS.append(&#039;atlas&#039;)&lt;br /&gt;
            LIBS.append(&#039;gfortran&#039;)  # &amp;lt;----------------------------------------------- add this line&lt;br /&gt;
            LIBS.append(&#039;quadmath&#039;)  # &amp;lt;----------------------------------------------- add this line&lt;br /&gt;
            res = context.TryLink(text,&#039;.c&#039;)&lt;br /&gt;
            if res: &lt;br /&gt;
                context.Result(res)&lt;br /&gt;
                context.env[&#039;LIBS&#039;] = LIBS &lt;br /&gt;
                context.env[&#039;BLAS&#039;] = &#039;cblas&#039;&lt;br /&gt;
            else:&lt;br /&gt;
                context.Result(context_failure)&lt;br /&gt;
                context.env[&#039;CPPDEFINES&#039;] = \&lt;br /&gt;
                    path_get(context,&#039;CPPDEFINES&#039;,&#039;NO_BLAS&#039;)&lt;br /&gt;
                LIBS.pop()&lt;br /&gt;
                LIBS.pop()&lt;br /&gt;
                LIBS.pop()&lt;br /&gt;
                context.env[&#039;BLAS&#039;] = None &lt;br /&gt;
                need_pkg(&#039;blas&#039;, fatal=False)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* Run the &amp;lt;code&amp;gt;configure&amp;lt;/code&amp;gt; script, for example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;./configure --prefix=/usr/local/rsf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Output should give:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
checking for Python ... /usr/bin/python&lt;br /&gt;
checking Python version ... 2.7.13&lt;br /&gt;
checking for RSFROOT ... /usr/local/rsf&lt;br /&gt;
checking for SCons ... /usr/bin/scons&lt;br /&gt;
checking SCons version ... v2.5.1.rel_2.5.1:3735:9dc6cee5c168[MODIFIED]&lt;br /&gt;
Running RSFROOT=/usr/local/rsf /usr/bin/scons  config ...&lt;br /&gt;
------------------------&lt;br /&gt;
scons: Reading SConscript files ...&lt;br /&gt;
checking platform ... (cached) linux [fedora]&lt;br /&gt;
checking for C compiler ... (cached) gcc&lt;br /&gt;
checking if gcc works ... yes&lt;br /&gt;
checking if gcc accepts &#039;-x c -std=gnu99 -Wall -pedantic&#039; ... yes&lt;br /&gt;
checking for ar ... (cached) ar&lt;br /&gt;
checking for libraries ... [&#039;m&#039;]&lt;br /&gt;
checking complex support ... yes&lt;br /&gt;
checking for X11 headers ... /usr/include&lt;br /&gt;
checking for X11 libraries ... /usr/lib&lt;br /&gt;
checking for OpenGL ... yes&lt;br /&gt;
checking for sfpen ... (cached) xtpen&lt;br /&gt;
checking for ppm ... yes&lt;br /&gt;
checking for tiff ... yes&lt;br /&gt;
checking for GD (PNG) ... yes&lt;br /&gt;
checking for GD (GIF) ... yes&lt;br /&gt;
checking for plplot ... yes&lt;br /&gt;
checking for ffmpeg ... yes&lt;br /&gt;
checking for cairo (PNG) ... yes&lt;br /&gt;
checking for cairo (SVG) ... yes&lt;br /&gt;
checking for cairo (PDF) ... yes&lt;br /&gt;
checking for jpeg ... yes&lt;br /&gt;
checking for BLAS ... yes&lt;br /&gt;
checking for LAPACK ... yes&lt;br /&gt;
checking for SWIG ... (cached) /usr/bin/swig&lt;br /&gt;
checking for numpy ... (cached) yes&lt;br /&gt;
checking API options ... (cached) []&lt;br /&gt;
checking for C++ compiler ... (cached) g++&lt;br /&gt;
checking if g++ works ... yes&lt;br /&gt;
checking if g++ accepts &#039;-std=c++11 -U__STRICT_ANSI__ -Wall -pedantic&#039; ... yes&lt;br /&gt;
checking for MPICC ... (cached) /usr/lib64/openmpi/bin/mpicc&lt;br /&gt;
checking if /usr/lib64/openmpi/bin/mpicc works ... yes&lt;br /&gt;
checking for MPICXX ... (cached) /usr/lib64/openmpi/bin/mpicxx&lt;br /&gt;
checking if /usr/lib64/openmpi/bin/mpicxx works ... yes&lt;br /&gt;
checking for MPIRUN ... (cached) /usr/lib64/openmpi/bin/mpirun&lt;br /&gt;
checking for Posix threads ... yes&lt;br /&gt;
checking for OpenMP ... yes&lt;br /&gt;
checking for CUDA ... (cached) no&lt;br /&gt;
checking for FFTW ... yes&lt;br /&gt;
checking if FFTW supports threads ... yes&lt;br /&gt;
checking for SuiteSparse ... yes&lt;br /&gt;
checking for pfft ... no&lt;br /&gt;
scons: done reading SConscript files.&lt;br /&gt;
scons: Building targets ...&lt;br /&gt;
shell_script([&amp;quot;env.sh&amp;quot;], [])&lt;br /&gt;
shell_script([&amp;quot;env.csh&amp;quot;], [])&lt;br /&gt;
scons: done building targets.&lt;br /&gt;
------------------------&lt;br /&gt;
Done with configuration.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* Then run the compilation:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;make&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* and finally the installation&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;sudo make install&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Debian 5==&lt;br /&gt;
Specific dependencies:&lt;br /&gt;
* Debian 5.0 (&amp;quot;Lenny&amp;quot;): Please make sure you have the &amp;lt;tt&amp;gt;libc6-dev&amp;lt;/tt&amp;gt; package before trying to compile from source. The &amp;lt;tt&amp;gt;libXaw7-dev&amp;lt;/tt&amp;gt; package might be a dependency for &amp;lt;tt&amp;gt;xtpen&amp;lt;/tt&amp;gt; (was in Debian 4.0)&lt;br /&gt;
&lt;br /&gt;
==Yellow Dog Linux 6.1 on Sony PlayStation 3==&lt;br /&gt;
See [http://www.reproducibility.org/rsflog/uploads/Friday_Seminar_Madagascar_on_PS3.ppt Will Burnett&#039;s guide (PowerPoint)]&lt;br /&gt;
&lt;br /&gt;
==Mac OS X==&lt;br /&gt;
&lt;br /&gt;
Install necessary Mac OS X applications using:&lt;br /&gt;
* [http://www.macports.org/ MacPorts], an easy-to-use system for compiling, installing, and upgrading open-source software on Mac OS X.&lt;br /&gt;
* [http://www.finkproject.org/ Fink], a tool that brings the full world of Unix Open Source software to Mac OS X. &lt;br /&gt;
&lt;br /&gt;
Installation on Mac OS X Mountain Lion requires the following:&lt;br /&gt;
# &amp;lt;b&amp;gt;Xcode&amp;lt;/b&amp;gt;: Download and install [https://developer.apple.com/xcode/ XCode] from Apple using App Store application. In Xcode, make sure to enable and install the command-line tools in Xcode/Preferences/Downloads &lt;br /&gt;
# (Optionally) &amp;lt;b&amp;gt;X11&amp;lt;/b&amp;gt;: Install X11 libraries from [http://xquartz.macosforge.org Xquartz]. &lt;br /&gt;
# (Optionally) &amp;lt;b&amp;gt;gcc&amp;lt;/b&amp;gt;: Install the Gnu C compiler from [http://hpc.sourceforge.net HPC Mac OS X]. &lt;br /&gt;
# (Optionally) [[SEGTeX]]: To use &amp;lt;b&amp;gt;SEGTeX&amp;lt;/b&amp;gt;, you may need [http://www.tug.org/texlive/ TeX Live]. &amp;lt;b&amp;gt;MacPorts&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;Fink&amp;lt;/b&amp;gt; provide an easy way to install it with commands &amp;lt;pre&amp;gt;sudo port install texlive&amp;lt;/pre&amp;gt; or &amp;lt;pre&amp;gt;sudo fink install texlive&amp;lt;/pre&amp;gt;&lt;br /&gt;
# (Optionally) &amp;lt;b&amp;gt;FFTW&amp;lt;/b&amp;gt;: Using &amp;lt;b&amp;gt;MacPorts&amp;lt;/b&amp;gt;, run &amp;lt;pre&amp;gt;sudo port install fftw-3-single&amp;lt;/pre&amp;gt;&amp;lt;pre&amp;gt;sudo port install fftw-3 +gfortran&amp;lt;/pre&amp;gt;&lt;br /&gt;
# (Optionally) &amp;lt;b&amp;gt;MPI&amp;lt;/b&amp;gt;: Using &amp;lt;b&amp;gt;MacPorts&amp;lt;/b&amp;gt;, run &amp;lt;pre&amp;gt;sudo port install openmpi&amp;lt;/pre&amp;gt;&amp;lt;pre&amp;gt;sudo port select --set mpi openmpi-mp-fortran&amp;lt;/pre&amp;gt;&lt;br /&gt;
# (Optionally) &amp;lt;b&amp;gt;ppmpen&amp;lt;/b&amp;gt;: Using &amp;lt;b&amp;gt;MacPorts&amp;lt;/b&amp;gt;, run &amp;lt;pre&amp;gt;sudo port install libnetpbm&amp;lt;/pre&amp;gt;&lt;br /&gt;
# (Optionally) &amp;lt;b&amp;gt;Open vplots using double click&amp;lt;/b&amp;gt;: [[machacks|Instructions]].&lt;br /&gt;
# Install python with libraries including jupyter and  ipython.  I recommend the Anaconda distribution.  which is available at https://www.anaconda.com/download&lt;br /&gt;
# (Optionally) &amp;lt;b&amp;gt;SWIG&amp;lt;/b&amp;gt; is required for some of the options of the Python api (used if you are coding in Python).  run  &amp;lt;pre&amp;gt;conda install swig&amp;lt;/pre&amp;gt; . I had to run&amp;lt;pre&amp;gt;cp `which siwg` /usr/local/bin&amp;lt;/pre&amp;gt; to get ./configure to find swig. &lt;br /&gt;
#Proceed with configuration and installation following the normal procedure.  You may need to use Apple&#039;s compiler (clang) instead of gcc.  Use one of these commands in the $RSFSRC directory &amp;lt;pre&amp;gt;./configure CC=clang CXX=clang++&amp;lt;/pre&amp;gt; or &amp;lt;pre&amp;gt;./configure CC=clang CXX=clang++ API=python --prefix=`pwd`&amp;lt;/pre&amp;gt;&lt;br /&gt;
#build the system with: &amp;lt;pre&amp;gt;make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
#After installing a new version of python you must run: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./configure &lt;br /&gt;
make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In summer of 2018 on a new MacBook Pro running Mac OS 10.14.1 (Mojave) I encountered en abort trap: 6 error message when running sfpen from command line.  I do not &lt;br /&gt;
have a problem running sfpen inside scons. I changed to use xtpen from the command line.  I continue to use this work around.&lt;br /&gt;
 &lt;br /&gt;
command line.&lt;br /&gt;
&lt;br /&gt;
==OpenSolaris==&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;tt&amp;gt;pkg&amp;lt;/tt&amp;gt; to install missing components such as X11 headers.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
pfexec pkg install SUNWxorg-headers&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==MS Windows==&lt;br /&gt;
Due to its size, this topic has been assigned [[Windows | its own Wiki page]].&lt;br /&gt;
&lt;br /&gt;
==How to adapt Madagascar to a new platform==&lt;br /&gt;
The most laborious part of adapting madagascar to a new platform is finding the proper dependency names. This usually proceeds as follows: dependency X fails with a &amp;quot;missing file&amp;quot; error either as a header file in &amp;lt;tt&amp;gt;config.log&amp;lt;/tt&amp;gt;, or a missing library during the build step. Possible package names are found through an internet search for the missing file name and the distribution name or by using specific [http://rpm.pbone.net/ rpm search tools]. Packages are installed and the configure (and, if necessary) build processes are repeated until the error goes away.&lt;br /&gt;
&lt;br /&gt;
=Multi-user installs=&lt;br /&gt;
Some organizations may find it desirable to deny write access of some users to all RSFSRC/RSFROOT except their own user directory. Fortunately, this can be easily done by placing the restricted user dirs outside RSFSRC/RSFROOT, i.e. in their home dirs, say /home/joe/rsfsrc. In order to move a user&#039;s directory out of RSFSRC, you must:&lt;br /&gt;
* &amp;quot;tell&amp;quot; the SConstruct in the user&#039;s dir where to find RSFSRC so that when the user builds in his directory, it can import &amp;lt;tt&amp;gt;configure.py&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;config.py&amp;lt;/tt&amp;gt; You do that by setting the environment variable RSFSRC to the absolute path of the Madagascar source root, and by making sure that lines 2 and 3 in the users&#039; SConstruct files are&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
srcroot = os.environ.get(&#039;RSFSRC&#039;, &#039;../..&#039;)&lt;br /&gt;
sys.path.append(srcroot)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
and then replace &amp;lt;tt&amp;gt;../..&amp;lt;/tt&amp;gt; throughout the SConstruct using &amp;lt;tt&amp;gt;os.path.join&amp;lt;/tt&amp;gt; and the &amp;lt;tt&amp;gt;srcroot&amp;lt;/tt&amp;gt; variable.&lt;br /&gt;
* &amp;quot;tell&amp;quot; the build scripts about the user&#039;s dir, so that it is included in the builds launched from RSFSRC. You do that with a symbolic link:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ln -s /home/joe/rsfsrc $RSFSRC/user/joe&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&#039;&#039;When the link exists&#039;&#039;, those of Joe&#039;s programs that are mentioned in the &amp;quot;prog&amp;quot; string in SConstruct get included in the distribution, complete with self-doc. If Joe is just learning how to code and his stuff breaks the build, just remove the symbolic link. Even if build+installs are done after the link is removed, his stable programs and self-doc will continue to remain installed system-wide as long as the admin does not type &amp;lt;tt&amp;gt;scons -c install&amp;lt;/tt&amp;gt; (not likely).&lt;br /&gt;
* point the user&#039;s RSFDOC environment variable to a location where the user has write access&lt;br /&gt;
* edit the users&#039; SConstruct so that it uses the RSF library and headers already installed in $RSFROOT/lib and $RSFROOT/include , instead of building again the whole &amp;lt;tt&amp;gt;librsf&amp;lt;/tt&amp;gt; with user-specific flags in &amp;lt;tt&amp;gt;RSFSRC/filt/lib/&amp;lt;/tt&amp;gt;. To do that, replace in the user&#039;s SConstruct the env.Prepend statement with&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
rsfroot = os.environ.get(&#039;RSFROOT&#039;,&#039;/usr/local/rsf&#039;)&lt;br /&gt;
&lt;br /&gt;
env.Prepend(CPPPATH=[os.path.join(rsfroot,&#039;include&#039;)],&lt;br /&gt;
            LIBPATH=[os.path.join(rsfroot,&#039;lib&#039;)],&lt;br /&gt;
            LIBS=[&#039;rsf&#039;])&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* If the link from RSFSRC to Joe&#039;s directory was not made, add Joe&#039;s directory to his own path so that he can execute his own binaries.&lt;br /&gt;
&lt;br /&gt;
To understand how $DATAPATH disk space issues may become an issue in a multi-user environment, refer to the [[Advanced_Installation#Disk_space|Disk Space subsection]] at the beginning of this document.&lt;br /&gt;
&lt;br /&gt;
=Keeping your stuff separate=&lt;br /&gt;
A user may add his own programs and recipes to the Madagascar system. He may also create his own computational examples, data, and locked figures for testing. All of these components can be placed in their default locations, but it is not necessary to make them public. To keep these items private simply do not add them to the repository.&lt;br /&gt;
&lt;br /&gt;
However, it might be desirable to keep these components in separate places. For example, if you keep your private programs in RSFSRC/user you will have to remember to make a copy somewhere else if you ever want to delete the Madagascar installation to perform a fresh install. Yup, I deleted all my programs that way once. Good thing I had a back up! Fortunately, it is easy to keep each of these components in a separate place if desired.&lt;br /&gt;
&lt;br /&gt;
==Keeping programs separate==&lt;br /&gt;
User programs are ordinarily kept in a subdirectory of RSFSRC/user.  However, if you want to keep your programs separate all you have to do is put your subdirectory somewhere else and make a link to it in RSFSRC/user:&lt;br /&gt;
&amp;lt;bash&amp;gt;&lt;br /&gt;
ln -s path_to_my_programs $RSFSRC/user/my_programs&lt;br /&gt;
&amp;lt;/bash&amp;gt;&lt;br /&gt;
The additional instructions above for &amp;quot;multi-user installs&amp;quot; are for the case where the other users do not have write access to RSFSRC.  However, if you have full write access and only want to keep the programs in a separate place the link is the only thing you need.&lt;br /&gt;
&lt;br /&gt;
===Problems when symbolic linking and using SVN=== &lt;br /&gt;
If you decide to use a symbolic link e.g. &amp;quot;ln -s ...&amp;quot; as above, you will have difficulties checking in your code into the SVN repository.  SVN typically does not follow the symbolic link but will only the save the symbolic link.   &lt;br /&gt;
&lt;br /&gt;
See this answer from Stackoverflow (http://stackoverflow.com/questions/24850844/follow-symlinks-in-svn)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If I understand your problem, you have:&lt;br /&gt;
&lt;br /&gt;
project1/&lt;br /&gt;
project1/link1 -&amp;gt; ../../some/where/else&lt;br /&gt;
&lt;br /&gt;
If you do a simple svn add link1 it adds a symlink entry to the subversion repository, but what you&#039;re trying to accomplish is getting the stuff under somewhere else into the tree.&lt;br /&gt;
&lt;br /&gt;
If this is the case, then you&#039;re fighting in the wrong direction, you should make the real files and directories under link1, and make the target locations symlinks into the link1 directory. That would be a simple solution to the problem.&lt;br /&gt;
&lt;br /&gt;
Another solution would be to make the location ../../some/where/else an svn location in it&#039;s own right, and make link1 an externals definition to that location. When you commit in the main directory, the externals would be committed at the same time which would achieve storing the information; however to ensure that the other location was kept in sync, you would have to make sure to update it to the same version as the stored data.&lt;br /&gt;
&lt;br /&gt;
In my case, on my desktop, I have a settings directory:&lt;br /&gt;
&lt;br /&gt;
$HOME/settings&lt;br /&gt;
&lt;br /&gt;
This is a checked out copy of a directory containing .bashrc, .profile, .vimrc, .vim, etc. files and folders from an svn repo. All my profile files and directories were symlinks into this folder, so for example .profile -&amp;gt; settings/.profile, etc. When I make changes, they are reflected in the svn tree, which I can commit back to in order to ensure that I don&#039;t lose my config settings when I go to another system.&lt;br /&gt;
&lt;br /&gt;
If you really want svn to follow symlinks as hardlinks (You can&#039;t make directory hardlinks because it would be a bad thing™), then you&#039;ll have to hack the svn client source so that it did what you wanted; but this would be a maintenance nightmare.&lt;br /&gt;
&lt;br /&gt;
You could get away with making the symlink into a bind mount point directed at the target, but that has it&#039;s own issues - you would need to be root to accomplish this, and it ends up leaving funny entries in your /proc/mounts to accomplish this:&lt;br /&gt;
&lt;br /&gt;
mount --bind /absolute/path/to/some/where/else project1/link1&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Keeping recipes separate==&lt;br /&gt;
Computational recipes written in Python and imported by the SConstruct file of a workflow are normally stored in RSFSRC/book/Recipes.  The install process copies these recipes to a directory like $RSFROOT/lib/python2.5/site-packages/rsf/recipes and adds this directory to your PYTHONPATH so that Python can find them.&lt;br /&gt;
&lt;br /&gt;
However, you can put you own recipes anywhere you want.  You only have to add that place to your PYTHONPATH like this (bash):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
export PYTHONPATH=${PYTHONPATH}:path_to_my_recipes&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Or like this (csh):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
setenv PYTHONPATH ${PYTHONPATH}:path_to_my_recipes&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Keeping examples separate==&lt;br /&gt;
Madagascar&#039;s public collection of example workflows are stored in RSFSRC/book, but you can put your private workflows anywhere you want.  No special instructions are required.&lt;br /&gt;
&lt;br /&gt;
However, Madagascar assumes that the workflows are organized into a three-level book/chapter/section directory hierarchy when it creates a directory tree for the data and locked figures associated with your workflow. It is not required, but it might be easier to find the data and locked figures if you put your workflows in a three-level directory tree something like this: path_to_my_book/chapter/section/SConstruct.&lt;br /&gt;
&lt;br /&gt;
==Keeping data separate==&lt;br /&gt;
The location of the data portion of your *.rsf files is controlled by your DATAPATH environment variable.  However, you may want to keep the data for your private workflows in a different place, or several different places, than the data created by the public examples in RSFSRC/book.  The way to do that is to temporarily change the DATAPATH variable in the SConstruct &#039;&#039;before&#039;&#039; importing rsf.proj like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import os&lt;br /&gt;
os.environ[&#039;DATAPATH&#039;] = &#039;path_to_my_private_data&#039;&lt;br /&gt;
&lt;br /&gt;
from rsf.proj import *&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Keeping locked figures separate==&lt;br /&gt;
The command &amp;quot;scons lock&amp;quot; in the directory of a workflow will store a &amp;quot;locked&amp;quot; copy of your figures for regression testing.  Normally these figures are stored in the location pointed to by your RSFFIGS variable, and that is where the figures from the figures repository should be stored for testing in RSFSRC/book.&lt;br /&gt;
&lt;br /&gt;
However, you may want to keep your private figures in a different place.  The way to do that is to temporarily change the RSFFIGS variable in the SConstruct &#039;&#039;before&#039;&#039; importing rsf.proj like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import os&lt;br /&gt;
os.environ[&#039;RSFFIGS&#039;] = &#039;path_to_my_private_figures&#039;&lt;br /&gt;
&lt;br /&gt;
from rsf.proj import *&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
If you also create a RSFALTFIGS environment variable pointing to path_to_my_private_figures, then the testing script sffiglist will automatically test your figures against those in RSFALTFIGS when the sffiglist command is executed from a location outside of RSFSRC/book.&lt;br /&gt;
&lt;br /&gt;
=Capturing error and warning messages=&lt;br /&gt;
The messages during configuration are few and their importance quite high, so they should be watched &amp;quot;in person&amp;quot;. A complete log of the configuration process is recorded in RSFSRC/configure.log&lt;br /&gt;
&lt;br /&gt;
Console messages generated during the build step can be captured to a log file and observed at the same time with a command like this (tcsh):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
nice +10 nohup /usr/bin/time -p scons -k |&amp;amp; tee log_build.asc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The log file can be of course named otherwise than &amp;lt;tt&amp;gt;log_build.asc&amp;lt;/tt&amp;gt;. The file can be later grepped for error and warnings with commands such as:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
grep -c error log_build.asc&lt;br /&gt;
grep error log_build.asc | awk &#039;/error.c/ {next}; /error.h/ {next}; /error.o/ {next}; {print}&#039;&lt;br /&gt;
grep -c warning log_build.asc&lt;br /&gt;
grep warning log_build.asc | awk &#039;/imaginary constants are a GCC extension/ {next}; {print}&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Advanced troubleshooting=&lt;br /&gt;
* If you removed one of your programs or changed its name, and &amp;lt;tt&amp;gt;scons install&amp;lt;/tt&amp;gt; fails with &amp;quot;Source &amp;lt;tt&amp;gt;oldprogname&amp;lt;/tt&amp;gt; not found, needed by target install&amp;quot;, and you cleaned everything there was to clean but still get this message, remove &amp;lt;tt&amp;gt;RSFSRC/.sconsign*&amp;lt;/tt&amp;gt;&lt;br /&gt;
* If during &amp;lt;tt&amp;gt;scons install&amp;lt;/tt&amp;gt; you get a &amp;lt;tt&amp;gt;DBAccessError : (13, &#039;Permission denied&#039;)&amp;lt;/tt&amp;gt; in some reproducible papers, check permissions in your &amp;lt;tt&amp;gt;$DATAPATH&amp;lt;/tt&amp;gt; directory. This is where SCons places database &amp;quot;.sconsign&amp;quot; files for its dependencies (according to the rules in &amp;lt;tt&amp;gt;rsf.proj&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;rsf.tex&amp;lt;/tt&amp;gt;).&lt;br /&gt;
* If &amp;lt;tt&amp;gt;scons&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;scons install&amp;lt;/tt&amp;gt; fail due to an a bug introduced in a tool you are certain you will not use, a quick workaround for the problem is already built into scons: the &amp;lt;tt&amp;gt;-k&amp;lt;/tt&amp;gt; option, which means &amp;quot;keep going&amp;quot;. Thus, if you use &amp;lt;tt&amp;gt;scons -k&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;scons -k install&amp;lt;/tt&amp;gt;, SCons will not be able to build the failed component, or anything that depends on it, but it will keep going and make everything else that it can.&lt;br /&gt;
&lt;br /&gt;
=Further support=&lt;br /&gt;
Subscribe to the [https://lists.sourceforge.net/lists/listinfo/rsf-user rsf-user mailing list].&lt;/div&gt;</summary>
		<author><name>Karl</name></author>
	</entry>
	<entry>
		<id>https://ahay.org/index.php?title=Guide_to_madagascar_API&amp;diff=3753</id>
		<title>Guide to madagascar API</title>
		<link rel="alternate" type="text/html" href="https://ahay.org/index.php?title=Guide_to_madagascar_API&amp;diff=3753"/>
		<updated>2018-12-14T21:33:12Z</updated>

		<summary type="html">&lt;p&gt;Karl: /* Python interface */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;center&amp;gt;&amp;lt;font size=&amp;quot;-1&amp;quot;&amp;gt;&#039;&#039;This page was created from the LaTeX source in [http://sourceforge.net/p/rsf/code/HEAD/tree/trunk/book/rsf/rsf/api.tex book/rsf/rsf/api.tex] using [[latex2wiki]]&#039;&#039;&amp;lt;/font&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Fotolia_555071_XS.jpg|right|]]&lt;br /&gt;
&lt;br /&gt;
This guide explains the RSF programming interface.  See the &#039;&#039;&#039;[[Library_Reference | Library Reference]]&#039;&#039;&#039; for more information on how to use the particular APIs.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
To work with RSF files in your own programs, you may need to use an&lt;br /&gt;
appropriate programming interface. We will demonstrate the interface in&lt;br /&gt;
different languages using a simple example. The example is a clipping program.&lt;br /&gt;
It reads and writes RSF files and accesses parameters both from the input file&lt;br /&gt;
and the command line. The input is processed trace by trace. This is not&lt;br /&gt;
necessarily the most efficient approach&amp;lt;ref&amp;gt;Compare with the [http://rsf.svn.sourceforge.net/viewvc/rsf/trunk/filt/proc/Mclip.c?view=markup library clip program].&amp;lt;/ref&amp;gt; but it suffices for a simple demonstration.&lt;br /&gt;
&lt;br /&gt;
==Installation== &lt;br /&gt;
Only the C interface is installed by default. To install other APIs, use &amp;lt;tt&amp;gt;API=&amp;lt;/tt&amp;gt;&lt;br /&gt;
parameter in the RSF configuration. For example, to install C++ and&lt;br /&gt;
Fortran-90 API bindings in addition to the basic package, run&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./configure API=c++,fortran-90&lt;br /&gt;
scons install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The configuration parameters are stored in &amp;lt;tt&amp;gt;&amp;amp;#36;RSFROOT/share/madagascar/etc/config.py&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==C interface==&lt;br /&gt;
&lt;br /&gt;
The C clip function is listed below.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
/* Clip the data. */&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;rsf.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char* argv[])&lt;br /&gt;
{&lt;br /&gt;
    int n1, n2, i1, i2;&lt;br /&gt;
    float clip, *trace=NULL;&lt;br /&gt;
    sf_file in=NULL, out=NULL; /* Input and output files */&lt;br /&gt;
&lt;br /&gt;
    /* Initialize RSF */&lt;br /&gt;
    sf_init(argc,argv);&lt;br /&gt;
    /* standard input */&lt;br /&gt;
    in = sf_input(&amp;quot;in&amp;quot;);&lt;br /&gt;
    /* standard output */&lt;br /&gt;
    out = sf_output(&amp;quot;out&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
    /* check that the input is float */&lt;br /&gt;
    if (SF_FLOAT != sf_gettype(in)) &lt;br /&gt;
	sf_error(&amp;quot;Need float input&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
    /* n1 is the fastest dimension (trace length) */&lt;br /&gt;
    if (!sf_histint(in,&amp;quot;n1&amp;quot;,&amp;amp;n1)) &lt;br /&gt;
	sf_error(&amp;quot;No n1= in input&amp;quot;);&lt;br /&gt;
    /* leftsize gets n2*n3*n4*... (the number of traces) */&lt;br /&gt;
    n2 = sf_leftsize(in,1);&lt;br /&gt;
&lt;br /&gt;
    /* parameter from the command line (i.e. clip=1.5 ) */&lt;br /&gt;
    if (!sf_getfloat(&amp;quot;clip&amp;quot;,&amp;amp;clip)) sf_error(&amp;quot;Need clip=&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
    /* allocate floating point array */&lt;br /&gt;
    trace = sf_floatalloc (n1);&lt;br /&gt;
&lt;br /&gt;
    /* loop over traces */&lt;br /&gt;
    for (i2=0; i2 &amp;lt; n2; i2++) {&lt;br /&gt;
&lt;br /&gt;
	/*read a trace */&lt;br /&gt;
	sf_floatread(trace,n1,in);&lt;br /&gt;
&lt;br /&gt;
	/* loop over samples */&lt;br /&gt;
	for (i1=0; i1 &amp;lt; n1; i1++) {&lt;br /&gt;
	    if      (trace[i1] &amp;gt;  clip) trace[i1]= clip;&lt;br /&gt;
	    else if (trace[i1] &amp;lt; -clip) trace[i1]=-clip;&lt;br /&gt;
	}&lt;br /&gt;
    &lt;br /&gt;
	/* write a trace */&lt;br /&gt;
	sf_floatwrite(trace,n1,out);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    free(trace);&lt;br /&gt;
    sf_close();&lt;br /&gt;
    exit(0);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let us examine it in detail. &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;rsf.h&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The include preprocessing directive is required to access the RSF interface. &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
    sf_file in=NULL, out=NULL; /* Input and output files */&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
RSF data files are defined with an abstract &amp;lt;tt&amp;gt;sf_file&amp;lt;/tt&amp;gt; data type. An&lt;br /&gt;
abstract data type means that the contents of it are not publicly declared,&lt;br /&gt;
and all operations on &amp;lt;tt&amp;gt;sf_file&amp;lt;/tt&amp;gt; objects should be performed with&lt;br /&gt;
library functions. This is analogous to &amp;lt;tt&amp;gt;FILE *&amp;lt;/tt&amp;gt; data type used in&lt;br /&gt;
&amp;lt;tt&amp;gt;stdio.h&amp;lt;/tt&amp;gt; and as close as C gets to an object-oriented style of&lt;br /&gt;
programming (Roberts, 1998&amp;lt;ref&amp;gt;Roberts, E. S.,  1998, Programming abstractions in C: Addison-Wesley.&amp;lt;/ref&amp;gt;).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
    /* Initialize RSF */&lt;br /&gt;
    sf_init(argc,argv);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before using any of the other functions, you must call&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_init&amp;lt;/tt&amp;gt;. This function parses the command line and&lt;br /&gt;
initializes an internally stored table of command-line parameters.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
    /* standard input */&lt;br /&gt;
    in = sf_input(&amp;quot;in&amp;quot;);&lt;br /&gt;
    /* standard output */&lt;br /&gt;
    out = sf_output(&amp;quot;out&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The input and output RSF file objects are created with &amp;lt;tt&amp;gt;sf_input&amp;lt;/tt&amp;gt; and&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_output&amp;lt;/tt&amp;gt; constructor functions. Both these functions take a string&lt;br /&gt;
argument. The string may refer to a file name or a file tag. For example, if&lt;br /&gt;
the command line contains &amp;lt;tt&amp;gt;vel=velocity.rsf&amp;lt;/tt&amp;gt;, then both&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_input(&amp;quot;velocity.rsf&amp;quot;)&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;sf_input(&amp;quot;vel&amp;quot;)&amp;lt;/tt&amp;gt; are&lt;br /&gt;
acceptable. Two tags are special: &amp;lt;tt&amp;gt;&amp;quot;in&amp;quot;&amp;lt;/tt&amp;gt; refers to the file in the&lt;br /&gt;
standard input and &amp;lt;tt&amp;gt;&amp;quot;out&amp;quot;&amp;lt;/tt&amp;gt; refers to the file in the standard&lt;br /&gt;
output. &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
    /* check that the input is float */&lt;br /&gt;
    if (SF_FLOAT != sf_gettype(in)) &lt;br /&gt;
	sf_error(&amp;quot;Need float input&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
RSF files can store data of different types (character, integer,&lt;br /&gt;
floating point, complex). We extract the data type of the input file&lt;br /&gt;
with the library &amp;lt;tt&amp;gt;sf_gettype&amp;lt;/tt&amp;gt; function and check if it&lt;br /&gt;
represents floating point numbers. If not, the program is aborted with&lt;br /&gt;
an error message, using the &amp;lt;tt&amp;gt;sf_error&amp;lt;/tt&amp;gt; function.  It is&lt;br /&gt;
generally a good idea to check the input for user errors and, if they&lt;br /&gt;
cannot be corrected, to take a safe exit.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
    /* n1 is the fastest dimension (trace length) */&lt;br /&gt;
    if (!sf_histint(in,&amp;quot;n1&amp;quot;,&amp;amp;n1)) &lt;br /&gt;
	sf_error(&amp;quot;No n1= in input&amp;quot;);&lt;br /&gt;
    /* leftsize gets n2*n3*n4*... (the number of traces) */&lt;br /&gt;
    n2 = sf_leftsize(in,1);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Conceptually, the RSF data model is a multidimensional hypercube. By&lt;br /&gt;
convention, the dimensions of the cube are stored in &amp;lt;tt&amp;gt;n1=&amp;lt;/tt&amp;gt;,&lt;br /&gt;
&amp;lt;tt&amp;gt;n2=&amp;lt;/tt&amp;gt;, etc. parameters. The &amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt; parameter refers to the&lt;br /&gt;
fastest axis. If the input dataset is a collection of traces,&lt;br /&gt;
&amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt; refers to the trace length. We extract it using the&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_histint&amp;lt;/tt&amp;gt; function (integer parameter from history) and&lt;br /&gt;
abort if no value for &amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt; is found. We could proceed in a&lt;br /&gt;
similar fashion, extracting &amp;lt;tt&amp;gt;n2&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;n3&amp;lt;/tt&amp;gt;, etc. If we are&lt;br /&gt;
interested in the total number of traces, like in the clip example, a&lt;br /&gt;
shortcut is to use the &amp;lt;tt&amp;gt;sf_leftsize&amp;lt;/tt&amp;gt; function. Calling&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_leftsize(in,0)&amp;lt;/tt&amp;gt; returns the total number of elements in&lt;br /&gt;
the hypercube (the product of &amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;n2&amp;lt;/tt&amp;gt;, etc.), calling&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_leftsize(in,1)&amp;lt;/tt&amp;gt; returns the number of traces (the product&lt;br /&gt;
of &amp;lt;tt&amp;gt;n2&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;n3&amp;lt;/tt&amp;gt;, etc.), calling&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_leftsize(in,2)&amp;lt;/tt&amp;gt; returns the product of &amp;lt;tt&amp;gt;n3&amp;lt;/tt&amp;gt;,&lt;br /&gt;
&amp;lt;tt&amp;gt;n4&amp;lt;/tt&amp;gt;, etc. By calling &amp;lt;tt&amp;gt;sf_leftsize&amp;lt;/tt&amp;gt;, we avoid the need&lt;br /&gt;
to extract additional parameters for the hypercube dimensions that we&lt;br /&gt;
are not interested in.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
    /* parameter from the command line (i.e. clip=1.5 ) */&lt;br /&gt;
    if (!sf_getfloat(&amp;quot;clip&amp;quot;,&amp;amp;clip)) sf_error(&amp;quot;Need clip=&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
The clip parameter is read from the command line, where it can be&lt;br /&gt;
specified, for example, as &amp;lt;tt&amp;gt;clip=10&amp;lt;/tt&amp;gt;. The parameter has the&lt;br /&gt;
&amp;lt;tt&amp;gt;float&amp;lt;/tt&amp;gt; type, therefore we read it with the&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_getfloat&amp;lt;/tt&amp;gt; function. If no &amp;lt;tt&amp;gt;clip=&amp;lt;/tt&amp;gt; parameter is&lt;br /&gt;
found among the command line arguments, the program is aborted with an&lt;br /&gt;
error message using the &amp;lt;tt&amp;gt;sf_error&amp;lt;/tt&amp;gt; function.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
    /* allocate floating point array */&lt;br /&gt;
    trace = sf_floatalloc (n1);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Next, we allocate an array of floating-point numbers to store a trace&lt;br /&gt;
with the library &amp;lt;tt&amp;gt;sf_floatalloc&amp;lt;/tt&amp;gt; function. Unlike the standard&lt;br /&gt;
&amp;lt;tt&amp;gt;malloc&amp;lt;/tt&amp;gt; the RSF allocation function checks for errors and&lt;br /&gt;
either terminates the program or returns a valid pointer.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
    /* loop over traces */&lt;br /&gt;
    for (i2=0; i2 &amp;lt; n2; i2++) {&lt;br /&gt;
&lt;br /&gt;
	/*read a trace */&lt;br /&gt;
	sf_floatread(trace,n1,in);&lt;br /&gt;
&lt;br /&gt;
	/* loop over samples */&lt;br /&gt;
	for (i1=0; i1 &amp;lt; n1; i1++) {&lt;br /&gt;
	    if      (trace[i1] &amp;gt;  clip) trace[i1]= clip;&lt;br /&gt;
	    else if (trace[i1] &amp;lt; -clip) trace[i1]=-clip;&lt;br /&gt;
	}&lt;br /&gt;
    &lt;br /&gt;
	/* write a trace */&lt;br /&gt;
	sf_floatwrite(trace,n1,out);&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
The rest of the program is straightforward. We loop over all available&lt;br /&gt;
traces, read each trace, clip it and right the output out. The syntax&lt;br /&gt;
of &amp;lt;tt&amp;gt;sf_floatread&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;sf_floatwrite&amp;lt;/tt&amp;gt; functions is&lt;br /&gt;
similar to the syntax of the C standard &amp;lt;tt&amp;gt;fread&amp;lt;/tt&amp;gt; and&lt;br /&gt;
&amp;lt;tt&amp;gt;fwrite&amp;lt;/tt&amp;gt; function except that the type of the element is&lt;br /&gt;
specified explicitly in the function name and that the input and&lt;br /&gt;
output files have the RSF type &amp;lt;tt&amp;gt;sf_file&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
sf_close();&lt;br /&gt;
exit(0)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We explicitly close the input file to avoid leaving a stale temporary file in &amp;lt;tt&amp;gt;$DATAPATH&amp;lt;/tt&amp;gt; if the program is called in a pipe sequence. Then, we close the program by sending the shell the Unix code that tells it no errors were encountered. &lt;br /&gt;
&lt;br /&gt;
Note that this is an introductory example, optimized for clarity, not execution speed. For advanced techniques, see [[Madagascar Code Patterns]].&lt;br /&gt;
&lt;br /&gt;
===Compiling===&lt;br /&gt;
To compile the &amp;lt;tt&amp;gt;clip&amp;lt;/tt&amp;gt; program, run&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cc clip.c -I&amp;amp;#36;RSFROOT/include -L&amp;amp;#36;RSFROOT/lib -lrsf -lm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Change &amp;lt;tt&amp;gt;cc&amp;lt;/tt&amp;gt; to the C compiler appropriate for your system and include&lt;br /&gt;
additional compiler flags if necessary. The flags that RSF typically uses are&lt;br /&gt;
in &amp;lt;tt&amp;gt;&amp;amp;#36;RSFROOT/share/madagascar/etc/config.py&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==C++ interface==&lt;br /&gt;
&lt;br /&gt;
The C++ clip function is listed below.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
/* Clip the data. */&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;valarray&amp;gt;&lt;br /&gt;
#include &amp;lt;rsf.hh&amp;gt;&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char* argv[])&lt;br /&gt;
{&lt;br /&gt;
    sf_init(argc,argv); // Initialize RSF&lt;br /&gt;
    &lt;br /&gt;
    iRSF par(0), in; // input parameter, file&lt;br /&gt;
    oRSF out;        // output file&lt;br /&gt;
&lt;br /&gt;
    int n1, n2;      // trace length, number of traces&lt;br /&gt;
    float clip;&lt;br /&gt;
    &lt;br /&gt;
    in.get(&amp;quot;n1&amp;quot;,n1);&lt;br /&gt;
    n2=in.size(1);&lt;br /&gt;
&lt;br /&gt;
    par.get(&amp;quot;clip&amp;quot;,clip); // parameter from the command line&lt;br /&gt;
&lt;br /&gt;
    std::valarray&amp;lt;float&amp;gt; trace(n1);&lt;br /&gt;
&lt;br /&gt;
    for (int i2=0; i2 &amp;lt; n2; i2++) { // loop over traces&lt;br /&gt;
	in &amp;gt;&amp;gt; trace; // read a trace&lt;br /&gt;
&lt;br /&gt;
	for (int i1=0; i1 &amp;lt; n1; i1++) { // loop over samples&lt;br /&gt;
	    if      (trace[i1] &amp;gt;  clip) trace[i1]=clip;&lt;br /&gt;
	    else if (trace[i1] &amp;lt; -clip) trace[i1]=-clip;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	out &amp;lt;&amp;lt; trace; // write a trace&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    exit(0);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let us examine it line by line. &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;rsf.hh&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Including &amp;quot;&amp;lt;tt&amp;gt;rsf.hh&amp;lt;/tt&amp;gt;&amp;quot; is required for accessing the RSF C++&lt;br /&gt;
interface.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    sf_init(argc,argv); // Initialize RSF&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A call to &amp;lt;tt&amp;gt;sf_init&amp;lt;/tt&amp;gt; is required to initialize the internally stored&lt;br /&gt;
table of command-line arguments.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    iRSF par(0), in; // input parameter, file&lt;br /&gt;
    oRSF out;        // output file&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Two classes: &amp;lt;tt&amp;gt;iRSF&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;oRSF&amp;lt;/tt&amp;gt; are used to define input and&lt;br /&gt;
output files. For simplicity, the command-line parameters are also handled &lt;br /&gt;
as an &amp;lt;tt&amp;gt;iRSF&amp;lt;/tt&amp;gt; object, initialized with zero.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    in.get(&amp;quot;n1&amp;quot;,n1);&lt;br /&gt;
    n2=in.size(1);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, we read the data dimensions from the input RSF file object called&lt;br /&gt;
&amp;lt;tt&amp;gt;in&amp;lt;/tt&amp;gt;: the trace length is a parameter called &amp;quot;&amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt;&amp;quot; and the&lt;br /&gt;
number of traces is the size of &amp;lt;tt&amp;gt;in&amp;lt;/tt&amp;gt; remaining after excluding the&lt;br /&gt;
first dimension. It is extracted with the &amp;lt;tt&amp;gt;size&amp;lt;/tt&amp;gt; method.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    par.get(&amp;quot;clip&amp;quot;,clip); // parameter from the command line&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
The clip parameter should be specified on the command line, for&lt;br /&gt;
example, as &amp;lt;tt&amp;gt;clip=10&amp;lt;/tt&amp;gt;. It is extracted with the &amp;lt;tt&amp;gt;get&amp;lt;/tt&amp;gt;&lt;br /&gt;
method of &amp;lt;tt&amp;gt;iRSF&amp;lt;/tt&amp;gt; class from the &amp;lt;tt&amp;gt;par&amp;lt;/tt&amp;gt; object.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    std::valarray&amp;lt;float&amp;gt; trace(n1);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The trace object has the single-precision floating-point type and is a&lt;br /&gt;
1-D array of length &amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt;. It is declared and allocated using&lt;br /&gt;
the &amp;lt;tt&amp;gt;valarray&amp;lt;/tt&amp;gt; template class from the standard C++ library.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    for (int i2=0; i2 &amp;lt; n2; i2++) { // loop over traces&lt;br /&gt;
	in &amp;gt;&amp;gt; trace; // read a trace&lt;br /&gt;
&lt;br /&gt;
	for (int i1=0; i1 &amp;lt; n1; i1++) { // loop over samples&lt;br /&gt;
	    if      (trace[i1] &amp;gt;  clip) trace[i1]=clip;&lt;br /&gt;
	    else if (trace[i1] &amp;lt; -clip) trace[i1]=-clip;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	out &amp;lt;&amp;lt; trace; // write a trace&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, we loop through the traces, read each trace from &amp;lt;tt&amp;gt;in&amp;lt;/tt&amp;gt;, clip it&lt;br /&gt;
and write the output to &amp;lt;tt&amp;gt;out&amp;lt;/tt&amp;gt;.&lt;br /&gt;
===Compiling===&lt;br /&gt;
To compile the C++ program, run&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
c++ clip.cc -I&amp;amp;#36;RSFROOT/include -L&amp;amp;#36;RSFROOT/lib -lrsf++ -lrsf -lm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Change &amp;lt;tt&amp;gt;c++&amp;lt;/tt&amp;gt; to the C++ compiler appropriate for your system and&lt;br /&gt;
include additional compiler flags if necessary. The flags that RSF typically&lt;br /&gt;
uses are in &amp;lt;tt&amp;gt;&amp;amp;#36;RSFROOT/share/madagascar/etc/config.py&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Fortran-77 interface==&lt;br /&gt;
&lt;br /&gt;
The Fortran-77 clip function is listed below.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
	program Clipit&lt;br /&gt;
	implicit none&lt;br /&gt;
	integer n1, n2, i1, i2, in, out&lt;br /&gt;
	integer sf_input, sf_output, sf_leftsize, sf_gettype&lt;br /&gt;
	logical sf_getfloat, sf_histint&lt;br /&gt;
	real clip, trace(1000)&lt;br /&gt;
&lt;br /&gt;
	call sf_init()&lt;br /&gt;
	in = sf_input(&amp;quot;in&amp;quot;)&lt;br /&gt;
	out = sf_output(&amp;quot;out&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
	if (3 .ne. sf_gettype(in)) &lt;br /&gt;
     &amp;amp;  call sf_error(&amp;quot;Need float input&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
	if (.not. sf_histint(in,&amp;quot;n1&amp;quot;,n1)) then&lt;br /&gt;
	   call sf_error(&amp;quot;No n1= in input&amp;quot;)&lt;br /&gt;
	else if (n1 &amp;gt; 1000) then&lt;br /&gt;
	   call sf_error(&amp;quot;n1 is too long&amp;quot;)&lt;br /&gt;
	end if&lt;br /&gt;
	n2 = sf_leftsize(in,1)&lt;br /&gt;
&lt;br /&gt;
	if (.not. sf_getfloat(&amp;quot;clip&amp;quot;,clip)) &lt;br /&gt;
     &amp;amp;  call sf_error(&amp;quot;Need clip=&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
	do 10 i2=1, n2&lt;br /&gt;
	   call sf_floatread(trace,n1,in)&lt;br /&gt;
&lt;br /&gt;
	   do 20 i1=1, n1&lt;br /&gt;
	      if (trace(i1) &amp;gt;  clip) then&lt;br /&gt;
		 trace(i1)=clip&lt;br /&gt;
	      else if (trace(i1) &amp;lt; -clip) then&lt;br /&gt;
		 trace(i1)=-clip&lt;br /&gt;
	      end if&lt;br /&gt;
 20	   continue&lt;br /&gt;
&lt;br /&gt;
	   call sf_floatwrite(trace,n1,out)&lt;br /&gt;
 10	continue&lt;br /&gt;
&lt;br /&gt;
	stop&lt;br /&gt;
	end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let us examine it in detail.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
	call sf_init()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The program starts with a call to &amp;lt;tt&amp;gt;sf_init&amp;lt;/tt&amp;gt;, which initializes the&lt;br /&gt;
command-line interface.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
	in = sf_input(&amp;quot;in&amp;quot;)&lt;br /&gt;
	out = sf_output(&amp;quot;out&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The input and output files are created with calls to&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_input&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;sf_output&amp;lt;/tt&amp;gt;. Because of the absence of&lt;br /&gt;
derived types in Fortran-77, we use simple integer pointers to&lt;br /&gt;
represent RSF files. Both &amp;lt;tt&amp;gt;sf_input&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;sf_output&amp;lt;/tt&amp;gt;&lt;br /&gt;
accept a character string, which may refer to a file name or a file&lt;br /&gt;
tag. For example, if the command line contains&lt;br /&gt;
&amp;lt;tt&amp;gt;vel=velocity.rsf&amp;lt;/tt&amp;gt;, then both&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_input(&amp;quot;velocity.rsf&amp;quot;)&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;sf_input(&amp;quot;vel&amp;quot;)&amp;lt;/tt&amp;gt; are&lt;br /&gt;
acceptable. Two tags are special: &amp;lt;tt&amp;gt;&amp;quot;in&amp;quot;&amp;lt;/tt&amp;gt; refers to the file in&lt;br /&gt;
the standard input and &amp;lt;tt&amp;gt;&amp;quot;out&amp;quot;&amp;lt;/tt&amp;gt; refers to the file in the&lt;br /&gt;
standard output.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
	if (3 .ne. sf_gettype(in)) &lt;br /&gt;
     &amp;amp;  call sf_error(&amp;quot;Need float input&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
RSF files can store data of different types (character, integer,&lt;br /&gt;
floating point, complex). The function &amp;lt;tt&amp;gt;sf_gettype&amp;lt;/tt&amp;gt; checks the&lt;br /&gt;
type of data stored in the RSF file. We make sure that the type&lt;br /&gt;
corresponds to floating-point numbers. If not, the program is aborted&lt;br /&gt;
with an error message, using the &amp;lt;tt&amp;gt;sf_error&amp;lt;/tt&amp;gt; function.  It is&lt;br /&gt;
generally a good idea to check the input for user errors and, if they&lt;br /&gt;
cannot be corrected, to take a safe exit.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
	if (.not. sf_histint(in,&amp;quot;n1&amp;quot;,n1)) then&lt;br /&gt;
	   call sf_error(&amp;quot;No n1= in input&amp;quot;)&lt;br /&gt;
	else if (n1 &amp;gt; 1000) then&lt;br /&gt;
	   call sf_error(&amp;quot;n1 is too long&amp;quot;)&lt;br /&gt;
	end if&lt;br /&gt;
	n2 = sf_leftsize(in,1)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Conceptually, the RSF data model is a multidimensional hypercube. By&lt;br /&gt;
convention, the dimensions of the cube are stored in &amp;lt;tt&amp;gt;n1=&amp;lt;/tt&amp;gt;,&lt;br /&gt;
&amp;lt;tt&amp;gt;n2=&amp;lt;/tt&amp;gt;, etc. parameters. The &amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt; parameter refers to the&lt;br /&gt;
fastest axis. If the input dataset is a collection of traces,&lt;br /&gt;
&amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt; refers to the trace length. We extract it using the&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_histint&amp;lt;/tt&amp;gt; function (integer parameter from history) and&lt;br /&gt;
abort if no value for &amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt; is found. Since Fortran-77 cannot&lt;br /&gt;
easily handle dynamic allocation, we also need to check that&lt;br /&gt;
&amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt; is not larger than the size of the statically allocated&lt;br /&gt;
array. We could proceed in a similar fashion, extracting &amp;lt;tt&amp;gt;n2&amp;lt;/tt&amp;gt;,&lt;br /&gt;
&amp;lt;tt&amp;gt;n3&amp;lt;/tt&amp;gt;, etc. If we are interested in the total number of traces,&lt;br /&gt;
like in the clip example, a shortcut is to use the&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_leftsize&amp;lt;/tt&amp;gt; function.  Calling &amp;lt;tt&amp;gt;sf_leftsize(in,0)&amp;lt;/tt&amp;gt;&lt;br /&gt;
returns the total number of elements in the hypercube (the product of&lt;br /&gt;
&amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;n2&amp;lt;/tt&amp;gt;, etc.), calling &amp;lt;tt&amp;gt;sf_leftsize(in,1)&amp;lt;/tt&amp;gt;&lt;br /&gt;
returns the number of traces (the product of &amp;lt;tt&amp;gt;n2&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;n3&amp;lt;/tt&amp;gt;,&lt;br /&gt;
etc.), calling &amp;lt;tt&amp;gt;sf_leftsize(in,2)&amp;lt;/tt&amp;gt; returns the product of&lt;br /&gt;
&amp;lt;tt&amp;gt;n3&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;n4&amp;lt;/tt&amp;gt;, etc. By calling &amp;lt;tt&amp;gt;sf_leftsize&amp;lt;/tt&amp;gt;, we&lt;br /&gt;
avoid the need to extract additional parameters for the hypercube&lt;br /&gt;
dimensions that we are not interested in.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
	if (.not. sf_getfloat(&amp;quot;clip&amp;quot;,clip)) &lt;br /&gt;
     &amp;amp;  call sf_error(&amp;quot;Need clip=&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The clip parameter is read from the command line, where it can be&lt;br /&gt;
specified, for example, as &amp;lt;tt&amp;gt;clip=10&amp;lt;/tt&amp;gt;. The parameter has the&lt;br /&gt;
&amp;lt;tt&amp;gt;float&amp;lt;/tt&amp;gt; type, therefore we read it with the&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_getfloat&amp;lt;/tt&amp;gt; function. If no &amp;lt;tt&amp;gt;clip=&amp;lt;/tt&amp;gt; parameter is&lt;br /&gt;
found among the command line arguments, the program is aborted with an&lt;br /&gt;
error message using the &amp;lt;tt&amp;gt;sf_error&amp;lt;/tt&amp;gt; function.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
	do 10 i2=1, n2&lt;br /&gt;
	   call sf_floatread(trace,n1,in)&lt;br /&gt;
&lt;br /&gt;
	   do 20 i1=1, n1&lt;br /&gt;
	      if (trace(i1) &amp;gt;  clip) then&lt;br /&gt;
		 trace(i1)=clip&lt;br /&gt;
	      else if (trace(i1) &amp;lt; -clip) then&lt;br /&gt;
		 trace(i1)=-clip&lt;br /&gt;
	      end if&lt;br /&gt;
 20	   continue&lt;br /&gt;
&lt;br /&gt;
	   call sf_floatwrite(trace,n1,out)&lt;br /&gt;
 10	continue&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, we do the actual work: loop over input traces, reading,&lt;br /&gt;
clipping, and writing out each trace.&lt;br /&gt;
===Compiling===&lt;br /&gt;
To compile the Fortran-77 program, run&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
f77 clip.f -L$RSFROOT/lib -lrsff -lrsf -lm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Change &amp;lt;tt&amp;gt;f77&amp;lt;/tt&amp;gt; to the Fortran compiler appropriate for your system and&lt;br /&gt;
include additional compiler flags if necessary. The flags that RSF typically&lt;br /&gt;
uses are in &amp;lt;tt&amp;gt;&amp;amp;#36;RSFROOT/share/madagascar/etc/config.py&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Fortran-90 interface==&lt;br /&gt;
&lt;br /&gt;
The Fortran-90 clip function is listed below.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
program Clipit&lt;br /&gt;
  use rsf&lt;br /&gt;
&lt;br /&gt;
  implicit none&lt;br /&gt;
  type (file)                      :: in, out&lt;br /&gt;
  integer                          :: n1, n2, i1, i2&lt;br /&gt;
  real                             :: clip&lt;br /&gt;
  real, dimension (:), allocatable :: trace&lt;br /&gt;
&lt;br /&gt;
  call sf_init()            ! initialize RSF&lt;br /&gt;
  in = rsf_input()&lt;br /&gt;
  out = rsf_output()&lt;br /&gt;
&lt;br /&gt;
  if (sf_float /= gettype(in)) call sf_error(&amp;quot;Need float type&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
  call from_par(in,&amp;quot;n1&amp;quot;,n1)&lt;br /&gt;
  n2 = filesize(in,1)&lt;br /&gt;
&lt;br /&gt;
  call from_par(&amp;quot;clip&amp;quot;,clip) ! command-line parameter &lt;br /&gt;
&lt;br /&gt;
  allocate (trace (n1))&lt;br /&gt;
&lt;br /&gt;
  do i2=1, n2                ! loop over traces&lt;br /&gt;
     call rsf_read(in,trace)&lt;br /&gt;
     &lt;br /&gt;
     where (trace &amp;gt;  clip) trace =  clip&lt;br /&gt;
     where (trace &amp;lt; -clip) trace = -clip&lt;br /&gt;
&lt;br /&gt;
     call rsf_write(out,trace)&lt;br /&gt;
  end do&lt;br /&gt;
&lt;br /&gt;
  deallocate (trace)&lt;br /&gt;
&lt;br /&gt;
end program Clipit&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let us examine it in detail.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
  use rsf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The program starts with importing the &amp;lt;tt&amp;gt;rsf&amp;lt;/tt&amp;gt; module.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
  call sf_init()            ! initialize RSF&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A call to &amp;lt;tt&amp;gt;sf_init&amp;lt;/tt&amp;gt; is needed to initialize the command-line&lt;br /&gt;
interface.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
  in = rsf_input()&lt;br /&gt;
  out = rsf_output()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The standard input and output files are initialized with&lt;br /&gt;
&amp;lt;tt&amp;gt;rsf_input&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;rsf_output&amp;lt;/tt&amp;gt; functions. Both functions&lt;br /&gt;
accept optional arguments. For example, if the command line contains&lt;br /&gt;
&amp;lt;tt&amp;gt;vel=velocity.rsf&amp;lt;/tt&amp;gt;, then both&lt;br /&gt;
&amp;lt;tt&amp;gt;rsf_input(&amp;quot;velocity.rsf&amp;quot;)&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;rsf_input(&amp;quot;vel&amp;quot;)&amp;lt;/tt&amp;gt; are&lt;br /&gt;
acceptable.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
  if (sf_float /= gettype(in)) call sf_error(&amp;quot;Need float type&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A call to &amp;lt;tt&amp;gt;from_par&amp;lt;/tt&amp;gt; extracts the &amp;quot;&amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt;&amp;quot; parameter&lt;br /&gt;
from the input file. Conceptually, the RSF data model is a&lt;br /&gt;
multidimensional hypercube.  The &amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt; parameter refers to the&lt;br /&gt;
fastest axis. If the input dataset is a collection of traces,&lt;br /&gt;
&amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt; corresponds to the trace length. We could proceed in a&lt;br /&gt;
similar fashion, extracting &amp;lt;tt&amp;gt;n2&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;n3&amp;lt;/tt&amp;gt;, etc. If we are&lt;br /&gt;
interested in the total number of traces, like in the clip example, a&lt;br /&gt;
shortcut is to use the &amp;lt;tt&amp;gt;filesize&amp;lt;/tt&amp;gt; function.  Calling&lt;br /&gt;
&amp;lt;tt&amp;gt;filesize(in)&amp;lt;/tt&amp;gt; returns the total number of elements in the&lt;br /&gt;
hypercube (the product of &amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;n2&amp;lt;/tt&amp;gt;, etc.), calling&lt;br /&gt;
&amp;lt;tt&amp;gt;filesize(in,1)&amp;lt;/tt&amp;gt; returns the number of traces (the product of&lt;br /&gt;
&amp;lt;tt&amp;gt;n2&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;n3&amp;lt;/tt&amp;gt;, etc.), calling &amp;lt;tt&amp;gt;filesize(in,2)&amp;lt;/tt&amp;gt;&lt;br /&gt;
returns the product of &amp;lt;tt&amp;gt;n3&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;n4&amp;lt;/tt&amp;gt;, etc. By calling&lt;br /&gt;
&amp;lt;tt&amp;gt;filesize&amp;lt;/tt&amp;gt;, we avoid the need to extract additional parameters&lt;br /&gt;
for the hypercube dimensions that we are not interested in.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
  n2 = filesize(in,1)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The clip parameter is read from the command line, where it can be&lt;br /&gt;
specified, for example, as &amp;lt;tt&amp;gt;clip=10&amp;lt;/tt&amp;gt;. If we knew a good default&lt;br /&gt;
value for &amp;lt;tt&amp;gt;clip&amp;lt;/tt&amp;gt;, we could specify it with an optional&lt;br /&gt;
argument, i.e. &amp;lt;tt&amp;gt;call~from_par(&amp;quot;clip&amp;quot;,clip,default)&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
  allocate (trace (n1))&lt;br /&gt;
&lt;br /&gt;
  do i2=1, n2                ! loop over traces&lt;br /&gt;
     call rsf_read(in,trace)&lt;br /&gt;
     &lt;br /&gt;
     where (trace &amp;gt;  clip) trace =  clip&lt;br /&gt;
     where (trace &amp;lt; -clip) trace = -clip&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, we do the actual work: loop over input traces, reading,&lt;br /&gt;
clipping, and writing out each trace.&lt;br /&gt;
===Compiling===&lt;br /&gt;
To compile the Fortran-90 program, run&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
f90 clip.f90 -I&amp;amp;#36;RSFROOT/include -L&amp;amp;#36;RSFROOT/lib -lrsff90 -lrsf -lm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Change &amp;lt;tt&amp;gt;f90&amp;lt;/tt&amp;gt; to the Fortran-90 compiler appropriate for your system and&lt;br /&gt;
include additional compiler flags if necessary. The flags that RSF typically&lt;br /&gt;
uses are in &amp;lt;tt&amp;gt;&amp;amp;#36;RSFROOT/share/madagasacar/etc/config.py&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The complete specification for the F90 API can be found [[Library_Reference#Fortran_90_API | on the Library Reference page]].&lt;br /&gt;
&lt;br /&gt;
==Python interface==&lt;br /&gt;
Examples that use the python interface are in the directory $RSFSRC/api/python/test.&lt;br /&gt;
&lt;br /&gt;
The Python script clip.py is:.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
#!/usr/bin/env python&lt;br /&gt;
&lt;br /&gt;
import numpy&lt;br /&gt;
import m8r&lt;br /&gt;
&lt;br /&gt;
par = m8r.Par()&lt;br /&gt;
inp  = m8r.Input()&lt;br /&gt;
output = m8r.Output()&lt;br /&gt;
assert &#039;float&#039; == inp.type&lt;br /&gt;
&lt;br /&gt;
n1 = inp.int(&amp;quot;n1&amp;quot;)&lt;br /&gt;
n2 = inp.size(1)&lt;br /&gt;
assert n1&lt;br /&gt;
&lt;br /&gt;
clip = par.float(&amp;quot;clip&amp;quot;)&lt;br /&gt;
assert clip&lt;br /&gt;
&lt;br /&gt;
trace = numpy.zeros(n1,&#039;f&#039;)&lt;br /&gt;
&lt;br /&gt;
for i2 in xrange(n2): # loop over traces&lt;br /&gt;
    inp.read(trace)&lt;br /&gt;
    trace = numpy.clip(trace,-clip,clip)&lt;br /&gt;
    output.write(trace)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let us examine it in detail. &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import numpy&lt;br /&gt;
import m8r&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The script starts with importing the &amp;lt;tt&amp;gt;numpy&amp;lt;/tt&amp;gt; module and the&lt;br /&gt;
&amp;lt;tt&amp;gt;m8r&amp;lt;/tt&amp;gt; API.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
par = m8r.Par()&lt;br /&gt;
inp  = m8r.Input()&lt;br /&gt;
output = m8r.Output()&lt;br /&gt;
assert &#039;float&#039; == inp.type&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, we initialize the command line interface and the standard input and&lt;br /&gt;
output files. We also make sure that the input file type is floating point.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
n1 = input.int(&amp;quot;n1&amp;quot;)&lt;br /&gt;
n2 = input.size(1)&lt;br /&gt;
assert n1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We extract the &amp;quot;&amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt;&amp;quot; parameter from the input file.&lt;br /&gt;
Conceptually, the RSF data model is a multidimensional hypercube.  The&lt;br /&gt;
&amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt; parameter refers to the fastest axis. If the input dataset&lt;br /&gt;
is a collection of traces, &amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt; corresponds to the trace&lt;br /&gt;
length. We could proceed in a similar fashion, extracting &amp;lt;tt&amp;gt;n2&amp;lt;/tt&amp;gt;,&lt;br /&gt;
&amp;lt;tt&amp;gt;n3&amp;lt;/tt&amp;gt;, etc. If we are interested in the total number of traces,&lt;br /&gt;
like in the clip example, a shortcut is to use the &amp;lt;tt&amp;gt;size&amp;lt;/tt&amp;gt;&lt;br /&gt;
method of the &amp;lt;tt&amp;gt;Input&amp;lt;/tt&amp;gt; class.  Calling &amp;lt;tt&amp;gt;size(0)&amp;lt;/tt&amp;gt; returns&lt;br /&gt;
the total number of elements in the hypercube (the product of&lt;br /&gt;
&amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;n2&amp;lt;/tt&amp;gt;, etc.), calling &amp;lt;tt&amp;gt;size(1)&amp;lt;/tt&amp;gt; returns the&lt;br /&gt;
number of traces (the product of &amp;lt;tt&amp;gt;n2&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;n3&amp;lt;/tt&amp;gt;, etc.),&lt;br /&gt;
calling &amp;lt;tt&amp;gt;size(2)&amp;lt;/tt&amp;gt; returns the product of &amp;lt;tt&amp;gt;n3&amp;lt;/tt&amp;gt;,&lt;br /&gt;
&amp;lt;tt&amp;gt;n4&amp;lt;/tt&amp;gt;, etc.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
clip = par.float(&amp;quot;clip&amp;quot;)&lt;br /&gt;
assert clip&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The clip parameter is read from the command line, where it can be specified,&lt;br /&gt;
for example, as &amp;lt;tt&amp;gt;clip=10&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
trace = numpy.zeros(n1,&#039;f&#039;)&lt;br /&gt;
for i2 in xrange(n2): # loop over traces&lt;br /&gt;
    inp.read(trace)&lt;br /&gt;
    trace = numpy.clip(trace,-clip,clip)&lt;br /&gt;
    output.write(trace)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, we do the actual work: allocate an array to hold a trace and  loop &lt;br /&gt;
over input traces, reading, clipping, and writing out each trace.&lt;br /&gt;
&lt;br /&gt;
Alternative code use inp.trace to allocate an array and read &lt;br /&gt;
the whole file into memory. The loop is no longer needed:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
alltraces=inp.read()&lt;br /&gt;
alltraces = numpy.clip(alltraces,-clip,clip)&lt;br /&gt;
output.write(alltraces)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Compiling===&lt;br /&gt;
The python script does not require compilation. Simply make sure that&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;amp;#36;RSFROOT/lib&amp;lt;/tt&amp;gt; is in &amp;lt;tt&amp;gt;PYTHONPATH&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;LD_LIBRARY_PATH&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Using the Python API for interactive development in Jupyter notebooks===&lt;br /&gt;
Jupyter notebooks are a good way to prototype python code, explore data, and to &lt;br /&gt;
integrate rich text to describe your code.  There are four example notebooks in &lt;br /&gt;
$RSFSRC/api/python/test that demonstrate how to use Jupyter notebooks.  These are:&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |-&lt;br /&gt;
 | clip.ipynb || clip.py converted to a Jupyter notebook&lt;br /&gt;
 |-&lt;br /&gt;
 |simple_m8r_create_write_filter_read.ipynb || numpy, write rsf, Madagascar commands, read rsf, plot&lt;br /&gt;
 |-&lt;br /&gt;
 | tle_edge_preserve.ipynb || reproduces a paper from TLE with numpy and Matplotlib&lt;br /&gt;
 |-&lt;br /&gt;
 | file_filter_scons_example.ipynb || advanced m8r options;  File, filter, and scons from python  &lt;br /&gt;
|} &lt;br /&gt;
They can be started form the command line with the commands:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd $RSFSRC/api/python/test&lt;br /&gt;
jupyter notebook clip.ipynb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Interactive mode usage without graphics===&lt;br /&gt;
Madagascar&#039;s Python API can be used interactively too. Create an input dataset with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sfmath  n1=10 n2=9 output=x1+x2  &amp;gt; test.rsf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, start the python interpreter and paste the following to its command line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import numpy, m8r&lt;br /&gt;
&lt;br /&gt;
inp = m8r.Input(&#039;test.rsf&#039;)&lt;br /&gt;
n1 = inp.int(&amp;quot;n1&amp;quot;)&lt;br /&gt;
n2 = inp.int(&amp;quot;n2&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
data =inp.read(shape=(n2,n1))&lt;br /&gt;
data = data.transpose() # Example of numpy in action&lt;br /&gt;
&lt;br /&gt;
print data&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[[ 0.  1.  2.  3.  4.  5.  6.  7.  8.]&lt;br /&gt;
 [ 1.  2.  3.  4.  5.  6.  7.  8.  9.]&lt;br /&gt;
 [ 2.  3.  4.  5.  6.  7.  8.  9. 10.]&lt;br /&gt;
 [ 3.  4.  5.  6.  7.  8.  9. 10. 11.]&lt;br /&gt;
 [ 4.  5.  6.  7.  8.  9. 10. 11. 12.]&lt;br /&gt;
 [ 5.  6.  7.  8.  9. 10. 11. 12. 13.]&lt;br /&gt;
 [ 6.  7.  8.  9. 10. 11. 12. 13. 14.]&lt;br /&gt;
 [ 7.  8.  9. 10. 11. 12. 13. 14. 15.]&lt;br /&gt;
 [ 8.  9. 10. 11. 12. 13. 14. 15. 16.]&lt;br /&gt;
 [ 9. 10. 11. 12. 13. 14. 15. 16. 17.]]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code will also work in batch mode in a Python script, not only pasted to the interpreter&#039;s command line. &lt;br /&gt;
&lt;br /&gt;
===Graphics with Matplotlib===&lt;br /&gt;
Python can plot arrays directly from memory, without having to write a file to disk first. [http://matplotlib.sourceforge.net/ Matplotlib] is one of the [http://en.wikipedia.org/wiki/Category:Free_plotting_software several] packages that accomplish this. To create a figure, execute the code in the previous section, followed by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from pylab import *&lt;br /&gt;
imshow(data)&lt;br /&gt;
xlabel(&#039;X (m)&#039;)&lt;br /&gt;
ylabel(&#039;Y (m)&#039;)&lt;br /&gt;
title(&#039;Matplotlib example&#039;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to pop up a figure in an interactive session, after pasting to a Python command line the code shown before, also paste:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
show()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will get Figure 1. The figure will pop up if you run the code in a script too, and the script will stop until the figure is manually closed. You must press the floppy disk button in order to save it. To have the image written to disk automatically, instead of &amp;lt;tt&amp;gt;show()&amp;lt;/tt&amp;gt; use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
savefig(&#039;myfile.png&#039;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:matplotlib_imshow.png]]&lt;br /&gt;
&lt;br /&gt;
Putting it all together, here is a sample script reading a RSF file from stdin and printing out a figure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
#!/usr/bin/env python&lt;br /&gt;
import m8r, numpy, sys, pylab&lt;br /&gt;
&lt;br /&gt;
inp = m8r.Input(&#039;test.rsf&#039;)&lt;br /&gt;
n1 = inp.int(&amp;quot;n1&amp;quot;)&lt;br /&gt;
n2 = inp.int(&amp;quot;n2&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
data=input.read()&lt;br /&gt;
&lt;br /&gt;
pylab.imshow(data)&lt;br /&gt;
pylab.savefig(&#039;out.png&#039;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
===Python interfaces to the standalone programs===&lt;br /&gt;
The &amp;lt;tt&amp;gt;m8r&amp;lt;/tt&amp;gt; module offers a way to call Madagascar standalone programs (including graphics) elegantly from inside a Python program, interactively or in batch mode. The blog contains examples of running the &amp;lt;tt&amp;gt;m8r&amp;lt;/tt&amp;gt; module [http://www.ahay.org/rsflog/index.php?/archives/173-Extending-Python-interface.html from inside a SAGE notebook] or [http://www.ahay.org/rsflog/index.php?/archives/264-Running-Madagascar-in-an-interactive-console.html from inside an iPython shell].&lt;br /&gt;
&lt;br /&gt;
==MATLAB interface==&lt;br /&gt;
&lt;br /&gt;
The MATLAB clip function is listed below.&lt;br /&gt;
&amp;lt;matlab&amp;gt;&lt;br /&gt;
function clip(in,out,clip)&lt;br /&gt;
%CLIP Clip the data&lt;br /&gt;
&lt;br /&gt;
dims = rsf_dim(in);&lt;br /&gt;
n1 = dims(1);           % trace length&lt;br /&gt;
n2 = prod(dims(2:end)); % number of traces&lt;br /&gt;
trace = 1:n1;           % allocate trace&lt;br /&gt;
rsf_create(out,in)      % create an output file&lt;br /&gt;
&lt;br /&gt;
for i2 = 1:n2           % loop over traces&lt;br /&gt;
    rsf_read(trace,in,&#039;same&#039;);&lt;br /&gt;
    trace(trace &amp;gt;   clip) =  clip;&lt;br /&gt;
    trace(trace &amp;lt; - clip) = -clip;&lt;br /&gt;
    rsf_write(trace,out,&#039;same&#039;);&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/matlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let us examine it in detail. &lt;br /&gt;
&amp;lt;matlab&amp;gt;&lt;br /&gt;
dims = rsf_dim(in);&lt;br /&gt;
&amp;lt;/matlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We start by figuring out the input file dimensions.&lt;br /&gt;
&amp;lt;matlab&amp;gt;&lt;br /&gt;
n1 = dims(1);           % trace length&lt;br /&gt;
n2 = prod(dims(2:end)); % number of traces&lt;br /&gt;
&amp;lt;/matlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first dimension is the trace length, the product of all other&lt;br /&gt;
dimensions correspond to the number of traces.&lt;br /&gt;
&amp;lt;matlab&amp;gt;&lt;br /&gt;
trace = 1:n1;           % allocate trace&lt;br /&gt;
rsf_create(out,in)      % create an output file&lt;br /&gt;
&amp;lt;/matlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, we allocate the trace array and create an output file.&lt;br /&gt;
&amp;lt;matlab&amp;gt;&lt;br /&gt;
for i2 = 1:n2           % loop over traces&lt;br /&gt;
    rsf_read(trace,in,&#039;same&#039;);&lt;br /&gt;
    trace(trace &amp;gt;   clip) =  clip;&lt;br /&gt;
    trace(trace &amp;lt; - clip) = -clip;&lt;br /&gt;
    rsf_write(trace,out,&#039;same&#039;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/matlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, we do the actual work: loop over input traces, reading,&lt;br /&gt;
clipping, and writing out each trace.&lt;br /&gt;
===Available functions===&lt;br /&gt;
Only some of the functions in the &amp;lt;tt&amp;gt;rsf&amp;lt;/tt&amp;gt; library have received a MATLAB interface. These functions are &amp;lt;tt&amp;gt;rsf_par&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;rsf_dim&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;rsf_read&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;rsf_write&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;rsf_create&amp;lt;/tt&amp;gt;. All these functions except &amp;lt;tt&amp;gt;rsf_par&amp;lt;/tt&amp;gt; have been illustrated in the example above.&lt;br /&gt;
===Compiling===&lt;br /&gt;
The MATLAB script does not require compilation. Simply make sure that&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;amp;#36;RSFROOT/lib&amp;lt;/tt&amp;gt; is in &amp;lt;tt&amp;gt;MATLABPATH&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;LD_LIBRARY_PATH&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Java Interface==&lt;br /&gt;
There are two interfaces to Java that are available.  New codes should be written to use the SWIG interface ONLY.  The older interface (using the MINES JTK) is deprecated, and is only provided while users migrate their code to the new interface.&lt;br /&gt;
&lt;br /&gt;
===SWIG===&lt;br /&gt;
&lt;br /&gt;
To install the SWIG interface:&lt;br /&gt;
&lt;br /&gt;
1 - Download the Java Standard Development Kit (JDK).  Installation varies by platform.&lt;br /&gt;
&lt;br /&gt;
2 - Create the JAVA_HOME environment variable for your shell.  This should point to the directory where the JDK was installed. Example (for Ubuntu 10.04):&lt;br /&gt;
&amp;lt;bash&amp;gt;&lt;br /&gt;
export JAVA_HOME=/usr/lib/jvm/java-6-opensdk&lt;br /&gt;
&amp;lt;/bash&amp;gt;&lt;br /&gt;
3 - Reconfigure Madagascar:&lt;br /&gt;
&amp;lt;bash&amp;gt;&lt;br /&gt;
./configure API=java&lt;br /&gt;
&amp;lt;/bash&amp;gt;&lt;br /&gt;
4 - Reinstall Madagascar (Ignore the compilation warnings for Java files):&lt;br /&gt;
&amp;lt;bash&amp;gt;&lt;br /&gt;
scons; scons install&lt;br /&gt;
&amp;lt;/bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The installation creates two files:  $RSFROOT/lib/libjrsf.so and $RSFROOT/lib/rsf.jar .&lt;br /&gt;
&lt;br /&gt;
Make sure that you set your LD_LIBRARY_PATH to include $RSFROOT/lib.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A short demonstration of the interface follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;java&amp;gt;&lt;br /&gt;
import rsf.RSF;&lt;br /&gt;
import rsf.Input;&lt;br /&gt;
import rsf.Output;&lt;br /&gt;
&lt;br /&gt;
/* A simple Java program to clip a dataset. */&lt;br /&gt;
&lt;br /&gt;
public class Clip {&lt;br /&gt;
    static {&lt;br /&gt;
        System.loadLibrary(&amp;quot;jrsf&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    public static void main(String[] args){&lt;br /&gt;
        // Initialize command line argument passing&lt;br /&gt;
         RSF par = new RSF(args);&lt;br /&gt;
         // Get the input file name.&lt;br /&gt;
         Input input = new Input(&amp;quot;in&amp;quot;);&lt;br /&gt;
         Output output = new Output(&amp;quot;out&amp;quot;);&lt;br /&gt;
        // Get the value to clip to.&lt;br /&gt;
         float clip = par.getFloat(&amp;quot;clip&amp;quot;,0.0f);&lt;br /&gt;
        // Read our input header&lt;br /&gt;
        int n3 = input.getN(3);&lt;br /&gt;
        int n2 = input.getN(2);&lt;br /&gt;
        int n1 = input.getN(1);&lt;br /&gt;
        //Perform clipping operation on a single trace and write out.&lt;br /&gt;
        float[] data = new float[n1];&lt;br /&gt;
         for(int i = 0; i &amp;lt; n3; ++i){&lt;br /&gt;
            for(int j = 0; j &amp;lt; n2; ++j){&lt;br /&gt;
                input.read(data);&lt;br /&gt;
                for(int k = 0; k &amp;lt; n1; ++k){&lt;br /&gt;
                    if (data[k] &amp;gt; clip) data[k] = clip;&lt;br /&gt;
                    else if (data[k] &amp;lt; -clip) data[k] = -clip;&lt;br /&gt;
                }&lt;br /&gt;
                output.write(data);&lt;br /&gt;
            }&lt;br /&gt;
         }&lt;br /&gt;
         output.setN(1,n1);&lt;br /&gt;
         output.setN(2,n2);&lt;br /&gt;
         output.setN(3,n3);&lt;br /&gt;
         input.close();&lt;br /&gt;
         output.close();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/java&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are only three classes in the interface:&lt;br /&gt;
&lt;br /&gt;
1 -- RSF - The command line argument parser, and the initializer for the native interface.  An RSF object MUST be instantiated BEFORE instantiating an Input or Output object.&lt;br /&gt;
&lt;br /&gt;
2 -- Input - An object that provides read access to an RSF file.  &lt;br /&gt;
&lt;br /&gt;
3 -- Output - An object that provides write access to an RSF file.&lt;br /&gt;
&lt;br /&gt;
Additionally, the shared library (libjrsf.so or libjrsf.dll) must be included via the System.loadLibrary(&amp;quot;jrsf&amp;quot;); as the first command in the file.&lt;br /&gt;
&lt;br /&gt;
To compile on the command line:&lt;br /&gt;
&amp;lt;bash&amp;gt;&lt;br /&gt;
javac -cp $RSFROOT/lib Clip.java&lt;br /&gt;
&amp;lt;/bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To include this as part of a SCons script (SConstruct):&lt;br /&gt;
&amp;lt;python&amp;gt;&lt;br /&gt;
from rsf.proj import *&lt;br /&gt;
&lt;br /&gt;
# Compiles Clip.class&lt;br /&gt;
project.Java(&#039;.&#039;,&#039;Clip.java&#039;)&lt;br /&gt;
&lt;br /&gt;
Flow(&#039;dat&#039;,None,&#039;spike n1=1000 n2=100 n3=10 nsp=1 k1=500 l1=1000&#039;)&lt;br /&gt;
Flow(&#039;clipd&#039;,&#039;dat Clip.class&#039;,&lt;br /&gt;
    &#039;&#039;&#039;&lt;br /&gt;
    %s Clip clip=0.5&lt;br /&gt;
    &#039;&#039;&#039; % WhereIs(&#039;java&#039;))&lt;br /&gt;
Flow(&#039;test.attr&#039;,&#039;clipd&#039;,&#039;sfattr&#039;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/python&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note, that we compile Clip.java using the SCons Java builder.  To execute the command, we have to locate the &amp;quot;java&amp;quot; command, which we do using WhereIs(&#039;java&#039;).  Then we execute the class name, and pass any command line arguments as usual.  The files are read from standard in for this program and written to standard out.  &lt;br /&gt;
&lt;br /&gt;
Please see the [[Library Reference]] for more details on the functions available in the SWIG API.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note: Additional Java packages can included in SCons automatically by setting the CLASSPATH environment variable to point to the JAR files that they are contained in.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Mines JTK===&lt;br /&gt;
&#039;&#039;&#039;THIS INTERFACE IS DEPRECATED AND ONLY PROVIDED AS A REFERENCE.  THIS INTERFACE IS NO LONGER SUPPORTED AND WILL BE REMOVED&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This interface may still be compiled by specifying the MINESJTK environment variable. &lt;br /&gt;
&lt;br /&gt;
The interface to Java is less full featured than others.  Presently, it only allows you to read RSF files with fewer than 4-dimensions into Java, and then export RSF files.  &#039;&#039;&#039;The Java interface does not support reading from standard in, or writing from standard out.  Therefore, the Java Interface does not support piping either.&#039;&#039;&#039; The Java interface at present treats all values as floats, and does not have support for complex numbers.  Java programs are not parsed for self-doc information like other programs are either.  Using javadoc may be a viable alternative to creating a parsing engine for Java programs.&lt;br /&gt;
&lt;br /&gt;
Once the build is complete, the JAR file rsf.jar will be added to your $RSFROOT/lib folder.  &lt;br /&gt;
&lt;br /&gt;
There are two ways to access the API:&lt;br /&gt;
&lt;br /&gt;
1 - From the command line:  point the classpath at BOTH compile and runtime to this location on the command line.&lt;br /&gt;
&amp;lt;bash&amp;gt;&lt;br /&gt;
javac -cp $MINESJTK:$RSFROOT/lib/rsf.jar:. Test.java &lt;br /&gt;
java -cp $MINESJTK:$RSFROOT/lib/rsf.jar:. Test arg1=... arg2=... arg3=...&lt;br /&gt;
&amp;lt;/bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2 - From within a SConstruct script:  BOTH the path for the API ($RSFROOT/lib) and the path to the Mines JTK ($MINESJTK) are automatically added to the environment variable CLASSPATH and JAVACLASSPATH for executions made within an SConstruct.  Additionally, any additional classes that are already in the CLASSPATH environmental variable in the shell that you launch from will be added to your classpath.  This allows you to include additional libraries automatically within your Java programs.  The local directory (.) is also included in the CLASSPATH.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;python&amp;gt;&lt;br /&gt;
from rsf.proj import *&lt;br /&gt;
&lt;br /&gt;
# Compiles Clip.class&lt;br /&gt;
project.Java(&#039;.&#039;,&#039;Clip.java&#039;)&lt;br /&gt;
&lt;br /&gt;
Flow(&#039;dat&#039;,None,&#039;spike n1=1000 n2=100 n3=10 nsp=1 k1=500&#039;)&lt;br /&gt;
Flow(&#039;clipd&#039;,&#039;Clip.class dat&#039;,&lt;br /&gt;
    &#039;&#039;&#039;&lt;br /&gt;
    %s ${SOURCES[0].filebase} clip=0.5 &lt;br /&gt;
    in=${SOURCES[1]} out=$TARGET &lt;br /&gt;
    &#039;&#039;&#039; % WhereIs(&#039;java&#039;),stdin=0,stdout=-1)&lt;br /&gt;
Flow(&#039;test.attr&#039;,&#039;clipd&#039;,&#039;sfattr&#039;)&lt;br /&gt;
&lt;br /&gt;
End()&lt;br /&gt;
&amp;lt;/python&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The interface itself is fairly straightforward.  More details on the methods exposed by the API can be found at the [[Library_Reference#Java_API | Library Reference]].&lt;br /&gt;
&lt;br /&gt;
Data clipping, argument parsing, and IO example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;java&amp;gt;&lt;br /&gt;
import rsf.Par;&lt;br /&gt;
import rsf.Reader;&lt;br /&gt;
import rsf.Writer;&lt;br /&gt;
import rsf.Header;&lt;br /&gt;
&lt;br /&gt;
/* A simple Java program to clip a dataset.&lt;br /&gt;
&lt;br /&gt;
Presently, there is no automatic self-documentation generation for use&lt;br /&gt;
with sfdoc.  Javadoc may be a better way to generate self-doc for Java&lt;br /&gt;
programs.&lt;br /&gt;
&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
public class Clip {&lt;br /&gt;
    public static void main(String[] args){&lt;br /&gt;
        // Initialize command line argument passing&lt;br /&gt;
         Par par = new Par(args);&lt;br /&gt;
         // Get the input file name.&lt;br /&gt;
         String input = par.getString(&amp;quot;in&amp;quot;,&amp;quot;&amp;quot;);&lt;br /&gt;
         // If the input file name is nothing, then quit!&lt;br /&gt;
         if (input.equals(&amp;quot;&amp;quot;)){&lt;br /&gt;
                System.out.println(&amp;quot;Did not find input file!&amp;quot;);&lt;br /&gt;
                System.exit(1);&lt;br /&gt;
         }&lt;br /&gt;
         //If the output file name is nothing, then quit!&lt;br /&gt;
         String output = par.getString(&amp;quot;out&amp;quot;,&amp;quot;&amp;quot;);&lt;br /&gt;
         if (output.equals(&amp;quot;&amp;quot;)){&lt;br /&gt;
                System.out.println(&amp;quot;Did not find output file!&amp;quot;);&lt;br /&gt;
                System.exit(1);&lt;br /&gt;
         }&lt;br /&gt;
        // Get the value to clip to.&lt;br /&gt;
         float clip = par.getFloat(&amp;quot;clip&amp;quot;,0.0f);&lt;br /&gt;
        //Read our header file.&lt;br /&gt;
         Header header = Reader.readHeader(input);&lt;br /&gt;
        // Read our binary data.&lt;br /&gt;
         float[][][] data = Reader.readBinary3D(header);&lt;br /&gt;
        //Initialize our array values.&lt;br /&gt;
         int n3 = header.getN(3);&lt;br /&gt;
         int n2 = header.getN(2);&lt;br /&gt;
         int n1 = header.getN(1);&lt;br /&gt;
        //Perform clipping operation.&lt;br /&gt;
         for(int i = 0; i &amp;lt; n3; ++i){&lt;br /&gt;
            for(int j = 0; j &amp;lt; n2; ++j){&lt;br /&gt;
                for(int k = 0; k &amp;lt; n1; ++k){&lt;br /&gt;
                    float trace = data[i][j][k];&lt;br /&gt;
                    if (trace &amp;gt; clip) data[i][j][k] = clip;&lt;br /&gt;
                    else if (trace &amp;lt; -clip) data[i][j][k] = -clip;&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
         }&lt;br /&gt;
        //Write our data out, using the same header values to the file&lt;br /&gt;
        //located at: output.&lt;br /&gt;
         Writer.writeRSF(header,data,output);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/java&amp;gt;&lt;br /&gt;
&lt;br /&gt;
How to read a file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;java&amp;gt;&lt;br /&gt;
&lt;br /&gt;
import rsf.Header;&lt;br /&gt;
import rsf.Reader;&lt;br /&gt;
import rsf.Writer;&lt;br /&gt;
&lt;br /&gt;
public class Test {&lt;br /&gt;
      public static void main(String[] args){&lt;br /&gt;
&lt;br /&gt;
                Header header = Reader.readHeader(&amp;quot;junk.rsf&amp;quot;); //To read the header file, just feed in the path relative to the execution directory&lt;br /&gt;
                System.out.println(header); //The header file will print out if you ask it to, this is good for debugging&lt;br /&gt;
&lt;br /&gt;
                float[][] data = Reader.readBinary2D(header); //Now I can manipulate my data&lt;br /&gt;
       }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/java&amp;gt;&lt;br /&gt;
&lt;br /&gt;
How to write a file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;java&amp;gt;&lt;br /&gt;
import rsf.Header;&lt;br /&gt;
import rsf.Reader;&lt;br /&gt;
import rsf.Writer;&lt;br /&gt;
&lt;br /&gt;
public class Test {&lt;br /&gt;
      public static void main(String[] args){&lt;br /&gt;
                &lt;br /&gt;
                Header header = Reader.readHeader(&amp;quot;test.rsf&amp;quot;); //To read the header file, just feed in the path relative to the execution directory&lt;br /&gt;
                System.out.println(header); //The header file will print out if you ask it to, this is good for debugging&lt;br /&gt;
&lt;br /&gt;
                float[][] data = Reader.readBinary2D(header); //Now I can manipulate my data&lt;br /&gt;
&lt;br /&gt;
                //...Do something&lt;br /&gt;
                Writer.writeRSF(header,data,&amp;quot;test2.rsf&amp;quot;); //Write out my data!&lt;br /&gt;
       }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/java&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to create a dataset from scratch from within Java, then you can create an array of data, modify the values, create a header, and then write it out to rsf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;java&amp;gt;&lt;br /&gt;
import rsf.Header;&lt;br /&gt;
import rsf.Reader;&lt;br /&gt;
import rsf.Writer;&lt;br /&gt;
&lt;br /&gt;
public class Test {&lt;br /&gt;
      public static void main(String[] args){&lt;br /&gt;
&lt;br /&gt;
                int n1 = 20;&lt;br /&gt;
                int n2 = 40;&lt;br /&gt;
                float[][] data = new float[n2][n1]; &lt;br /&gt;
                //The order for dimensions is reversed, because RSF stores them as column-major arrays (see Python API).&lt;br /&gt;
&lt;br /&gt;
                //...Do something&lt;br /&gt;
&lt;br /&gt;
                Header header = new Header();&lt;br /&gt;
                header.setN(1,n1);&lt;br /&gt;
                /* We set the values using the proper RSF number for the dimension, instead of the Java array index.&lt;br /&gt;
                   Example:  RSF Dimension 1, corresponds to array index 0 in Java.&lt;br /&gt;
                             However, we set the values using index 1.  The mapping is handled behind the scenes.&lt;br /&gt;
                 */&lt;br /&gt;
                header.setN(2,n2); &lt;br /&gt;
                header.setDelta(1,0.0);&lt;br /&gt;
                header.setLabel(1,&amp;quot;time&amp;quot;);&lt;br /&gt;
                header.setUnits(1,&amp;quot;s&amp;quot;);&lt;br /&gt;
                Writer.writeRSF(header,data,&amp;quot;junk2.rsf&amp;quot;); //Write out my data!&lt;br /&gt;
       }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/java&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Karl</name></author>
	</entry>
	<entry>
		<id>https://ahay.org/index.php?title=Guide_to_madagascar_API&amp;diff=3752</id>
		<title>Guide to madagascar API</title>
		<link rel="alternate" type="text/html" href="https://ahay.org/index.php?title=Guide_to_madagascar_API&amp;diff=3752"/>
		<updated>2018-12-14T17:18:56Z</updated>

		<summary type="html">&lt;p&gt;Karl: /* Python interface */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;center&amp;gt;&amp;lt;font size=&amp;quot;-1&amp;quot;&amp;gt;&#039;&#039;This page was created from the LaTeX source in [http://sourceforge.net/p/rsf/code/HEAD/tree/trunk/book/rsf/rsf/api.tex book/rsf/rsf/api.tex] using [[latex2wiki]]&#039;&#039;&amp;lt;/font&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Fotolia_555071_XS.jpg|right|]]&lt;br /&gt;
&lt;br /&gt;
This guide explains the RSF programming interface.  See the &#039;&#039;&#039;[[Library_Reference | Library Reference]]&#039;&#039;&#039; for more information on how to use the particular APIs.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
To work with RSF files in your own programs, you may need to use an&lt;br /&gt;
appropriate programming interface. We will demonstrate the interface in&lt;br /&gt;
different languages using a simple example. The example is a clipping program.&lt;br /&gt;
It reads and writes RSF files and accesses parameters both from the input file&lt;br /&gt;
and the command line. The input is processed trace by trace. This is not&lt;br /&gt;
necessarily the most efficient approach&amp;lt;ref&amp;gt;Compare with the [http://rsf.svn.sourceforge.net/viewvc/rsf/trunk/filt/proc/Mclip.c?view=markup library clip program].&amp;lt;/ref&amp;gt; but it suffices for a simple demonstration.&lt;br /&gt;
&lt;br /&gt;
==Installation== &lt;br /&gt;
Only the C interface is installed by default. To install other APIs, use &amp;lt;tt&amp;gt;API=&amp;lt;/tt&amp;gt;&lt;br /&gt;
parameter in the RSF configuration. For example, to install C++ and&lt;br /&gt;
Fortran-90 API bindings in addition to the basic package, run&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./configure API=c++,fortran-90&lt;br /&gt;
scons install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The configuration parameters are stored in &amp;lt;tt&amp;gt;&amp;amp;#36;RSFROOT/share/madagascar/etc/config.py&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==C interface==&lt;br /&gt;
&lt;br /&gt;
The C clip function is listed below.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
/* Clip the data. */&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;rsf.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char* argv[])&lt;br /&gt;
{&lt;br /&gt;
    int n1, n2, i1, i2;&lt;br /&gt;
    float clip, *trace=NULL;&lt;br /&gt;
    sf_file in=NULL, out=NULL; /* Input and output files */&lt;br /&gt;
&lt;br /&gt;
    /* Initialize RSF */&lt;br /&gt;
    sf_init(argc,argv);&lt;br /&gt;
    /* standard input */&lt;br /&gt;
    in = sf_input(&amp;quot;in&amp;quot;);&lt;br /&gt;
    /* standard output */&lt;br /&gt;
    out = sf_output(&amp;quot;out&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
    /* check that the input is float */&lt;br /&gt;
    if (SF_FLOAT != sf_gettype(in)) &lt;br /&gt;
	sf_error(&amp;quot;Need float input&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
    /* n1 is the fastest dimension (trace length) */&lt;br /&gt;
    if (!sf_histint(in,&amp;quot;n1&amp;quot;,&amp;amp;n1)) &lt;br /&gt;
	sf_error(&amp;quot;No n1= in input&amp;quot;);&lt;br /&gt;
    /* leftsize gets n2*n3*n4*... (the number of traces) */&lt;br /&gt;
    n2 = sf_leftsize(in,1);&lt;br /&gt;
&lt;br /&gt;
    /* parameter from the command line (i.e. clip=1.5 ) */&lt;br /&gt;
    if (!sf_getfloat(&amp;quot;clip&amp;quot;,&amp;amp;clip)) sf_error(&amp;quot;Need clip=&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
    /* allocate floating point array */&lt;br /&gt;
    trace = sf_floatalloc (n1);&lt;br /&gt;
&lt;br /&gt;
    /* loop over traces */&lt;br /&gt;
    for (i2=0; i2 &amp;lt; n2; i2++) {&lt;br /&gt;
&lt;br /&gt;
	/*read a trace */&lt;br /&gt;
	sf_floatread(trace,n1,in);&lt;br /&gt;
&lt;br /&gt;
	/* loop over samples */&lt;br /&gt;
	for (i1=0; i1 &amp;lt; n1; i1++) {&lt;br /&gt;
	    if      (trace[i1] &amp;gt;  clip) trace[i1]= clip;&lt;br /&gt;
	    else if (trace[i1] &amp;lt; -clip) trace[i1]=-clip;&lt;br /&gt;
	}&lt;br /&gt;
    &lt;br /&gt;
	/* write a trace */&lt;br /&gt;
	sf_floatwrite(trace,n1,out);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    free(trace);&lt;br /&gt;
    sf_close();&lt;br /&gt;
    exit(0);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let us examine it in detail. &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;rsf.h&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The include preprocessing directive is required to access the RSF interface. &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
    sf_file in=NULL, out=NULL; /* Input and output files */&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
RSF data files are defined with an abstract &amp;lt;tt&amp;gt;sf_file&amp;lt;/tt&amp;gt; data type. An&lt;br /&gt;
abstract data type means that the contents of it are not publicly declared,&lt;br /&gt;
and all operations on &amp;lt;tt&amp;gt;sf_file&amp;lt;/tt&amp;gt; objects should be performed with&lt;br /&gt;
library functions. This is analogous to &amp;lt;tt&amp;gt;FILE *&amp;lt;/tt&amp;gt; data type used in&lt;br /&gt;
&amp;lt;tt&amp;gt;stdio.h&amp;lt;/tt&amp;gt; and as close as C gets to an object-oriented style of&lt;br /&gt;
programming (Roberts, 1998&amp;lt;ref&amp;gt;Roberts, E. S.,  1998, Programming abstractions in C: Addison-Wesley.&amp;lt;/ref&amp;gt;).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
    /* Initialize RSF */&lt;br /&gt;
    sf_init(argc,argv);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before using any of the other functions, you must call&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_init&amp;lt;/tt&amp;gt;. This function parses the command line and&lt;br /&gt;
initializes an internally stored table of command-line parameters.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
    /* standard input */&lt;br /&gt;
    in = sf_input(&amp;quot;in&amp;quot;);&lt;br /&gt;
    /* standard output */&lt;br /&gt;
    out = sf_output(&amp;quot;out&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The input and output RSF file objects are created with &amp;lt;tt&amp;gt;sf_input&amp;lt;/tt&amp;gt; and&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_output&amp;lt;/tt&amp;gt; constructor functions. Both these functions take a string&lt;br /&gt;
argument. The string may refer to a file name or a file tag. For example, if&lt;br /&gt;
the command line contains &amp;lt;tt&amp;gt;vel=velocity.rsf&amp;lt;/tt&amp;gt;, then both&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_input(&amp;quot;velocity.rsf&amp;quot;)&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;sf_input(&amp;quot;vel&amp;quot;)&amp;lt;/tt&amp;gt; are&lt;br /&gt;
acceptable. Two tags are special: &amp;lt;tt&amp;gt;&amp;quot;in&amp;quot;&amp;lt;/tt&amp;gt; refers to the file in the&lt;br /&gt;
standard input and &amp;lt;tt&amp;gt;&amp;quot;out&amp;quot;&amp;lt;/tt&amp;gt; refers to the file in the standard&lt;br /&gt;
output. &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
    /* check that the input is float */&lt;br /&gt;
    if (SF_FLOAT != sf_gettype(in)) &lt;br /&gt;
	sf_error(&amp;quot;Need float input&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
RSF files can store data of different types (character, integer,&lt;br /&gt;
floating point, complex). We extract the data type of the input file&lt;br /&gt;
with the library &amp;lt;tt&amp;gt;sf_gettype&amp;lt;/tt&amp;gt; function and check if it&lt;br /&gt;
represents floating point numbers. If not, the program is aborted with&lt;br /&gt;
an error message, using the &amp;lt;tt&amp;gt;sf_error&amp;lt;/tt&amp;gt; function.  It is&lt;br /&gt;
generally a good idea to check the input for user errors and, if they&lt;br /&gt;
cannot be corrected, to take a safe exit.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
    /* n1 is the fastest dimension (trace length) */&lt;br /&gt;
    if (!sf_histint(in,&amp;quot;n1&amp;quot;,&amp;amp;n1)) &lt;br /&gt;
	sf_error(&amp;quot;No n1= in input&amp;quot;);&lt;br /&gt;
    /* leftsize gets n2*n3*n4*... (the number of traces) */&lt;br /&gt;
    n2 = sf_leftsize(in,1);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Conceptually, the RSF data model is a multidimensional hypercube. By&lt;br /&gt;
convention, the dimensions of the cube are stored in &amp;lt;tt&amp;gt;n1=&amp;lt;/tt&amp;gt;,&lt;br /&gt;
&amp;lt;tt&amp;gt;n2=&amp;lt;/tt&amp;gt;, etc. parameters. The &amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt; parameter refers to the&lt;br /&gt;
fastest axis. If the input dataset is a collection of traces,&lt;br /&gt;
&amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt; refers to the trace length. We extract it using the&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_histint&amp;lt;/tt&amp;gt; function (integer parameter from history) and&lt;br /&gt;
abort if no value for &amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt; is found. We could proceed in a&lt;br /&gt;
similar fashion, extracting &amp;lt;tt&amp;gt;n2&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;n3&amp;lt;/tt&amp;gt;, etc. If we are&lt;br /&gt;
interested in the total number of traces, like in the clip example, a&lt;br /&gt;
shortcut is to use the &amp;lt;tt&amp;gt;sf_leftsize&amp;lt;/tt&amp;gt; function. Calling&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_leftsize(in,0)&amp;lt;/tt&amp;gt; returns the total number of elements in&lt;br /&gt;
the hypercube (the product of &amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;n2&amp;lt;/tt&amp;gt;, etc.), calling&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_leftsize(in,1)&amp;lt;/tt&amp;gt; returns the number of traces (the product&lt;br /&gt;
of &amp;lt;tt&amp;gt;n2&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;n3&amp;lt;/tt&amp;gt;, etc.), calling&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_leftsize(in,2)&amp;lt;/tt&amp;gt; returns the product of &amp;lt;tt&amp;gt;n3&amp;lt;/tt&amp;gt;,&lt;br /&gt;
&amp;lt;tt&amp;gt;n4&amp;lt;/tt&amp;gt;, etc. By calling &amp;lt;tt&amp;gt;sf_leftsize&amp;lt;/tt&amp;gt;, we avoid the need&lt;br /&gt;
to extract additional parameters for the hypercube dimensions that we&lt;br /&gt;
are not interested in.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
    /* parameter from the command line (i.e. clip=1.5 ) */&lt;br /&gt;
    if (!sf_getfloat(&amp;quot;clip&amp;quot;,&amp;amp;clip)) sf_error(&amp;quot;Need clip=&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
The clip parameter is read from the command line, where it can be&lt;br /&gt;
specified, for example, as &amp;lt;tt&amp;gt;clip=10&amp;lt;/tt&amp;gt;. The parameter has the&lt;br /&gt;
&amp;lt;tt&amp;gt;float&amp;lt;/tt&amp;gt; type, therefore we read it with the&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_getfloat&amp;lt;/tt&amp;gt; function. If no &amp;lt;tt&amp;gt;clip=&amp;lt;/tt&amp;gt; parameter is&lt;br /&gt;
found among the command line arguments, the program is aborted with an&lt;br /&gt;
error message using the &amp;lt;tt&amp;gt;sf_error&amp;lt;/tt&amp;gt; function.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
    /* allocate floating point array */&lt;br /&gt;
    trace = sf_floatalloc (n1);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Next, we allocate an array of floating-point numbers to store a trace&lt;br /&gt;
with the library &amp;lt;tt&amp;gt;sf_floatalloc&amp;lt;/tt&amp;gt; function. Unlike the standard&lt;br /&gt;
&amp;lt;tt&amp;gt;malloc&amp;lt;/tt&amp;gt; the RSF allocation function checks for errors and&lt;br /&gt;
either terminates the program or returns a valid pointer.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
    /* loop over traces */&lt;br /&gt;
    for (i2=0; i2 &amp;lt; n2; i2++) {&lt;br /&gt;
&lt;br /&gt;
	/*read a trace */&lt;br /&gt;
	sf_floatread(trace,n1,in);&lt;br /&gt;
&lt;br /&gt;
	/* loop over samples */&lt;br /&gt;
	for (i1=0; i1 &amp;lt; n1; i1++) {&lt;br /&gt;
	    if      (trace[i1] &amp;gt;  clip) trace[i1]= clip;&lt;br /&gt;
	    else if (trace[i1] &amp;lt; -clip) trace[i1]=-clip;&lt;br /&gt;
	}&lt;br /&gt;
    &lt;br /&gt;
	/* write a trace */&lt;br /&gt;
	sf_floatwrite(trace,n1,out);&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
The rest of the program is straightforward. We loop over all available&lt;br /&gt;
traces, read each trace, clip it and right the output out. The syntax&lt;br /&gt;
of &amp;lt;tt&amp;gt;sf_floatread&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;sf_floatwrite&amp;lt;/tt&amp;gt; functions is&lt;br /&gt;
similar to the syntax of the C standard &amp;lt;tt&amp;gt;fread&amp;lt;/tt&amp;gt; and&lt;br /&gt;
&amp;lt;tt&amp;gt;fwrite&amp;lt;/tt&amp;gt; function except that the type of the element is&lt;br /&gt;
specified explicitly in the function name and that the input and&lt;br /&gt;
output files have the RSF type &amp;lt;tt&amp;gt;sf_file&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
sf_close();&lt;br /&gt;
exit(0)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We explicitly close the input file to avoid leaving a stale temporary file in &amp;lt;tt&amp;gt;$DATAPATH&amp;lt;/tt&amp;gt; if the program is called in a pipe sequence. Then, we close the program by sending the shell the Unix code that tells it no errors were encountered. &lt;br /&gt;
&lt;br /&gt;
Note that this is an introductory example, optimized for clarity, not execution speed. For advanced techniques, see [[Madagascar Code Patterns]].&lt;br /&gt;
&lt;br /&gt;
===Compiling===&lt;br /&gt;
To compile the &amp;lt;tt&amp;gt;clip&amp;lt;/tt&amp;gt; program, run&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cc clip.c -I&amp;amp;#36;RSFROOT/include -L&amp;amp;#36;RSFROOT/lib -lrsf -lm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Change &amp;lt;tt&amp;gt;cc&amp;lt;/tt&amp;gt; to the C compiler appropriate for your system and include&lt;br /&gt;
additional compiler flags if necessary. The flags that RSF typically uses are&lt;br /&gt;
in &amp;lt;tt&amp;gt;&amp;amp;#36;RSFROOT/share/madagascar/etc/config.py&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==C++ interface==&lt;br /&gt;
&lt;br /&gt;
The C++ clip function is listed below.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
/* Clip the data. */&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;valarray&amp;gt;&lt;br /&gt;
#include &amp;lt;rsf.hh&amp;gt;&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char* argv[])&lt;br /&gt;
{&lt;br /&gt;
    sf_init(argc,argv); // Initialize RSF&lt;br /&gt;
    &lt;br /&gt;
    iRSF par(0), in; // input parameter, file&lt;br /&gt;
    oRSF out;        // output file&lt;br /&gt;
&lt;br /&gt;
    int n1, n2;      // trace length, number of traces&lt;br /&gt;
    float clip;&lt;br /&gt;
    &lt;br /&gt;
    in.get(&amp;quot;n1&amp;quot;,n1);&lt;br /&gt;
    n2=in.size(1);&lt;br /&gt;
&lt;br /&gt;
    par.get(&amp;quot;clip&amp;quot;,clip); // parameter from the command line&lt;br /&gt;
&lt;br /&gt;
    std::valarray&amp;lt;float&amp;gt; trace(n1);&lt;br /&gt;
&lt;br /&gt;
    for (int i2=0; i2 &amp;lt; n2; i2++) { // loop over traces&lt;br /&gt;
	in &amp;gt;&amp;gt; trace; // read a trace&lt;br /&gt;
&lt;br /&gt;
	for (int i1=0; i1 &amp;lt; n1; i1++) { // loop over samples&lt;br /&gt;
	    if      (trace[i1] &amp;gt;  clip) trace[i1]=clip;&lt;br /&gt;
	    else if (trace[i1] &amp;lt; -clip) trace[i1]=-clip;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	out &amp;lt;&amp;lt; trace; // write a trace&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    exit(0);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let us examine it line by line. &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;rsf.hh&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Including &amp;quot;&amp;lt;tt&amp;gt;rsf.hh&amp;lt;/tt&amp;gt;&amp;quot; is required for accessing the RSF C++&lt;br /&gt;
interface.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    sf_init(argc,argv); // Initialize RSF&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A call to &amp;lt;tt&amp;gt;sf_init&amp;lt;/tt&amp;gt; is required to initialize the internally stored&lt;br /&gt;
table of command-line arguments.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    iRSF par(0), in; // input parameter, file&lt;br /&gt;
    oRSF out;        // output file&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Two classes: &amp;lt;tt&amp;gt;iRSF&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;oRSF&amp;lt;/tt&amp;gt; are used to define input and&lt;br /&gt;
output files. For simplicity, the command-line parameters are also handled &lt;br /&gt;
as an &amp;lt;tt&amp;gt;iRSF&amp;lt;/tt&amp;gt; object, initialized with zero.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    in.get(&amp;quot;n1&amp;quot;,n1);&lt;br /&gt;
    n2=in.size(1);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, we read the data dimensions from the input RSF file object called&lt;br /&gt;
&amp;lt;tt&amp;gt;in&amp;lt;/tt&amp;gt;: the trace length is a parameter called &amp;quot;&amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt;&amp;quot; and the&lt;br /&gt;
number of traces is the size of &amp;lt;tt&amp;gt;in&amp;lt;/tt&amp;gt; remaining after excluding the&lt;br /&gt;
first dimension. It is extracted with the &amp;lt;tt&amp;gt;size&amp;lt;/tt&amp;gt; method.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    par.get(&amp;quot;clip&amp;quot;,clip); // parameter from the command line&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
The clip parameter should be specified on the command line, for&lt;br /&gt;
example, as &amp;lt;tt&amp;gt;clip=10&amp;lt;/tt&amp;gt;. It is extracted with the &amp;lt;tt&amp;gt;get&amp;lt;/tt&amp;gt;&lt;br /&gt;
method of &amp;lt;tt&amp;gt;iRSF&amp;lt;/tt&amp;gt; class from the &amp;lt;tt&amp;gt;par&amp;lt;/tt&amp;gt; object.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    std::valarray&amp;lt;float&amp;gt; trace(n1);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The trace object has the single-precision floating-point type and is a&lt;br /&gt;
1-D array of length &amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt;. It is declared and allocated using&lt;br /&gt;
the &amp;lt;tt&amp;gt;valarray&amp;lt;/tt&amp;gt; template class from the standard C++ library.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    for (int i2=0; i2 &amp;lt; n2; i2++) { // loop over traces&lt;br /&gt;
	in &amp;gt;&amp;gt; trace; // read a trace&lt;br /&gt;
&lt;br /&gt;
	for (int i1=0; i1 &amp;lt; n1; i1++) { // loop over samples&lt;br /&gt;
	    if      (trace[i1] &amp;gt;  clip) trace[i1]=clip;&lt;br /&gt;
	    else if (trace[i1] &amp;lt; -clip) trace[i1]=-clip;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	out &amp;lt;&amp;lt; trace; // write a trace&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, we loop through the traces, read each trace from &amp;lt;tt&amp;gt;in&amp;lt;/tt&amp;gt;, clip it&lt;br /&gt;
and write the output to &amp;lt;tt&amp;gt;out&amp;lt;/tt&amp;gt;.&lt;br /&gt;
===Compiling===&lt;br /&gt;
To compile the C++ program, run&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
c++ clip.cc -I&amp;amp;#36;RSFROOT/include -L&amp;amp;#36;RSFROOT/lib -lrsf++ -lrsf -lm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Change &amp;lt;tt&amp;gt;c++&amp;lt;/tt&amp;gt; to the C++ compiler appropriate for your system and&lt;br /&gt;
include additional compiler flags if necessary. The flags that RSF typically&lt;br /&gt;
uses are in &amp;lt;tt&amp;gt;&amp;amp;#36;RSFROOT/share/madagascar/etc/config.py&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Fortran-77 interface==&lt;br /&gt;
&lt;br /&gt;
The Fortran-77 clip function is listed below.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
	program Clipit&lt;br /&gt;
	implicit none&lt;br /&gt;
	integer n1, n2, i1, i2, in, out&lt;br /&gt;
	integer sf_input, sf_output, sf_leftsize, sf_gettype&lt;br /&gt;
	logical sf_getfloat, sf_histint&lt;br /&gt;
	real clip, trace(1000)&lt;br /&gt;
&lt;br /&gt;
	call sf_init()&lt;br /&gt;
	in = sf_input(&amp;quot;in&amp;quot;)&lt;br /&gt;
	out = sf_output(&amp;quot;out&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
	if (3 .ne. sf_gettype(in)) &lt;br /&gt;
     &amp;amp;  call sf_error(&amp;quot;Need float input&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
	if (.not. sf_histint(in,&amp;quot;n1&amp;quot;,n1)) then&lt;br /&gt;
	   call sf_error(&amp;quot;No n1= in input&amp;quot;)&lt;br /&gt;
	else if (n1 &amp;gt; 1000) then&lt;br /&gt;
	   call sf_error(&amp;quot;n1 is too long&amp;quot;)&lt;br /&gt;
	end if&lt;br /&gt;
	n2 = sf_leftsize(in,1)&lt;br /&gt;
&lt;br /&gt;
	if (.not. sf_getfloat(&amp;quot;clip&amp;quot;,clip)) &lt;br /&gt;
     &amp;amp;  call sf_error(&amp;quot;Need clip=&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
	do 10 i2=1, n2&lt;br /&gt;
	   call sf_floatread(trace,n1,in)&lt;br /&gt;
&lt;br /&gt;
	   do 20 i1=1, n1&lt;br /&gt;
	      if (trace(i1) &amp;gt;  clip) then&lt;br /&gt;
		 trace(i1)=clip&lt;br /&gt;
	      else if (trace(i1) &amp;lt; -clip) then&lt;br /&gt;
		 trace(i1)=-clip&lt;br /&gt;
	      end if&lt;br /&gt;
 20	   continue&lt;br /&gt;
&lt;br /&gt;
	   call sf_floatwrite(trace,n1,out)&lt;br /&gt;
 10	continue&lt;br /&gt;
&lt;br /&gt;
	stop&lt;br /&gt;
	end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let us examine it in detail.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
	call sf_init()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The program starts with a call to &amp;lt;tt&amp;gt;sf_init&amp;lt;/tt&amp;gt;, which initializes the&lt;br /&gt;
command-line interface.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
	in = sf_input(&amp;quot;in&amp;quot;)&lt;br /&gt;
	out = sf_output(&amp;quot;out&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The input and output files are created with calls to&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_input&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;sf_output&amp;lt;/tt&amp;gt;. Because of the absence of&lt;br /&gt;
derived types in Fortran-77, we use simple integer pointers to&lt;br /&gt;
represent RSF files. Both &amp;lt;tt&amp;gt;sf_input&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;sf_output&amp;lt;/tt&amp;gt;&lt;br /&gt;
accept a character string, which may refer to a file name or a file&lt;br /&gt;
tag. For example, if the command line contains&lt;br /&gt;
&amp;lt;tt&amp;gt;vel=velocity.rsf&amp;lt;/tt&amp;gt;, then both&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_input(&amp;quot;velocity.rsf&amp;quot;)&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;sf_input(&amp;quot;vel&amp;quot;)&amp;lt;/tt&amp;gt; are&lt;br /&gt;
acceptable. Two tags are special: &amp;lt;tt&amp;gt;&amp;quot;in&amp;quot;&amp;lt;/tt&amp;gt; refers to the file in&lt;br /&gt;
the standard input and &amp;lt;tt&amp;gt;&amp;quot;out&amp;quot;&amp;lt;/tt&amp;gt; refers to the file in the&lt;br /&gt;
standard output.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
	if (3 .ne. sf_gettype(in)) &lt;br /&gt;
     &amp;amp;  call sf_error(&amp;quot;Need float input&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
RSF files can store data of different types (character, integer,&lt;br /&gt;
floating point, complex). The function &amp;lt;tt&amp;gt;sf_gettype&amp;lt;/tt&amp;gt; checks the&lt;br /&gt;
type of data stored in the RSF file. We make sure that the type&lt;br /&gt;
corresponds to floating-point numbers. If not, the program is aborted&lt;br /&gt;
with an error message, using the &amp;lt;tt&amp;gt;sf_error&amp;lt;/tt&amp;gt; function.  It is&lt;br /&gt;
generally a good idea to check the input for user errors and, if they&lt;br /&gt;
cannot be corrected, to take a safe exit.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
	if (.not. sf_histint(in,&amp;quot;n1&amp;quot;,n1)) then&lt;br /&gt;
	   call sf_error(&amp;quot;No n1= in input&amp;quot;)&lt;br /&gt;
	else if (n1 &amp;gt; 1000) then&lt;br /&gt;
	   call sf_error(&amp;quot;n1 is too long&amp;quot;)&lt;br /&gt;
	end if&lt;br /&gt;
	n2 = sf_leftsize(in,1)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Conceptually, the RSF data model is a multidimensional hypercube. By&lt;br /&gt;
convention, the dimensions of the cube are stored in &amp;lt;tt&amp;gt;n1=&amp;lt;/tt&amp;gt;,&lt;br /&gt;
&amp;lt;tt&amp;gt;n2=&amp;lt;/tt&amp;gt;, etc. parameters. The &amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt; parameter refers to the&lt;br /&gt;
fastest axis. If the input dataset is a collection of traces,&lt;br /&gt;
&amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt; refers to the trace length. We extract it using the&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_histint&amp;lt;/tt&amp;gt; function (integer parameter from history) and&lt;br /&gt;
abort if no value for &amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt; is found. Since Fortran-77 cannot&lt;br /&gt;
easily handle dynamic allocation, we also need to check that&lt;br /&gt;
&amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt; is not larger than the size of the statically allocated&lt;br /&gt;
array. We could proceed in a similar fashion, extracting &amp;lt;tt&amp;gt;n2&amp;lt;/tt&amp;gt;,&lt;br /&gt;
&amp;lt;tt&amp;gt;n3&amp;lt;/tt&amp;gt;, etc. If we are interested in the total number of traces,&lt;br /&gt;
like in the clip example, a shortcut is to use the&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_leftsize&amp;lt;/tt&amp;gt; function.  Calling &amp;lt;tt&amp;gt;sf_leftsize(in,0)&amp;lt;/tt&amp;gt;&lt;br /&gt;
returns the total number of elements in the hypercube (the product of&lt;br /&gt;
&amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;n2&amp;lt;/tt&amp;gt;, etc.), calling &amp;lt;tt&amp;gt;sf_leftsize(in,1)&amp;lt;/tt&amp;gt;&lt;br /&gt;
returns the number of traces (the product of &amp;lt;tt&amp;gt;n2&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;n3&amp;lt;/tt&amp;gt;,&lt;br /&gt;
etc.), calling &amp;lt;tt&amp;gt;sf_leftsize(in,2)&amp;lt;/tt&amp;gt; returns the product of&lt;br /&gt;
&amp;lt;tt&amp;gt;n3&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;n4&amp;lt;/tt&amp;gt;, etc. By calling &amp;lt;tt&amp;gt;sf_leftsize&amp;lt;/tt&amp;gt;, we&lt;br /&gt;
avoid the need to extract additional parameters for the hypercube&lt;br /&gt;
dimensions that we are not interested in.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
	if (.not. sf_getfloat(&amp;quot;clip&amp;quot;,clip)) &lt;br /&gt;
     &amp;amp;  call sf_error(&amp;quot;Need clip=&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The clip parameter is read from the command line, where it can be&lt;br /&gt;
specified, for example, as &amp;lt;tt&amp;gt;clip=10&amp;lt;/tt&amp;gt;. The parameter has the&lt;br /&gt;
&amp;lt;tt&amp;gt;float&amp;lt;/tt&amp;gt; type, therefore we read it with the&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_getfloat&amp;lt;/tt&amp;gt; function. If no &amp;lt;tt&amp;gt;clip=&amp;lt;/tt&amp;gt; parameter is&lt;br /&gt;
found among the command line arguments, the program is aborted with an&lt;br /&gt;
error message using the &amp;lt;tt&amp;gt;sf_error&amp;lt;/tt&amp;gt; function.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
	do 10 i2=1, n2&lt;br /&gt;
	   call sf_floatread(trace,n1,in)&lt;br /&gt;
&lt;br /&gt;
	   do 20 i1=1, n1&lt;br /&gt;
	      if (trace(i1) &amp;gt;  clip) then&lt;br /&gt;
		 trace(i1)=clip&lt;br /&gt;
	      else if (trace(i1) &amp;lt; -clip) then&lt;br /&gt;
		 trace(i1)=-clip&lt;br /&gt;
	      end if&lt;br /&gt;
 20	   continue&lt;br /&gt;
&lt;br /&gt;
	   call sf_floatwrite(trace,n1,out)&lt;br /&gt;
 10	continue&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, we do the actual work: loop over input traces, reading,&lt;br /&gt;
clipping, and writing out each trace.&lt;br /&gt;
===Compiling===&lt;br /&gt;
To compile the Fortran-77 program, run&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
f77 clip.f -L$RSFROOT/lib -lrsff -lrsf -lm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Change &amp;lt;tt&amp;gt;f77&amp;lt;/tt&amp;gt; to the Fortran compiler appropriate for your system and&lt;br /&gt;
include additional compiler flags if necessary. The flags that RSF typically&lt;br /&gt;
uses are in &amp;lt;tt&amp;gt;&amp;amp;#36;RSFROOT/share/madagascar/etc/config.py&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Fortran-90 interface==&lt;br /&gt;
&lt;br /&gt;
The Fortran-90 clip function is listed below.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
program Clipit&lt;br /&gt;
  use rsf&lt;br /&gt;
&lt;br /&gt;
  implicit none&lt;br /&gt;
  type (file)                      :: in, out&lt;br /&gt;
  integer                          :: n1, n2, i1, i2&lt;br /&gt;
  real                             :: clip&lt;br /&gt;
  real, dimension (:), allocatable :: trace&lt;br /&gt;
&lt;br /&gt;
  call sf_init()            ! initialize RSF&lt;br /&gt;
  in = rsf_input()&lt;br /&gt;
  out = rsf_output()&lt;br /&gt;
&lt;br /&gt;
  if (sf_float /= gettype(in)) call sf_error(&amp;quot;Need float type&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
  call from_par(in,&amp;quot;n1&amp;quot;,n1)&lt;br /&gt;
  n2 = filesize(in,1)&lt;br /&gt;
&lt;br /&gt;
  call from_par(&amp;quot;clip&amp;quot;,clip) ! command-line parameter &lt;br /&gt;
&lt;br /&gt;
  allocate (trace (n1))&lt;br /&gt;
&lt;br /&gt;
  do i2=1, n2                ! loop over traces&lt;br /&gt;
     call rsf_read(in,trace)&lt;br /&gt;
     &lt;br /&gt;
     where (trace &amp;gt;  clip) trace =  clip&lt;br /&gt;
     where (trace &amp;lt; -clip) trace = -clip&lt;br /&gt;
&lt;br /&gt;
     call rsf_write(out,trace)&lt;br /&gt;
  end do&lt;br /&gt;
&lt;br /&gt;
  deallocate (trace)&lt;br /&gt;
&lt;br /&gt;
end program Clipit&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let us examine it in detail.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
  use rsf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The program starts with importing the &amp;lt;tt&amp;gt;rsf&amp;lt;/tt&amp;gt; module.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
  call sf_init()            ! initialize RSF&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A call to &amp;lt;tt&amp;gt;sf_init&amp;lt;/tt&amp;gt; is needed to initialize the command-line&lt;br /&gt;
interface.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
  in = rsf_input()&lt;br /&gt;
  out = rsf_output()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The standard input and output files are initialized with&lt;br /&gt;
&amp;lt;tt&amp;gt;rsf_input&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;rsf_output&amp;lt;/tt&amp;gt; functions. Both functions&lt;br /&gt;
accept optional arguments. For example, if the command line contains&lt;br /&gt;
&amp;lt;tt&amp;gt;vel=velocity.rsf&amp;lt;/tt&amp;gt;, then both&lt;br /&gt;
&amp;lt;tt&amp;gt;rsf_input(&amp;quot;velocity.rsf&amp;quot;)&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;rsf_input(&amp;quot;vel&amp;quot;)&amp;lt;/tt&amp;gt; are&lt;br /&gt;
acceptable.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
  if (sf_float /= gettype(in)) call sf_error(&amp;quot;Need float type&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A call to &amp;lt;tt&amp;gt;from_par&amp;lt;/tt&amp;gt; extracts the &amp;quot;&amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt;&amp;quot; parameter&lt;br /&gt;
from the input file. Conceptually, the RSF data model is a&lt;br /&gt;
multidimensional hypercube.  The &amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt; parameter refers to the&lt;br /&gt;
fastest axis. If the input dataset is a collection of traces,&lt;br /&gt;
&amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt; corresponds to the trace length. We could proceed in a&lt;br /&gt;
similar fashion, extracting &amp;lt;tt&amp;gt;n2&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;n3&amp;lt;/tt&amp;gt;, etc. If we are&lt;br /&gt;
interested in the total number of traces, like in the clip example, a&lt;br /&gt;
shortcut is to use the &amp;lt;tt&amp;gt;filesize&amp;lt;/tt&amp;gt; function.  Calling&lt;br /&gt;
&amp;lt;tt&amp;gt;filesize(in)&amp;lt;/tt&amp;gt; returns the total number of elements in the&lt;br /&gt;
hypercube (the product of &amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;n2&amp;lt;/tt&amp;gt;, etc.), calling&lt;br /&gt;
&amp;lt;tt&amp;gt;filesize(in,1)&amp;lt;/tt&amp;gt; returns the number of traces (the product of&lt;br /&gt;
&amp;lt;tt&amp;gt;n2&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;n3&amp;lt;/tt&amp;gt;, etc.), calling &amp;lt;tt&amp;gt;filesize(in,2)&amp;lt;/tt&amp;gt;&lt;br /&gt;
returns the product of &amp;lt;tt&amp;gt;n3&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;n4&amp;lt;/tt&amp;gt;, etc. By calling&lt;br /&gt;
&amp;lt;tt&amp;gt;filesize&amp;lt;/tt&amp;gt;, we avoid the need to extract additional parameters&lt;br /&gt;
for the hypercube dimensions that we are not interested in.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
  n2 = filesize(in,1)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The clip parameter is read from the command line, where it can be&lt;br /&gt;
specified, for example, as &amp;lt;tt&amp;gt;clip=10&amp;lt;/tt&amp;gt;. If we knew a good default&lt;br /&gt;
value for &amp;lt;tt&amp;gt;clip&amp;lt;/tt&amp;gt;, we could specify it with an optional&lt;br /&gt;
argument, i.e. &amp;lt;tt&amp;gt;call~from_par(&amp;quot;clip&amp;quot;,clip,default)&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
  allocate (trace (n1))&lt;br /&gt;
&lt;br /&gt;
  do i2=1, n2                ! loop over traces&lt;br /&gt;
     call rsf_read(in,trace)&lt;br /&gt;
     &lt;br /&gt;
     where (trace &amp;gt;  clip) trace =  clip&lt;br /&gt;
     where (trace &amp;lt; -clip) trace = -clip&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, we do the actual work: loop over input traces, reading,&lt;br /&gt;
clipping, and writing out each trace.&lt;br /&gt;
===Compiling===&lt;br /&gt;
To compile the Fortran-90 program, run&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
f90 clip.f90 -I&amp;amp;#36;RSFROOT/include -L&amp;amp;#36;RSFROOT/lib -lrsff90 -lrsf -lm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Change &amp;lt;tt&amp;gt;f90&amp;lt;/tt&amp;gt; to the Fortran-90 compiler appropriate for your system and&lt;br /&gt;
include additional compiler flags if necessary. The flags that RSF typically&lt;br /&gt;
uses are in &amp;lt;tt&amp;gt;&amp;amp;#36;RSFROOT/share/madagasacar/etc/config.py&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The complete specification for the F90 API can be found [[Library_Reference#Fortran_90_API | on the Library Reference page]].&lt;br /&gt;
&lt;br /&gt;
==Python interface==&lt;br /&gt;
Examples that use the python interface are in the directory $RSFSRC/api/python/test.&lt;br /&gt;
&lt;br /&gt;
The Python script clip.py is:.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
#!/usr/bin/env python&lt;br /&gt;
&lt;br /&gt;
import numpy&lt;br /&gt;
import m8r&lt;br /&gt;
&lt;br /&gt;
par = m8r.Par()&lt;br /&gt;
inp  = m8r.Input()&lt;br /&gt;
output = m8r.Output()&lt;br /&gt;
assert &#039;float&#039; == inp.type&lt;br /&gt;
&lt;br /&gt;
n1 = inp.int(&amp;quot;n1&amp;quot;)&lt;br /&gt;
n2 = inp.size(1)&lt;br /&gt;
assert n1&lt;br /&gt;
&lt;br /&gt;
clip = par.float(&amp;quot;clip&amp;quot;)&lt;br /&gt;
assert clip&lt;br /&gt;
&lt;br /&gt;
trace = numpy.zeros(n1,&#039;f&#039;)&lt;br /&gt;
&lt;br /&gt;
for i2 in xrange(n2): # loop over traces&lt;br /&gt;
    inp.read(trace)&lt;br /&gt;
    trace = numpy.clip(trace,-clip,clip)&lt;br /&gt;
    output.write(trace)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let us examine it in detail. &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import numpy&lt;br /&gt;
import m8r&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The script starts with importing the &amp;lt;tt&amp;gt;numpy&amp;lt;/tt&amp;gt; module and the&lt;br /&gt;
&amp;lt;tt&amp;gt;m8r&amp;lt;/tt&amp;gt; API.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
par = m8r.Par()&lt;br /&gt;
inp  = m8r.Input()&lt;br /&gt;
output = m8r.Output()&lt;br /&gt;
assert &#039;float&#039; == inp.type&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, we initialize the command line interface and the standard input and&lt;br /&gt;
output files. We also make sure that the input file type is floating point.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
n1 = input.int(&amp;quot;n1&amp;quot;)&lt;br /&gt;
n2 = input.size(1)&lt;br /&gt;
assert n1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We extract the &amp;quot;&amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt;&amp;quot; parameter from the input file.&lt;br /&gt;
Conceptually, the RSF data model is a multidimensional hypercube.  The&lt;br /&gt;
&amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt; parameter refers to the fastest axis. If the input dataset&lt;br /&gt;
is a collection of traces, &amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt; corresponds to the trace&lt;br /&gt;
length. We could proceed in a similar fashion, extracting &amp;lt;tt&amp;gt;n2&amp;lt;/tt&amp;gt;,&lt;br /&gt;
&amp;lt;tt&amp;gt;n3&amp;lt;/tt&amp;gt;, etc. If we are interested in the total number of traces,&lt;br /&gt;
like in the clip example, a shortcut is to use the &amp;lt;tt&amp;gt;size&amp;lt;/tt&amp;gt;&lt;br /&gt;
method of the &amp;lt;tt&amp;gt;Input&amp;lt;/tt&amp;gt; class.  Calling &amp;lt;tt&amp;gt;size(0)&amp;lt;/tt&amp;gt; returns&lt;br /&gt;
the total number of elements in the hypercube (the product of&lt;br /&gt;
&amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;n2&amp;lt;/tt&amp;gt;, etc.), calling &amp;lt;tt&amp;gt;size(1)&amp;lt;/tt&amp;gt; returns the&lt;br /&gt;
number of traces (the product of &amp;lt;tt&amp;gt;n2&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;n3&amp;lt;/tt&amp;gt;, etc.),&lt;br /&gt;
calling &amp;lt;tt&amp;gt;size(2)&amp;lt;/tt&amp;gt; returns the product of &amp;lt;tt&amp;gt;n3&amp;lt;/tt&amp;gt;,&lt;br /&gt;
&amp;lt;tt&amp;gt;n4&amp;lt;/tt&amp;gt;, etc.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
clip = par.float(&amp;quot;clip&amp;quot;)&lt;br /&gt;
assert clip&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The clip parameter is read from the command line, where it can be specified,&lt;br /&gt;
for example, as &amp;lt;tt&amp;gt;clip=10&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
trace = numpy.zeros(n1,&#039;f&#039;)&lt;br /&gt;
for i2 in xrange(n2): # loop over traces&lt;br /&gt;
    inp.read(trace)&lt;br /&gt;
    trace = numpy.clip(trace,-clip,clip)&lt;br /&gt;
    output.write(trace)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, we do the actual work: allocate an array to hold a trace and  loop &lt;br /&gt;
over input traces, reading, clipping, and writing out each trace.&lt;br /&gt;
&lt;br /&gt;
Alternative code use inp.trace to allocate an array and read &lt;br /&gt;
the whole file into memory. The loop is no longer needed:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
alltraces=inp.read()&lt;br /&gt;
alltraces = numpy.clip(alltraces,-clip,clip)&lt;br /&gt;
output.write(alltraces)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Compiling===&lt;br /&gt;
The python script does not require compilation. Simply make sure that&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;amp;#36;RSFROOT/lib&amp;lt;/tt&amp;gt; is in &amp;lt;tt&amp;gt;PYTHONPATH&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;LD_LIBRARY_PATH&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Using the Python API for interactive development in Jupyter notebooks===&lt;br /&gt;
Jupyter notebooks are a good way to prototype python code, explore data, and to &lt;br /&gt;
integrate rich text to describe your code.  There are four example notebooks in &lt;br /&gt;
$RSFSRC/api/python/test that demonstrate how to use Jupyter notebooks.  These are:&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |-&lt;br /&gt;
 | clip.ipynb || clip.py converted to a Jupyter notebook&lt;br /&gt;
 |-&lt;br /&gt;
 |simple_m8r_create_write_filter_read.ipynb || numpy, write rsf, Madagascar commands, read rsf, plot&lt;br /&gt;
 |-&lt;br /&gt;
 | synthetic_for_tle_Edge-preserving.ipynb || reproduces a paper from TLE with numpy and Matplotlib&lt;br /&gt;
 |-&lt;br /&gt;
 | file_filter_scons_example.ipynb || advanced m8r options;  File, filter, and scons from python  &lt;br /&gt;
|} &lt;br /&gt;
They can be started form the command line with the commands:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd $RSFSRC/api/python/test&lt;br /&gt;
jupyter notebook clip.ipynb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Interactive mode usage without graphics===&lt;br /&gt;
Madagascar&#039;s Python API can be used interactively too. Create an input dataset with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sfmath  n1=10 n2=9 output=x1+x2  &amp;gt; test.rsf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, start the python interpreter and paste the following to its command line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import numpy, m8r&lt;br /&gt;
&lt;br /&gt;
inp = m8r.Input(&#039;test.rsf&#039;)&lt;br /&gt;
n1 = inp.int(&amp;quot;n1&amp;quot;)&lt;br /&gt;
n2 = inp.int(&amp;quot;n2&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
data =inp.read(shape=(n2,n1))&lt;br /&gt;
data = data.transpose() # Example of numpy in action&lt;br /&gt;
&lt;br /&gt;
print data&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[[ 0.  1.  2.  3.  4.  5.  6.  7.  8.]&lt;br /&gt;
 [ 1.  2.  3.  4.  5.  6.  7.  8.  9.]&lt;br /&gt;
 [ 2.  3.  4.  5.  6.  7.  8.  9. 10.]&lt;br /&gt;
 [ 3.  4.  5.  6.  7.  8.  9. 10. 11.]&lt;br /&gt;
 [ 4.  5.  6.  7.  8.  9. 10. 11. 12.]&lt;br /&gt;
 [ 5.  6.  7.  8.  9. 10. 11. 12. 13.]&lt;br /&gt;
 [ 6.  7.  8.  9. 10. 11. 12. 13. 14.]&lt;br /&gt;
 [ 7.  8.  9. 10. 11. 12. 13. 14. 15.]&lt;br /&gt;
 [ 8.  9. 10. 11. 12. 13. 14. 15. 16.]&lt;br /&gt;
 [ 9. 10. 11. 12. 13. 14. 15. 16. 17.]]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code will also work in batch mode in a Python script, not only pasted to the interpreter&#039;s command line. &lt;br /&gt;
&lt;br /&gt;
===Graphics with Matplotlib===&lt;br /&gt;
Python can plot arrays directly from memory, without having to write a file to disk first. [http://matplotlib.sourceforge.net/ Matplotlib] is one of the [http://en.wikipedia.org/wiki/Category:Free_plotting_software several] packages that accomplish this. To create a figure, execute the code in the previous section, followed by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from pylab import *&lt;br /&gt;
imshow(data)&lt;br /&gt;
xlabel(&#039;X (m)&#039;)&lt;br /&gt;
ylabel(&#039;Y (m)&#039;)&lt;br /&gt;
title(&#039;Matplotlib example&#039;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to pop up a figure in an interactive session, after pasting to a Python command line the code shown before, also paste:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
show()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will get Figure 1. The figure will pop up if you run the code in a script too, and the script will stop until the figure is manually closed. You must press the floppy disk button in order to save it. To have the image written to disk automatically, instead of &amp;lt;tt&amp;gt;show()&amp;lt;/tt&amp;gt; use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
savefig(&#039;myfile.png&#039;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:matplotlib_imshow.png]]&lt;br /&gt;
&lt;br /&gt;
Putting it all together, here is a sample script reading a RSF file from stdin and printing out a figure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
#!/usr/bin/env python&lt;br /&gt;
import m8r, numpy, sys, pylab&lt;br /&gt;
&lt;br /&gt;
inp = m8r.Input(&#039;test.rsf&#039;)&lt;br /&gt;
n1 = inp.int(&amp;quot;n1&amp;quot;)&lt;br /&gt;
n2 = inp.int(&amp;quot;n2&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
data=input.read()&lt;br /&gt;
&lt;br /&gt;
pylab.imshow(data)&lt;br /&gt;
pylab.savefig(&#039;out.png&#039;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
===Python interfaces to the standalone programs===&lt;br /&gt;
The &amp;lt;tt&amp;gt;m8r&amp;lt;/tt&amp;gt; module offers a way to call Madagascar standalone programs (including graphics) elegantly from inside a Python program, interactively or in batch mode. The blog contains examples of running the &amp;lt;tt&amp;gt;m8r&amp;lt;/tt&amp;gt; module [http://www.ahay.org/rsflog/index.php?/archives/173-Extending-Python-interface.html from inside a SAGE notebook] or [http://www.ahay.org/rsflog/index.php?/archives/264-Running-Madagascar-in-an-interactive-console.html from inside an iPython shell].&lt;br /&gt;
&lt;br /&gt;
==MATLAB interface==&lt;br /&gt;
&lt;br /&gt;
The MATLAB clip function is listed below.&lt;br /&gt;
&amp;lt;matlab&amp;gt;&lt;br /&gt;
function clip(in,out,clip)&lt;br /&gt;
%CLIP Clip the data&lt;br /&gt;
&lt;br /&gt;
dims = rsf_dim(in);&lt;br /&gt;
n1 = dims(1);           % trace length&lt;br /&gt;
n2 = prod(dims(2:end)); % number of traces&lt;br /&gt;
trace = 1:n1;           % allocate trace&lt;br /&gt;
rsf_create(out,in)      % create an output file&lt;br /&gt;
&lt;br /&gt;
for i2 = 1:n2           % loop over traces&lt;br /&gt;
    rsf_read(trace,in,&#039;same&#039;);&lt;br /&gt;
    trace(trace &amp;gt;   clip) =  clip;&lt;br /&gt;
    trace(trace &amp;lt; - clip) = -clip;&lt;br /&gt;
    rsf_write(trace,out,&#039;same&#039;);&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/matlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let us examine it in detail. &lt;br /&gt;
&amp;lt;matlab&amp;gt;&lt;br /&gt;
dims = rsf_dim(in);&lt;br /&gt;
&amp;lt;/matlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We start by figuring out the input file dimensions.&lt;br /&gt;
&amp;lt;matlab&amp;gt;&lt;br /&gt;
n1 = dims(1);           % trace length&lt;br /&gt;
n2 = prod(dims(2:end)); % number of traces&lt;br /&gt;
&amp;lt;/matlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first dimension is the trace length, the product of all other&lt;br /&gt;
dimensions correspond to the number of traces.&lt;br /&gt;
&amp;lt;matlab&amp;gt;&lt;br /&gt;
trace = 1:n1;           % allocate trace&lt;br /&gt;
rsf_create(out,in)      % create an output file&lt;br /&gt;
&amp;lt;/matlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, we allocate the trace array and create an output file.&lt;br /&gt;
&amp;lt;matlab&amp;gt;&lt;br /&gt;
for i2 = 1:n2           % loop over traces&lt;br /&gt;
    rsf_read(trace,in,&#039;same&#039;);&lt;br /&gt;
    trace(trace &amp;gt;   clip) =  clip;&lt;br /&gt;
    trace(trace &amp;lt; - clip) = -clip;&lt;br /&gt;
    rsf_write(trace,out,&#039;same&#039;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/matlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, we do the actual work: loop over input traces, reading,&lt;br /&gt;
clipping, and writing out each trace.&lt;br /&gt;
===Available functions===&lt;br /&gt;
Only some of the functions in the &amp;lt;tt&amp;gt;rsf&amp;lt;/tt&amp;gt; library have received a MATLAB interface. These functions are &amp;lt;tt&amp;gt;rsf_par&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;rsf_dim&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;rsf_read&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;rsf_write&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;rsf_create&amp;lt;/tt&amp;gt;. All these functions except &amp;lt;tt&amp;gt;rsf_par&amp;lt;/tt&amp;gt; have been illustrated in the example above.&lt;br /&gt;
===Compiling===&lt;br /&gt;
The MATLAB script does not require compilation. Simply make sure that&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;amp;#36;RSFROOT/lib&amp;lt;/tt&amp;gt; is in &amp;lt;tt&amp;gt;MATLABPATH&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;LD_LIBRARY_PATH&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Java Interface==&lt;br /&gt;
There are two interfaces to Java that are available.  New codes should be written to use the SWIG interface ONLY.  The older interface (using the MINES JTK) is deprecated, and is only provided while users migrate their code to the new interface.&lt;br /&gt;
&lt;br /&gt;
===SWIG===&lt;br /&gt;
&lt;br /&gt;
To install the SWIG interface:&lt;br /&gt;
&lt;br /&gt;
1 - Download the Java Standard Development Kit (JDK).  Installation varies by platform.&lt;br /&gt;
&lt;br /&gt;
2 - Create the JAVA_HOME environment variable for your shell.  This should point to the directory where the JDK was installed. Example (for Ubuntu 10.04):&lt;br /&gt;
&amp;lt;bash&amp;gt;&lt;br /&gt;
export JAVA_HOME=/usr/lib/jvm/java-6-opensdk&lt;br /&gt;
&amp;lt;/bash&amp;gt;&lt;br /&gt;
3 - Reconfigure Madagascar:&lt;br /&gt;
&amp;lt;bash&amp;gt;&lt;br /&gt;
./configure API=java&lt;br /&gt;
&amp;lt;/bash&amp;gt;&lt;br /&gt;
4 - Reinstall Madagascar (Ignore the compilation warnings for Java files):&lt;br /&gt;
&amp;lt;bash&amp;gt;&lt;br /&gt;
scons; scons install&lt;br /&gt;
&amp;lt;/bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The installation creates two files:  $RSFROOT/lib/libjrsf.so and $RSFROOT/lib/rsf.jar .&lt;br /&gt;
&lt;br /&gt;
Make sure that you set your LD_LIBRARY_PATH to include $RSFROOT/lib.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A short demonstration of the interface follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;java&amp;gt;&lt;br /&gt;
import rsf.RSF;&lt;br /&gt;
import rsf.Input;&lt;br /&gt;
import rsf.Output;&lt;br /&gt;
&lt;br /&gt;
/* A simple Java program to clip a dataset. */&lt;br /&gt;
&lt;br /&gt;
public class Clip {&lt;br /&gt;
    static {&lt;br /&gt;
        System.loadLibrary(&amp;quot;jrsf&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    public static void main(String[] args){&lt;br /&gt;
        // Initialize command line argument passing&lt;br /&gt;
         RSF par = new RSF(args);&lt;br /&gt;
         // Get the input file name.&lt;br /&gt;
         Input input = new Input(&amp;quot;in&amp;quot;);&lt;br /&gt;
         Output output = new Output(&amp;quot;out&amp;quot;);&lt;br /&gt;
        // Get the value to clip to.&lt;br /&gt;
         float clip = par.getFloat(&amp;quot;clip&amp;quot;,0.0f);&lt;br /&gt;
        // Read our input header&lt;br /&gt;
        int n3 = input.getN(3);&lt;br /&gt;
        int n2 = input.getN(2);&lt;br /&gt;
        int n1 = input.getN(1);&lt;br /&gt;
        //Perform clipping operation on a single trace and write out.&lt;br /&gt;
        float[] data = new float[n1];&lt;br /&gt;
         for(int i = 0; i &amp;lt; n3; ++i){&lt;br /&gt;
            for(int j = 0; j &amp;lt; n2; ++j){&lt;br /&gt;
                input.read(data);&lt;br /&gt;
                for(int k = 0; k &amp;lt; n1; ++k){&lt;br /&gt;
                    if (data[k] &amp;gt; clip) data[k] = clip;&lt;br /&gt;
                    else if (data[k] &amp;lt; -clip) data[k] = -clip;&lt;br /&gt;
                }&lt;br /&gt;
                output.write(data);&lt;br /&gt;
            }&lt;br /&gt;
         }&lt;br /&gt;
         output.setN(1,n1);&lt;br /&gt;
         output.setN(2,n2);&lt;br /&gt;
         output.setN(3,n3);&lt;br /&gt;
         input.close();&lt;br /&gt;
         output.close();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/java&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are only three classes in the interface:&lt;br /&gt;
&lt;br /&gt;
1 -- RSF - The command line argument parser, and the initializer for the native interface.  An RSF object MUST be instantiated BEFORE instantiating an Input or Output object.&lt;br /&gt;
&lt;br /&gt;
2 -- Input - An object that provides read access to an RSF file.  &lt;br /&gt;
&lt;br /&gt;
3 -- Output - An object that provides write access to an RSF file.&lt;br /&gt;
&lt;br /&gt;
Additionally, the shared library (libjrsf.so or libjrsf.dll) must be included via the System.loadLibrary(&amp;quot;jrsf&amp;quot;); as the first command in the file.&lt;br /&gt;
&lt;br /&gt;
To compile on the command line:&lt;br /&gt;
&amp;lt;bash&amp;gt;&lt;br /&gt;
javac -cp $RSFROOT/lib Clip.java&lt;br /&gt;
&amp;lt;/bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To include this as part of a SCons script (SConstruct):&lt;br /&gt;
&amp;lt;python&amp;gt;&lt;br /&gt;
from rsf.proj import *&lt;br /&gt;
&lt;br /&gt;
# Compiles Clip.class&lt;br /&gt;
project.Java(&#039;.&#039;,&#039;Clip.java&#039;)&lt;br /&gt;
&lt;br /&gt;
Flow(&#039;dat&#039;,None,&#039;spike n1=1000 n2=100 n3=10 nsp=1 k1=500 l1=1000&#039;)&lt;br /&gt;
Flow(&#039;clipd&#039;,&#039;dat Clip.class&#039;,&lt;br /&gt;
    &#039;&#039;&#039;&lt;br /&gt;
    %s Clip clip=0.5&lt;br /&gt;
    &#039;&#039;&#039; % WhereIs(&#039;java&#039;))&lt;br /&gt;
Flow(&#039;test.attr&#039;,&#039;clipd&#039;,&#039;sfattr&#039;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/python&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note, that we compile Clip.java using the SCons Java builder.  To execute the command, we have to locate the &amp;quot;java&amp;quot; command, which we do using WhereIs(&#039;java&#039;).  Then we execute the class name, and pass any command line arguments as usual.  The files are read from standard in for this program and written to standard out.  &lt;br /&gt;
&lt;br /&gt;
Please see the [[Library Reference]] for more details on the functions available in the SWIG API.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note: Additional Java packages can included in SCons automatically by setting the CLASSPATH environment variable to point to the JAR files that they are contained in.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Mines JTK===&lt;br /&gt;
&#039;&#039;&#039;THIS INTERFACE IS DEPRECATED AND ONLY PROVIDED AS A REFERENCE.  THIS INTERFACE IS NO LONGER SUPPORTED AND WILL BE REMOVED&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This interface may still be compiled by specifying the MINESJTK environment variable. &lt;br /&gt;
&lt;br /&gt;
The interface to Java is less full featured than others.  Presently, it only allows you to read RSF files with fewer than 4-dimensions into Java, and then export RSF files.  &#039;&#039;&#039;The Java interface does not support reading from standard in, or writing from standard out.  Therefore, the Java Interface does not support piping either.&#039;&#039;&#039; The Java interface at present treats all values as floats, and does not have support for complex numbers.  Java programs are not parsed for self-doc information like other programs are either.  Using javadoc may be a viable alternative to creating a parsing engine for Java programs.&lt;br /&gt;
&lt;br /&gt;
Once the build is complete, the JAR file rsf.jar will be added to your $RSFROOT/lib folder.  &lt;br /&gt;
&lt;br /&gt;
There are two ways to access the API:&lt;br /&gt;
&lt;br /&gt;
1 - From the command line:  point the classpath at BOTH compile and runtime to this location on the command line.&lt;br /&gt;
&amp;lt;bash&amp;gt;&lt;br /&gt;
javac -cp $MINESJTK:$RSFROOT/lib/rsf.jar:. Test.java &lt;br /&gt;
java -cp $MINESJTK:$RSFROOT/lib/rsf.jar:. Test arg1=... arg2=... arg3=...&lt;br /&gt;
&amp;lt;/bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2 - From within a SConstruct script:  BOTH the path for the API ($RSFROOT/lib) and the path to the Mines JTK ($MINESJTK) are automatically added to the environment variable CLASSPATH and JAVACLASSPATH for executions made within an SConstruct.  Additionally, any additional classes that are already in the CLASSPATH environmental variable in the shell that you launch from will be added to your classpath.  This allows you to include additional libraries automatically within your Java programs.  The local directory (.) is also included in the CLASSPATH.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;python&amp;gt;&lt;br /&gt;
from rsf.proj import *&lt;br /&gt;
&lt;br /&gt;
# Compiles Clip.class&lt;br /&gt;
project.Java(&#039;.&#039;,&#039;Clip.java&#039;)&lt;br /&gt;
&lt;br /&gt;
Flow(&#039;dat&#039;,None,&#039;spike n1=1000 n2=100 n3=10 nsp=1 k1=500&#039;)&lt;br /&gt;
Flow(&#039;clipd&#039;,&#039;Clip.class dat&#039;,&lt;br /&gt;
    &#039;&#039;&#039;&lt;br /&gt;
    %s ${SOURCES[0].filebase} clip=0.5 &lt;br /&gt;
    in=${SOURCES[1]} out=$TARGET &lt;br /&gt;
    &#039;&#039;&#039; % WhereIs(&#039;java&#039;),stdin=0,stdout=-1)&lt;br /&gt;
Flow(&#039;test.attr&#039;,&#039;clipd&#039;,&#039;sfattr&#039;)&lt;br /&gt;
&lt;br /&gt;
End()&lt;br /&gt;
&amp;lt;/python&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The interface itself is fairly straightforward.  More details on the methods exposed by the API can be found at the [[Library_Reference#Java_API | Library Reference]].&lt;br /&gt;
&lt;br /&gt;
Data clipping, argument parsing, and IO example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;java&amp;gt;&lt;br /&gt;
import rsf.Par;&lt;br /&gt;
import rsf.Reader;&lt;br /&gt;
import rsf.Writer;&lt;br /&gt;
import rsf.Header;&lt;br /&gt;
&lt;br /&gt;
/* A simple Java program to clip a dataset.&lt;br /&gt;
&lt;br /&gt;
Presently, there is no automatic self-documentation generation for use&lt;br /&gt;
with sfdoc.  Javadoc may be a better way to generate self-doc for Java&lt;br /&gt;
programs.&lt;br /&gt;
&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
public class Clip {&lt;br /&gt;
    public static void main(String[] args){&lt;br /&gt;
        // Initialize command line argument passing&lt;br /&gt;
         Par par = new Par(args);&lt;br /&gt;
         // Get the input file name.&lt;br /&gt;
         String input = par.getString(&amp;quot;in&amp;quot;,&amp;quot;&amp;quot;);&lt;br /&gt;
         // If the input file name is nothing, then quit!&lt;br /&gt;
         if (input.equals(&amp;quot;&amp;quot;)){&lt;br /&gt;
                System.out.println(&amp;quot;Did not find input file!&amp;quot;);&lt;br /&gt;
                System.exit(1);&lt;br /&gt;
         }&lt;br /&gt;
         //If the output file name is nothing, then quit!&lt;br /&gt;
         String output = par.getString(&amp;quot;out&amp;quot;,&amp;quot;&amp;quot;);&lt;br /&gt;
         if (output.equals(&amp;quot;&amp;quot;)){&lt;br /&gt;
                System.out.println(&amp;quot;Did not find output file!&amp;quot;);&lt;br /&gt;
                System.exit(1);&lt;br /&gt;
         }&lt;br /&gt;
        // Get the value to clip to.&lt;br /&gt;
         float clip = par.getFloat(&amp;quot;clip&amp;quot;,0.0f);&lt;br /&gt;
        //Read our header file.&lt;br /&gt;
         Header header = Reader.readHeader(input);&lt;br /&gt;
        // Read our binary data.&lt;br /&gt;
         float[][][] data = Reader.readBinary3D(header);&lt;br /&gt;
        //Initialize our array values.&lt;br /&gt;
         int n3 = header.getN(3);&lt;br /&gt;
         int n2 = header.getN(2);&lt;br /&gt;
         int n1 = header.getN(1);&lt;br /&gt;
        //Perform clipping operation.&lt;br /&gt;
         for(int i = 0; i &amp;lt; n3; ++i){&lt;br /&gt;
            for(int j = 0; j &amp;lt; n2; ++j){&lt;br /&gt;
                for(int k = 0; k &amp;lt; n1; ++k){&lt;br /&gt;
                    float trace = data[i][j][k];&lt;br /&gt;
                    if (trace &amp;gt; clip) data[i][j][k] = clip;&lt;br /&gt;
                    else if (trace &amp;lt; -clip) data[i][j][k] = -clip;&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
         }&lt;br /&gt;
        //Write our data out, using the same header values to the file&lt;br /&gt;
        //located at: output.&lt;br /&gt;
         Writer.writeRSF(header,data,output);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/java&amp;gt;&lt;br /&gt;
&lt;br /&gt;
How to read a file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;java&amp;gt;&lt;br /&gt;
&lt;br /&gt;
import rsf.Header;&lt;br /&gt;
import rsf.Reader;&lt;br /&gt;
import rsf.Writer;&lt;br /&gt;
&lt;br /&gt;
public class Test {&lt;br /&gt;
      public static void main(String[] args){&lt;br /&gt;
&lt;br /&gt;
                Header header = Reader.readHeader(&amp;quot;junk.rsf&amp;quot;); //To read the header file, just feed in the path relative to the execution directory&lt;br /&gt;
                System.out.println(header); //The header file will print out if you ask it to, this is good for debugging&lt;br /&gt;
&lt;br /&gt;
                float[][] data = Reader.readBinary2D(header); //Now I can manipulate my data&lt;br /&gt;
       }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/java&amp;gt;&lt;br /&gt;
&lt;br /&gt;
How to write a file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;java&amp;gt;&lt;br /&gt;
import rsf.Header;&lt;br /&gt;
import rsf.Reader;&lt;br /&gt;
import rsf.Writer;&lt;br /&gt;
&lt;br /&gt;
public class Test {&lt;br /&gt;
      public static void main(String[] args){&lt;br /&gt;
                &lt;br /&gt;
                Header header = Reader.readHeader(&amp;quot;test.rsf&amp;quot;); //To read the header file, just feed in the path relative to the execution directory&lt;br /&gt;
                System.out.println(header); //The header file will print out if you ask it to, this is good for debugging&lt;br /&gt;
&lt;br /&gt;
                float[][] data = Reader.readBinary2D(header); //Now I can manipulate my data&lt;br /&gt;
&lt;br /&gt;
                //...Do something&lt;br /&gt;
                Writer.writeRSF(header,data,&amp;quot;test2.rsf&amp;quot;); //Write out my data!&lt;br /&gt;
       }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/java&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to create a dataset from scratch from within Java, then you can create an array of data, modify the values, create a header, and then write it out to rsf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;java&amp;gt;&lt;br /&gt;
import rsf.Header;&lt;br /&gt;
import rsf.Reader;&lt;br /&gt;
import rsf.Writer;&lt;br /&gt;
&lt;br /&gt;
public class Test {&lt;br /&gt;
      public static void main(String[] args){&lt;br /&gt;
&lt;br /&gt;
                int n1 = 20;&lt;br /&gt;
                int n2 = 40;&lt;br /&gt;
                float[][] data = new float[n2][n1]; &lt;br /&gt;
                //The order for dimensions is reversed, because RSF stores them as column-major arrays (see Python API).&lt;br /&gt;
&lt;br /&gt;
                //...Do something&lt;br /&gt;
&lt;br /&gt;
                Header header = new Header();&lt;br /&gt;
                header.setN(1,n1);&lt;br /&gt;
                /* We set the values using the proper RSF number for the dimension, instead of the Java array index.&lt;br /&gt;
                   Example:  RSF Dimension 1, corresponds to array index 0 in Java.&lt;br /&gt;
                             However, we set the values using index 1.  The mapping is handled behind the scenes.&lt;br /&gt;
                 */&lt;br /&gt;
                header.setN(2,n2); &lt;br /&gt;
                header.setDelta(1,0.0);&lt;br /&gt;
                header.setLabel(1,&amp;quot;time&amp;quot;);&lt;br /&gt;
                header.setUnits(1,&amp;quot;s&amp;quot;);&lt;br /&gt;
                Writer.writeRSF(header,data,&amp;quot;junk2.rsf&amp;quot;); //Write out my data!&lt;br /&gt;
       }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/java&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Karl</name></author>
	</entry>
	<entry>
		<id>https://ahay.org/index.php?title=Advanced_Installation&amp;diff=3751</id>
		<title>Advanced Installation</title>
		<link rel="alternate" type="text/html" href="https://ahay.org/index.php?title=Advanced_Installation&amp;diff=3751"/>
		<updated>2018-12-14T14:53:24Z</updated>

		<summary type="html">&lt;p&gt;Karl: /* Mac OS X */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:Fotolia_419157_XS.jpg|right|]]&lt;br /&gt;
Before reading this document, please familiarize yourself with the [[Installation|short Installation guide]].&lt;br /&gt;
=What the installation process does=&lt;br /&gt;
The term &amp;quot;installation&amp;quot; in the title is used for brevity, and it actually covers all three steps: configuration, build and install.&lt;br /&gt;
# Configure: determine what tools are available on the system and how they should be used to built the software. Creates a layer of abstraction so that the build is platform-independent. Should ideally either solve or flag all problems, so that the build either works, or does not proceed at all.&lt;br /&gt;
# Build: compiles the software and documentation using RSFSRC/build as a &amp;quot;workplace&amp;quot;&lt;br /&gt;
# Install: moves the compiled executables and the documentation to the final locations in $RSFROOT, sometimes changing filenames. Kept separate from build so that it can be done by root, and to avoid build failures leaving junk files all over the system.&lt;br /&gt;
A successful installation will have created in &amp;lt;tt&amp;gt;$RSFROOT&amp;lt;/tt&amp;gt; the following directories:&lt;br /&gt;
* &amp;lt;tt&amp;gt;bin/&amp;lt;/tt&amp;gt;: executable programs&lt;br /&gt;
* &amp;lt;tt&amp;gt;doc/&amp;lt;/tt&amp;gt;: auto-generated HTML documentation&lt;br /&gt;
* &amp;lt;tt&amp;gt;include/&amp;lt;/tt&amp;gt;: header files with info on library procedures; fonts&lt;br /&gt;
* &amp;lt;tt&amp;gt;lib/&amp;lt;/tt&amp;gt;: libraries and Python modules&lt;br /&gt;
&lt;br /&gt;
=Old (1.0 and 1.1) version installation=&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;tt&amp;gt;$RSFROOT/etc/madagascar/&amp;lt;/tt&amp;gt; as the location of &amp;lt;tt&amp;gt;env&amp;lt;/tt&amp;gt; scripts instead of &amp;lt;tt&amp;gt;$RSFROOT/share/madagascar/etc/&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=Old (0.9.9) version installation=&lt;br /&gt;
&lt;br /&gt;
====Environment variables====&lt;br /&gt;
Example configuration for &amp;lt;tt&amp;gt;bash&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
export RSFROOT=/usr/local/rsf # directory where Madagascar will be installed. &lt;br /&gt;
if [ -n &amp;quot;$PYTHONPATH&amp;quot; ]; then&lt;br /&gt;
export PYTHONPATH=${PYTHONPATH}:$RSFROOT/lib&lt;br /&gt;
else&lt;br /&gt;
export PYTHONPATH=$RSFROOT/lib&lt;br /&gt;
fi&lt;br /&gt;
export PATH=$RSFROOT/bin:$PATH&lt;br /&gt;
export DATAPATH=/var/tmp/&lt;br /&gt;
export MANPATH=$RSFROOT/share/man:$(manpath)&lt;br /&gt;
export LD_LIBRARY_PATH=$RSFROOT/lib:$LD_LIBRARY_PATH&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Notice the slash at the end of the &amp;lt;tt&amp;gt;DATAPATH&amp;lt;/tt&amp;gt; variable. &lt;br /&gt;
&lt;br /&gt;
Example configuration for &amp;lt;tt&amp;gt;csh&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;tcsh&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
setenv RSFROOT /usr/local/rsf&lt;br /&gt;
if ($?PYTHONPATH) then&lt;br /&gt;
setenv PYTHONPATH ${PYTHONPATH}:$RSFROOT/lib&lt;br /&gt;
else&lt;br /&gt;
setenv PYTHONPATH $RSFROOT/lib&lt;br /&gt;
endif&lt;br /&gt;
set path = ($RSFROOT/bin $path)&lt;br /&gt;
setenv DATAPATH /var/tmp/&lt;br /&gt;
setenv MANPATH $RSFROOT/share/man:`manpath`&lt;br /&gt;
setenv LD_LIBRARY_PATH $RSFROOT/lib:$LD_LIBRARY_PATH&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Notice the backticks surrounding the call to &amp;lt;tt&amp;gt;manpath&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Be aware that on some systems /var/tmp gets automatically cleaned at some intervals, so if you want to keep your data binaries for a long time, set &amp;lt;tt&amp;gt;DATAPATH&amp;lt;/tt&amp;gt; to another location where you have write access and that allows large files.&lt;br /&gt;
&lt;br /&gt;
====Software construction====&lt;br /&gt;
  &lt;br /&gt;
#Configuration. Change to the top source directory and run &amp;lt;pre&amp;gt;./configure&amp;lt;/pre&amp;gt; You can examine the &amp;lt;tt&amp;gt;config.py&amp;lt;/tt&amp;gt; file that this command generates.  Additional options are available. You can obtain a full list of customizable variables by running &amp;lt;tt&amp;gt;scons -h&amp;lt;/tt&amp;gt;. For example, to install C++ and Fortran-90 API bindings in addition to the basic package, run &amp;lt;pre&amp;gt;./configure API=c++,fortran-90&amp;lt;/pre&amp;gt; &lt;br /&gt;
#Building and installing the package. Run &amp;lt;tt&amp;gt;scons install&amp;lt;/tt&amp;gt; or the following two commands in succession:  &amp;lt;pre&amp;gt;make; make install&amp;lt;/pre&amp;gt; or &amp;lt;pre&amp;gt;scons; scons install&amp;lt;/pre&amp;gt; If you need &amp;quot;root&amp;quot; privileges for installing under &amp;lt;tt&amp;gt;&amp;amp;#36;RSFROOT&amp;lt;/tt&amp;gt;, you may need to run &amp;lt;pre&amp;gt;su; scons install &amp;lt;/pre&amp;gt; or &amp;lt;pre&amp;gt;sudo scons install&amp;lt;/pre&amp;gt;&lt;br /&gt;
#Cleaning. To clean all intermediate files generated by SCons, run &amp;lt;pre&amp;gt;make clean&amp;lt;/pre&amp;gt; or &amp;lt;pre&amp;gt;scons -c&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Prerequisites=&lt;br /&gt;
Basic prerequisites are described in the [[Installation|short Installation guide]]. Here are some additional details. &lt;br /&gt;
==Compilers==&lt;br /&gt;
Madagascar has been built successfully with the following compilers, and possibly with others:&lt;br /&gt;
* gcc&lt;br /&gt;
* Intel (icc/ifort)&lt;br /&gt;
* open64&lt;br /&gt;
* clang&lt;br /&gt;
* cc (Solaris)&lt;br /&gt;
&lt;br /&gt;
==Python and SCons==&lt;br /&gt;
As described below under [[Advanced Installation#Platform-specific installation advice | Platform-specific installation advice]], Madagascar supports the oldest non-deprecated Python version currently supported by the latest stable version of [http://scons.org/ SCons].  If your version of Python is older and you experience problems you should probably [http://www.python.org/ upgrade].&lt;br /&gt;
&lt;br /&gt;
Madagascar includes the latest stable version of SCons and the configure scripts will try to install it for you in RSFROOT if you don&#039;t have it already.  However, if you have an older version of SCons the configure scripts will not try to install the newer version. Your older version might work fine, but Madagascar attempts to support only the latest stable version of SCons, so if you have problems you should upgrade.&lt;br /&gt;
&lt;br /&gt;
To install the SCons bundled with Madagascar go to &amp;lt;tt&amp;gt;RSFSRC/scons&amp;lt;/tt&amp;gt;, unpack the tar file, and type&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
python setup.py install&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will install SCons in the standard location. You might need root privileges. If you don&#039;t have root privileges, or you don&#039;t want to interfere with the system SCons you can install it somewhere else with a --prefix option. A logical choice is to put it in RSFROOT like this:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
python setup.py install --prefix=$RSFROOT&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Location==&lt;br /&gt;
As long as you set the environment variables and directory permissions correctly, it does not matter in what part of your filesystem you place the install. If you have the luxury of installing anywhere, it is good practice to follow the [http://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard Filesystem Hierarchy Standard] and either:&lt;br /&gt;
# Install everything (including &amp;lt;tt&amp;gt;figs&amp;lt;/tt&amp;gt; if you do testing) under &amp;lt;tt&amp;gt;/usr/local/rsf&amp;lt;/tt&amp;gt;, with the source tree in &amp;lt;tt&amp;gt;/usr/local/rsf/src&amp;lt;/tt&amp;gt;, OR &lt;br /&gt;
# Put the source tree in &amp;lt;tt&amp;gt;/usr/local/src/rsf&amp;lt;/tt&amp;gt;, and specify &amp;lt;tt&amp;gt;RSFROOT=/usr/local&amp;lt;/tt&amp;gt;, so that header files and binaries go in &amp;lt;tt&amp;gt;/usr/local/bin&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;/usr/local/include&amp;lt;/tt&amp;gt;. To follow the standard, before installing set &amp;lt;tt&amp;gt;RSFDOC=/usr/local/share/rsf/doc&amp;lt;/tt&amp;gt; and create the appropriate directories. The auto-generated HTML documentation will get put there. Also, if installed, the figs directory for testing should be &amp;lt;tt&amp;gt;/usr/local/share/rsf/figs/&amp;lt;/tt&amp;gt;.&lt;br /&gt;
# Package Madagascar (i.e. build a RPM, etc) and install it in the default locations. For RPMs, those are as like the ones from the previous option, just directly in the &amp;lt;tt&amp;gt;/usr/&amp;lt;/tt&amp;gt; hierarchy, instead of in the &amp;lt;tt&amp;gt;/usr/local/&amp;lt;/tt&amp;gt; one.&lt;br /&gt;
&lt;br /&gt;
==Disk space==&lt;br /&gt;
At present (Feb 2007, r2530), the source directory containing the build tree from the development version was approx. 200Mb, the full installation (&amp;lt;tt&amp;gt;bin/&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;doc/&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;include/&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;lib&amp;lt;/tt&amp;gt;) is 31Mb, and &amp;lt;tt&amp;gt;figs/&amp;lt;/tt&amp;gt; (the optional directory if you want to do testing) is about 10 Gb. The stable version is significantly smaller.&lt;br /&gt;
&lt;br /&gt;
The only Madagascar-related directory where disk space can be an issue is &amp;lt;tt&amp;gt;$DATAPATH&amp;lt;/tt&amp;gt;. Real 3-D seismic datasets can be measured in Terabytes. Buggy programs/processing flows can fill up &amp;lt;tt&amp;gt;$DATAPATH&amp;lt;/tt&amp;gt;. A real problem are &amp;quot;disk memory leaks&amp;quot; -- removing header files with anything else than &amp;lt;tt&amp;gt;sfrm&amp;lt;/tt&amp;gt; will leave the binaries intact. Crashed jobs which start to write to binary but never get to write the header also produce &amp;quot;leaks&amp;quot;. Experience has shown that over time &amp;lt;tt&amp;gt;$DATAPATH&amp;lt;/tt&amp;gt; inexorably fills up. You may need to &lt;br /&gt;
# keep irreplaceable data and expensive results in a separate place;&lt;br /&gt;
# remove the oldest files in &amp;lt;tt&amp;gt;$DATAPATH&amp;lt;/tt&amp;gt; whenever the amount of free space declines under a preset threshold.&lt;br /&gt;
&lt;br /&gt;
==Dependencies==&lt;br /&gt;
Some platforms feature complete lists of dependencies. See [[Advanced Installation#Platform-specific installation advice | Platform-specific installation advice]] for details.&lt;br /&gt;
===C++ API===&lt;br /&gt;
A C++ compiler. SCons is smart and will try to find it for you. If it does not work specify the path to your compiler in the &amp;lt;tt&amp;gt;CXX&amp;lt;/tt&amp;gt; environment variable (can be passed as an option to the configuration script, like the &amp;lt;tt&amp;gt;API&amp;lt;/tt&amp;gt; one).&lt;br /&gt;
===F77 API===&lt;br /&gt;
A Fortran 77 compiler. If SCons does not find one, then you can either specify its path through the &amp;lt;tt&amp;gt;F77&amp;lt;/tt&amp;gt; variable, or if the executable is in your path, add its name to the list of F77 compilers in &amp;lt;tt&amp;gt;RSFSRC/configure.py&amp;lt;/tt&amp;gt; .&lt;br /&gt;
===F90 API===&lt;br /&gt;
Same as for Fortran 77 &amp;amp;ndash; just substitute &amp;lt;tt&amp;gt;F90&amp;lt;/tt&amp;gt;. If using the &amp;lt;tt&amp;gt;gfortran&amp;lt;/tt&amp;gt; compiler, make sure to get [http://gcc.gnu.org/wiki/GFortranBinaries the latest version]. If you have more than one compiler installed on your system, specify the desired one at configuration time:&lt;br /&gt;
&amp;lt;bash&amp;gt;&lt;br /&gt;
./configure API=f90 F90=/path/to/preferred/compiler&lt;br /&gt;
&amp;lt;/bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Java API===&lt;br /&gt;
There are two styles of API, old (1.0 release and previous) and new. The two APIs are not compatible with each other.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;old&amp;quot; interface requires the Mines Java Toolkit for fast Java file IO. The Mines JTK, is an open-source Java package that can be downloaded from [http://inside.mines.edu/~dhale/jtk/ Mines JTK]. Currently, the &amp;quot;old&amp;quot; interface will also build alongside the new one if the MINESJTK environment variable exists, and can be used as was previously.&lt;br /&gt;
&lt;br /&gt;
To install the new API, you need the (Oracle) JDK. Set your JAVA_HOME environment variable to the location of the jdk (on Ubuntu 10.04 this is: /usr/lib/jvm/java-6-openjdk), then reconfigure (./configure API=java ...) and reinstall.  &lt;br /&gt;
&lt;br /&gt;
Ignore the SWIG warnings (there are lots). &lt;br /&gt;
&lt;br /&gt;
Make sure to set your LD_LIBRARY_PATH to $RSFROOT/lib .&lt;br /&gt;
&lt;br /&gt;
If you want to include additional Java packages, you can set them using your shell&#039;s CLASSPATH variable.  This environment variable is now automatically passed onto all Java classes in SCons.&lt;br /&gt;
&lt;br /&gt;
The installation can be tested using the example demonstrating the new API in api/java/test .&lt;br /&gt;
&lt;br /&gt;
===Matlab API===&lt;br /&gt;
Besides Matlab itself, you need Mex, which compiles C code into regular Matlab functions. Use the &amp;lt;tt&amp;gt;MATLAB&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;MEX&amp;lt;/tt&amp;gt; environment variables to specify their paths if they are installed, but not found.&lt;br /&gt;
===Octave API===&lt;br /&gt;
The Octave function compiler (&amp;lt;tt&amp;gt;mkoctfile&amp;lt;/tt&amp;gt;) is sometimes bundled in a separate package, so it may be missing from the Octave installation.&lt;br /&gt;
&lt;br /&gt;
===Python API===&lt;br /&gt;
This API requires [http://www.swig.org/ SWIG], [http://numpy.scipy.org/ numpy] and the Python development kit. Numpy requires Python 2.4 or newer (i.e. RHEL 5 or newer). However, these dependencies are unnecessary for the common case when Python is just used as [http://en.wikipedia.org/wiki/Glue_language glue] to create chains of programs, and it only needs to read the RSF header, and not the binary. To allow Python [http://en.wikipedia.org/wiki/Meta-programs metaprograms] in madagascar to function, and programming in this style to be done, a fallback development kit implementing only the header-related functionality will be installed in the lack of these dependencies.&lt;br /&gt;
&lt;br /&gt;
===Python modules in user space===&lt;br /&gt;
Python is an evolving language. Many large systems have old versions for stability reasons, and administrators of such large systems tend to not install all software users may wish, and to not allow access to rpm either. To install a module in your user space, download the tarball, unzip it, cd into the directory and run: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;python setup.py install --prefix=/path/to/your/place&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The installer will create a subdirectory named &amp;lt;tt&amp;gt;lib&amp;lt;/tt&amp;gt;, or &amp;lt;tt&amp;gt;lib64&amp;lt;/tt&amp;gt; under the directory above. These &amp;lt;tt&amp;gt;lib*&amp;lt;/tt&amp;gt; dirs will have a directory named &amp;lt;tt&amp;gt;python&amp;lt;/tt&amp;gt;, or &amp;lt;tt&amp;gt;python2.3&amp;lt;/tt&amp;gt; for example, and those will have a subdirectory named &amp;lt;tt&amp;gt;site-packages&amp;lt;/tt&amp;gt;. Add all paths to these &amp;lt;tt&amp;gt;site-packages&amp;lt;/tt&amp;gt; subdirectories in your &amp;lt;tt&amp;gt;PYTHONPATH&amp;lt;/tt&amp;gt; environment variable. Some (&amp;lt;tt&amp;gt;numpy&amp;lt;/tt&amp;gt;) may create a &amp;lt;tt&amp;gt;bin&amp;lt;/tt&amp;gt; directory that needs to be added to &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=Environment variables=&lt;br /&gt;
Besides the variables defined in env.sh or env.csh (see the [[Installation|short Installation guide]]), Madagascar programs may read the variables below. They usually have reasonable defaults and were introduced just to provide more power to the advanced user.&lt;br /&gt;
&lt;br /&gt;
For future documentation writers: the environment variables read by Madagascar that have not been documented below can be found by running the script &amp;lt;tt&amp;gt;$RSFSRC/admin/find_env_var.py&amp;lt;/tt&amp;gt;. If the script does not exist or does not work, a summary of all environment variable calls can be obtained by going to $RSFSRC, temporarily moving the directory &amp;lt;tt&amp;gt;build/&amp;lt;/tt&amp;gt; outside RSFSRC, and typing&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
grep environ.get *.py */*.py */*/*.py */*/*/*.py&lt;br /&gt;
grep getenv           */*.c  */*/*.c  */*/*/*.c&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Used by the Madagascar core==&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; style=&amp;quot;background:#ffdead;&amp;quot;|Variables introduced by Madagascar&#039;s non-graphic programs&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Name&#039;&#039;&#039; || &#039;&#039;&#039;Default&#039;&#039;&#039; || Meaning&lt;br /&gt;
|-&lt;br /&gt;
| RSF_DATASERVER || &amp;lt;nowiki&amp;gt;ftp://egl.beg.utexas.edu/&amp;lt;/nowiki&amp;gt; || Data server for benchmark datasets&lt;br /&gt;
|-&lt;br /&gt;
| RSFDOC || $RSFROOT/doc || Directory for the HTML self-doc&lt;br /&gt;
|-&lt;br /&gt;
| RSFFIGS || $RSFROOT/figs || Directory with figures for testing examples in $RSFSRC/book&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| RSFALTFIGS || $RSFFIGS || Alternate directory with figures for testing examples not in $RSFSRC/book&lt;br /&gt;
|-&lt;br /&gt;
| RSFMEMSIZE || 100 || Maximum RAM (Mb) to be used by some programs  &lt;br /&gt;
|-&lt;br /&gt;
| RSFSRC || undefined || Root of the Madagascar source tree&lt;br /&gt;
|-&lt;br /&gt;
| TMPDATAPATH || $DATAPATH || Datapath for temporary files on local disk.&lt;br /&gt;
|-&lt;br /&gt;
| LATEX2HTML || undefined || LateX2HTML customization directory&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; style=&amp;quot;background:#ffdead;&amp;quot;|Variables introduced by Madagascar graphics programs &lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Name&#039;&#039;&#039; || &#039;&#039;&#039;Default&#039;&#039;&#039; || Meaning&lt;br /&gt;
|-&lt;br /&gt;
| DEFAULT_PAPER_SIZE || &amp;quot;letter&amp;quot; || For pspen. Other options: legal, a3, a4, a5.&lt;br /&gt;
|-&lt;br /&gt;
| FATMULT || ? || Fatness multiplication factor. &lt;br /&gt;
|-&lt;br /&gt;
| GIFBORDER || 0.25 || For vplot2gif (spacing)&lt;br /&gt;
|-&lt;br /&gt;
| GIFDELAY || 100 || For vplot2gif (for animations)&lt;br /&gt;
|-&lt;br /&gt;
| IMAGE_TYPE || &#039;png&#039; || Icon type for LateX2HTML &lt;br /&gt;
|-&lt;br /&gt;
| PATTERNMULT || None || Pattern multiplication factor  &lt;br /&gt;
|-&lt;br /&gt;
| PLOTSTYLE || None || Used in vplot&lt;br /&gt;
|-&lt;br /&gt;
| PPI || 75 || For vplot2gif (screen resolution)&lt;br /&gt;
|-&lt;br /&gt;
| PPMSCALE || 1 || For vplot2gif&lt;br /&gt;
|-&lt;br /&gt;
| PSBORDER || 0.05 || For vplot2eps (border around the plot)&lt;br /&gt;
|-&lt;br /&gt;
| PSPRINTER || postscript or colorps || For pspen&lt;br /&gt;
|-&lt;br /&gt;
| PSTEXPENOPTS || color=n fat=1 fatmult=1.5 invras=y || Other vplot2eps options &lt;br /&gt;
|-&lt;br /&gt;
| VPLOTFONTDIR || $RSFROOT/include || Dir with backup fonts in case the runtime-loaded vplot fonts are not found&lt;br /&gt;
|-&lt;br /&gt;
| VPLOTSPOOLDIR || /tmp || Where to put vplot tmp files&lt;br /&gt;
|-&lt;br /&gt;
| WSTYPE || &amp;quot;default&amp;quot; || Workstation type.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:#ffdead;&amp;quot;| Variables set by OS/other apps, read-only to Madagascar&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Name&#039;&#039;&#039; || &#039;&#039;&#039;Primarily used/set by&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| CWPROOT || Seismic Unix&lt;br /&gt;
|-&lt;br /&gt;
| DISPLAY || Operating System (OS)&lt;br /&gt;
|-&lt;br /&gt;
| HOME || OS&lt;br /&gt;
|-&lt;br /&gt;
| LD_LIBRARY_PATH || linker&lt;br /&gt;
|-&lt;br /&gt;
| MATLABPATH || Matlab&lt;br /&gt;
|-&lt;br /&gt;
| XAUTHORITY || X-Windows&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Used by the Madagascar build process and parallelization utilities==&lt;br /&gt;
Type &amp;lt;tt&amp;gt;scons -h&amp;lt;/tt&amp;gt; in RSFSRC to get a list of environment variables that affect the build process, with explanations, defaults and actual values. Below are more detailed explanations for some of them:&lt;br /&gt;
* &amp;lt;tt&amp;gt;RSF_THREADS&amp;lt;/tt&amp;gt;: used by &amp;lt;tt&amp;gt;pscons&amp;lt;/tt&amp;gt; to determine on how many threads to run on the local node, overriding the number of threads detected by Madagascar&lt;br /&gt;
* &amp;lt;tt&amp;gt;RSF_CLUSTER&amp;lt;/tt&amp;gt;: used by &amp;lt;tt&amp;gt;pscons&amp;lt;/tt&amp;gt; to determine on which cluster nodes to run, and on how many CPUs&lt;br /&gt;
&lt;br /&gt;
==Used by the Matlab API==&lt;br /&gt;
To use the Matlab API, you need to add &amp;lt;tt&amp;gt;$RSFROOT/lib&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;MATLABPATH&amp;lt;/tt&amp;gt;&lt;br /&gt;
==Used by the Octave API==&lt;br /&gt;
To use the Octave API, you need to add &amp;lt;tt&amp;gt;$RSFROOT/lib&amp;lt;/tt&amp;gt; to Octave&#039;s path. Determine Octave&#039;s version with&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
octave -v | head -1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
If your version is lower than 2.9.6, type at a Unix command line:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
echo &#039;LOADPATH = &amp;quot;::$RSFROOT/lib/octave&amp;quot;&#039; &amp;gt;&amp;gt; ~/.octaverc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
For later versions, use:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
echo &#039;addpath([getenv(&amp;quot;RSFROOT&amp;quot;) &amp;quot;/lib/octave&amp;quot;])&#039; &amp;gt;&amp;gt; ~/.octaverc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
==Used by the Java API==&lt;br /&gt;
New-style (post-1.0) API: Needs &amp;lt;tt&amp;gt;JAVA_HOME&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Old-style API (1.0 and before): The path to the downloaded Mines JTK must be specified in the MINESJTK environment variable in order to install the Java API. For example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
export MINESJTK=/home/user/edu_mines_jtk.jar&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==RSFROOT for NFS-shared user home directories==&lt;br /&gt;
Heterogeneous networks with user home directories shared through [http://en.wikipedia.org/wiki/Network_File_System_(protocol) NFS] are quite common in many institutions. In addition, even when the architecture is the same (i.e. 64-bit) and the operating system is the same (i.e. [http://en.wikipedia.org/wiki/RHEL RHEL]), the difference between operating system versions may be very significant because clusters may run legacy versions, while desktop workstations may run the latest-and-greatest (even beta), and entirely different Madagascar versions may be needed to support both. &lt;br /&gt;
&lt;br /&gt;
One possible solution of detecting the distribution version and architecture and setting RSFROOT appropriately is shown below. In the example network, all RHEL4 machines have the same architecture, but there are RHEL 3 machines with several architectures:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
REDHAT_RELEASE=`awk -F&#039;release&#039; &#039;{ print $2 }&#039; /etc/redhat-release | awk -F&#039; &#039; &#039;{ print $1 }&#039;`&lt;br /&gt;
&lt;br /&gt;
RSFROOT=/usr/local/rsf/rhel$REDHAT_RELEASE&lt;br /&gt;
&lt;br /&gt;
if [ $REDHAT_RELEASE == &#039;4&#039; ] ; then&lt;br /&gt;
    export RSFROOT&lt;br /&gt;
elif [ $REDHAT_RELEASE == &#039;3&#039; ] ; then&lt;br /&gt;
    export RSFROOT=$RSFROOT/$ARCH&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Of course, the Madagascar administrator will have to download appropriate versions of Madagascar to each $RSFROOT, and compile them on the appropriate system.&lt;br /&gt;
&lt;br /&gt;
If you have many kinds of systems to maintain, with multiple versions of Madagascar, and users have more than one shell, you may find it easy to outsource the complex logic to the easy-to-debug Python, i.e.:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
export RSFROOT=`$M8R_SETUP/get_rsfroot.py`&lt;br /&gt;
export PYTHONPATH=`$M8R_SETUP/edit_pythonpath.py`&lt;br /&gt;
export PATH=`$M8R_SETUP/edit_path.py`&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and similarly for (t)csh. The Python scripts determine the operating system and its version, determine the machine name, and simply print to stdout the desired string.&lt;br /&gt;
&lt;br /&gt;
==Eclipse + Pydev==&lt;br /&gt;
If you use [http://eclipse.org/ Eclipse] with [http://pydev.org/ Pydev], [http://pydev.org/manual_101_interpreter.html#id2 configure the interpreter] by adding &amp;lt;tt&amp;gt;$RSFROOT/lib&amp;lt;/tt&amp;gt; to the &amp;lt;tt&amp;gt;PYTHONPATH&amp;lt;/tt&amp;gt; for your chosen interpreter.&lt;br /&gt;
&lt;br /&gt;
=Platform-specific installation advice=&lt;br /&gt;
==Supported platforms==&lt;br /&gt;
Madagascar attempts to support any [http://en.wikipedia.org/wiki/POSIX POSIX-compliant] operating system demanded by users. For systems that bundle Python (i.e. Linux distributions, BSDs), backwards compatibility will attempt to cover those systems that were bundled with the oldest non-deprecated Python version currently supported by the latest stable version of [http://scons.org/ SCons]. For example, in early 2009 the stable SCons release (1.2) supported Python 2.2 or newer. [http://distrowatch.com/table.php?distribution=redhat Python 2.2 was bundled by RHEL3], so RHEL 3 and newer are supported. &lt;br /&gt;
&lt;br /&gt;
Attempts for backward compatibility with a given operating system are also stopped if the operating system itself becomes unsupported. For example, Python 2.2 was bundled by Fedora 1 and newer, but in January 2010 only Fedora 11 and 12 are actively maintained. Thus, in January 2010 Madagascar was not attempting to support Fedora 1, even though it included Python 2.2.&lt;br /&gt;
&lt;br /&gt;
Please keep in mind that the above statements constitute only general guidelines for what will be attempted, and do not constitute in any way a warranty of support. An application of the above guidelines to some Linux distributions follows:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Support info&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Distribution&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Life Cycle&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Supported versions&lt;br /&gt;
|-&lt;br /&gt;
| RHEL/CentOS/Scientific Linux&lt;br /&gt;
| [https://www.redhat.com/security/updates/errata/ 7 years]&lt;br /&gt;
| &lt;br /&gt;
* 6 until 2017-11-30&lt;br /&gt;
* 5 until 2014-03-31&lt;br /&gt;
|-&lt;br /&gt;
| Fedora&lt;br /&gt;
| [http://fedoraproject.org/wiki/Fedora_Release_Life_Cycle Release X maintained until one month after the release of X+2]&lt;br /&gt;
| &lt;br /&gt;
* 15 until 2012-06-24&lt;br /&gt;
* 14 until 2011-12-02&lt;br /&gt;
|-&lt;br /&gt;
| Ubuntu&lt;br /&gt;
| [https://wiki.ubuntu.com/Releases Releases every 6 mo, maintained for 1.5 yrs; LTS versions every 2 yrs, maintained for 5 yrs]&lt;br /&gt;
| &lt;br /&gt;
* 15.10 until July 2016&lt;br /&gt;
* 14.04 LTS until end of April 2019&lt;br /&gt;
* 12.04.4 LTS until end of April 2017&lt;br /&gt;
|-&lt;br /&gt;
| Debian&lt;br /&gt;
| [http://wiki.debian.org/DebianLenny Usually: stable releases every 1.5-3 yrs, release X maintained 1 yr after release X+1]&lt;br /&gt;
| &lt;br /&gt;
* 6 until its TBD end of life (approx. 2014)&lt;br /&gt;
* 5 until 2012-04&lt;br /&gt;
|- &lt;br /&gt;
| openSUSE&lt;br /&gt;
| [http://en.opensuse.org/Lifetime openSUSE releases Lifetime of 1.5-2.5 years]&lt;br /&gt;
| &lt;br /&gt;
* 11.4 until 2012-09-10&lt;br /&gt;
* 11.3 until 2012-01-15&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Ubuntu==&lt;br /&gt;
In &#039;&#039;&#039;Ubuntu 18.04&#039;&#039;&#039;, you can install the essential Madagascar depenency by running&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install libxaw7-dev freeglut3-dev libnetpbm10-dev libgd-dev libplplot-dev \&lt;br /&gt;
libavcodec-dev libcairo2-dev libjpeg-dev swig python-dev python-numpy g++ gfortran \&lt;br /&gt;
libopenmpi-dev libfftw3-dev libsuitesparse-dev python-epydoc scons git emacs25&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In &#039;&#039;&#039;Ubuntu 15.10 &#039;&#039;Wily Werewolf&#039;&#039;&#039;&#039;&#039; (as well as some previous versions), you can install the essential Madagascar depenency by running&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install libxaw7-dev &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and (optionally) all of Madagascar&#039;s dependencies by running&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install libxaw7-dev freeglut3-dev libnetpbm10-dev libgd-dev libplplot-dev \&lt;br /&gt;
libavcodec-dev libcairo2-dev libjpeg-dev swig python-dev python-numpy g++ gfortran \&lt;br /&gt;
libopenmpi-dev libfftw3-dev libsuitesparse-dev python-epydoc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In Ubuntu 13.04 &#039;&#039;Raring Ringtail&#039;&#039;, you can install all of Madagascar&#039;s dependencies by running&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install freeglut3-dev g++ gfortran libgd2-xpm-dev libx11-dev libxaw7-dev \&lt;br /&gt;
libnetpbm10-dev swig python-dev python-numpy libblas-dev libcairo2-dev liblapack-dev \&lt;br /&gt;
libavcodec-dev python-epydoc scons&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In Ubuntu 12.10 &#039;&#039;Quantal Quetzal&#039;&#039;, you can install all of Madagascar&#039;s dependencies by running&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install freeglut3-dev g++ gfortran libgd2-xpm-dev libx11-dev libxaw7-dev \&lt;br /&gt;
libnetpbm10-dev swig python-dev python-numpy libblas-dev libcairo2-dev liblapack-dev \&lt;br /&gt;
libavcodec-dev python-epydoc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In Ubuntu 12.04 &#039;&#039;Precise Pangolin&#039;&#039;, you can install all of Madagascar&#039;s dependencies by running&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install scons openmpi-bin libopenmpi-dev freeglut3-dev g++ gfortran libgd2-xpm-dev \&lt;br /&gt;
libglew1.6-dev libx11-dev libxaw7-dev libnetpbm10-dev swig python-dev python-scipy python-numpy \&lt;br /&gt;
libtiff4-dev scons units libblas-dev libcairo2-dev liblapack-dev libavcodec-dev python-epydoc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In Ubuntu 10.10 &#039;&#039;Maverick Meerkat&#039;&#039;, you can install all of Madagascar&#039;s dependencies by running &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install freeglut3-dev g++ gfortran libgd2-xpm-dev libglew1.5-dev libjpeg62-dev \&lt;br /&gt;
libx11-dev libxaw7-dev libnetpbm10-dev swig python-dev python-scipy python-numpy libtiff4-dev \&lt;br /&gt;
scons units libblas-dev libcairo2-dev libavcodec-dev libplplot-dev &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In Ubuntu 9.04 &#039;&#039;Jaunty Jackalope&#039;&#039;, the corresponding command is&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install freeglut3-dev g++ gfortran libc6-dev libgd2-xpm-dev libglew1.5-dev libjpeg62-dev \&lt;br /&gt;
libx11-dev libxaw7-dev libnetpbm10-dev swig python-dev python-scipy python-numpy libtiff4-dev scons units &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Earlier versions may work with&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install mesa-libGL-devel g++ g77 libc6-dev libgd2-xpm-dev libglew-dev libjpeg62-dev \&lt;br /&gt;
libx11-dev libxaw7-dev libnetpbm10-dev swig python-dev python-scipy python-numpy libtiff4-dev scons units &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If working with the development version, you will also need &amp;lt;tt&amp;gt;git&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;subversion&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Fedora, RedHat, CentOS, Scientific Linux, openSUSE==&lt;br /&gt;
&lt;br /&gt;
Install essential Madagascar dependencies with&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo yum install gcc libXaw-devel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dependency package names, sorted by Linux distribution and Madagascar feature they provide. Packages that are not included in the standard distro repositories are hyperlinked to their providers. The tables below cover build dependencies. &lt;br /&gt;
&lt;br /&gt;
Names of packages that are runtime dependencies are &#039;&#039;&#039;highlighted&#039;&#039;&#039; in the tables below (task under construction).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note: In the future, it should be possible for the configuration scripts to output the dependency tables below, so that they are guaranteed to be in synch with a given Madagascar version&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Minimal install (&amp;quot;Core&amp;quot;), publishing and development&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Core&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | LaTeX&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Development version&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | C++ API&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | F77 API, F90 API&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Python API&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Java API&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Octave API&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Matlab API&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Fedora 15&lt;br /&gt;
| binutils, gcc, glibc-headers, python&lt;br /&gt;
| texlive-latex&lt;br /&gt;
| subversion&lt;br /&gt;
| gcc-c++&lt;br /&gt;
| gcc-gfortran&lt;br /&gt;
| numpy, swig, python-devel&lt;br /&gt;
| Java (Sun&#039;s? IcedTea?)&lt;br /&gt;
| octave, octave-devel&lt;br /&gt;
| [http://www.mathworks.com/ Matlab] with Mex&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Fedora 14&lt;br /&gt;
| binutils, gcc, glibc-headers, python&lt;br /&gt;
| texlive-latex&lt;br /&gt;
| subversion&lt;br /&gt;
| gcc-c++&lt;br /&gt;
| gcc-gfortran&lt;br /&gt;
| numpy, swig&lt;br /&gt;
| Java (Sun&#039;s? IcedTea?)&lt;br /&gt;
| octave, octave-devel&lt;br /&gt;
| [http://www.mathworks.com/ Matlab] with Mex&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Fedora 13&lt;br /&gt;
| binutils, gcc, glibc-headers, python&lt;br /&gt;
| texlive-latex&lt;br /&gt;
| subversion&lt;br /&gt;
| gcc-c++&lt;br /&gt;
| gcc-gfortran&lt;br /&gt;
| numpy, swig&lt;br /&gt;
| Java (Sun&#039;s? IcedTea?)&lt;br /&gt;
| octave, octave-devel&lt;br /&gt;
| [http://www.mathworks.com/ Matlab]&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | CentOS 5&lt;br /&gt;
| binutils, gcc, glibc-headers; python (needs [http://dag.wieers.com/rpm/FAQ.php#B2 RPMforge&#039;s RHEL5 repository])&lt;br /&gt;
| ?&lt;br /&gt;
| subversion&lt;br /&gt;
| gcc-c++&lt;br /&gt;
| gcc-gfortran&lt;br /&gt;
| numpy, swig&lt;br /&gt;
| Java (Sun&#039;s? IcedTea?), [http://inside.mines.edu/~dhale/jtk/ Mines JTK]&lt;br /&gt;
| [http://www.gnu.org/software/octave/ Octave, octave-devel]&lt;br /&gt;
| [http://www.mathworks.com/ Matlab]&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | openSUSE 11.0&lt;br /&gt;
| gcc, python&lt;br /&gt;
| texlive-latex&lt;br /&gt;
| subversion&lt;br /&gt;
| gcc-c++&lt;br /&gt;
| gcc-fortran&lt;br /&gt;
| [http://numpy.scipy.org/ NumPy], swig&lt;br /&gt;
| Java (Sun&#039;s? IcedTea?), [http://inside.mines.edu/~dhale/jtk/ Mines JTK]&lt;br /&gt;
| [http://www.gnu.org/software/octave/ Octave]&lt;br /&gt;
| [http://www.mathworks.com/ Matlab]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Graphics and visualization&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The minimum requirement is X11 graphics for running &#039;&#039;&#039;xtpen&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | X11 graphics&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | vplot2gif&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | vplot2avi&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Some sort of movies?&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | TIFF output&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | JPEG output&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | PLplot graphics&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | OpenGL graphics&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | ppm (?)&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | unknown&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Fedora 13&lt;br /&gt;
| libXaw-devel&lt;br /&gt;
| gifsicle&lt;br /&gt;
| ffmpeg (needs the [http://rpmfusion.org/ RPM Fusion] repository enabled)&lt;br /&gt;
| ffmpeg-devel (needs the [http://rpmfusion.org/ RPM Fusion] repository enabled)&lt;br /&gt;
| libtiff-devel&lt;br /&gt;
| libjpeg-devel&lt;br /&gt;
| plplot-devel&lt;br /&gt;
| mesa-libGL-devel, freeglut, freeglut-devel&lt;br /&gt;
| netpbm-devel&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | openSUSE 11.0&lt;br /&gt;
| xorg-x11-devel&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
| libtiff-devel&lt;br /&gt;
| libjpeg-devel&lt;br /&gt;
| plplot-devel&lt;br /&gt;
| mesa-libGL-devel, freeglut, freeglut-devel&lt;br /&gt;
| netpbm-devel&lt;br /&gt;
| cairo-devel, gd-devel, glew-devel&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Numerical and file manipulation utilities&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | OpenMP&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | MPI&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | BLAS/ATLAS&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Interface to the Fast Discrete Curvelet Transform&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | sfunits&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Fedora 13&lt;br /&gt;
| libgomp&lt;br /&gt;
| openmpi, openmpi-devel; openmpi-libs (?)&lt;br /&gt;
| blas, blas-devel, atlas, atlas-devel&lt;br /&gt;
| [https://wave.eos.ubc.ca/Software/Licenced/ pyct]&lt;br /&gt;
| units&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | CentOS 5&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
| [https://wave.eos.ubc.ca/Software/Licenced/ pyct]&lt;br /&gt;
| [http://www.gnu.org/software/units/units.html Gnu Units]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Other&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Inclusions from Seismic Unix&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Fedora 14, 15&lt;br /&gt;
| [http://www.cwp.mines.edu/cwpcodes/ Seismic Unix]&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | CentOS 5&lt;br /&gt;
| [http://www.cwp.mines.edu/cwpcodes/ Seismic Unix]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Command to install all dependencies present in the public repositories&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Usually package management software will not install again a package that is already installed, so it should be safe to copy and paste the command below to a command line:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Fedora 15&lt;br /&gt;
| &#039;&#039;&#039;yum -y install&#039;&#039;&#039; binutils gcc glibc-headers scons texlive-latex subversion gcc-c++ gcc-gfortran numpy python python-devel swig octave octave-devel libgomp openmpi openmpi-devel blas blas-devel atlas atlas-devel units gifsicle ffmpeg ffmpeg-devel libtiff-devel libjpeg-devel plplot-devel mesa-libGL-devel freeglut freeglut-devel libXaw-devel netpbm-devel&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Fedora 13&lt;br /&gt;
| &#039;&#039;&#039;yum -y install&#039;&#039;&#039; binutils gcc glibc-headers scons texlive-latex subversion gcc-c++ gcc-gfortran numpy python swig octave octave-devel libgomp openmpi openmpi-devel blas blas-devel atlas atlas-devel units gifsicle ffmpeg ffmpeg-devel libtiff-devel libjpeg-devel plplot-devel mesa-libGL-devel freeglut freeglut-devel libXaw-devel netpbm-devel&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | CentOS 5&lt;br /&gt;
| &#039;&#039;&#039;yum -y install&#039;&#039;&#039; binutils freeglut freeglut-devel gcc gcc-c++ gcc-gfortran glibc-headers libjpeg-devel libXaw-devel netpbm-devel&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | openSUSE 11.0&lt;br /&gt;
| &#039;&#039;&#039;zypper install&#039;&#039;&#039; cairo-devel gcc gcc-c++ gcc-fortran gd-devel glew-devel libjpeg-devel libtiff-devel octave scons subversion texlive-latex xorg-x11-devel&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;List of runtime dependencies only&#039;&#039;&#039;&lt;br /&gt;
(needed by packagers of Madagascar in order to properly list dependencies):&lt;br /&gt;
UNDER CONSTRUCTION&lt;br /&gt;
&lt;br /&gt;
===Fedora 25===&lt;br /&gt;
The following explains how to install madagascar on Fedora 25.&lt;br /&gt;
&lt;br /&gt;
We use the following compiler: &amp;lt;code&amp;gt;gcc&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;g++&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;gfortran&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* Install some packages&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; inline style=&amp;quot;white-space:wrap&amp;quot;&amp;gt;sudo dnf install scons lapack-static lapack64-static atlas-static fftw-static gd gd-devel libtool-ltdl-devel \&lt;br /&gt;
libXaw-devel mesa-libGL-devel freeglut-devel netpbm-devel plplot-devel ffmpeg-devel swig openmpi openmpi-devel suitesparse-devel&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This installed the following packages:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
scons-2.5.1-1.fc25.noarch&lt;br /&gt;
lapack-static-3.6.1-2.fc25.x86_64&lt;br /&gt;
lapack64-static-3.6.1-2.fc25.x86_64&lt;br /&gt;
atlas-static-3.10.2-14.fc25.x86_64&lt;br /&gt;
fftw-static-3.3.5-3.fc25.x86_64&lt;br /&gt;
gd-2.2.4-1.fc25.x86_64&lt;br /&gt;
gd-devel-2.2.4-1.fc25.x86_64&lt;br /&gt;
libtool-ltdl-devel-2.4.6-13.fc25.x86_64&lt;br /&gt;
libXaw-devel-1.0.13-4.fc25.x86_64&lt;br /&gt;
mesa-libGL-devel-17.0.5-3.fc25.x86_64&lt;br /&gt;
freeglut-devel-3.0.0-3.fc24.x86_64&lt;br /&gt;
netpbm-devel-10.78.00-1.fc25.x86_64&lt;br /&gt;
plplot-devel-5.11.1-13.fc25.x86_64&lt;br /&gt;
ffmpeg-devel-3.1.9-1.fc25.x86_64&lt;br /&gt;
swig-3.0.11-1.fc25.x86_64&lt;br /&gt;
openmpi-1.10.5-1.fc25.x86_64&lt;br /&gt;
openmpi-devel-1.10.5-1.fc25.x86_64&lt;br /&gt;
suitesparse-devel-4.4.6-7.fc25.x86_64&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and many other dependencies.&lt;br /&gt;
&lt;br /&gt;
* Get the sources from the git repository&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;git clone https://github.com/ahay/src&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you run now the &amp;lt;code&amp;gt;configure&amp;lt;/code&amp;gt; script, you will get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
checking for Python ... /usr/bin/python&lt;br /&gt;
checking Python version ... 2.7.13&lt;br /&gt;
checking for RSFROOT ... /usr/local/rsf&lt;br /&gt;
checking for SCons ... /usr/bin/scons&lt;br /&gt;
checking SCons version ... v2.5.1.rel_2.5.1:3735:9dc6cee5c168[MODIFIED]&lt;br /&gt;
Running RSFROOT=/usr/local/rsf /usr/bin/scons  config ...&lt;br /&gt;
------------------------&lt;br /&gt;
scons: Reading SConscript files ...&lt;br /&gt;
checking platform ... (cached) linux [fedora]&lt;br /&gt;
checking for C compiler ... (cached) gcc&lt;br /&gt;
checking if gcc works ... yes&lt;br /&gt;
checking if gcc accepts &#039;-x c -std=gnu99 -Wall -pedantic&#039; ... yes&lt;br /&gt;
checking for ar ... (cached) ar&lt;br /&gt;
checking for libraries ... [&#039;m&#039;]&lt;br /&gt;
checking complex support ... yes&lt;br /&gt;
checking for X11 headers ... /usr/include&lt;br /&gt;
checking for X11 libraries ... /usr/lib&lt;br /&gt;
checking for OpenGL ... yes&lt;br /&gt;
checking for sfpen ... (cached) xtpen&lt;br /&gt;
checking for ppm ... yes&lt;br /&gt;
checking for tiff ... yes&lt;br /&gt;
checking for GD (PNG) ... yes&lt;br /&gt;
checking for GD (GIF) ... yes&lt;br /&gt;
checking for plplot ... no&lt;br /&gt;
&lt;br /&gt;
  Optional package: plplot-devel&lt;br /&gt;
checking for ffmpeg ... yes&lt;br /&gt;
checking for cairo (PNG) ... yes&lt;br /&gt;
checking for cairo (SVG) ... yes&lt;br /&gt;
checking for cairo (PDF) ... yes&lt;br /&gt;
checking for jpeg ... yes&lt;br /&gt;
checking for BLAS ... yes&lt;br /&gt;
checking for LAPACK ... no&lt;br /&gt;
&lt;br /&gt;
  Optional package: blas + blas-devel + atlas + atlas-devel&lt;br /&gt;
checking for SWIG ... (cached) /usr/bin/swig&lt;br /&gt;
checking for numpy ... (cached) yes&lt;br /&gt;
checking API options ... (cached) []&lt;br /&gt;
checking for C++ compiler ... (cached) g++&lt;br /&gt;
checking if g++ works ... yes&lt;br /&gt;
checking if g++ accepts &#039;-std=c++11 -U__STRICT_ANSI__ -Wall -pedantic&#039; ... yes&lt;br /&gt;
checking for MPICC ... (cached) /usr/lib64/openmpi/bin/mpicc&lt;br /&gt;
checking if /usr/lib64/openmpi/bin/mpicc works ... yes&lt;br /&gt;
checking for MPICXX ... (cached) /usr/lib64/openmpi/bin/mpicxx&lt;br /&gt;
checking if /usr/lib64/openmpi/bin/mpicxx works ... yes&lt;br /&gt;
checking for MPIRUN ... (cached) /usr/lib64/openmpi/bin/mpirun&lt;br /&gt;
checking for Posix threads ... yes&lt;br /&gt;
checking for OpenMP ... yes&lt;br /&gt;
checking for CUDA ... (cached) no&lt;br /&gt;
checking for FFTW ... yes&lt;br /&gt;
checking if FFTW supports threads ... yes&lt;br /&gt;
checking for SuiteSparse ... yes&lt;br /&gt;
checking for pfft ... no&lt;br /&gt;
scons: done reading SConscript files.&lt;br /&gt;
scons: Building targets ...&lt;br /&gt;
shell_script([&amp;quot;env.sh&amp;quot;], [])&lt;br /&gt;
shell_script([&amp;quot;env.csh&amp;quot;], [])&lt;br /&gt;
scons: done building targets.&lt;br /&gt;
------------------------&lt;br /&gt;
Done with configuration.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Libraries &amp;lt;code&amp;gt;plplot&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;lapack&amp;lt;/code&amp;gt; are not found. File &amp;lt;code&amp;gt;config.log&amp;lt;/code&amp;gt; says&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/bin/ld: cannot find -lplplotd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gcc -o .sconf_temp/sfconftest_21 .sconf_temp/conftest_21.o -L/usr/lib64/atlas -lm -lf77blas -lcblas -latlas -llapack -lcblas&lt;br /&gt;
/usr/lib64/atlas/liblapack.a(dgesv.o): In function `dgesv_&#039;:&lt;br /&gt;
(.text+0x69): undefined reference to `xerbla_&#039;&lt;br /&gt;
/usr/lib64/atlas/liblapack.a(ATL_f77wrap_dgesv.o): In function `atl_f77wrap_dgesv_&#039;:&lt;br /&gt;
(.text+0x10d): undefined reference to `ATL_xerbla&#039;&lt;br /&gt;
/usr/lib64/atlas/liblapack.a(ATL_dgetf2.o): In function `ATL_dgetf2&#039;:&lt;br /&gt;
(.text+0x184): undefined reference to `ATL_dger&#039;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So library &amp;lt;code&amp;gt;plplotd&amp;lt;/code&amp;gt; doesn&#039;t exist on Fedora 25 and the &amp;lt;code&amp;gt;configure&amp;lt;/code&amp;gt; script is looking for the wrong &amp;lt;code&amp;gt;lapack&amp;lt;/code&amp;gt; library.&lt;br /&gt;
&lt;br /&gt;
If compiling now, 2 other libraries won&#039;t be found: &amp;lt;code&amp;gt;gfortran&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;quadmath&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Regarding the &amp;lt;code&amp;gt;plplotd&amp;lt;/code&amp;gt; library, edit file &amp;lt;code&amp;gt;framework/configure.py&amp;lt;/code&amp;gt; and change the line 724:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line start=&amp;quot;724&amp;quot;&amp;gt;plplot = context.env.get(&#039;PLPLOT&#039;,&#039;plplotd&#039;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
to&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line start=&amp;quot;724&amp;quot;&amp;gt;plplot = context.env.get(&#039;PLPLOT&#039;,&#039;plplot&#039;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* As for the libraries&lt;br /&gt;
** &amp;lt;code&amp;gt;lapack&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;gfortran&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;quadmath&amp;lt;/code&amp;gt;&lt;br /&gt;
We must use the &amp;lt;code&amp;gt;lapack&amp;lt;/code&amp;gt; library installed in &amp;lt;code&amp;gt;/usr/lib64&amp;lt;/code&amp;gt;, not the one installed in &amp;lt;code&amp;gt;/usr/lib64/atlas&amp;lt;/code&amp;gt;. And libraries &amp;lt;code&amp;gt;gfortran&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;quadmath&amp;lt;/code&amp;gt; are installed in &amp;lt;code&amp;gt;/usr/lib/gcc/x86_64-redhat-linux/6.3.1/&amp;lt;/code&amp;gt;.&lt;br /&gt;
Edit file &amp;lt;code&amp;gt;framework/configure.py&amp;lt;/code&amp;gt; and add the following 4 lines:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[&#039;/usr/lib/gcc/x86_64-redhat-linux/6.3.1/&#039;,&lt;br /&gt;
 &#039;/usr/lib64/&#039;,&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LIBS.append(&#039;gfortran&#039;)&lt;br /&gt;
LIBS.append(&#039;quadmath&#039;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
so that we end up with the following &amp;lt;code&amp;gt;blas&amp;lt;/code&amp;gt; function: &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line start=&amp;quot;971&amp;quot;&amp;gt;def blas(context):&lt;br /&gt;
    context.Message(&amp;quot;checking for BLAS ... &amp;quot;)&lt;br /&gt;
    text = &#039;&#039;&#039;&lt;br /&gt;
    #ifdef __APPLE__&lt;br /&gt;
    #include &amp;lt;Accelerate/Accelerate.h&amp;gt;&lt;br /&gt;
    #else&lt;br /&gt;
    #ifdef HAVE_MKL&lt;br /&gt;
    #include &amp;lt;mkl.h&amp;gt;&lt;br /&gt;
    #else&lt;br /&gt;
    #include &amp;lt;cblas.h&amp;gt;&lt;br /&gt;
    #endif&lt;br /&gt;
    #endif&lt;br /&gt;
    int main(int argc,char* argv[]) {&lt;br /&gt;
    float d, x[]={1.,2.,3.}, y[]={3.,2.,1.};&lt;br /&gt;
    d = cblas_sdot(3,x,1,y,1);&lt;br /&gt;
    return 0;&lt;br /&gt;
    }\n&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    if plat[&#039;OS&#039;] == &#039;cygwin&#039;:&lt;br /&gt;
        context.env[&#039;ENV&#039;][&#039;PATH&#039;] = context.env[&#039;ENV&#039;][&#039;PATH&#039;] + \&lt;br /&gt;
                                         &#039;:/lib/lapack&#039;&lt;br /&gt;
&lt;br /&gt;
    res = context.TryLink(text,&#039;.c&#039;)&lt;br /&gt;
    if res: &lt;br /&gt;
        context.Result(res)&lt;br /&gt;
        context.env[&#039;BLAS&#039;] = True &lt;br /&gt;
    else:&lt;br /&gt;
        # first try blas&lt;br /&gt;
        LIBS = path_get(context,&#039;LIBS&#039;)&lt;br /&gt;
        blas = context.env.get(&#039;BLAS&#039;,&#039;blas&#039;)&lt;br /&gt;
        LIBS.append(blas)&lt;br /&gt;
        res = context.TryLink(text,&#039;.c&#039;)&lt;br /&gt;
        if res: &lt;br /&gt;
            context.Result(res)&lt;br /&gt;
            context.env[&#039;LIBS&#039;] = LIBS &lt;br /&gt;
            context.env[&#039;BLAS&#039;] = blas &lt;br /&gt;
        else:&lt;br /&gt;
            # some systems require cblas and atlas&lt;br /&gt;
            for atlas_dir in filter(os.path.isdir,&lt;br /&gt;
                                    [&#039;/usr/lib/gcc/x86_64-redhat-linux/6.3.1/&#039;,  # &amp;lt;--- add this line&lt;br /&gt;
                                     &#039;/usr/lib64/&#039;,                              # &amp;lt;--- add this line&lt;br /&gt;
                                     &#039;/usr/lib64/atlas/&#039;,&lt;br /&gt;
                                     &#039;/usr/lib/atlas/&#039;]):&lt;br /&gt;
                context.env[&#039;LIBPATH&#039;].append(atlas_dir)&lt;br /&gt;
            LIBS.pop()&lt;br /&gt;
            LIBS.append(&#039;f77blas&#039;)&lt;br /&gt;
            LIBS.append(&#039;cblas&#039;)&lt;br /&gt;
            LIBS.append(&#039;atlas&#039;)&lt;br /&gt;
            LIBS.append(&#039;gfortran&#039;)  # &amp;lt;----------------------------------------------- add this line&lt;br /&gt;
            LIBS.append(&#039;quadmath&#039;)  # &amp;lt;----------------------------------------------- add this line&lt;br /&gt;
            res = context.TryLink(text,&#039;.c&#039;)&lt;br /&gt;
            if res: &lt;br /&gt;
                context.Result(res)&lt;br /&gt;
                context.env[&#039;LIBS&#039;] = LIBS &lt;br /&gt;
                context.env[&#039;BLAS&#039;] = &#039;cblas&#039;&lt;br /&gt;
            else:&lt;br /&gt;
                context.Result(context_failure)&lt;br /&gt;
                context.env[&#039;CPPDEFINES&#039;] = \&lt;br /&gt;
                    path_get(context,&#039;CPPDEFINES&#039;,&#039;NO_BLAS&#039;)&lt;br /&gt;
                LIBS.pop()&lt;br /&gt;
                LIBS.pop()&lt;br /&gt;
                LIBS.pop()&lt;br /&gt;
                context.env[&#039;BLAS&#039;] = None &lt;br /&gt;
                need_pkg(&#039;blas&#039;, fatal=False)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* Run the &amp;lt;code&amp;gt;configure&amp;lt;/code&amp;gt; script, for example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;./configure --prefix=/usr/local/rsf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Output should give:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
checking for Python ... /usr/bin/python&lt;br /&gt;
checking Python version ... 2.7.13&lt;br /&gt;
checking for RSFROOT ... /usr/local/rsf&lt;br /&gt;
checking for SCons ... /usr/bin/scons&lt;br /&gt;
checking SCons version ... v2.5.1.rel_2.5.1:3735:9dc6cee5c168[MODIFIED]&lt;br /&gt;
Running RSFROOT=/usr/local/rsf /usr/bin/scons  config ...&lt;br /&gt;
------------------------&lt;br /&gt;
scons: Reading SConscript files ...&lt;br /&gt;
checking platform ... (cached) linux [fedora]&lt;br /&gt;
checking for C compiler ... (cached) gcc&lt;br /&gt;
checking if gcc works ... yes&lt;br /&gt;
checking if gcc accepts &#039;-x c -std=gnu99 -Wall -pedantic&#039; ... yes&lt;br /&gt;
checking for ar ... (cached) ar&lt;br /&gt;
checking for libraries ... [&#039;m&#039;]&lt;br /&gt;
checking complex support ... yes&lt;br /&gt;
checking for X11 headers ... /usr/include&lt;br /&gt;
checking for X11 libraries ... /usr/lib&lt;br /&gt;
checking for OpenGL ... yes&lt;br /&gt;
checking for sfpen ... (cached) xtpen&lt;br /&gt;
checking for ppm ... yes&lt;br /&gt;
checking for tiff ... yes&lt;br /&gt;
checking for GD (PNG) ... yes&lt;br /&gt;
checking for GD (GIF) ... yes&lt;br /&gt;
checking for plplot ... yes&lt;br /&gt;
checking for ffmpeg ... yes&lt;br /&gt;
checking for cairo (PNG) ... yes&lt;br /&gt;
checking for cairo (SVG) ... yes&lt;br /&gt;
checking for cairo (PDF) ... yes&lt;br /&gt;
checking for jpeg ... yes&lt;br /&gt;
checking for BLAS ... yes&lt;br /&gt;
checking for LAPACK ... yes&lt;br /&gt;
checking for SWIG ... (cached) /usr/bin/swig&lt;br /&gt;
checking for numpy ... (cached) yes&lt;br /&gt;
checking API options ... (cached) []&lt;br /&gt;
checking for C++ compiler ... (cached) g++&lt;br /&gt;
checking if g++ works ... yes&lt;br /&gt;
checking if g++ accepts &#039;-std=c++11 -U__STRICT_ANSI__ -Wall -pedantic&#039; ... yes&lt;br /&gt;
checking for MPICC ... (cached) /usr/lib64/openmpi/bin/mpicc&lt;br /&gt;
checking if /usr/lib64/openmpi/bin/mpicc works ... yes&lt;br /&gt;
checking for MPICXX ... (cached) /usr/lib64/openmpi/bin/mpicxx&lt;br /&gt;
checking if /usr/lib64/openmpi/bin/mpicxx works ... yes&lt;br /&gt;
checking for MPIRUN ... (cached) /usr/lib64/openmpi/bin/mpirun&lt;br /&gt;
checking for Posix threads ... yes&lt;br /&gt;
checking for OpenMP ... yes&lt;br /&gt;
checking for CUDA ... (cached) no&lt;br /&gt;
checking for FFTW ... yes&lt;br /&gt;
checking if FFTW supports threads ... yes&lt;br /&gt;
checking for SuiteSparse ... yes&lt;br /&gt;
checking for pfft ... no&lt;br /&gt;
scons: done reading SConscript files.&lt;br /&gt;
scons: Building targets ...&lt;br /&gt;
shell_script([&amp;quot;env.sh&amp;quot;], [])&lt;br /&gt;
shell_script([&amp;quot;env.csh&amp;quot;], [])&lt;br /&gt;
scons: done building targets.&lt;br /&gt;
------------------------&lt;br /&gt;
Done with configuration.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* Then run the compilation:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;make&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* and finally the installation&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;sudo make install&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Debian 5==&lt;br /&gt;
Specific dependencies:&lt;br /&gt;
* Debian 5.0 (&amp;quot;Lenny&amp;quot;): Please make sure you have the &amp;lt;tt&amp;gt;libc6-dev&amp;lt;/tt&amp;gt; package before trying to compile from source. The &amp;lt;tt&amp;gt;libXaw7-dev&amp;lt;/tt&amp;gt; package might be a dependency for &amp;lt;tt&amp;gt;xtpen&amp;lt;/tt&amp;gt; (was in Debian 4.0)&lt;br /&gt;
&lt;br /&gt;
==Yellow Dog Linux 6.1 on Sony PlayStation 3==&lt;br /&gt;
See [http://www.reproducibility.org/rsflog/uploads/Friday_Seminar_Madagascar_on_PS3.ppt Will Burnett&#039;s guide (PowerPoint)]&lt;br /&gt;
&lt;br /&gt;
==Mac OS X==&lt;br /&gt;
&lt;br /&gt;
Install necessary Mac OS X applications using:&lt;br /&gt;
* [http://www.macports.org/ MacPorts], an easy-to-use system for compiling, installing, and upgrading open-source software on Mac OS X.&lt;br /&gt;
* [http://www.finkproject.org/ Fink], a tool that brings the full world of Unix Open Source software to Mac OS X. &lt;br /&gt;
&lt;br /&gt;
Installation on Mac OS X Mountain Lion requires the following:&lt;br /&gt;
# &amp;lt;b&amp;gt;Xcode&amp;lt;/b&amp;gt;: Download and install [https://developer.apple.com/xcode/ XCode] from Apple using App Store application. In Xcode, make sure to enable and install the command-line tools in Xcode/Preferences/Downloads &lt;br /&gt;
# (Optionally) &amp;lt;b&amp;gt;X11&amp;lt;/b&amp;gt;: Install X11 libraries from [http://xquartz.macosforge.org Xquartz]. &lt;br /&gt;
# (Optionally) &amp;lt;b&amp;gt;gcc&amp;lt;/b&amp;gt;: Install the Gnu C compiler from [http://hpc.sourceforge.net HPC Mac OS X]. &lt;br /&gt;
# (Optionally) [[SEGTeX]]: To use &amp;lt;b&amp;gt;SEGTeX&amp;lt;/b&amp;gt;, you may need [http://www.tug.org/texlive/ TeX Live]. &amp;lt;b&amp;gt;MacPorts&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;Fink&amp;lt;/b&amp;gt; provide an easy way to install it with commands &amp;lt;pre&amp;gt;sudo port install texlive&amp;lt;/pre&amp;gt; or &amp;lt;pre&amp;gt;sudo fink install texlive&amp;lt;/pre&amp;gt;&lt;br /&gt;
# (Optionally) &amp;lt;b&amp;gt;FFTW&amp;lt;/b&amp;gt;: Using &amp;lt;b&amp;gt;MacPorts&amp;lt;/b&amp;gt;, run &amp;lt;pre&amp;gt;sudo port install fftw-3-single&amp;lt;/pre&amp;gt;&amp;lt;pre&amp;gt;sudo port install fftw-3 +gfortran&amp;lt;/pre&amp;gt;&lt;br /&gt;
# (Optionally) &amp;lt;b&amp;gt;MPI&amp;lt;/b&amp;gt;: Using &amp;lt;b&amp;gt;MacPorts&amp;lt;/b&amp;gt;, run &amp;lt;pre&amp;gt;sudo port install openmpi&amp;lt;/pre&amp;gt;&amp;lt;pre&amp;gt;sudo port select --set mpi openmpi-mp-fortran&amp;lt;/pre&amp;gt;&lt;br /&gt;
# (Optionally) &amp;lt;b&amp;gt;ppmpen&amp;lt;/b&amp;gt;: Using &amp;lt;b&amp;gt;MacPorts&amp;lt;/b&amp;gt;, run &amp;lt;pre&amp;gt;sudo port install libnetpbm&amp;lt;/pre&amp;gt;&lt;br /&gt;
# (Optionally) &amp;lt;b&amp;gt;Open vplots using double click&amp;lt;/b&amp;gt;: [[machacks|Instructions]].&lt;br /&gt;
# Install python with libraries including jupyter and  ipython.  I recommend the Anaconda distribution.  which is available at https://www.anaconda.com/download&lt;br /&gt;
# (Optionally) &amp;lt;b&amp;gt;SWIG&amp;lt;/b&amp;gt; is required for some of the options of the Python api (used if you are coding in Python).  run  &amp;lt;pre&amp;gt;conda install swig&amp;lt;/pre&amp;gt; . I had to run&amp;lt;pre&amp;gt;cp `which siwg` /usr/local/bin&amp;lt;/pre&amp;gt; to get ./configure to find swig. &lt;br /&gt;
#Proceed with configuration and installation following the normal procedure.  You may need to use Apple&#039;s compiler (clang) instead of gcc.  Use one of these commands in the $RSFSRC directory &amp;lt;pre&amp;gt;./configure CC=clang CXX=clang++&amp;lt;/pre&amp;gt; or &amp;lt;pre&amp;gt;./configure CC=clang CXX=clang++ API=python --prefix=`pwd`&amp;lt;/pre&amp;gt;&lt;br /&gt;
#build the system with: &amp;lt;pre&amp;gt;make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
#After installing a new version of python you must run: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./configure &lt;br /&gt;
make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==OpenSolaris==&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;tt&amp;gt;pkg&amp;lt;/tt&amp;gt; to install missing components such as X11 headers.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
pfexec pkg install SUNWxorg-headers&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==MS Windows==&lt;br /&gt;
Due to its size, this topic has been assigned [[Windows | its own Wiki page]].&lt;br /&gt;
&lt;br /&gt;
==How to adapt Madagascar to a new platform==&lt;br /&gt;
The most laborious part of adapting madagascar to a new platform is finding the proper dependency names. This usually proceeds as follows: dependency X fails with a &amp;quot;missing file&amp;quot; error either as a header file in &amp;lt;tt&amp;gt;config.log&amp;lt;/tt&amp;gt;, or a missing library during the build step. Possible package names are found through an internet search for the missing file name and the distribution name or by using specific [http://rpm.pbone.net/ rpm search tools]. Packages are installed and the configure (and, if necessary) build processes are repeated until the error goes away.&lt;br /&gt;
&lt;br /&gt;
=Multi-user installs=&lt;br /&gt;
Some organizations may find it desirable to deny write access of some users to all RSFSRC/RSFROOT except their own user directory. Fortunately, this can be easily done by placing the restricted user dirs outside RSFSRC/RSFROOT, i.e. in their home dirs, say /home/joe/rsfsrc. In order to move a user&#039;s directory out of RSFSRC, you must:&lt;br /&gt;
* &amp;quot;tell&amp;quot; the SConstruct in the user&#039;s dir where to find RSFSRC so that when the user builds in his directory, it can import &amp;lt;tt&amp;gt;configure.py&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;config.py&amp;lt;/tt&amp;gt; You do that by setting the environment variable RSFSRC to the absolute path of the Madagascar source root, and by making sure that lines 2 and 3 in the users&#039; SConstruct files are&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
srcroot = os.environ.get(&#039;RSFSRC&#039;, &#039;../..&#039;)&lt;br /&gt;
sys.path.append(srcroot)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
and then replace &amp;lt;tt&amp;gt;../..&amp;lt;/tt&amp;gt; throughout the SConstruct using &amp;lt;tt&amp;gt;os.path.join&amp;lt;/tt&amp;gt; and the &amp;lt;tt&amp;gt;srcroot&amp;lt;/tt&amp;gt; variable.&lt;br /&gt;
* &amp;quot;tell&amp;quot; the build scripts about the user&#039;s dir, so that it is included in the builds launched from RSFSRC. You do that with a symbolic link:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ln -s /home/joe/rsfsrc $RSFSRC/user/joe&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&#039;&#039;When the link exists&#039;&#039;, those of Joe&#039;s programs that are mentioned in the &amp;quot;prog&amp;quot; string in SConstruct get included in the distribution, complete with self-doc. If Joe is just learning how to code and his stuff breaks the build, just remove the symbolic link. Even if build+installs are done after the link is removed, his stable programs and self-doc will continue to remain installed system-wide as long as the admin does not type &amp;lt;tt&amp;gt;scons -c install&amp;lt;/tt&amp;gt; (not likely).&lt;br /&gt;
* point the user&#039;s RSFDOC environment variable to a location where the user has write access&lt;br /&gt;
* edit the users&#039; SConstruct so that it uses the RSF library and headers already installed in $RSFROOT/lib and $RSFROOT/include , instead of building again the whole &amp;lt;tt&amp;gt;librsf&amp;lt;/tt&amp;gt; with user-specific flags in &amp;lt;tt&amp;gt;RSFSRC/filt/lib/&amp;lt;/tt&amp;gt;. To do that, replace in the user&#039;s SConstruct the env.Prepend statement with&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
rsfroot = os.environ.get(&#039;RSFROOT&#039;,&#039;/usr/local/rsf&#039;)&lt;br /&gt;
&lt;br /&gt;
env.Prepend(CPPPATH=[os.path.join(rsfroot,&#039;include&#039;)],&lt;br /&gt;
            LIBPATH=[os.path.join(rsfroot,&#039;lib&#039;)],&lt;br /&gt;
            LIBS=[&#039;rsf&#039;])&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* If the link from RSFSRC to Joe&#039;s directory was not made, add Joe&#039;s directory to his own path so that he can execute his own binaries.&lt;br /&gt;
&lt;br /&gt;
To understand how $DATAPATH disk space issues may become an issue in a multi-user environment, refer to the [[Advanced_Installation#Disk_space|Disk Space subsection]] at the beginning of this document.&lt;br /&gt;
&lt;br /&gt;
=Keeping your stuff separate=&lt;br /&gt;
A user may add his own programs and recipes to the Madagascar system. He may also create his own computational examples, data, and locked figures for testing. All of these components can be placed in their default locations, but it is not necessary to make them public. To keep these items private simply do not add them to the repository.&lt;br /&gt;
&lt;br /&gt;
However, it might be desirable to keep these components in separate places. For example, if you keep your private programs in RSFSRC/user you will have to remember to make a copy somewhere else if you ever want to delete the Madagascar installation to perform a fresh install. Yup, I deleted all my programs that way once. Good thing I had a back up! Fortunately, it is easy to keep each of these components in a separate place if desired.&lt;br /&gt;
&lt;br /&gt;
==Keeping programs separate==&lt;br /&gt;
User programs are ordinarily kept in a subdirectory of RSFSRC/user.  However, if you want to keep your programs separate all you have to do is put your subdirectory somewhere else and make a link to it in RSFSRC/user:&lt;br /&gt;
&amp;lt;bash&amp;gt;&lt;br /&gt;
ln -s path_to_my_programs $RSFSRC/user/my_programs&lt;br /&gt;
&amp;lt;/bash&amp;gt;&lt;br /&gt;
The additional instructions above for &amp;quot;multi-user installs&amp;quot; are for the case where the other users do not have write access to RSFSRC.  However, if you have full write access and only want to keep the programs in a separate place the link is the only thing you need.&lt;br /&gt;
&lt;br /&gt;
===Problems when symbolic linking and using SVN=== &lt;br /&gt;
If you decide to use a symbolic link e.g. &amp;quot;ln -s ...&amp;quot; as above, you will have difficulties checking in your code into the SVN repository.  SVN typically does not follow the symbolic link but will only the save the symbolic link.   &lt;br /&gt;
&lt;br /&gt;
See this answer from Stackoverflow (http://stackoverflow.com/questions/24850844/follow-symlinks-in-svn)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If I understand your problem, you have:&lt;br /&gt;
&lt;br /&gt;
project1/&lt;br /&gt;
project1/link1 -&amp;gt; ../../some/where/else&lt;br /&gt;
&lt;br /&gt;
If you do a simple svn add link1 it adds a symlink entry to the subversion repository, but what you&#039;re trying to accomplish is getting the stuff under somewhere else into the tree.&lt;br /&gt;
&lt;br /&gt;
If this is the case, then you&#039;re fighting in the wrong direction, you should make the real files and directories under link1, and make the target locations symlinks into the link1 directory. That would be a simple solution to the problem.&lt;br /&gt;
&lt;br /&gt;
Another solution would be to make the location ../../some/where/else an svn location in it&#039;s own right, and make link1 an externals definition to that location. When you commit in the main directory, the externals would be committed at the same time which would achieve storing the information; however to ensure that the other location was kept in sync, you would have to make sure to update it to the same version as the stored data.&lt;br /&gt;
&lt;br /&gt;
In my case, on my desktop, I have a settings directory:&lt;br /&gt;
&lt;br /&gt;
$HOME/settings&lt;br /&gt;
&lt;br /&gt;
This is a checked out copy of a directory containing .bashrc, .profile, .vimrc, .vim, etc. files and folders from an svn repo. All my profile files and directories were symlinks into this folder, so for example .profile -&amp;gt; settings/.profile, etc. When I make changes, they are reflected in the svn tree, which I can commit back to in order to ensure that I don&#039;t lose my config settings when I go to another system.&lt;br /&gt;
&lt;br /&gt;
If you really want svn to follow symlinks as hardlinks (You can&#039;t make directory hardlinks because it would be a bad thing™), then you&#039;ll have to hack the svn client source so that it did what you wanted; but this would be a maintenance nightmare.&lt;br /&gt;
&lt;br /&gt;
You could get away with making the symlink into a bind mount point directed at the target, but that has it&#039;s own issues - you would need to be root to accomplish this, and it ends up leaving funny entries in your /proc/mounts to accomplish this:&lt;br /&gt;
&lt;br /&gt;
mount --bind /absolute/path/to/some/where/else project1/link1&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Keeping recipes separate==&lt;br /&gt;
Computational recipes written in Python and imported by the SConstruct file of a workflow are normally stored in RSFSRC/book/Recipes.  The install process copies these recipes to a directory like $RSFROOT/lib/python2.5/site-packages/rsf/recipes and adds this directory to your PYTHONPATH so that Python can find them.&lt;br /&gt;
&lt;br /&gt;
However, you can put you own recipes anywhere you want.  You only have to add that place to your PYTHONPATH like this (bash):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
export PYTHONPATH=${PYTHONPATH}:path_to_my_recipes&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Or like this (csh):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
setenv PYTHONPATH ${PYTHONPATH}:path_to_my_recipes&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Keeping examples separate==&lt;br /&gt;
Madagascar&#039;s public collection of example workflows are stored in RSFSRC/book, but you can put your private workflows anywhere you want.  No special instructions are required.&lt;br /&gt;
&lt;br /&gt;
However, Madagascar assumes that the workflows are organized into a three-level book/chapter/section directory hierarchy when it creates a directory tree for the data and locked figures associated with your workflow. It is not required, but it might be easier to find the data and locked figures if you put your workflows in a three-level directory tree something like this: path_to_my_book/chapter/section/SConstruct.&lt;br /&gt;
&lt;br /&gt;
==Keeping data separate==&lt;br /&gt;
The location of the data portion of your *.rsf files is controlled by your DATAPATH environment variable.  However, you may want to keep the data for your private workflows in a different place, or several different places, than the data created by the public examples in RSFSRC/book.  The way to do that is to temporarily change the DATAPATH variable in the SConstruct &#039;&#039;before&#039;&#039; importing rsf.proj like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import os&lt;br /&gt;
os.environ[&#039;DATAPATH&#039;] = &#039;path_to_my_private_data&#039;&lt;br /&gt;
&lt;br /&gt;
from rsf.proj import *&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Keeping locked figures separate==&lt;br /&gt;
The command &amp;quot;scons lock&amp;quot; in the directory of a workflow will store a &amp;quot;locked&amp;quot; copy of your figures for regression testing.  Normally these figures are stored in the location pointed to by your RSFFIGS variable, and that is where the figures from the figures repository should be stored for testing in RSFSRC/book.&lt;br /&gt;
&lt;br /&gt;
However, you may want to keep your private figures in a different place.  The way to do that is to temporarily change the RSFFIGS variable in the SConstruct &#039;&#039;before&#039;&#039; importing rsf.proj like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import os&lt;br /&gt;
os.environ[&#039;RSFFIGS&#039;] = &#039;path_to_my_private_figures&#039;&lt;br /&gt;
&lt;br /&gt;
from rsf.proj import *&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
If you also create a RSFALTFIGS environment variable pointing to path_to_my_private_figures, then the testing script sffiglist will automatically test your figures against those in RSFALTFIGS when the sffiglist command is executed from a location outside of RSFSRC/book.&lt;br /&gt;
&lt;br /&gt;
=Capturing error and warning messages=&lt;br /&gt;
The messages during configuration are few and their importance quite high, so they should be watched &amp;quot;in person&amp;quot;. A complete log of the configuration process is recorded in RSFSRC/configure.log&lt;br /&gt;
&lt;br /&gt;
Console messages generated during the build step can be captured to a log file and observed at the same time with a command like this (tcsh):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
nice +10 nohup /usr/bin/time -p scons -k |&amp;amp; tee log_build.asc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The log file can be of course named otherwise than &amp;lt;tt&amp;gt;log_build.asc&amp;lt;/tt&amp;gt;. The file can be later grepped for error and warnings with commands such as:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
grep -c error log_build.asc&lt;br /&gt;
grep error log_build.asc | awk &#039;/error.c/ {next}; /error.h/ {next}; /error.o/ {next}; {print}&#039;&lt;br /&gt;
grep -c warning log_build.asc&lt;br /&gt;
grep warning log_build.asc | awk &#039;/imaginary constants are a GCC extension/ {next}; {print}&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Advanced troubleshooting=&lt;br /&gt;
* If you removed one of your programs or changed its name, and &amp;lt;tt&amp;gt;scons install&amp;lt;/tt&amp;gt; fails with &amp;quot;Source &amp;lt;tt&amp;gt;oldprogname&amp;lt;/tt&amp;gt; not found, needed by target install&amp;quot;, and you cleaned everything there was to clean but still get this message, remove &amp;lt;tt&amp;gt;RSFSRC/.sconsign*&amp;lt;/tt&amp;gt;&lt;br /&gt;
* If during &amp;lt;tt&amp;gt;scons install&amp;lt;/tt&amp;gt; you get a &amp;lt;tt&amp;gt;DBAccessError : (13, &#039;Permission denied&#039;)&amp;lt;/tt&amp;gt; in some reproducible papers, check permissions in your &amp;lt;tt&amp;gt;$DATAPATH&amp;lt;/tt&amp;gt; directory. This is where SCons places database &amp;quot;.sconsign&amp;quot; files for its dependencies (according to the rules in &amp;lt;tt&amp;gt;rsf.proj&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;rsf.tex&amp;lt;/tt&amp;gt;).&lt;br /&gt;
* If &amp;lt;tt&amp;gt;scons&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;scons install&amp;lt;/tt&amp;gt; fail due to an a bug introduced in a tool you are certain you will not use, a quick workaround for the problem is already built into scons: the &amp;lt;tt&amp;gt;-k&amp;lt;/tt&amp;gt; option, which means &amp;quot;keep going&amp;quot;. Thus, if you use &amp;lt;tt&amp;gt;scons -k&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;scons -k install&amp;lt;/tt&amp;gt;, SCons will not be able to build the failed component, or anything that depends on it, but it will keep going and make everything else that it can.&lt;br /&gt;
&lt;br /&gt;
=Further support=&lt;br /&gt;
Subscribe to the [https://lists.sourceforge.net/lists/listinfo/rsf-user rsf-user mailing list].&lt;/div&gt;</summary>
		<author><name>Karl</name></author>
	</entry>
	<entry>
		<id>https://ahay.org/index.php?title=Advanced_Installation&amp;diff=3750</id>
		<title>Advanced Installation</title>
		<link rel="alternate" type="text/html" href="https://ahay.org/index.php?title=Advanced_Installation&amp;diff=3750"/>
		<updated>2018-12-13T23:05:23Z</updated>

		<summary type="html">&lt;p&gt;Karl: /* Mac OS X */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:Fotolia_419157_XS.jpg|right|]]&lt;br /&gt;
Before reading this document, please familiarize yourself with the [[Installation|short Installation guide]].&lt;br /&gt;
=What the installation process does=&lt;br /&gt;
The term &amp;quot;installation&amp;quot; in the title is used for brevity, and it actually covers all three steps: configuration, build and install.&lt;br /&gt;
# Configure: determine what tools are available on the system and how they should be used to built the software. Creates a layer of abstraction so that the build is platform-independent. Should ideally either solve or flag all problems, so that the build either works, or does not proceed at all.&lt;br /&gt;
# Build: compiles the software and documentation using RSFSRC/build as a &amp;quot;workplace&amp;quot;&lt;br /&gt;
# Install: moves the compiled executables and the documentation to the final locations in $RSFROOT, sometimes changing filenames. Kept separate from build so that it can be done by root, and to avoid build failures leaving junk files all over the system.&lt;br /&gt;
A successful installation will have created in &amp;lt;tt&amp;gt;$RSFROOT&amp;lt;/tt&amp;gt; the following directories:&lt;br /&gt;
* &amp;lt;tt&amp;gt;bin/&amp;lt;/tt&amp;gt;: executable programs&lt;br /&gt;
* &amp;lt;tt&amp;gt;doc/&amp;lt;/tt&amp;gt;: auto-generated HTML documentation&lt;br /&gt;
* &amp;lt;tt&amp;gt;include/&amp;lt;/tt&amp;gt;: header files with info on library procedures; fonts&lt;br /&gt;
* &amp;lt;tt&amp;gt;lib/&amp;lt;/tt&amp;gt;: libraries and Python modules&lt;br /&gt;
&lt;br /&gt;
=Old (1.0 and 1.1) version installation=&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;tt&amp;gt;$RSFROOT/etc/madagascar/&amp;lt;/tt&amp;gt; as the location of &amp;lt;tt&amp;gt;env&amp;lt;/tt&amp;gt; scripts instead of &amp;lt;tt&amp;gt;$RSFROOT/share/madagascar/etc/&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=Old (0.9.9) version installation=&lt;br /&gt;
&lt;br /&gt;
====Environment variables====&lt;br /&gt;
Example configuration for &amp;lt;tt&amp;gt;bash&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
export RSFROOT=/usr/local/rsf # directory where Madagascar will be installed. &lt;br /&gt;
if [ -n &amp;quot;$PYTHONPATH&amp;quot; ]; then&lt;br /&gt;
export PYTHONPATH=${PYTHONPATH}:$RSFROOT/lib&lt;br /&gt;
else&lt;br /&gt;
export PYTHONPATH=$RSFROOT/lib&lt;br /&gt;
fi&lt;br /&gt;
export PATH=$RSFROOT/bin:$PATH&lt;br /&gt;
export DATAPATH=/var/tmp/&lt;br /&gt;
export MANPATH=$RSFROOT/share/man:$(manpath)&lt;br /&gt;
export LD_LIBRARY_PATH=$RSFROOT/lib:$LD_LIBRARY_PATH&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Notice the slash at the end of the &amp;lt;tt&amp;gt;DATAPATH&amp;lt;/tt&amp;gt; variable. &lt;br /&gt;
&lt;br /&gt;
Example configuration for &amp;lt;tt&amp;gt;csh&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;tcsh&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
setenv RSFROOT /usr/local/rsf&lt;br /&gt;
if ($?PYTHONPATH) then&lt;br /&gt;
setenv PYTHONPATH ${PYTHONPATH}:$RSFROOT/lib&lt;br /&gt;
else&lt;br /&gt;
setenv PYTHONPATH $RSFROOT/lib&lt;br /&gt;
endif&lt;br /&gt;
set path = ($RSFROOT/bin $path)&lt;br /&gt;
setenv DATAPATH /var/tmp/&lt;br /&gt;
setenv MANPATH $RSFROOT/share/man:`manpath`&lt;br /&gt;
setenv LD_LIBRARY_PATH $RSFROOT/lib:$LD_LIBRARY_PATH&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Notice the backticks surrounding the call to &amp;lt;tt&amp;gt;manpath&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Be aware that on some systems /var/tmp gets automatically cleaned at some intervals, so if you want to keep your data binaries for a long time, set &amp;lt;tt&amp;gt;DATAPATH&amp;lt;/tt&amp;gt; to another location where you have write access and that allows large files.&lt;br /&gt;
&lt;br /&gt;
====Software construction====&lt;br /&gt;
  &lt;br /&gt;
#Configuration. Change to the top source directory and run &amp;lt;pre&amp;gt;./configure&amp;lt;/pre&amp;gt; You can examine the &amp;lt;tt&amp;gt;config.py&amp;lt;/tt&amp;gt; file that this command generates.  Additional options are available. You can obtain a full list of customizable variables by running &amp;lt;tt&amp;gt;scons -h&amp;lt;/tt&amp;gt;. For example, to install C++ and Fortran-90 API bindings in addition to the basic package, run &amp;lt;pre&amp;gt;./configure API=c++,fortran-90&amp;lt;/pre&amp;gt; &lt;br /&gt;
#Building and installing the package. Run &amp;lt;tt&amp;gt;scons install&amp;lt;/tt&amp;gt; or the following two commands in succession:  &amp;lt;pre&amp;gt;make; make install&amp;lt;/pre&amp;gt; or &amp;lt;pre&amp;gt;scons; scons install&amp;lt;/pre&amp;gt; If you need &amp;quot;root&amp;quot; privileges for installing under &amp;lt;tt&amp;gt;&amp;amp;#36;RSFROOT&amp;lt;/tt&amp;gt;, you may need to run &amp;lt;pre&amp;gt;su; scons install &amp;lt;/pre&amp;gt; or &amp;lt;pre&amp;gt;sudo scons install&amp;lt;/pre&amp;gt;&lt;br /&gt;
#Cleaning. To clean all intermediate files generated by SCons, run &amp;lt;pre&amp;gt;make clean&amp;lt;/pre&amp;gt; or &amp;lt;pre&amp;gt;scons -c&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Prerequisites=&lt;br /&gt;
Basic prerequisites are described in the [[Installation|short Installation guide]]. Here are some additional details. &lt;br /&gt;
==Compilers==&lt;br /&gt;
Madagascar has been built successfully with the following compilers, and possibly with others:&lt;br /&gt;
* gcc&lt;br /&gt;
* Intel (icc/ifort)&lt;br /&gt;
* open64&lt;br /&gt;
* clang&lt;br /&gt;
* cc (Solaris)&lt;br /&gt;
&lt;br /&gt;
==Python and SCons==&lt;br /&gt;
As described below under [[Advanced Installation#Platform-specific installation advice | Platform-specific installation advice]], Madagascar supports the oldest non-deprecated Python version currently supported by the latest stable version of [http://scons.org/ SCons].  If your version of Python is older and you experience problems you should probably [http://www.python.org/ upgrade].&lt;br /&gt;
&lt;br /&gt;
Madagascar includes the latest stable version of SCons and the configure scripts will try to install it for you in RSFROOT if you don&#039;t have it already.  However, if you have an older version of SCons the configure scripts will not try to install the newer version. Your older version might work fine, but Madagascar attempts to support only the latest stable version of SCons, so if you have problems you should upgrade.&lt;br /&gt;
&lt;br /&gt;
To install the SCons bundled with Madagascar go to &amp;lt;tt&amp;gt;RSFSRC/scons&amp;lt;/tt&amp;gt;, unpack the tar file, and type&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
python setup.py install&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will install SCons in the standard location. You might need root privileges. If you don&#039;t have root privileges, or you don&#039;t want to interfere with the system SCons you can install it somewhere else with a --prefix option. A logical choice is to put it in RSFROOT like this:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
python setup.py install --prefix=$RSFROOT&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Location==&lt;br /&gt;
As long as you set the environment variables and directory permissions correctly, it does not matter in what part of your filesystem you place the install. If you have the luxury of installing anywhere, it is good practice to follow the [http://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard Filesystem Hierarchy Standard] and either:&lt;br /&gt;
# Install everything (including &amp;lt;tt&amp;gt;figs&amp;lt;/tt&amp;gt; if you do testing) under &amp;lt;tt&amp;gt;/usr/local/rsf&amp;lt;/tt&amp;gt;, with the source tree in &amp;lt;tt&amp;gt;/usr/local/rsf/src&amp;lt;/tt&amp;gt;, OR &lt;br /&gt;
# Put the source tree in &amp;lt;tt&amp;gt;/usr/local/src/rsf&amp;lt;/tt&amp;gt;, and specify &amp;lt;tt&amp;gt;RSFROOT=/usr/local&amp;lt;/tt&amp;gt;, so that header files and binaries go in &amp;lt;tt&amp;gt;/usr/local/bin&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;/usr/local/include&amp;lt;/tt&amp;gt;. To follow the standard, before installing set &amp;lt;tt&amp;gt;RSFDOC=/usr/local/share/rsf/doc&amp;lt;/tt&amp;gt; and create the appropriate directories. The auto-generated HTML documentation will get put there. Also, if installed, the figs directory for testing should be &amp;lt;tt&amp;gt;/usr/local/share/rsf/figs/&amp;lt;/tt&amp;gt;.&lt;br /&gt;
# Package Madagascar (i.e. build a RPM, etc) and install it in the default locations. For RPMs, those are as like the ones from the previous option, just directly in the &amp;lt;tt&amp;gt;/usr/&amp;lt;/tt&amp;gt; hierarchy, instead of in the &amp;lt;tt&amp;gt;/usr/local/&amp;lt;/tt&amp;gt; one.&lt;br /&gt;
&lt;br /&gt;
==Disk space==&lt;br /&gt;
At present (Feb 2007, r2530), the source directory containing the build tree from the development version was approx. 200Mb, the full installation (&amp;lt;tt&amp;gt;bin/&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;doc/&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;include/&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;lib&amp;lt;/tt&amp;gt;) is 31Mb, and &amp;lt;tt&amp;gt;figs/&amp;lt;/tt&amp;gt; (the optional directory if you want to do testing) is about 10 Gb. The stable version is significantly smaller.&lt;br /&gt;
&lt;br /&gt;
The only Madagascar-related directory where disk space can be an issue is &amp;lt;tt&amp;gt;$DATAPATH&amp;lt;/tt&amp;gt;. Real 3-D seismic datasets can be measured in Terabytes. Buggy programs/processing flows can fill up &amp;lt;tt&amp;gt;$DATAPATH&amp;lt;/tt&amp;gt;. A real problem are &amp;quot;disk memory leaks&amp;quot; -- removing header files with anything else than &amp;lt;tt&amp;gt;sfrm&amp;lt;/tt&amp;gt; will leave the binaries intact. Crashed jobs which start to write to binary but never get to write the header also produce &amp;quot;leaks&amp;quot;. Experience has shown that over time &amp;lt;tt&amp;gt;$DATAPATH&amp;lt;/tt&amp;gt; inexorably fills up. You may need to &lt;br /&gt;
# keep irreplaceable data and expensive results in a separate place;&lt;br /&gt;
# remove the oldest files in &amp;lt;tt&amp;gt;$DATAPATH&amp;lt;/tt&amp;gt; whenever the amount of free space declines under a preset threshold.&lt;br /&gt;
&lt;br /&gt;
==Dependencies==&lt;br /&gt;
Some platforms feature complete lists of dependencies. See [[Advanced Installation#Platform-specific installation advice | Platform-specific installation advice]] for details.&lt;br /&gt;
===C++ API===&lt;br /&gt;
A C++ compiler. SCons is smart and will try to find it for you. If it does not work specify the path to your compiler in the &amp;lt;tt&amp;gt;CXX&amp;lt;/tt&amp;gt; environment variable (can be passed as an option to the configuration script, like the &amp;lt;tt&amp;gt;API&amp;lt;/tt&amp;gt; one).&lt;br /&gt;
===F77 API===&lt;br /&gt;
A Fortran 77 compiler. If SCons does not find one, then you can either specify its path through the &amp;lt;tt&amp;gt;F77&amp;lt;/tt&amp;gt; variable, or if the executable is in your path, add its name to the list of F77 compilers in &amp;lt;tt&amp;gt;RSFSRC/configure.py&amp;lt;/tt&amp;gt; .&lt;br /&gt;
===F90 API===&lt;br /&gt;
Same as for Fortran 77 &amp;amp;ndash; just substitute &amp;lt;tt&amp;gt;F90&amp;lt;/tt&amp;gt;. If using the &amp;lt;tt&amp;gt;gfortran&amp;lt;/tt&amp;gt; compiler, make sure to get [http://gcc.gnu.org/wiki/GFortranBinaries the latest version]. If you have more than one compiler installed on your system, specify the desired one at configuration time:&lt;br /&gt;
&amp;lt;bash&amp;gt;&lt;br /&gt;
./configure API=f90 F90=/path/to/preferred/compiler&lt;br /&gt;
&amp;lt;/bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Java API===&lt;br /&gt;
There are two styles of API, old (1.0 release and previous) and new. The two APIs are not compatible with each other.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;old&amp;quot; interface requires the Mines Java Toolkit for fast Java file IO. The Mines JTK, is an open-source Java package that can be downloaded from [http://inside.mines.edu/~dhale/jtk/ Mines JTK]. Currently, the &amp;quot;old&amp;quot; interface will also build alongside the new one if the MINESJTK environment variable exists, and can be used as was previously.&lt;br /&gt;
&lt;br /&gt;
To install the new API, you need the (Oracle) JDK. Set your JAVA_HOME environment variable to the location of the jdk (on Ubuntu 10.04 this is: /usr/lib/jvm/java-6-openjdk), then reconfigure (./configure API=java ...) and reinstall.  &lt;br /&gt;
&lt;br /&gt;
Ignore the SWIG warnings (there are lots). &lt;br /&gt;
&lt;br /&gt;
Make sure to set your LD_LIBRARY_PATH to $RSFROOT/lib .&lt;br /&gt;
&lt;br /&gt;
If you want to include additional Java packages, you can set them using your shell&#039;s CLASSPATH variable.  This environment variable is now automatically passed onto all Java classes in SCons.&lt;br /&gt;
&lt;br /&gt;
The installation can be tested using the example demonstrating the new API in api/java/test .&lt;br /&gt;
&lt;br /&gt;
===Matlab API===&lt;br /&gt;
Besides Matlab itself, you need Mex, which compiles C code into regular Matlab functions. Use the &amp;lt;tt&amp;gt;MATLAB&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;MEX&amp;lt;/tt&amp;gt; environment variables to specify their paths if they are installed, but not found.&lt;br /&gt;
===Octave API===&lt;br /&gt;
The Octave function compiler (&amp;lt;tt&amp;gt;mkoctfile&amp;lt;/tt&amp;gt;) is sometimes bundled in a separate package, so it may be missing from the Octave installation.&lt;br /&gt;
&lt;br /&gt;
===Python API===&lt;br /&gt;
This API requires [http://www.swig.org/ SWIG], [http://numpy.scipy.org/ numpy] and the Python development kit. Numpy requires Python 2.4 or newer (i.e. RHEL 5 or newer). However, these dependencies are unnecessary for the common case when Python is just used as [http://en.wikipedia.org/wiki/Glue_language glue] to create chains of programs, and it only needs to read the RSF header, and not the binary. To allow Python [http://en.wikipedia.org/wiki/Meta-programs metaprograms] in madagascar to function, and programming in this style to be done, a fallback development kit implementing only the header-related functionality will be installed in the lack of these dependencies.&lt;br /&gt;
&lt;br /&gt;
===Python modules in user space===&lt;br /&gt;
Python is an evolving language. Many large systems have old versions for stability reasons, and administrators of such large systems tend to not install all software users may wish, and to not allow access to rpm either. To install a module in your user space, download the tarball, unzip it, cd into the directory and run: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;python setup.py install --prefix=/path/to/your/place&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The installer will create a subdirectory named &amp;lt;tt&amp;gt;lib&amp;lt;/tt&amp;gt;, or &amp;lt;tt&amp;gt;lib64&amp;lt;/tt&amp;gt; under the directory above. These &amp;lt;tt&amp;gt;lib*&amp;lt;/tt&amp;gt; dirs will have a directory named &amp;lt;tt&amp;gt;python&amp;lt;/tt&amp;gt;, or &amp;lt;tt&amp;gt;python2.3&amp;lt;/tt&amp;gt; for example, and those will have a subdirectory named &amp;lt;tt&amp;gt;site-packages&amp;lt;/tt&amp;gt;. Add all paths to these &amp;lt;tt&amp;gt;site-packages&amp;lt;/tt&amp;gt; subdirectories in your &amp;lt;tt&amp;gt;PYTHONPATH&amp;lt;/tt&amp;gt; environment variable. Some (&amp;lt;tt&amp;gt;numpy&amp;lt;/tt&amp;gt;) may create a &amp;lt;tt&amp;gt;bin&amp;lt;/tt&amp;gt; directory that needs to be added to &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=Environment variables=&lt;br /&gt;
Besides the variables defined in env.sh or env.csh (see the [[Installation|short Installation guide]]), Madagascar programs may read the variables below. They usually have reasonable defaults and were introduced just to provide more power to the advanced user.&lt;br /&gt;
&lt;br /&gt;
For future documentation writers: the environment variables read by Madagascar that have not been documented below can be found by running the script &amp;lt;tt&amp;gt;$RSFSRC/admin/find_env_var.py&amp;lt;/tt&amp;gt;. If the script does not exist or does not work, a summary of all environment variable calls can be obtained by going to $RSFSRC, temporarily moving the directory &amp;lt;tt&amp;gt;build/&amp;lt;/tt&amp;gt; outside RSFSRC, and typing&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
grep environ.get *.py */*.py */*/*.py */*/*/*.py&lt;br /&gt;
grep getenv           */*.c  */*/*.c  */*/*/*.c&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Used by the Madagascar core==&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; style=&amp;quot;background:#ffdead;&amp;quot;|Variables introduced by Madagascar&#039;s non-graphic programs&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Name&#039;&#039;&#039; || &#039;&#039;&#039;Default&#039;&#039;&#039; || Meaning&lt;br /&gt;
|-&lt;br /&gt;
| RSF_DATASERVER || &amp;lt;nowiki&amp;gt;ftp://egl.beg.utexas.edu/&amp;lt;/nowiki&amp;gt; || Data server for benchmark datasets&lt;br /&gt;
|-&lt;br /&gt;
| RSFDOC || $RSFROOT/doc || Directory for the HTML self-doc&lt;br /&gt;
|-&lt;br /&gt;
| RSFFIGS || $RSFROOT/figs || Directory with figures for testing examples in $RSFSRC/book&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| RSFALTFIGS || $RSFFIGS || Alternate directory with figures for testing examples not in $RSFSRC/book&lt;br /&gt;
|-&lt;br /&gt;
| RSFMEMSIZE || 100 || Maximum RAM (Mb) to be used by some programs  &lt;br /&gt;
|-&lt;br /&gt;
| RSFSRC || undefined || Root of the Madagascar source tree&lt;br /&gt;
|-&lt;br /&gt;
| TMPDATAPATH || $DATAPATH || Datapath for temporary files on local disk.&lt;br /&gt;
|-&lt;br /&gt;
| LATEX2HTML || undefined || LateX2HTML customization directory&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; style=&amp;quot;background:#ffdead;&amp;quot;|Variables introduced by Madagascar graphics programs &lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Name&#039;&#039;&#039; || &#039;&#039;&#039;Default&#039;&#039;&#039; || Meaning&lt;br /&gt;
|-&lt;br /&gt;
| DEFAULT_PAPER_SIZE || &amp;quot;letter&amp;quot; || For pspen. Other options: legal, a3, a4, a5.&lt;br /&gt;
|-&lt;br /&gt;
| FATMULT || ? || Fatness multiplication factor. &lt;br /&gt;
|-&lt;br /&gt;
| GIFBORDER || 0.25 || For vplot2gif (spacing)&lt;br /&gt;
|-&lt;br /&gt;
| GIFDELAY || 100 || For vplot2gif (for animations)&lt;br /&gt;
|-&lt;br /&gt;
| IMAGE_TYPE || &#039;png&#039; || Icon type for LateX2HTML &lt;br /&gt;
|-&lt;br /&gt;
| PATTERNMULT || None || Pattern multiplication factor  &lt;br /&gt;
|-&lt;br /&gt;
| PLOTSTYLE || None || Used in vplot&lt;br /&gt;
|-&lt;br /&gt;
| PPI || 75 || For vplot2gif (screen resolution)&lt;br /&gt;
|-&lt;br /&gt;
| PPMSCALE || 1 || For vplot2gif&lt;br /&gt;
|-&lt;br /&gt;
| PSBORDER || 0.05 || For vplot2eps (border around the plot)&lt;br /&gt;
|-&lt;br /&gt;
| PSPRINTER || postscript or colorps || For pspen&lt;br /&gt;
|-&lt;br /&gt;
| PSTEXPENOPTS || color=n fat=1 fatmult=1.5 invras=y || Other vplot2eps options &lt;br /&gt;
|-&lt;br /&gt;
| VPLOTFONTDIR || $RSFROOT/include || Dir with backup fonts in case the runtime-loaded vplot fonts are not found&lt;br /&gt;
|-&lt;br /&gt;
| VPLOTSPOOLDIR || /tmp || Where to put vplot tmp files&lt;br /&gt;
|-&lt;br /&gt;
| WSTYPE || &amp;quot;default&amp;quot; || Workstation type.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:#ffdead;&amp;quot;| Variables set by OS/other apps, read-only to Madagascar&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Name&#039;&#039;&#039; || &#039;&#039;&#039;Primarily used/set by&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| CWPROOT || Seismic Unix&lt;br /&gt;
|-&lt;br /&gt;
| DISPLAY || Operating System (OS)&lt;br /&gt;
|-&lt;br /&gt;
| HOME || OS&lt;br /&gt;
|-&lt;br /&gt;
| LD_LIBRARY_PATH || linker&lt;br /&gt;
|-&lt;br /&gt;
| MATLABPATH || Matlab&lt;br /&gt;
|-&lt;br /&gt;
| XAUTHORITY || X-Windows&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Used by the Madagascar build process and parallelization utilities==&lt;br /&gt;
Type &amp;lt;tt&amp;gt;scons -h&amp;lt;/tt&amp;gt; in RSFSRC to get a list of environment variables that affect the build process, with explanations, defaults and actual values. Below are more detailed explanations for some of them:&lt;br /&gt;
* &amp;lt;tt&amp;gt;RSF_THREADS&amp;lt;/tt&amp;gt;: used by &amp;lt;tt&amp;gt;pscons&amp;lt;/tt&amp;gt; to determine on how many threads to run on the local node, overriding the number of threads detected by Madagascar&lt;br /&gt;
* &amp;lt;tt&amp;gt;RSF_CLUSTER&amp;lt;/tt&amp;gt;: used by &amp;lt;tt&amp;gt;pscons&amp;lt;/tt&amp;gt; to determine on which cluster nodes to run, and on how many CPUs&lt;br /&gt;
&lt;br /&gt;
==Used by the Matlab API==&lt;br /&gt;
To use the Matlab API, you need to add &amp;lt;tt&amp;gt;$RSFROOT/lib&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;MATLABPATH&amp;lt;/tt&amp;gt;&lt;br /&gt;
==Used by the Octave API==&lt;br /&gt;
To use the Octave API, you need to add &amp;lt;tt&amp;gt;$RSFROOT/lib&amp;lt;/tt&amp;gt; to Octave&#039;s path. Determine Octave&#039;s version with&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
octave -v | head -1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
If your version is lower than 2.9.6, type at a Unix command line:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
echo &#039;LOADPATH = &amp;quot;::$RSFROOT/lib/octave&amp;quot;&#039; &amp;gt;&amp;gt; ~/.octaverc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
For later versions, use:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
echo &#039;addpath([getenv(&amp;quot;RSFROOT&amp;quot;) &amp;quot;/lib/octave&amp;quot;])&#039; &amp;gt;&amp;gt; ~/.octaverc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
==Used by the Java API==&lt;br /&gt;
New-style (post-1.0) API: Needs &amp;lt;tt&amp;gt;JAVA_HOME&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Old-style API (1.0 and before): The path to the downloaded Mines JTK must be specified in the MINESJTK environment variable in order to install the Java API. For example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
export MINESJTK=/home/user/edu_mines_jtk.jar&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==RSFROOT for NFS-shared user home directories==&lt;br /&gt;
Heterogeneous networks with user home directories shared through [http://en.wikipedia.org/wiki/Network_File_System_(protocol) NFS] are quite common in many institutions. In addition, even when the architecture is the same (i.e. 64-bit) and the operating system is the same (i.e. [http://en.wikipedia.org/wiki/RHEL RHEL]), the difference between operating system versions may be very significant because clusters may run legacy versions, while desktop workstations may run the latest-and-greatest (even beta), and entirely different Madagascar versions may be needed to support both. &lt;br /&gt;
&lt;br /&gt;
One possible solution of detecting the distribution version and architecture and setting RSFROOT appropriately is shown below. In the example network, all RHEL4 machines have the same architecture, but there are RHEL 3 machines with several architectures:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
REDHAT_RELEASE=`awk -F&#039;release&#039; &#039;{ print $2 }&#039; /etc/redhat-release | awk -F&#039; &#039; &#039;{ print $1 }&#039;`&lt;br /&gt;
&lt;br /&gt;
RSFROOT=/usr/local/rsf/rhel$REDHAT_RELEASE&lt;br /&gt;
&lt;br /&gt;
if [ $REDHAT_RELEASE == &#039;4&#039; ] ; then&lt;br /&gt;
    export RSFROOT&lt;br /&gt;
elif [ $REDHAT_RELEASE == &#039;3&#039; ] ; then&lt;br /&gt;
    export RSFROOT=$RSFROOT/$ARCH&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Of course, the Madagascar administrator will have to download appropriate versions of Madagascar to each $RSFROOT, and compile them on the appropriate system.&lt;br /&gt;
&lt;br /&gt;
If you have many kinds of systems to maintain, with multiple versions of Madagascar, and users have more than one shell, you may find it easy to outsource the complex logic to the easy-to-debug Python, i.e.:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
export RSFROOT=`$M8R_SETUP/get_rsfroot.py`&lt;br /&gt;
export PYTHONPATH=`$M8R_SETUP/edit_pythonpath.py`&lt;br /&gt;
export PATH=`$M8R_SETUP/edit_path.py`&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and similarly for (t)csh. The Python scripts determine the operating system and its version, determine the machine name, and simply print to stdout the desired string.&lt;br /&gt;
&lt;br /&gt;
==Eclipse + Pydev==&lt;br /&gt;
If you use [http://eclipse.org/ Eclipse] with [http://pydev.org/ Pydev], [http://pydev.org/manual_101_interpreter.html#id2 configure the interpreter] by adding &amp;lt;tt&amp;gt;$RSFROOT/lib&amp;lt;/tt&amp;gt; to the &amp;lt;tt&amp;gt;PYTHONPATH&amp;lt;/tt&amp;gt; for your chosen interpreter.&lt;br /&gt;
&lt;br /&gt;
=Platform-specific installation advice=&lt;br /&gt;
==Supported platforms==&lt;br /&gt;
Madagascar attempts to support any [http://en.wikipedia.org/wiki/POSIX POSIX-compliant] operating system demanded by users. For systems that bundle Python (i.e. Linux distributions, BSDs), backwards compatibility will attempt to cover those systems that were bundled with the oldest non-deprecated Python version currently supported by the latest stable version of [http://scons.org/ SCons]. For example, in early 2009 the stable SCons release (1.2) supported Python 2.2 or newer. [http://distrowatch.com/table.php?distribution=redhat Python 2.2 was bundled by RHEL3], so RHEL 3 and newer are supported. &lt;br /&gt;
&lt;br /&gt;
Attempts for backward compatibility with a given operating system are also stopped if the operating system itself becomes unsupported. For example, Python 2.2 was bundled by Fedora 1 and newer, but in January 2010 only Fedora 11 and 12 are actively maintained. Thus, in January 2010 Madagascar was not attempting to support Fedora 1, even though it included Python 2.2.&lt;br /&gt;
&lt;br /&gt;
Please keep in mind that the above statements constitute only general guidelines for what will be attempted, and do not constitute in any way a warranty of support. An application of the above guidelines to some Linux distributions follows:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Support info&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Distribution&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Life Cycle&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Supported versions&lt;br /&gt;
|-&lt;br /&gt;
| RHEL/CentOS/Scientific Linux&lt;br /&gt;
| [https://www.redhat.com/security/updates/errata/ 7 years]&lt;br /&gt;
| &lt;br /&gt;
* 6 until 2017-11-30&lt;br /&gt;
* 5 until 2014-03-31&lt;br /&gt;
|-&lt;br /&gt;
| Fedora&lt;br /&gt;
| [http://fedoraproject.org/wiki/Fedora_Release_Life_Cycle Release X maintained until one month after the release of X+2]&lt;br /&gt;
| &lt;br /&gt;
* 15 until 2012-06-24&lt;br /&gt;
* 14 until 2011-12-02&lt;br /&gt;
|-&lt;br /&gt;
| Ubuntu&lt;br /&gt;
| [https://wiki.ubuntu.com/Releases Releases every 6 mo, maintained for 1.5 yrs; LTS versions every 2 yrs, maintained for 5 yrs]&lt;br /&gt;
| &lt;br /&gt;
* 15.10 until July 2016&lt;br /&gt;
* 14.04 LTS until end of April 2019&lt;br /&gt;
* 12.04.4 LTS until end of April 2017&lt;br /&gt;
|-&lt;br /&gt;
| Debian&lt;br /&gt;
| [http://wiki.debian.org/DebianLenny Usually: stable releases every 1.5-3 yrs, release X maintained 1 yr after release X+1]&lt;br /&gt;
| &lt;br /&gt;
* 6 until its TBD end of life (approx. 2014)&lt;br /&gt;
* 5 until 2012-04&lt;br /&gt;
|- &lt;br /&gt;
| openSUSE&lt;br /&gt;
| [http://en.opensuse.org/Lifetime openSUSE releases Lifetime of 1.5-2.5 years]&lt;br /&gt;
| &lt;br /&gt;
* 11.4 until 2012-09-10&lt;br /&gt;
* 11.3 until 2012-01-15&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Ubuntu==&lt;br /&gt;
In &#039;&#039;&#039;Ubuntu 18.04&#039;&#039;&#039;, you can install the essential Madagascar depenency by running&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install libxaw7-dev freeglut3-dev libnetpbm10-dev libgd-dev libplplot-dev \&lt;br /&gt;
libavcodec-dev libcairo2-dev libjpeg-dev swig python-dev python-numpy g++ gfortran \&lt;br /&gt;
libopenmpi-dev libfftw3-dev libsuitesparse-dev python-epydoc scons git emacs25&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In &#039;&#039;&#039;Ubuntu 15.10 &#039;&#039;Wily Werewolf&#039;&#039;&#039;&#039;&#039; (as well as some previous versions), you can install the essential Madagascar depenency by running&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install libxaw7-dev &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and (optionally) all of Madagascar&#039;s dependencies by running&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install libxaw7-dev freeglut3-dev libnetpbm10-dev libgd-dev libplplot-dev \&lt;br /&gt;
libavcodec-dev libcairo2-dev libjpeg-dev swig python-dev python-numpy g++ gfortran \&lt;br /&gt;
libopenmpi-dev libfftw3-dev libsuitesparse-dev python-epydoc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In Ubuntu 13.04 &#039;&#039;Raring Ringtail&#039;&#039;, you can install all of Madagascar&#039;s dependencies by running&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install freeglut3-dev g++ gfortran libgd2-xpm-dev libx11-dev libxaw7-dev \&lt;br /&gt;
libnetpbm10-dev swig python-dev python-numpy libblas-dev libcairo2-dev liblapack-dev \&lt;br /&gt;
libavcodec-dev python-epydoc scons&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In Ubuntu 12.10 &#039;&#039;Quantal Quetzal&#039;&#039;, you can install all of Madagascar&#039;s dependencies by running&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install freeglut3-dev g++ gfortran libgd2-xpm-dev libx11-dev libxaw7-dev \&lt;br /&gt;
libnetpbm10-dev swig python-dev python-numpy libblas-dev libcairo2-dev liblapack-dev \&lt;br /&gt;
libavcodec-dev python-epydoc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In Ubuntu 12.04 &#039;&#039;Precise Pangolin&#039;&#039;, you can install all of Madagascar&#039;s dependencies by running&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install scons openmpi-bin libopenmpi-dev freeglut3-dev g++ gfortran libgd2-xpm-dev \&lt;br /&gt;
libglew1.6-dev libx11-dev libxaw7-dev libnetpbm10-dev swig python-dev python-scipy python-numpy \&lt;br /&gt;
libtiff4-dev scons units libblas-dev libcairo2-dev liblapack-dev libavcodec-dev python-epydoc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In Ubuntu 10.10 &#039;&#039;Maverick Meerkat&#039;&#039;, you can install all of Madagascar&#039;s dependencies by running &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install freeglut3-dev g++ gfortran libgd2-xpm-dev libglew1.5-dev libjpeg62-dev \&lt;br /&gt;
libx11-dev libxaw7-dev libnetpbm10-dev swig python-dev python-scipy python-numpy libtiff4-dev \&lt;br /&gt;
scons units libblas-dev libcairo2-dev libavcodec-dev libplplot-dev &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In Ubuntu 9.04 &#039;&#039;Jaunty Jackalope&#039;&#039;, the corresponding command is&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install freeglut3-dev g++ gfortran libc6-dev libgd2-xpm-dev libglew1.5-dev libjpeg62-dev \&lt;br /&gt;
libx11-dev libxaw7-dev libnetpbm10-dev swig python-dev python-scipy python-numpy libtiff4-dev scons units &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Earlier versions may work with&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install mesa-libGL-devel g++ g77 libc6-dev libgd2-xpm-dev libglew-dev libjpeg62-dev \&lt;br /&gt;
libx11-dev libxaw7-dev libnetpbm10-dev swig python-dev python-scipy python-numpy libtiff4-dev scons units &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If working with the development version, you will also need &amp;lt;tt&amp;gt;git&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;subversion&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Fedora, RedHat, CentOS, Scientific Linux, openSUSE==&lt;br /&gt;
&lt;br /&gt;
Install essential Madagascar dependencies with&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo yum install gcc libXaw-devel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dependency package names, sorted by Linux distribution and Madagascar feature they provide. Packages that are not included in the standard distro repositories are hyperlinked to their providers. The tables below cover build dependencies. &lt;br /&gt;
&lt;br /&gt;
Names of packages that are runtime dependencies are &#039;&#039;&#039;highlighted&#039;&#039;&#039; in the tables below (task under construction).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note: In the future, it should be possible for the configuration scripts to output the dependency tables below, so that they are guaranteed to be in synch with a given Madagascar version&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Minimal install (&amp;quot;Core&amp;quot;), publishing and development&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Core&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | LaTeX&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Development version&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | C++ API&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | F77 API, F90 API&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Python API&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Java API&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Octave API&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Matlab API&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Fedora 15&lt;br /&gt;
| binutils, gcc, glibc-headers, python&lt;br /&gt;
| texlive-latex&lt;br /&gt;
| subversion&lt;br /&gt;
| gcc-c++&lt;br /&gt;
| gcc-gfortran&lt;br /&gt;
| numpy, swig, python-devel&lt;br /&gt;
| Java (Sun&#039;s? IcedTea?)&lt;br /&gt;
| octave, octave-devel&lt;br /&gt;
| [http://www.mathworks.com/ Matlab] with Mex&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Fedora 14&lt;br /&gt;
| binutils, gcc, glibc-headers, python&lt;br /&gt;
| texlive-latex&lt;br /&gt;
| subversion&lt;br /&gt;
| gcc-c++&lt;br /&gt;
| gcc-gfortran&lt;br /&gt;
| numpy, swig&lt;br /&gt;
| Java (Sun&#039;s? IcedTea?)&lt;br /&gt;
| octave, octave-devel&lt;br /&gt;
| [http://www.mathworks.com/ Matlab] with Mex&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Fedora 13&lt;br /&gt;
| binutils, gcc, glibc-headers, python&lt;br /&gt;
| texlive-latex&lt;br /&gt;
| subversion&lt;br /&gt;
| gcc-c++&lt;br /&gt;
| gcc-gfortran&lt;br /&gt;
| numpy, swig&lt;br /&gt;
| Java (Sun&#039;s? IcedTea?)&lt;br /&gt;
| octave, octave-devel&lt;br /&gt;
| [http://www.mathworks.com/ Matlab]&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | CentOS 5&lt;br /&gt;
| binutils, gcc, glibc-headers; python (needs [http://dag.wieers.com/rpm/FAQ.php#B2 RPMforge&#039;s RHEL5 repository])&lt;br /&gt;
| ?&lt;br /&gt;
| subversion&lt;br /&gt;
| gcc-c++&lt;br /&gt;
| gcc-gfortran&lt;br /&gt;
| numpy, swig&lt;br /&gt;
| Java (Sun&#039;s? IcedTea?), [http://inside.mines.edu/~dhale/jtk/ Mines JTK]&lt;br /&gt;
| [http://www.gnu.org/software/octave/ Octave, octave-devel]&lt;br /&gt;
| [http://www.mathworks.com/ Matlab]&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | openSUSE 11.0&lt;br /&gt;
| gcc, python&lt;br /&gt;
| texlive-latex&lt;br /&gt;
| subversion&lt;br /&gt;
| gcc-c++&lt;br /&gt;
| gcc-fortran&lt;br /&gt;
| [http://numpy.scipy.org/ NumPy], swig&lt;br /&gt;
| Java (Sun&#039;s? IcedTea?), [http://inside.mines.edu/~dhale/jtk/ Mines JTK]&lt;br /&gt;
| [http://www.gnu.org/software/octave/ Octave]&lt;br /&gt;
| [http://www.mathworks.com/ Matlab]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Graphics and visualization&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The minimum requirement is X11 graphics for running &#039;&#039;&#039;xtpen&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | X11 graphics&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | vplot2gif&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | vplot2avi&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Some sort of movies?&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | TIFF output&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | JPEG output&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | PLplot graphics&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | OpenGL graphics&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | ppm (?)&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | unknown&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Fedora 13&lt;br /&gt;
| libXaw-devel&lt;br /&gt;
| gifsicle&lt;br /&gt;
| ffmpeg (needs the [http://rpmfusion.org/ RPM Fusion] repository enabled)&lt;br /&gt;
| ffmpeg-devel (needs the [http://rpmfusion.org/ RPM Fusion] repository enabled)&lt;br /&gt;
| libtiff-devel&lt;br /&gt;
| libjpeg-devel&lt;br /&gt;
| plplot-devel&lt;br /&gt;
| mesa-libGL-devel, freeglut, freeglut-devel&lt;br /&gt;
| netpbm-devel&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | openSUSE 11.0&lt;br /&gt;
| xorg-x11-devel&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
| libtiff-devel&lt;br /&gt;
| libjpeg-devel&lt;br /&gt;
| plplot-devel&lt;br /&gt;
| mesa-libGL-devel, freeglut, freeglut-devel&lt;br /&gt;
| netpbm-devel&lt;br /&gt;
| cairo-devel, gd-devel, glew-devel&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Numerical and file manipulation utilities&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | OpenMP&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | MPI&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | BLAS/ATLAS&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Interface to the Fast Discrete Curvelet Transform&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | sfunits&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Fedora 13&lt;br /&gt;
| libgomp&lt;br /&gt;
| openmpi, openmpi-devel; openmpi-libs (?)&lt;br /&gt;
| blas, blas-devel, atlas, atlas-devel&lt;br /&gt;
| [https://wave.eos.ubc.ca/Software/Licenced/ pyct]&lt;br /&gt;
| units&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | CentOS 5&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
| [https://wave.eos.ubc.ca/Software/Licenced/ pyct]&lt;br /&gt;
| [http://www.gnu.org/software/units/units.html Gnu Units]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Other&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Inclusions from Seismic Unix&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Fedora 14, 15&lt;br /&gt;
| [http://www.cwp.mines.edu/cwpcodes/ Seismic Unix]&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | CentOS 5&lt;br /&gt;
| [http://www.cwp.mines.edu/cwpcodes/ Seismic Unix]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Command to install all dependencies present in the public repositories&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Usually package management software will not install again a package that is already installed, so it should be safe to copy and paste the command below to a command line:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Fedora 15&lt;br /&gt;
| &#039;&#039;&#039;yum -y install&#039;&#039;&#039; binutils gcc glibc-headers scons texlive-latex subversion gcc-c++ gcc-gfortran numpy python python-devel swig octave octave-devel libgomp openmpi openmpi-devel blas blas-devel atlas atlas-devel units gifsicle ffmpeg ffmpeg-devel libtiff-devel libjpeg-devel plplot-devel mesa-libGL-devel freeglut freeglut-devel libXaw-devel netpbm-devel&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Fedora 13&lt;br /&gt;
| &#039;&#039;&#039;yum -y install&#039;&#039;&#039; binutils gcc glibc-headers scons texlive-latex subversion gcc-c++ gcc-gfortran numpy python swig octave octave-devel libgomp openmpi openmpi-devel blas blas-devel atlas atlas-devel units gifsicle ffmpeg ffmpeg-devel libtiff-devel libjpeg-devel plplot-devel mesa-libGL-devel freeglut freeglut-devel libXaw-devel netpbm-devel&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | CentOS 5&lt;br /&gt;
| &#039;&#039;&#039;yum -y install&#039;&#039;&#039; binutils freeglut freeglut-devel gcc gcc-c++ gcc-gfortran glibc-headers libjpeg-devel libXaw-devel netpbm-devel&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | openSUSE 11.0&lt;br /&gt;
| &#039;&#039;&#039;zypper install&#039;&#039;&#039; cairo-devel gcc gcc-c++ gcc-fortran gd-devel glew-devel libjpeg-devel libtiff-devel octave scons subversion texlive-latex xorg-x11-devel&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;List of runtime dependencies only&#039;&#039;&#039;&lt;br /&gt;
(needed by packagers of Madagascar in order to properly list dependencies):&lt;br /&gt;
UNDER CONSTRUCTION&lt;br /&gt;
&lt;br /&gt;
===Fedora 25===&lt;br /&gt;
The following explains how to install madagascar on Fedora 25.&lt;br /&gt;
&lt;br /&gt;
We use the following compiler: &amp;lt;code&amp;gt;gcc&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;g++&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;gfortran&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* Install some packages&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; inline style=&amp;quot;white-space:wrap&amp;quot;&amp;gt;sudo dnf install scons lapack-static lapack64-static atlas-static fftw-static gd gd-devel libtool-ltdl-devel \&lt;br /&gt;
libXaw-devel mesa-libGL-devel freeglut-devel netpbm-devel plplot-devel ffmpeg-devel swig openmpi openmpi-devel suitesparse-devel&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This installed the following packages:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
scons-2.5.1-1.fc25.noarch&lt;br /&gt;
lapack-static-3.6.1-2.fc25.x86_64&lt;br /&gt;
lapack64-static-3.6.1-2.fc25.x86_64&lt;br /&gt;
atlas-static-3.10.2-14.fc25.x86_64&lt;br /&gt;
fftw-static-3.3.5-3.fc25.x86_64&lt;br /&gt;
gd-2.2.4-1.fc25.x86_64&lt;br /&gt;
gd-devel-2.2.4-1.fc25.x86_64&lt;br /&gt;
libtool-ltdl-devel-2.4.6-13.fc25.x86_64&lt;br /&gt;
libXaw-devel-1.0.13-4.fc25.x86_64&lt;br /&gt;
mesa-libGL-devel-17.0.5-3.fc25.x86_64&lt;br /&gt;
freeglut-devel-3.0.0-3.fc24.x86_64&lt;br /&gt;
netpbm-devel-10.78.00-1.fc25.x86_64&lt;br /&gt;
plplot-devel-5.11.1-13.fc25.x86_64&lt;br /&gt;
ffmpeg-devel-3.1.9-1.fc25.x86_64&lt;br /&gt;
swig-3.0.11-1.fc25.x86_64&lt;br /&gt;
openmpi-1.10.5-1.fc25.x86_64&lt;br /&gt;
openmpi-devel-1.10.5-1.fc25.x86_64&lt;br /&gt;
suitesparse-devel-4.4.6-7.fc25.x86_64&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and many other dependencies.&lt;br /&gt;
&lt;br /&gt;
* Get the sources from the git repository&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;git clone https://github.com/ahay/src&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you run now the &amp;lt;code&amp;gt;configure&amp;lt;/code&amp;gt; script, you will get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
checking for Python ... /usr/bin/python&lt;br /&gt;
checking Python version ... 2.7.13&lt;br /&gt;
checking for RSFROOT ... /usr/local/rsf&lt;br /&gt;
checking for SCons ... /usr/bin/scons&lt;br /&gt;
checking SCons version ... v2.5.1.rel_2.5.1:3735:9dc6cee5c168[MODIFIED]&lt;br /&gt;
Running RSFROOT=/usr/local/rsf /usr/bin/scons  config ...&lt;br /&gt;
------------------------&lt;br /&gt;
scons: Reading SConscript files ...&lt;br /&gt;
checking platform ... (cached) linux [fedora]&lt;br /&gt;
checking for C compiler ... (cached) gcc&lt;br /&gt;
checking if gcc works ... yes&lt;br /&gt;
checking if gcc accepts &#039;-x c -std=gnu99 -Wall -pedantic&#039; ... yes&lt;br /&gt;
checking for ar ... (cached) ar&lt;br /&gt;
checking for libraries ... [&#039;m&#039;]&lt;br /&gt;
checking complex support ... yes&lt;br /&gt;
checking for X11 headers ... /usr/include&lt;br /&gt;
checking for X11 libraries ... /usr/lib&lt;br /&gt;
checking for OpenGL ... yes&lt;br /&gt;
checking for sfpen ... (cached) xtpen&lt;br /&gt;
checking for ppm ... yes&lt;br /&gt;
checking for tiff ... yes&lt;br /&gt;
checking for GD (PNG) ... yes&lt;br /&gt;
checking for GD (GIF) ... yes&lt;br /&gt;
checking for plplot ... no&lt;br /&gt;
&lt;br /&gt;
  Optional package: plplot-devel&lt;br /&gt;
checking for ffmpeg ... yes&lt;br /&gt;
checking for cairo (PNG) ... yes&lt;br /&gt;
checking for cairo (SVG) ... yes&lt;br /&gt;
checking for cairo (PDF) ... yes&lt;br /&gt;
checking for jpeg ... yes&lt;br /&gt;
checking for BLAS ... yes&lt;br /&gt;
checking for LAPACK ... no&lt;br /&gt;
&lt;br /&gt;
  Optional package: blas + blas-devel + atlas + atlas-devel&lt;br /&gt;
checking for SWIG ... (cached) /usr/bin/swig&lt;br /&gt;
checking for numpy ... (cached) yes&lt;br /&gt;
checking API options ... (cached) []&lt;br /&gt;
checking for C++ compiler ... (cached) g++&lt;br /&gt;
checking if g++ works ... yes&lt;br /&gt;
checking if g++ accepts &#039;-std=c++11 -U__STRICT_ANSI__ -Wall -pedantic&#039; ... yes&lt;br /&gt;
checking for MPICC ... (cached) /usr/lib64/openmpi/bin/mpicc&lt;br /&gt;
checking if /usr/lib64/openmpi/bin/mpicc works ... yes&lt;br /&gt;
checking for MPICXX ... (cached) /usr/lib64/openmpi/bin/mpicxx&lt;br /&gt;
checking if /usr/lib64/openmpi/bin/mpicxx works ... yes&lt;br /&gt;
checking for MPIRUN ... (cached) /usr/lib64/openmpi/bin/mpirun&lt;br /&gt;
checking for Posix threads ... yes&lt;br /&gt;
checking for OpenMP ... yes&lt;br /&gt;
checking for CUDA ... (cached) no&lt;br /&gt;
checking for FFTW ... yes&lt;br /&gt;
checking if FFTW supports threads ... yes&lt;br /&gt;
checking for SuiteSparse ... yes&lt;br /&gt;
checking for pfft ... no&lt;br /&gt;
scons: done reading SConscript files.&lt;br /&gt;
scons: Building targets ...&lt;br /&gt;
shell_script([&amp;quot;env.sh&amp;quot;], [])&lt;br /&gt;
shell_script([&amp;quot;env.csh&amp;quot;], [])&lt;br /&gt;
scons: done building targets.&lt;br /&gt;
------------------------&lt;br /&gt;
Done with configuration.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Libraries &amp;lt;code&amp;gt;plplot&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;lapack&amp;lt;/code&amp;gt; are not found. File &amp;lt;code&amp;gt;config.log&amp;lt;/code&amp;gt; says&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/bin/ld: cannot find -lplplotd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gcc -o .sconf_temp/sfconftest_21 .sconf_temp/conftest_21.o -L/usr/lib64/atlas -lm -lf77blas -lcblas -latlas -llapack -lcblas&lt;br /&gt;
/usr/lib64/atlas/liblapack.a(dgesv.o): In function `dgesv_&#039;:&lt;br /&gt;
(.text+0x69): undefined reference to `xerbla_&#039;&lt;br /&gt;
/usr/lib64/atlas/liblapack.a(ATL_f77wrap_dgesv.o): In function `atl_f77wrap_dgesv_&#039;:&lt;br /&gt;
(.text+0x10d): undefined reference to `ATL_xerbla&#039;&lt;br /&gt;
/usr/lib64/atlas/liblapack.a(ATL_dgetf2.o): In function `ATL_dgetf2&#039;:&lt;br /&gt;
(.text+0x184): undefined reference to `ATL_dger&#039;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So library &amp;lt;code&amp;gt;plplotd&amp;lt;/code&amp;gt; doesn&#039;t exist on Fedora 25 and the &amp;lt;code&amp;gt;configure&amp;lt;/code&amp;gt; script is looking for the wrong &amp;lt;code&amp;gt;lapack&amp;lt;/code&amp;gt; library.&lt;br /&gt;
&lt;br /&gt;
If compiling now, 2 other libraries won&#039;t be found: &amp;lt;code&amp;gt;gfortran&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;quadmath&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Regarding the &amp;lt;code&amp;gt;plplotd&amp;lt;/code&amp;gt; library, edit file &amp;lt;code&amp;gt;framework/configure.py&amp;lt;/code&amp;gt; and change the line 724:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line start=&amp;quot;724&amp;quot;&amp;gt;plplot = context.env.get(&#039;PLPLOT&#039;,&#039;plplotd&#039;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
to&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line start=&amp;quot;724&amp;quot;&amp;gt;plplot = context.env.get(&#039;PLPLOT&#039;,&#039;plplot&#039;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* As for the libraries&lt;br /&gt;
** &amp;lt;code&amp;gt;lapack&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;gfortran&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;quadmath&amp;lt;/code&amp;gt;&lt;br /&gt;
We must use the &amp;lt;code&amp;gt;lapack&amp;lt;/code&amp;gt; library installed in &amp;lt;code&amp;gt;/usr/lib64&amp;lt;/code&amp;gt;, not the one installed in &amp;lt;code&amp;gt;/usr/lib64/atlas&amp;lt;/code&amp;gt;. And libraries &amp;lt;code&amp;gt;gfortran&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;quadmath&amp;lt;/code&amp;gt; are installed in &amp;lt;code&amp;gt;/usr/lib/gcc/x86_64-redhat-linux/6.3.1/&amp;lt;/code&amp;gt;.&lt;br /&gt;
Edit file &amp;lt;code&amp;gt;framework/configure.py&amp;lt;/code&amp;gt; and add the following 4 lines:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[&#039;/usr/lib/gcc/x86_64-redhat-linux/6.3.1/&#039;,&lt;br /&gt;
 &#039;/usr/lib64/&#039;,&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LIBS.append(&#039;gfortran&#039;)&lt;br /&gt;
LIBS.append(&#039;quadmath&#039;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
so that we end up with the following &amp;lt;code&amp;gt;blas&amp;lt;/code&amp;gt; function: &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line start=&amp;quot;971&amp;quot;&amp;gt;def blas(context):&lt;br /&gt;
    context.Message(&amp;quot;checking for BLAS ... &amp;quot;)&lt;br /&gt;
    text = &#039;&#039;&#039;&lt;br /&gt;
    #ifdef __APPLE__&lt;br /&gt;
    #include &amp;lt;Accelerate/Accelerate.h&amp;gt;&lt;br /&gt;
    #else&lt;br /&gt;
    #ifdef HAVE_MKL&lt;br /&gt;
    #include &amp;lt;mkl.h&amp;gt;&lt;br /&gt;
    #else&lt;br /&gt;
    #include &amp;lt;cblas.h&amp;gt;&lt;br /&gt;
    #endif&lt;br /&gt;
    #endif&lt;br /&gt;
    int main(int argc,char* argv[]) {&lt;br /&gt;
    float d, x[]={1.,2.,3.}, y[]={3.,2.,1.};&lt;br /&gt;
    d = cblas_sdot(3,x,1,y,1);&lt;br /&gt;
    return 0;&lt;br /&gt;
    }\n&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    if plat[&#039;OS&#039;] == &#039;cygwin&#039;:&lt;br /&gt;
        context.env[&#039;ENV&#039;][&#039;PATH&#039;] = context.env[&#039;ENV&#039;][&#039;PATH&#039;] + \&lt;br /&gt;
                                         &#039;:/lib/lapack&#039;&lt;br /&gt;
&lt;br /&gt;
    res = context.TryLink(text,&#039;.c&#039;)&lt;br /&gt;
    if res: &lt;br /&gt;
        context.Result(res)&lt;br /&gt;
        context.env[&#039;BLAS&#039;] = True &lt;br /&gt;
    else:&lt;br /&gt;
        # first try blas&lt;br /&gt;
        LIBS = path_get(context,&#039;LIBS&#039;)&lt;br /&gt;
        blas = context.env.get(&#039;BLAS&#039;,&#039;blas&#039;)&lt;br /&gt;
        LIBS.append(blas)&lt;br /&gt;
        res = context.TryLink(text,&#039;.c&#039;)&lt;br /&gt;
        if res: &lt;br /&gt;
            context.Result(res)&lt;br /&gt;
            context.env[&#039;LIBS&#039;] = LIBS &lt;br /&gt;
            context.env[&#039;BLAS&#039;] = blas &lt;br /&gt;
        else:&lt;br /&gt;
            # some systems require cblas and atlas&lt;br /&gt;
            for atlas_dir in filter(os.path.isdir,&lt;br /&gt;
                                    [&#039;/usr/lib/gcc/x86_64-redhat-linux/6.3.1/&#039;,  # &amp;lt;--- add this line&lt;br /&gt;
                                     &#039;/usr/lib64/&#039;,                              # &amp;lt;--- add this line&lt;br /&gt;
                                     &#039;/usr/lib64/atlas/&#039;,&lt;br /&gt;
                                     &#039;/usr/lib/atlas/&#039;]):&lt;br /&gt;
                context.env[&#039;LIBPATH&#039;].append(atlas_dir)&lt;br /&gt;
            LIBS.pop()&lt;br /&gt;
            LIBS.append(&#039;f77blas&#039;)&lt;br /&gt;
            LIBS.append(&#039;cblas&#039;)&lt;br /&gt;
            LIBS.append(&#039;atlas&#039;)&lt;br /&gt;
            LIBS.append(&#039;gfortran&#039;)  # &amp;lt;----------------------------------------------- add this line&lt;br /&gt;
            LIBS.append(&#039;quadmath&#039;)  # &amp;lt;----------------------------------------------- add this line&lt;br /&gt;
            res = context.TryLink(text,&#039;.c&#039;)&lt;br /&gt;
            if res: &lt;br /&gt;
                context.Result(res)&lt;br /&gt;
                context.env[&#039;LIBS&#039;] = LIBS &lt;br /&gt;
                context.env[&#039;BLAS&#039;] = &#039;cblas&#039;&lt;br /&gt;
            else:&lt;br /&gt;
                context.Result(context_failure)&lt;br /&gt;
                context.env[&#039;CPPDEFINES&#039;] = \&lt;br /&gt;
                    path_get(context,&#039;CPPDEFINES&#039;,&#039;NO_BLAS&#039;)&lt;br /&gt;
                LIBS.pop()&lt;br /&gt;
                LIBS.pop()&lt;br /&gt;
                LIBS.pop()&lt;br /&gt;
                context.env[&#039;BLAS&#039;] = None &lt;br /&gt;
                need_pkg(&#039;blas&#039;, fatal=False)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* Run the &amp;lt;code&amp;gt;configure&amp;lt;/code&amp;gt; script, for example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;./configure --prefix=/usr/local/rsf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Output should give:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
checking for Python ... /usr/bin/python&lt;br /&gt;
checking Python version ... 2.7.13&lt;br /&gt;
checking for RSFROOT ... /usr/local/rsf&lt;br /&gt;
checking for SCons ... /usr/bin/scons&lt;br /&gt;
checking SCons version ... v2.5.1.rel_2.5.1:3735:9dc6cee5c168[MODIFIED]&lt;br /&gt;
Running RSFROOT=/usr/local/rsf /usr/bin/scons  config ...&lt;br /&gt;
------------------------&lt;br /&gt;
scons: Reading SConscript files ...&lt;br /&gt;
checking platform ... (cached) linux [fedora]&lt;br /&gt;
checking for C compiler ... (cached) gcc&lt;br /&gt;
checking if gcc works ... yes&lt;br /&gt;
checking if gcc accepts &#039;-x c -std=gnu99 -Wall -pedantic&#039; ... yes&lt;br /&gt;
checking for ar ... (cached) ar&lt;br /&gt;
checking for libraries ... [&#039;m&#039;]&lt;br /&gt;
checking complex support ... yes&lt;br /&gt;
checking for X11 headers ... /usr/include&lt;br /&gt;
checking for X11 libraries ... /usr/lib&lt;br /&gt;
checking for OpenGL ... yes&lt;br /&gt;
checking for sfpen ... (cached) xtpen&lt;br /&gt;
checking for ppm ... yes&lt;br /&gt;
checking for tiff ... yes&lt;br /&gt;
checking for GD (PNG) ... yes&lt;br /&gt;
checking for GD (GIF) ... yes&lt;br /&gt;
checking for plplot ... yes&lt;br /&gt;
checking for ffmpeg ... yes&lt;br /&gt;
checking for cairo (PNG) ... yes&lt;br /&gt;
checking for cairo (SVG) ... yes&lt;br /&gt;
checking for cairo (PDF) ... yes&lt;br /&gt;
checking for jpeg ... yes&lt;br /&gt;
checking for BLAS ... yes&lt;br /&gt;
checking for LAPACK ... yes&lt;br /&gt;
checking for SWIG ... (cached) /usr/bin/swig&lt;br /&gt;
checking for numpy ... (cached) yes&lt;br /&gt;
checking API options ... (cached) []&lt;br /&gt;
checking for C++ compiler ... (cached) g++&lt;br /&gt;
checking if g++ works ... yes&lt;br /&gt;
checking if g++ accepts &#039;-std=c++11 -U__STRICT_ANSI__ -Wall -pedantic&#039; ... yes&lt;br /&gt;
checking for MPICC ... (cached) /usr/lib64/openmpi/bin/mpicc&lt;br /&gt;
checking if /usr/lib64/openmpi/bin/mpicc works ... yes&lt;br /&gt;
checking for MPICXX ... (cached) /usr/lib64/openmpi/bin/mpicxx&lt;br /&gt;
checking if /usr/lib64/openmpi/bin/mpicxx works ... yes&lt;br /&gt;
checking for MPIRUN ... (cached) /usr/lib64/openmpi/bin/mpirun&lt;br /&gt;
checking for Posix threads ... yes&lt;br /&gt;
checking for OpenMP ... yes&lt;br /&gt;
checking for CUDA ... (cached) no&lt;br /&gt;
checking for FFTW ... yes&lt;br /&gt;
checking if FFTW supports threads ... yes&lt;br /&gt;
checking for SuiteSparse ... yes&lt;br /&gt;
checking for pfft ... no&lt;br /&gt;
scons: done reading SConscript files.&lt;br /&gt;
scons: Building targets ...&lt;br /&gt;
shell_script([&amp;quot;env.sh&amp;quot;], [])&lt;br /&gt;
shell_script([&amp;quot;env.csh&amp;quot;], [])&lt;br /&gt;
scons: done building targets.&lt;br /&gt;
------------------------&lt;br /&gt;
Done with configuration.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* Then run the compilation:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;make&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* and finally the installation&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;sudo make install&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Debian 5==&lt;br /&gt;
Specific dependencies:&lt;br /&gt;
* Debian 5.0 (&amp;quot;Lenny&amp;quot;): Please make sure you have the &amp;lt;tt&amp;gt;libc6-dev&amp;lt;/tt&amp;gt; package before trying to compile from source. The &amp;lt;tt&amp;gt;libXaw7-dev&amp;lt;/tt&amp;gt; package might be a dependency for &amp;lt;tt&amp;gt;xtpen&amp;lt;/tt&amp;gt; (was in Debian 4.0)&lt;br /&gt;
&lt;br /&gt;
==Yellow Dog Linux 6.1 on Sony PlayStation 3==&lt;br /&gt;
See [http://www.reproducibility.org/rsflog/uploads/Friday_Seminar_Madagascar_on_PS3.ppt Will Burnett&#039;s guide (PowerPoint)]&lt;br /&gt;
&lt;br /&gt;
==Mac OS X==&lt;br /&gt;
&lt;br /&gt;
Install necessary Mac OS X applications using:&lt;br /&gt;
* [http://www.macports.org/ MacPorts], an easy-to-use system for compiling, installing, and upgrading open-source software on Mac OS X.&lt;br /&gt;
* [http://www.finkproject.org/ Fink], a tool that brings the full world of Unix Open Source software to Mac OS X. &lt;br /&gt;
&lt;br /&gt;
Installation on Mac OS X Mountain Lion requires the following:&lt;br /&gt;
# &amp;lt;b&amp;gt;Xcode&amp;lt;/b&amp;gt;: Download and install [https://developer.apple.com/xcode/ XCode] from Apple using App Store application. In Xcode, make sure to enable and install the command-line tools in Xcode/Preferences/Downloads &lt;br /&gt;
# (Optionally) &amp;lt;b&amp;gt;X11&amp;lt;/b&amp;gt;: Install X11 libraries from [http://xquartz.macosforge.org Xquartz]. &lt;br /&gt;
# (Optionally) &amp;lt;b&amp;gt;gcc&amp;lt;/b&amp;gt;: Install the Gnu C compiler from [http://hpc.sourceforge.net HPC Mac OS X]. &lt;br /&gt;
# (Optionally) [[SEGTeX]]: To use &amp;lt;b&amp;gt;SEGTeX&amp;lt;/b&amp;gt;, you may need [http://www.tug.org/texlive/ TeX Live]. &amp;lt;b&amp;gt;MacPorts&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;Fink&amp;lt;/b&amp;gt; provide an easy way to install it with commands &amp;lt;pre&amp;gt;sudo port install texlive&amp;lt;/pre&amp;gt; or &amp;lt;pre&amp;gt;sudo fink install texlive&amp;lt;/pre&amp;gt;&lt;br /&gt;
# (Optionally) &amp;lt;b&amp;gt;FFTW&amp;lt;/b&amp;gt;: Using &amp;lt;b&amp;gt;MacPorts&amp;lt;/b&amp;gt;, run &amp;lt;pre&amp;gt;sudo port install fftw-3-single&amp;lt;/pre&amp;gt;&amp;lt;pre&amp;gt;sudo port install fftw-3 +gfortran&amp;lt;/pre&amp;gt;&lt;br /&gt;
# (Optionally) &amp;lt;b&amp;gt;MPI&amp;lt;/b&amp;gt;: Using &amp;lt;b&amp;gt;MacPorts&amp;lt;/b&amp;gt;, run &amp;lt;pre&amp;gt;sudo port install openmpi&amp;lt;/pre&amp;gt;&amp;lt;pre&amp;gt;sudo port select --set mpi openmpi-mp-fortran&amp;lt;/pre&amp;gt;&lt;br /&gt;
# (Optionally) &amp;lt;b&amp;gt;ppmpen&amp;lt;/b&amp;gt;: Using &amp;lt;b&amp;gt;MacPorts&amp;lt;/b&amp;gt;, run &amp;lt;pre&amp;gt;sudo port install libnetpbm&amp;lt;/pre&amp;gt;&lt;br /&gt;
# (Optionally) &amp;lt;b&amp;gt;Open vplots using double click&amp;lt;/b&amp;gt;: [[machacks|Instructions]].&lt;br /&gt;
# Install python with libraries including jupyter and  ipython.  I recommend the Anaconda distribution.  which is available at https://www.anaconda.com/download&lt;br /&gt;
# (Optionally) &amp;lt;b&amp;gt;SWIG&amp;lt;/b&amp;gt; is required for some of the options of the Python api (used if you are coding in Python).  run  &amp;lt;pre&amp;gt;conda install swig&amp;lt;/pre&amp;gt; . I had to run&amp;lt;pre&amp;gt;cp `which siwg` /usr/local/bin&amp;lt;/pre&amp;gt; to get ./configure to find swig. &lt;br /&gt;
#Proceed with configuration and installation following the normal procedure.  You may need to use Apple&#039;s compiler (clang) instead of gcc.  Use one of these commands in the $RSFSRC directory &amp;lt;pre&amp;gt;./configure CC=clang CXX=clang++&amp;lt;/pre&amp;gt; or &amp;lt;pre&amp;gt;./configure CC=clang CXX=clang++ API=python --prefix=`pwd`&amp;lt;/pre&amp;gt;&lt;br /&gt;
#build the system with: &amp;lt;pre&amp;gt;make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
#You must run: &amp;lt;pre&amp;gt;./configure &amp;lt;/pre&amp;gt; and &amp;lt;pre&amp;gt;make install&amp;lt;/pre&amp;gt; after installing a new version of python.&lt;br /&gt;
&lt;br /&gt;
==OpenSolaris==&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;tt&amp;gt;pkg&amp;lt;/tt&amp;gt; to install missing components such as X11 headers.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
pfexec pkg install SUNWxorg-headers&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==MS Windows==&lt;br /&gt;
Due to its size, this topic has been assigned [[Windows | its own Wiki page]].&lt;br /&gt;
&lt;br /&gt;
==How to adapt Madagascar to a new platform==&lt;br /&gt;
The most laborious part of adapting madagascar to a new platform is finding the proper dependency names. This usually proceeds as follows: dependency X fails with a &amp;quot;missing file&amp;quot; error either as a header file in &amp;lt;tt&amp;gt;config.log&amp;lt;/tt&amp;gt;, or a missing library during the build step. Possible package names are found through an internet search for the missing file name and the distribution name or by using specific [http://rpm.pbone.net/ rpm search tools]. Packages are installed and the configure (and, if necessary) build processes are repeated until the error goes away.&lt;br /&gt;
&lt;br /&gt;
=Multi-user installs=&lt;br /&gt;
Some organizations may find it desirable to deny write access of some users to all RSFSRC/RSFROOT except their own user directory. Fortunately, this can be easily done by placing the restricted user dirs outside RSFSRC/RSFROOT, i.e. in their home dirs, say /home/joe/rsfsrc. In order to move a user&#039;s directory out of RSFSRC, you must:&lt;br /&gt;
* &amp;quot;tell&amp;quot; the SConstruct in the user&#039;s dir where to find RSFSRC so that when the user builds in his directory, it can import &amp;lt;tt&amp;gt;configure.py&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;config.py&amp;lt;/tt&amp;gt; You do that by setting the environment variable RSFSRC to the absolute path of the Madagascar source root, and by making sure that lines 2 and 3 in the users&#039; SConstruct files are&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
srcroot = os.environ.get(&#039;RSFSRC&#039;, &#039;../..&#039;)&lt;br /&gt;
sys.path.append(srcroot)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
and then replace &amp;lt;tt&amp;gt;../..&amp;lt;/tt&amp;gt; throughout the SConstruct using &amp;lt;tt&amp;gt;os.path.join&amp;lt;/tt&amp;gt; and the &amp;lt;tt&amp;gt;srcroot&amp;lt;/tt&amp;gt; variable.&lt;br /&gt;
* &amp;quot;tell&amp;quot; the build scripts about the user&#039;s dir, so that it is included in the builds launched from RSFSRC. You do that with a symbolic link:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ln -s /home/joe/rsfsrc $RSFSRC/user/joe&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&#039;&#039;When the link exists&#039;&#039;, those of Joe&#039;s programs that are mentioned in the &amp;quot;prog&amp;quot; string in SConstruct get included in the distribution, complete with self-doc. If Joe is just learning how to code and his stuff breaks the build, just remove the symbolic link. Even if build+installs are done after the link is removed, his stable programs and self-doc will continue to remain installed system-wide as long as the admin does not type &amp;lt;tt&amp;gt;scons -c install&amp;lt;/tt&amp;gt; (not likely).&lt;br /&gt;
* point the user&#039;s RSFDOC environment variable to a location where the user has write access&lt;br /&gt;
* edit the users&#039; SConstruct so that it uses the RSF library and headers already installed in $RSFROOT/lib and $RSFROOT/include , instead of building again the whole &amp;lt;tt&amp;gt;librsf&amp;lt;/tt&amp;gt; with user-specific flags in &amp;lt;tt&amp;gt;RSFSRC/filt/lib/&amp;lt;/tt&amp;gt;. To do that, replace in the user&#039;s SConstruct the env.Prepend statement with&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
rsfroot = os.environ.get(&#039;RSFROOT&#039;,&#039;/usr/local/rsf&#039;)&lt;br /&gt;
&lt;br /&gt;
env.Prepend(CPPPATH=[os.path.join(rsfroot,&#039;include&#039;)],&lt;br /&gt;
            LIBPATH=[os.path.join(rsfroot,&#039;lib&#039;)],&lt;br /&gt;
            LIBS=[&#039;rsf&#039;])&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* If the link from RSFSRC to Joe&#039;s directory was not made, add Joe&#039;s directory to his own path so that he can execute his own binaries.&lt;br /&gt;
&lt;br /&gt;
To understand how $DATAPATH disk space issues may become an issue in a multi-user environment, refer to the [[Advanced_Installation#Disk_space|Disk Space subsection]] at the beginning of this document.&lt;br /&gt;
&lt;br /&gt;
=Keeping your stuff separate=&lt;br /&gt;
A user may add his own programs and recipes to the Madagascar system. He may also create his own computational examples, data, and locked figures for testing. All of these components can be placed in their default locations, but it is not necessary to make them public. To keep these items private simply do not add them to the repository.&lt;br /&gt;
&lt;br /&gt;
However, it might be desirable to keep these components in separate places. For example, if you keep your private programs in RSFSRC/user you will have to remember to make a copy somewhere else if you ever want to delete the Madagascar installation to perform a fresh install. Yup, I deleted all my programs that way once. Good thing I had a back up! Fortunately, it is easy to keep each of these components in a separate place if desired.&lt;br /&gt;
&lt;br /&gt;
==Keeping programs separate==&lt;br /&gt;
User programs are ordinarily kept in a subdirectory of RSFSRC/user.  However, if you want to keep your programs separate all you have to do is put your subdirectory somewhere else and make a link to it in RSFSRC/user:&lt;br /&gt;
&amp;lt;bash&amp;gt;&lt;br /&gt;
ln -s path_to_my_programs $RSFSRC/user/my_programs&lt;br /&gt;
&amp;lt;/bash&amp;gt;&lt;br /&gt;
The additional instructions above for &amp;quot;multi-user installs&amp;quot; are for the case where the other users do not have write access to RSFSRC.  However, if you have full write access and only want to keep the programs in a separate place the link is the only thing you need.&lt;br /&gt;
&lt;br /&gt;
===Problems when symbolic linking and using SVN=== &lt;br /&gt;
If you decide to use a symbolic link e.g. &amp;quot;ln -s ...&amp;quot; as above, you will have difficulties checking in your code into the SVN repository.  SVN typically does not follow the symbolic link but will only the save the symbolic link.   &lt;br /&gt;
&lt;br /&gt;
See this answer from Stackoverflow (http://stackoverflow.com/questions/24850844/follow-symlinks-in-svn)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If I understand your problem, you have:&lt;br /&gt;
&lt;br /&gt;
project1/&lt;br /&gt;
project1/link1 -&amp;gt; ../../some/where/else&lt;br /&gt;
&lt;br /&gt;
If you do a simple svn add link1 it adds a symlink entry to the subversion repository, but what you&#039;re trying to accomplish is getting the stuff under somewhere else into the tree.&lt;br /&gt;
&lt;br /&gt;
If this is the case, then you&#039;re fighting in the wrong direction, you should make the real files and directories under link1, and make the target locations symlinks into the link1 directory. That would be a simple solution to the problem.&lt;br /&gt;
&lt;br /&gt;
Another solution would be to make the location ../../some/where/else an svn location in it&#039;s own right, and make link1 an externals definition to that location. When you commit in the main directory, the externals would be committed at the same time which would achieve storing the information; however to ensure that the other location was kept in sync, you would have to make sure to update it to the same version as the stored data.&lt;br /&gt;
&lt;br /&gt;
In my case, on my desktop, I have a settings directory:&lt;br /&gt;
&lt;br /&gt;
$HOME/settings&lt;br /&gt;
&lt;br /&gt;
This is a checked out copy of a directory containing .bashrc, .profile, .vimrc, .vim, etc. files and folders from an svn repo. All my profile files and directories were symlinks into this folder, so for example .profile -&amp;gt; settings/.profile, etc. When I make changes, they are reflected in the svn tree, which I can commit back to in order to ensure that I don&#039;t lose my config settings when I go to another system.&lt;br /&gt;
&lt;br /&gt;
If you really want svn to follow symlinks as hardlinks (You can&#039;t make directory hardlinks because it would be a bad thing™), then you&#039;ll have to hack the svn client source so that it did what you wanted; but this would be a maintenance nightmare.&lt;br /&gt;
&lt;br /&gt;
You could get away with making the symlink into a bind mount point directed at the target, but that has it&#039;s own issues - you would need to be root to accomplish this, and it ends up leaving funny entries in your /proc/mounts to accomplish this:&lt;br /&gt;
&lt;br /&gt;
mount --bind /absolute/path/to/some/where/else project1/link1&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Keeping recipes separate==&lt;br /&gt;
Computational recipes written in Python and imported by the SConstruct file of a workflow are normally stored in RSFSRC/book/Recipes.  The install process copies these recipes to a directory like $RSFROOT/lib/python2.5/site-packages/rsf/recipes and adds this directory to your PYTHONPATH so that Python can find them.&lt;br /&gt;
&lt;br /&gt;
However, you can put you own recipes anywhere you want.  You only have to add that place to your PYTHONPATH like this (bash):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
export PYTHONPATH=${PYTHONPATH}:path_to_my_recipes&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Or like this (csh):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
setenv PYTHONPATH ${PYTHONPATH}:path_to_my_recipes&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Keeping examples separate==&lt;br /&gt;
Madagascar&#039;s public collection of example workflows are stored in RSFSRC/book, but you can put your private workflows anywhere you want.  No special instructions are required.&lt;br /&gt;
&lt;br /&gt;
However, Madagascar assumes that the workflows are organized into a three-level book/chapter/section directory hierarchy when it creates a directory tree for the data and locked figures associated with your workflow. It is not required, but it might be easier to find the data and locked figures if you put your workflows in a three-level directory tree something like this: path_to_my_book/chapter/section/SConstruct.&lt;br /&gt;
&lt;br /&gt;
==Keeping data separate==&lt;br /&gt;
The location of the data portion of your *.rsf files is controlled by your DATAPATH environment variable.  However, you may want to keep the data for your private workflows in a different place, or several different places, than the data created by the public examples in RSFSRC/book.  The way to do that is to temporarily change the DATAPATH variable in the SConstruct &#039;&#039;before&#039;&#039; importing rsf.proj like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import os&lt;br /&gt;
os.environ[&#039;DATAPATH&#039;] = &#039;path_to_my_private_data&#039;&lt;br /&gt;
&lt;br /&gt;
from rsf.proj import *&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Keeping locked figures separate==&lt;br /&gt;
The command &amp;quot;scons lock&amp;quot; in the directory of a workflow will store a &amp;quot;locked&amp;quot; copy of your figures for regression testing.  Normally these figures are stored in the location pointed to by your RSFFIGS variable, and that is where the figures from the figures repository should be stored for testing in RSFSRC/book.&lt;br /&gt;
&lt;br /&gt;
However, you may want to keep your private figures in a different place.  The way to do that is to temporarily change the RSFFIGS variable in the SConstruct &#039;&#039;before&#039;&#039; importing rsf.proj like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import os&lt;br /&gt;
os.environ[&#039;RSFFIGS&#039;] = &#039;path_to_my_private_figures&#039;&lt;br /&gt;
&lt;br /&gt;
from rsf.proj import *&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
If you also create a RSFALTFIGS environment variable pointing to path_to_my_private_figures, then the testing script sffiglist will automatically test your figures against those in RSFALTFIGS when the sffiglist command is executed from a location outside of RSFSRC/book.&lt;br /&gt;
&lt;br /&gt;
=Capturing error and warning messages=&lt;br /&gt;
The messages during configuration are few and their importance quite high, so they should be watched &amp;quot;in person&amp;quot;. A complete log of the configuration process is recorded in RSFSRC/configure.log&lt;br /&gt;
&lt;br /&gt;
Console messages generated during the build step can be captured to a log file and observed at the same time with a command like this (tcsh):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
nice +10 nohup /usr/bin/time -p scons -k |&amp;amp; tee log_build.asc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The log file can be of course named otherwise than &amp;lt;tt&amp;gt;log_build.asc&amp;lt;/tt&amp;gt;. The file can be later grepped for error and warnings with commands such as:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
grep -c error log_build.asc&lt;br /&gt;
grep error log_build.asc | awk &#039;/error.c/ {next}; /error.h/ {next}; /error.o/ {next}; {print}&#039;&lt;br /&gt;
grep -c warning log_build.asc&lt;br /&gt;
grep warning log_build.asc | awk &#039;/imaginary constants are a GCC extension/ {next}; {print}&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Advanced troubleshooting=&lt;br /&gt;
* If you removed one of your programs or changed its name, and &amp;lt;tt&amp;gt;scons install&amp;lt;/tt&amp;gt; fails with &amp;quot;Source &amp;lt;tt&amp;gt;oldprogname&amp;lt;/tt&amp;gt; not found, needed by target install&amp;quot;, and you cleaned everything there was to clean but still get this message, remove &amp;lt;tt&amp;gt;RSFSRC/.sconsign*&amp;lt;/tt&amp;gt;&lt;br /&gt;
* If during &amp;lt;tt&amp;gt;scons install&amp;lt;/tt&amp;gt; you get a &amp;lt;tt&amp;gt;DBAccessError : (13, &#039;Permission denied&#039;)&amp;lt;/tt&amp;gt; in some reproducible papers, check permissions in your &amp;lt;tt&amp;gt;$DATAPATH&amp;lt;/tt&amp;gt; directory. This is where SCons places database &amp;quot;.sconsign&amp;quot; files for its dependencies (according to the rules in &amp;lt;tt&amp;gt;rsf.proj&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;rsf.tex&amp;lt;/tt&amp;gt;).&lt;br /&gt;
* If &amp;lt;tt&amp;gt;scons&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;scons install&amp;lt;/tt&amp;gt; fail due to an a bug introduced in a tool you are certain you will not use, a quick workaround for the problem is already built into scons: the &amp;lt;tt&amp;gt;-k&amp;lt;/tt&amp;gt; option, which means &amp;quot;keep going&amp;quot;. Thus, if you use &amp;lt;tt&amp;gt;scons -k&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;scons -k install&amp;lt;/tt&amp;gt;, SCons will not be able to build the failed component, or anything that depends on it, but it will keep going and make everything else that it can.&lt;br /&gt;
&lt;br /&gt;
=Further support=&lt;br /&gt;
Subscribe to the [https://lists.sourceforge.net/lists/listinfo/rsf-user rsf-user mailing list].&lt;/div&gt;</summary>
		<author><name>Karl</name></author>
	</entry>
	<entry>
		<id>https://ahay.org/index.php?title=Guide_to_madagascar_API&amp;diff=3749</id>
		<title>Guide to madagascar API</title>
		<link rel="alternate" type="text/html" href="https://ahay.org/index.php?title=Guide_to_madagascar_API&amp;diff=3749"/>
		<updated>2018-12-13T21:08:32Z</updated>

		<summary type="html">&lt;p&gt;Karl: /* Python interface */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;center&amp;gt;&amp;lt;font size=&amp;quot;-1&amp;quot;&amp;gt;&#039;&#039;This page was created from the LaTeX source in [http://sourceforge.net/p/rsf/code/HEAD/tree/trunk/book/rsf/rsf/api.tex book/rsf/rsf/api.tex] using [[latex2wiki]]&#039;&#039;&amp;lt;/font&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Fotolia_555071_XS.jpg|right|]]&lt;br /&gt;
&lt;br /&gt;
This guide explains the RSF programming interface.  See the &#039;&#039;&#039;[[Library_Reference | Library Reference]]&#039;&#039;&#039; for more information on how to use the particular APIs.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
To work with RSF files in your own programs, you may need to use an&lt;br /&gt;
appropriate programming interface. We will demonstrate the interface in&lt;br /&gt;
different languages using a simple example. The example is a clipping program.&lt;br /&gt;
It reads and writes RSF files and accesses parameters both from the input file&lt;br /&gt;
and the command line. The input is processed trace by trace. This is not&lt;br /&gt;
necessarily the most efficient approach&amp;lt;ref&amp;gt;Compare with the [http://rsf.svn.sourceforge.net/viewvc/rsf/trunk/filt/proc/Mclip.c?view=markup library clip program].&amp;lt;/ref&amp;gt; but it suffices for a simple demonstration.&lt;br /&gt;
&lt;br /&gt;
==Installation== &lt;br /&gt;
Only the C interface is installed by default. To install other APIs, use &amp;lt;tt&amp;gt;API=&amp;lt;/tt&amp;gt;&lt;br /&gt;
parameter in the RSF configuration. For example, to install C++ and&lt;br /&gt;
Fortran-90 API bindings in addition to the basic package, run&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./configure API=c++,fortran-90&lt;br /&gt;
scons install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The configuration parameters are stored in &amp;lt;tt&amp;gt;&amp;amp;#36;RSFROOT/share/madagascar/etc/config.py&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==C interface==&lt;br /&gt;
&lt;br /&gt;
The C clip function is listed below.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
/* Clip the data. */&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;rsf.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char* argv[])&lt;br /&gt;
{&lt;br /&gt;
    int n1, n2, i1, i2;&lt;br /&gt;
    float clip, *trace=NULL;&lt;br /&gt;
    sf_file in=NULL, out=NULL; /* Input and output files */&lt;br /&gt;
&lt;br /&gt;
    /* Initialize RSF */&lt;br /&gt;
    sf_init(argc,argv);&lt;br /&gt;
    /* standard input */&lt;br /&gt;
    in = sf_input(&amp;quot;in&amp;quot;);&lt;br /&gt;
    /* standard output */&lt;br /&gt;
    out = sf_output(&amp;quot;out&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
    /* check that the input is float */&lt;br /&gt;
    if (SF_FLOAT != sf_gettype(in)) &lt;br /&gt;
	sf_error(&amp;quot;Need float input&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
    /* n1 is the fastest dimension (trace length) */&lt;br /&gt;
    if (!sf_histint(in,&amp;quot;n1&amp;quot;,&amp;amp;n1)) &lt;br /&gt;
	sf_error(&amp;quot;No n1= in input&amp;quot;);&lt;br /&gt;
    /* leftsize gets n2*n3*n4*... (the number of traces) */&lt;br /&gt;
    n2 = sf_leftsize(in,1);&lt;br /&gt;
&lt;br /&gt;
    /* parameter from the command line (i.e. clip=1.5 ) */&lt;br /&gt;
    if (!sf_getfloat(&amp;quot;clip&amp;quot;,&amp;amp;clip)) sf_error(&amp;quot;Need clip=&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
    /* allocate floating point array */&lt;br /&gt;
    trace = sf_floatalloc (n1);&lt;br /&gt;
&lt;br /&gt;
    /* loop over traces */&lt;br /&gt;
    for (i2=0; i2 &amp;lt; n2; i2++) {&lt;br /&gt;
&lt;br /&gt;
	/*read a trace */&lt;br /&gt;
	sf_floatread(trace,n1,in);&lt;br /&gt;
&lt;br /&gt;
	/* loop over samples */&lt;br /&gt;
	for (i1=0; i1 &amp;lt; n1; i1++) {&lt;br /&gt;
	    if      (trace[i1] &amp;gt;  clip) trace[i1]= clip;&lt;br /&gt;
	    else if (trace[i1] &amp;lt; -clip) trace[i1]=-clip;&lt;br /&gt;
	}&lt;br /&gt;
    &lt;br /&gt;
	/* write a trace */&lt;br /&gt;
	sf_floatwrite(trace,n1,out);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    free(trace);&lt;br /&gt;
    sf_close();&lt;br /&gt;
    exit(0);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let us examine it in detail. &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;rsf.h&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The include preprocessing directive is required to access the RSF interface. &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
    sf_file in=NULL, out=NULL; /* Input and output files */&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
RSF data files are defined with an abstract &amp;lt;tt&amp;gt;sf_file&amp;lt;/tt&amp;gt; data type. An&lt;br /&gt;
abstract data type means that the contents of it are not publicly declared,&lt;br /&gt;
and all operations on &amp;lt;tt&amp;gt;sf_file&amp;lt;/tt&amp;gt; objects should be performed with&lt;br /&gt;
library functions. This is analogous to &amp;lt;tt&amp;gt;FILE *&amp;lt;/tt&amp;gt; data type used in&lt;br /&gt;
&amp;lt;tt&amp;gt;stdio.h&amp;lt;/tt&amp;gt; and as close as C gets to an object-oriented style of&lt;br /&gt;
programming (Roberts, 1998&amp;lt;ref&amp;gt;Roberts, E. S.,  1998, Programming abstractions in C: Addison-Wesley.&amp;lt;/ref&amp;gt;).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
    /* Initialize RSF */&lt;br /&gt;
    sf_init(argc,argv);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before using any of the other functions, you must call&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_init&amp;lt;/tt&amp;gt;. This function parses the command line and&lt;br /&gt;
initializes an internally stored table of command-line parameters.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
    /* standard input */&lt;br /&gt;
    in = sf_input(&amp;quot;in&amp;quot;);&lt;br /&gt;
    /* standard output */&lt;br /&gt;
    out = sf_output(&amp;quot;out&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The input and output RSF file objects are created with &amp;lt;tt&amp;gt;sf_input&amp;lt;/tt&amp;gt; and&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_output&amp;lt;/tt&amp;gt; constructor functions. Both these functions take a string&lt;br /&gt;
argument. The string may refer to a file name or a file tag. For example, if&lt;br /&gt;
the command line contains &amp;lt;tt&amp;gt;vel=velocity.rsf&amp;lt;/tt&amp;gt;, then both&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_input(&amp;quot;velocity.rsf&amp;quot;)&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;sf_input(&amp;quot;vel&amp;quot;)&amp;lt;/tt&amp;gt; are&lt;br /&gt;
acceptable. Two tags are special: &amp;lt;tt&amp;gt;&amp;quot;in&amp;quot;&amp;lt;/tt&amp;gt; refers to the file in the&lt;br /&gt;
standard input and &amp;lt;tt&amp;gt;&amp;quot;out&amp;quot;&amp;lt;/tt&amp;gt; refers to the file in the standard&lt;br /&gt;
output. &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
    /* check that the input is float */&lt;br /&gt;
    if (SF_FLOAT != sf_gettype(in)) &lt;br /&gt;
	sf_error(&amp;quot;Need float input&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
RSF files can store data of different types (character, integer,&lt;br /&gt;
floating point, complex). We extract the data type of the input file&lt;br /&gt;
with the library &amp;lt;tt&amp;gt;sf_gettype&amp;lt;/tt&amp;gt; function and check if it&lt;br /&gt;
represents floating point numbers. If not, the program is aborted with&lt;br /&gt;
an error message, using the &amp;lt;tt&amp;gt;sf_error&amp;lt;/tt&amp;gt; function.  It is&lt;br /&gt;
generally a good idea to check the input for user errors and, if they&lt;br /&gt;
cannot be corrected, to take a safe exit.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
    /* n1 is the fastest dimension (trace length) */&lt;br /&gt;
    if (!sf_histint(in,&amp;quot;n1&amp;quot;,&amp;amp;n1)) &lt;br /&gt;
	sf_error(&amp;quot;No n1= in input&amp;quot;);&lt;br /&gt;
    /* leftsize gets n2*n3*n4*... (the number of traces) */&lt;br /&gt;
    n2 = sf_leftsize(in,1);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Conceptually, the RSF data model is a multidimensional hypercube. By&lt;br /&gt;
convention, the dimensions of the cube are stored in &amp;lt;tt&amp;gt;n1=&amp;lt;/tt&amp;gt;,&lt;br /&gt;
&amp;lt;tt&amp;gt;n2=&amp;lt;/tt&amp;gt;, etc. parameters. The &amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt; parameter refers to the&lt;br /&gt;
fastest axis. If the input dataset is a collection of traces,&lt;br /&gt;
&amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt; refers to the trace length. We extract it using the&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_histint&amp;lt;/tt&amp;gt; function (integer parameter from history) and&lt;br /&gt;
abort if no value for &amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt; is found. We could proceed in a&lt;br /&gt;
similar fashion, extracting &amp;lt;tt&amp;gt;n2&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;n3&amp;lt;/tt&amp;gt;, etc. If we are&lt;br /&gt;
interested in the total number of traces, like in the clip example, a&lt;br /&gt;
shortcut is to use the &amp;lt;tt&amp;gt;sf_leftsize&amp;lt;/tt&amp;gt; function. Calling&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_leftsize(in,0)&amp;lt;/tt&amp;gt; returns the total number of elements in&lt;br /&gt;
the hypercube (the product of &amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;n2&amp;lt;/tt&amp;gt;, etc.), calling&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_leftsize(in,1)&amp;lt;/tt&amp;gt; returns the number of traces (the product&lt;br /&gt;
of &amp;lt;tt&amp;gt;n2&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;n3&amp;lt;/tt&amp;gt;, etc.), calling&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_leftsize(in,2)&amp;lt;/tt&amp;gt; returns the product of &amp;lt;tt&amp;gt;n3&amp;lt;/tt&amp;gt;,&lt;br /&gt;
&amp;lt;tt&amp;gt;n4&amp;lt;/tt&amp;gt;, etc. By calling &amp;lt;tt&amp;gt;sf_leftsize&amp;lt;/tt&amp;gt;, we avoid the need&lt;br /&gt;
to extract additional parameters for the hypercube dimensions that we&lt;br /&gt;
are not interested in.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
    /* parameter from the command line (i.e. clip=1.5 ) */&lt;br /&gt;
    if (!sf_getfloat(&amp;quot;clip&amp;quot;,&amp;amp;clip)) sf_error(&amp;quot;Need clip=&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
The clip parameter is read from the command line, where it can be&lt;br /&gt;
specified, for example, as &amp;lt;tt&amp;gt;clip=10&amp;lt;/tt&amp;gt;. The parameter has the&lt;br /&gt;
&amp;lt;tt&amp;gt;float&amp;lt;/tt&amp;gt; type, therefore we read it with the&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_getfloat&amp;lt;/tt&amp;gt; function. If no &amp;lt;tt&amp;gt;clip=&amp;lt;/tt&amp;gt; parameter is&lt;br /&gt;
found among the command line arguments, the program is aborted with an&lt;br /&gt;
error message using the &amp;lt;tt&amp;gt;sf_error&amp;lt;/tt&amp;gt; function.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
    /* allocate floating point array */&lt;br /&gt;
    trace = sf_floatalloc (n1);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Next, we allocate an array of floating-point numbers to store a trace&lt;br /&gt;
with the library &amp;lt;tt&amp;gt;sf_floatalloc&amp;lt;/tt&amp;gt; function. Unlike the standard&lt;br /&gt;
&amp;lt;tt&amp;gt;malloc&amp;lt;/tt&amp;gt; the RSF allocation function checks for errors and&lt;br /&gt;
either terminates the program or returns a valid pointer.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
    /* loop over traces */&lt;br /&gt;
    for (i2=0; i2 &amp;lt; n2; i2++) {&lt;br /&gt;
&lt;br /&gt;
	/*read a trace */&lt;br /&gt;
	sf_floatread(trace,n1,in);&lt;br /&gt;
&lt;br /&gt;
	/* loop over samples */&lt;br /&gt;
	for (i1=0; i1 &amp;lt; n1; i1++) {&lt;br /&gt;
	    if      (trace[i1] &amp;gt;  clip) trace[i1]= clip;&lt;br /&gt;
	    else if (trace[i1] &amp;lt; -clip) trace[i1]=-clip;&lt;br /&gt;
	}&lt;br /&gt;
    &lt;br /&gt;
	/* write a trace */&lt;br /&gt;
	sf_floatwrite(trace,n1,out);&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
The rest of the program is straightforward. We loop over all available&lt;br /&gt;
traces, read each trace, clip it and right the output out. The syntax&lt;br /&gt;
of &amp;lt;tt&amp;gt;sf_floatread&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;sf_floatwrite&amp;lt;/tt&amp;gt; functions is&lt;br /&gt;
similar to the syntax of the C standard &amp;lt;tt&amp;gt;fread&amp;lt;/tt&amp;gt; and&lt;br /&gt;
&amp;lt;tt&amp;gt;fwrite&amp;lt;/tt&amp;gt; function except that the type of the element is&lt;br /&gt;
specified explicitly in the function name and that the input and&lt;br /&gt;
output files have the RSF type &amp;lt;tt&amp;gt;sf_file&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
sf_close();&lt;br /&gt;
exit(0)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We explicitly close the input file to avoid leaving a stale temporary file in &amp;lt;tt&amp;gt;$DATAPATH&amp;lt;/tt&amp;gt; if the program is called in a pipe sequence. Then, we close the program by sending the shell the Unix code that tells it no errors were encountered. &lt;br /&gt;
&lt;br /&gt;
Note that this is an introductory example, optimized for clarity, not execution speed. For advanced techniques, see [[Madagascar Code Patterns]].&lt;br /&gt;
&lt;br /&gt;
===Compiling===&lt;br /&gt;
To compile the &amp;lt;tt&amp;gt;clip&amp;lt;/tt&amp;gt; program, run&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cc clip.c -I&amp;amp;#36;RSFROOT/include -L&amp;amp;#36;RSFROOT/lib -lrsf -lm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Change &amp;lt;tt&amp;gt;cc&amp;lt;/tt&amp;gt; to the C compiler appropriate for your system and include&lt;br /&gt;
additional compiler flags if necessary. The flags that RSF typically uses are&lt;br /&gt;
in &amp;lt;tt&amp;gt;&amp;amp;#36;RSFROOT/share/madagascar/etc/config.py&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==C++ interface==&lt;br /&gt;
&lt;br /&gt;
The C++ clip function is listed below.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
/* Clip the data. */&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;valarray&amp;gt;&lt;br /&gt;
#include &amp;lt;rsf.hh&amp;gt;&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char* argv[])&lt;br /&gt;
{&lt;br /&gt;
    sf_init(argc,argv); // Initialize RSF&lt;br /&gt;
    &lt;br /&gt;
    iRSF par(0), in; // input parameter, file&lt;br /&gt;
    oRSF out;        // output file&lt;br /&gt;
&lt;br /&gt;
    int n1, n2;      // trace length, number of traces&lt;br /&gt;
    float clip;&lt;br /&gt;
    &lt;br /&gt;
    in.get(&amp;quot;n1&amp;quot;,n1);&lt;br /&gt;
    n2=in.size(1);&lt;br /&gt;
&lt;br /&gt;
    par.get(&amp;quot;clip&amp;quot;,clip); // parameter from the command line&lt;br /&gt;
&lt;br /&gt;
    std::valarray&amp;lt;float&amp;gt; trace(n1);&lt;br /&gt;
&lt;br /&gt;
    for (int i2=0; i2 &amp;lt; n2; i2++) { // loop over traces&lt;br /&gt;
	in &amp;gt;&amp;gt; trace; // read a trace&lt;br /&gt;
&lt;br /&gt;
	for (int i1=0; i1 &amp;lt; n1; i1++) { // loop over samples&lt;br /&gt;
	    if      (trace[i1] &amp;gt;  clip) trace[i1]=clip;&lt;br /&gt;
	    else if (trace[i1] &amp;lt; -clip) trace[i1]=-clip;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	out &amp;lt;&amp;lt; trace; // write a trace&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    exit(0);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let us examine it line by line. &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;rsf.hh&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Including &amp;quot;&amp;lt;tt&amp;gt;rsf.hh&amp;lt;/tt&amp;gt;&amp;quot; is required for accessing the RSF C++&lt;br /&gt;
interface.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    sf_init(argc,argv); // Initialize RSF&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A call to &amp;lt;tt&amp;gt;sf_init&amp;lt;/tt&amp;gt; is required to initialize the internally stored&lt;br /&gt;
table of command-line arguments.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    iRSF par(0), in; // input parameter, file&lt;br /&gt;
    oRSF out;        // output file&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Two classes: &amp;lt;tt&amp;gt;iRSF&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;oRSF&amp;lt;/tt&amp;gt; are used to define input and&lt;br /&gt;
output files. For simplicity, the command-line parameters are also handled &lt;br /&gt;
as an &amp;lt;tt&amp;gt;iRSF&amp;lt;/tt&amp;gt; object, initialized with zero.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    in.get(&amp;quot;n1&amp;quot;,n1);&lt;br /&gt;
    n2=in.size(1);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, we read the data dimensions from the input RSF file object called&lt;br /&gt;
&amp;lt;tt&amp;gt;in&amp;lt;/tt&amp;gt;: the trace length is a parameter called &amp;quot;&amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt;&amp;quot; and the&lt;br /&gt;
number of traces is the size of &amp;lt;tt&amp;gt;in&amp;lt;/tt&amp;gt; remaining after excluding the&lt;br /&gt;
first dimension. It is extracted with the &amp;lt;tt&amp;gt;size&amp;lt;/tt&amp;gt; method.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    par.get(&amp;quot;clip&amp;quot;,clip); // parameter from the command line&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
The clip parameter should be specified on the command line, for&lt;br /&gt;
example, as &amp;lt;tt&amp;gt;clip=10&amp;lt;/tt&amp;gt;. It is extracted with the &amp;lt;tt&amp;gt;get&amp;lt;/tt&amp;gt;&lt;br /&gt;
method of &amp;lt;tt&amp;gt;iRSF&amp;lt;/tt&amp;gt; class from the &amp;lt;tt&amp;gt;par&amp;lt;/tt&amp;gt; object.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    std::valarray&amp;lt;float&amp;gt; trace(n1);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The trace object has the single-precision floating-point type and is a&lt;br /&gt;
1-D array of length &amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt;. It is declared and allocated using&lt;br /&gt;
the &amp;lt;tt&amp;gt;valarray&amp;lt;/tt&amp;gt; template class from the standard C++ library.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    for (int i2=0; i2 &amp;lt; n2; i2++) { // loop over traces&lt;br /&gt;
	in &amp;gt;&amp;gt; trace; // read a trace&lt;br /&gt;
&lt;br /&gt;
	for (int i1=0; i1 &amp;lt; n1; i1++) { // loop over samples&lt;br /&gt;
	    if      (trace[i1] &amp;gt;  clip) trace[i1]=clip;&lt;br /&gt;
	    else if (trace[i1] &amp;lt; -clip) trace[i1]=-clip;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	out &amp;lt;&amp;lt; trace; // write a trace&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, we loop through the traces, read each trace from &amp;lt;tt&amp;gt;in&amp;lt;/tt&amp;gt;, clip it&lt;br /&gt;
and write the output to &amp;lt;tt&amp;gt;out&amp;lt;/tt&amp;gt;.&lt;br /&gt;
===Compiling===&lt;br /&gt;
To compile the C++ program, run&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
c++ clip.cc -I&amp;amp;#36;RSFROOT/include -L&amp;amp;#36;RSFROOT/lib -lrsf++ -lrsf -lm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Change &amp;lt;tt&amp;gt;c++&amp;lt;/tt&amp;gt; to the C++ compiler appropriate for your system and&lt;br /&gt;
include additional compiler flags if necessary. The flags that RSF typically&lt;br /&gt;
uses are in &amp;lt;tt&amp;gt;&amp;amp;#36;RSFROOT/share/madagascar/etc/config.py&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Fortran-77 interface==&lt;br /&gt;
&lt;br /&gt;
The Fortran-77 clip function is listed below.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
	program Clipit&lt;br /&gt;
	implicit none&lt;br /&gt;
	integer n1, n2, i1, i2, in, out&lt;br /&gt;
	integer sf_input, sf_output, sf_leftsize, sf_gettype&lt;br /&gt;
	logical sf_getfloat, sf_histint&lt;br /&gt;
	real clip, trace(1000)&lt;br /&gt;
&lt;br /&gt;
	call sf_init()&lt;br /&gt;
	in = sf_input(&amp;quot;in&amp;quot;)&lt;br /&gt;
	out = sf_output(&amp;quot;out&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
	if (3 .ne. sf_gettype(in)) &lt;br /&gt;
     &amp;amp;  call sf_error(&amp;quot;Need float input&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
	if (.not. sf_histint(in,&amp;quot;n1&amp;quot;,n1)) then&lt;br /&gt;
	   call sf_error(&amp;quot;No n1= in input&amp;quot;)&lt;br /&gt;
	else if (n1 &amp;gt; 1000) then&lt;br /&gt;
	   call sf_error(&amp;quot;n1 is too long&amp;quot;)&lt;br /&gt;
	end if&lt;br /&gt;
	n2 = sf_leftsize(in,1)&lt;br /&gt;
&lt;br /&gt;
	if (.not. sf_getfloat(&amp;quot;clip&amp;quot;,clip)) &lt;br /&gt;
     &amp;amp;  call sf_error(&amp;quot;Need clip=&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
	do 10 i2=1, n2&lt;br /&gt;
	   call sf_floatread(trace,n1,in)&lt;br /&gt;
&lt;br /&gt;
	   do 20 i1=1, n1&lt;br /&gt;
	      if (trace(i1) &amp;gt;  clip) then&lt;br /&gt;
		 trace(i1)=clip&lt;br /&gt;
	      else if (trace(i1) &amp;lt; -clip) then&lt;br /&gt;
		 trace(i1)=-clip&lt;br /&gt;
	      end if&lt;br /&gt;
 20	   continue&lt;br /&gt;
&lt;br /&gt;
	   call sf_floatwrite(trace,n1,out)&lt;br /&gt;
 10	continue&lt;br /&gt;
&lt;br /&gt;
	stop&lt;br /&gt;
	end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let us examine it in detail.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
	call sf_init()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The program starts with a call to &amp;lt;tt&amp;gt;sf_init&amp;lt;/tt&amp;gt;, which initializes the&lt;br /&gt;
command-line interface.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
	in = sf_input(&amp;quot;in&amp;quot;)&lt;br /&gt;
	out = sf_output(&amp;quot;out&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The input and output files are created with calls to&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_input&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;sf_output&amp;lt;/tt&amp;gt;. Because of the absence of&lt;br /&gt;
derived types in Fortran-77, we use simple integer pointers to&lt;br /&gt;
represent RSF files. Both &amp;lt;tt&amp;gt;sf_input&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;sf_output&amp;lt;/tt&amp;gt;&lt;br /&gt;
accept a character string, which may refer to a file name or a file&lt;br /&gt;
tag. For example, if the command line contains&lt;br /&gt;
&amp;lt;tt&amp;gt;vel=velocity.rsf&amp;lt;/tt&amp;gt;, then both&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_input(&amp;quot;velocity.rsf&amp;quot;)&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;sf_input(&amp;quot;vel&amp;quot;)&amp;lt;/tt&amp;gt; are&lt;br /&gt;
acceptable. Two tags are special: &amp;lt;tt&amp;gt;&amp;quot;in&amp;quot;&amp;lt;/tt&amp;gt; refers to the file in&lt;br /&gt;
the standard input and &amp;lt;tt&amp;gt;&amp;quot;out&amp;quot;&amp;lt;/tt&amp;gt; refers to the file in the&lt;br /&gt;
standard output.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
	if (3 .ne. sf_gettype(in)) &lt;br /&gt;
     &amp;amp;  call sf_error(&amp;quot;Need float input&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
RSF files can store data of different types (character, integer,&lt;br /&gt;
floating point, complex). The function &amp;lt;tt&amp;gt;sf_gettype&amp;lt;/tt&amp;gt; checks the&lt;br /&gt;
type of data stored in the RSF file. We make sure that the type&lt;br /&gt;
corresponds to floating-point numbers. If not, the program is aborted&lt;br /&gt;
with an error message, using the &amp;lt;tt&amp;gt;sf_error&amp;lt;/tt&amp;gt; function.  It is&lt;br /&gt;
generally a good idea to check the input for user errors and, if they&lt;br /&gt;
cannot be corrected, to take a safe exit.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
	if (.not. sf_histint(in,&amp;quot;n1&amp;quot;,n1)) then&lt;br /&gt;
	   call sf_error(&amp;quot;No n1= in input&amp;quot;)&lt;br /&gt;
	else if (n1 &amp;gt; 1000) then&lt;br /&gt;
	   call sf_error(&amp;quot;n1 is too long&amp;quot;)&lt;br /&gt;
	end if&lt;br /&gt;
	n2 = sf_leftsize(in,1)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Conceptually, the RSF data model is a multidimensional hypercube. By&lt;br /&gt;
convention, the dimensions of the cube are stored in &amp;lt;tt&amp;gt;n1=&amp;lt;/tt&amp;gt;,&lt;br /&gt;
&amp;lt;tt&amp;gt;n2=&amp;lt;/tt&amp;gt;, etc. parameters. The &amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt; parameter refers to the&lt;br /&gt;
fastest axis. If the input dataset is a collection of traces,&lt;br /&gt;
&amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt; refers to the trace length. We extract it using the&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_histint&amp;lt;/tt&amp;gt; function (integer parameter from history) and&lt;br /&gt;
abort if no value for &amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt; is found. Since Fortran-77 cannot&lt;br /&gt;
easily handle dynamic allocation, we also need to check that&lt;br /&gt;
&amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt; is not larger than the size of the statically allocated&lt;br /&gt;
array. We could proceed in a similar fashion, extracting &amp;lt;tt&amp;gt;n2&amp;lt;/tt&amp;gt;,&lt;br /&gt;
&amp;lt;tt&amp;gt;n3&amp;lt;/tt&amp;gt;, etc. If we are interested in the total number of traces,&lt;br /&gt;
like in the clip example, a shortcut is to use the&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_leftsize&amp;lt;/tt&amp;gt; function.  Calling &amp;lt;tt&amp;gt;sf_leftsize(in,0)&amp;lt;/tt&amp;gt;&lt;br /&gt;
returns the total number of elements in the hypercube (the product of&lt;br /&gt;
&amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;n2&amp;lt;/tt&amp;gt;, etc.), calling &amp;lt;tt&amp;gt;sf_leftsize(in,1)&amp;lt;/tt&amp;gt;&lt;br /&gt;
returns the number of traces (the product of &amp;lt;tt&amp;gt;n2&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;n3&amp;lt;/tt&amp;gt;,&lt;br /&gt;
etc.), calling &amp;lt;tt&amp;gt;sf_leftsize(in,2)&amp;lt;/tt&amp;gt; returns the product of&lt;br /&gt;
&amp;lt;tt&amp;gt;n3&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;n4&amp;lt;/tt&amp;gt;, etc. By calling &amp;lt;tt&amp;gt;sf_leftsize&amp;lt;/tt&amp;gt;, we&lt;br /&gt;
avoid the need to extract additional parameters for the hypercube&lt;br /&gt;
dimensions that we are not interested in.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
	if (.not. sf_getfloat(&amp;quot;clip&amp;quot;,clip)) &lt;br /&gt;
     &amp;amp;  call sf_error(&amp;quot;Need clip=&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The clip parameter is read from the command line, where it can be&lt;br /&gt;
specified, for example, as &amp;lt;tt&amp;gt;clip=10&amp;lt;/tt&amp;gt;. The parameter has the&lt;br /&gt;
&amp;lt;tt&amp;gt;float&amp;lt;/tt&amp;gt; type, therefore we read it with the&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_getfloat&amp;lt;/tt&amp;gt; function. If no &amp;lt;tt&amp;gt;clip=&amp;lt;/tt&amp;gt; parameter is&lt;br /&gt;
found among the command line arguments, the program is aborted with an&lt;br /&gt;
error message using the &amp;lt;tt&amp;gt;sf_error&amp;lt;/tt&amp;gt; function.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
	do 10 i2=1, n2&lt;br /&gt;
	   call sf_floatread(trace,n1,in)&lt;br /&gt;
&lt;br /&gt;
	   do 20 i1=1, n1&lt;br /&gt;
	      if (trace(i1) &amp;gt;  clip) then&lt;br /&gt;
		 trace(i1)=clip&lt;br /&gt;
	      else if (trace(i1) &amp;lt; -clip) then&lt;br /&gt;
		 trace(i1)=-clip&lt;br /&gt;
	      end if&lt;br /&gt;
 20	   continue&lt;br /&gt;
&lt;br /&gt;
	   call sf_floatwrite(trace,n1,out)&lt;br /&gt;
 10	continue&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, we do the actual work: loop over input traces, reading,&lt;br /&gt;
clipping, and writing out each trace.&lt;br /&gt;
===Compiling===&lt;br /&gt;
To compile the Fortran-77 program, run&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
f77 clip.f -L$RSFROOT/lib -lrsff -lrsf -lm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Change &amp;lt;tt&amp;gt;f77&amp;lt;/tt&amp;gt; to the Fortran compiler appropriate for your system and&lt;br /&gt;
include additional compiler flags if necessary. The flags that RSF typically&lt;br /&gt;
uses are in &amp;lt;tt&amp;gt;&amp;amp;#36;RSFROOT/share/madagascar/etc/config.py&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Fortran-90 interface==&lt;br /&gt;
&lt;br /&gt;
The Fortran-90 clip function is listed below.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
program Clipit&lt;br /&gt;
  use rsf&lt;br /&gt;
&lt;br /&gt;
  implicit none&lt;br /&gt;
  type (file)                      :: in, out&lt;br /&gt;
  integer                          :: n1, n2, i1, i2&lt;br /&gt;
  real                             :: clip&lt;br /&gt;
  real, dimension (:), allocatable :: trace&lt;br /&gt;
&lt;br /&gt;
  call sf_init()            ! initialize RSF&lt;br /&gt;
  in = rsf_input()&lt;br /&gt;
  out = rsf_output()&lt;br /&gt;
&lt;br /&gt;
  if (sf_float /= gettype(in)) call sf_error(&amp;quot;Need float type&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
  call from_par(in,&amp;quot;n1&amp;quot;,n1)&lt;br /&gt;
  n2 = filesize(in,1)&lt;br /&gt;
&lt;br /&gt;
  call from_par(&amp;quot;clip&amp;quot;,clip) ! command-line parameter &lt;br /&gt;
&lt;br /&gt;
  allocate (trace (n1))&lt;br /&gt;
&lt;br /&gt;
  do i2=1, n2                ! loop over traces&lt;br /&gt;
     call rsf_read(in,trace)&lt;br /&gt;
     &lt;br /&gt;
     where (trace &amp;gt;  clip) trace =  clip&lt;br /&gt;
     where (trace &amp;lt; -clip) trace = -clip&lt;br /&gt;
&lt;br /&gt;
     call rsf_write(out,trace)&lt;br /&gt;
  end do&lt;br /&gt;
&lt;br /&gt;
  deallocate (trace)&lt;br /&gt;
&lt;br /&gt;
end program Clipit&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let us examine it in detail.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
  use rsf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The program starts with importing the &amp;lt;tt&amp;gt;rsf&amp;lt;/tt&amp;gt; module.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
  call sf_init()            ! initialize RSF&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A call to &amp;lt;tt&amp;gt;sf_init&amp;lt;/tt&amp;gt; is needed to initialize the command-line&lt;br /&gt;
interface.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
  in = rsf_input()&lt;br /&gt;
  out = rsf_output()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The standard input and output files are initialized with&lt;br /&gt;
&amp;lt;tt&amp;gt;rsf_input&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;rsf_output&amp;lt;/tt&amp;gt; functions. Both functions&lt;br /&gt;
accept optional arguments. For example, if the command line contains&lt;br /&gt;
&amp;lt;tt&amp;gt;vel=velocity.rsf&amp;lt;/tt&amp;gt;, then both&lt;br /&gt;
&amp;lt;tt&amp;gt;rsf_input(&amp;quot;velocity.rsf&amp;quot;)&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;rsf_input(&amp;quot;vel&amp;quot;)&amp;lt;/tt&amp;gt; are&lt;br /&gt;
acceptable.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
  if (sf_float /= gettype(in)) call sf_error(&amp;quot;Need float type&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A call to &amp;lt;tt&amp;gt;from_par&amp;lt;/tt&amp;gt; extracts the &amp;quot;&amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt;&amp;quot; parameter&lt;br /&gt;
from the input file. Conceptually, the RSF data model is a&lt;br /&gt;
multidimensional hypercube.  The &amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt; parameter refers to the&lt;br /&gt;
fastest axis. If the input dataset is a collection of traces,&lt;br /&gt;
&amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt; corresponds to the trace length. We could proceed in a&lt;br /&gt;
similar fashion, extracting &amp;lt;tt&amp;gt;n2&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;n3&amp;lt;/tt&amp;gt;, etc. If we are&lt;br /&gt;
interested in the total number of traces, like in the clip example, a&lt;br /&gt;
shortcut is to use the &amp;lt;tt&amp;gt;filesize&amp;lt;/tt&amp;gt; function.  Calling&lt;br /&gt;
&amp;lt;tt&amp;gt;filesize(in)&amp;lt;/tt&amp;gt; returns the total number of elements in the&lt;br /&gt;
hypercube (the product of &amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;n2&amp;lt;/tt&amp;gt;, etc.), calling&lt;br /&gt;
&amp;lt;tt&amp;gt;filesize(in,1)&amp;lt;/tt&amp;gt; returns the number of traces (the product of&lt;br /&gt;
&amp;lt;tt&amp;gt;n2&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;n3&amp;lt;/tt&amp;gt;, etc.), calling &amp;lt;tt&amp;gt;filesize(in,2)&amp;lt;/tt&amp;gt;&lt;br /&gt;
returns the product of &amp;lt;tt&amp;gt;n3&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;n4&amp;lt;/tt&amp;gt;, etc. By calling&lt;br /&gt;
&amp;lt;tt&amp;gt;filesize&amp;lt;/tt&amp;gt;, we avoid the need to extract additional parameters&lt;br /&gt;
for the hypercube dimensions that we are not interested in.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
  n2 = filesize(in,1)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The clip parameter is read from the command line, where it can be&lt;br /&gt;
specified, for example, as &amp;lt;tt&amp;gt;clip=10&amp;lt;/tt&amp;gt;. If we knew a good default&lt;br /&gt;
value for &amp;lt;tt&amp;gt;clip&amp;lt;/tt&amp;gt;, we could specify it with an optional&lt;br /&gt;
argument, i.e. &amp;lt;tt&amp;gt;call~from_par(&amp;quot;clip&amp;quot;,clip,default)&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
  allocate (trace (n1))&lt;br /&gt;
&lt;br /&gt;
  do i2=1, n2                ! loop over traces&lt;br /&gt;
     call rsf_read(in,trace)&lt;br /&gt;
     &lt;br /&gt;
     where (trace &amp;gt;  clip) trace =  clip&lt;br /&gt;
     where (trace &amp;lt; -clip) trace = -clip&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, we do the actual work: loop over input traces, reading,&lt;br /&gt;
clipping, and writing out each trace.&lt;br /&gt;
===Compiling===&lt;br /&gt;
To compile the Fortran-90 program, run&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
f90 clip.f90 -I&amp;amp;#36;RSFROOT/include -L&amp;amp;#36;RSFROOT/lib -lrsff90 -lrsf -lm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Change &amp;lt;tt&amp;gt;f90&amp;lt;/tt&amp;gt; to the Fortran-90 compiler appropriate for your system and&lt;br /&gt;
include additional compiler flags if necessary. The flags that RSF typically&lt;br /&gt;
uses are in &amp;lt;tt&amp;gt;&amp;amp;#36;RSFROOT/share/madagasacar/etc/config.py&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The complete specification for the F90 API can be found [[Library_Reference#Fortran_90_API | on the Library Reference page]].&lt;br /&gt;
&lt;br /&gt;
==Python interface==&lt;br /&gt;
Examples that use the python interface are in the directory $RSFSRC/api/python/test.&lt;br /&gt;
&lt;br /&gt;
The Python script clip.py is:.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
#!/usr/bin/env python&lt;br /&gt;
&lt;br /&gt;
import numpy&lt;br /&gt;
import m8r&lt;br /&gt;
&lt;br /&gt;
par = m8r.Par()&lt;br /&gt;
inp  = m8r.Input()&lt;br /&gt;
output = m8r.Output()&lt;br /&gt;
assert &#039;float&#039; == inp.type&lt;br /&gt;
&lt;br /&gt;
n1 = inp.int(&amp;quot;n1&amp;quot;)&lt;br /&gt;
n2 = inp.size(1)&lt;br /&gt;
assert n1&lt;br /&gt;
&lt;br /&gt;
clip = par.float(&amp;quot;clip&amp;quot;)&lt;br /&gt;
assert clip&lt;br /&gt;
&lt;br /&gt;
trace = numpy.zeros(n1,&#039;f&#039;)&lt;br /&gt;
&lt;br /&gt;
for i2 in xrange(n2): # loop over traces&lt;br /&gt;
    inp.read(trace)&lt;br /&gt;
    trace = numpy.clip(trace,-clip,clip)&lt;br /&gt;
    output.write(trace)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let us examine it in detail. &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import numpy&lt;br /&gt;
import m8r&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The script starts with importing the &amp;lt;tt&amp;gt;numpy&amp;lt;/tt&amp;gt; module and the&lt;br /&gt;
&amp;lt;tt&amp;gt;m8r&amp;lt;/tt&amp;gt; API.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
par = m8r.Par()&lt;br /&gt;
inp  = m8r.Input()&lt;br /&gt;
output = m8r.Output()&lt;br /&gt;
assert &#039;float&#039; == inp.type&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, we initialize the command line interface and the standard input and&lt;br /&gt;
output files. We also make sure that the input file type is floating point.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
n1 = input.int(&amp;quot;n1&amp;quot;)&lt;br /&gt;
n2 = input.size(1)&lt;br /&gt;
assert n1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We extract the &amp;quot;&amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt;&amp;quot; parameter from the input file.&lt;br /&gt;
Conceptually, the RSF data model is a multidimensional hypercube.  The&lt;br /&gt;
&amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt; parameter refers to the fastest axis. If the input dataset&lt;br /&gt;
is a collection of traces, &amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt; corresponds to the trace&lt;br /&gt;
length. We could proceed in a similar fashion, extracting &amp;lt;tt&amp;gt;n2&amp;lt;/tt&amp;gt;,&lt;br /&gt;
&amp;lt;tt&amp;gt;n3&amp;lt;/tt&amp;gt;, etc. If we are interested in the total number of traces,&lt;br /&gt;
like in the clip example, a shortcut is to use the &amp;lt;tt&amp;gt;size&amp;lt;/tt&amp;gt;&lt;br /&gt;
method of the &amp;lt;tt&amp;gt;Input&amp;lt;/tt&amp;gt; class.  Calling &amp;lt;tt&amp;gt;size(0)&amp;lt;/tt&amp;gt; returns&lt;br /&gt;
the total number of elements in the hypercube (the product of&lt;br /&gt;
&amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;n2&amp;lt;/tt&amp;gt;, etc.), calling &amp;lt;tt&amp;gt;size(1)&amp;lt;/tt&amp;gt; returns the&lt;br /&gt;
number of traces (the product of &amp;lt;tt&amp;gt;n2&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;n3&amp;lt;/tt&amp;gt;, etc.),&lt;br /&gt;
calling &amp;lt;tt&amp;gt;size(2)&amp;lt;/tt&amp;gt; returns the product of &amp;lt;tt&amp;gt;n3&amp;lt;/tt&amp;gt;,&lt;br /&gt;
&amp;lt;tt&amp;gt;n4&amp;lt;/tt&amp;gt;, etc.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
clip = par.float(&amp;quot;clip&amp;quot;)&lt;br /&gt;
assert clip&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The clip parameter is read from the command line, where it can be specified,&lt;br /&gt;
for example, as &amp;lt;tt&amp;gt;clip=10&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
trace = numpy.zeros(n1,&#039;f&#039;)&lt;br /&gt;
for i2 in xrange(n2): # loop over traces&lt;br /&gt;
    inp.read(trace)&lt;br /&gt;
    trace = numpy.clip(trace,-clip,clip)&lt;br /&gt;
    output.write(trace)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, we do the actual work: allocate an array to hold a trace and  loop &lt;br /&gt;
over input traces, reading, clipping, and writing out each trace.&lt;br /&gt;
&lt;br /&gt;
Alternative code use inp.trace to allocate an array and read &lt;br /&gt;
the whole file into memory. The loop is no longer needed:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
alltraces=inp.read()&lt;br /&gt;
alltraces = numpy.clip(alltraces,-clip,clip)&lt;br /&gt;
output.write(alltraces)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Compiling===&lt;br /&gt;
The python script does not require compilation. Simply make sure that&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;amp;#36;RSFROOT/lib&amp;lt;/tt&amp;gt; is in &amp;lt;tt&amp;gt;PYTHONPATH&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;LD_LIBRARY_PATH&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Interactive mode usage without graphics===&lt;br /&gt;
Madagascar&#039;s Python API can be used interactively too. Create an input dataset with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sfmath  n1=10 n2=9 output=x1+x2  &amp;gt; test.rsf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, start the python interpreter and paste the following to its command line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import numpy, m8r&lt;br /&gt;
&lt;br /&gt;
inp = m8r.Input(&#039;test.rsf&#039;)&lt;br /&gt;
n1 = inp.int(&amp;quot;n1&amp;quot;)&lt;br /&gt;
n2 = inp.int(&amp;quot;n2&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
data =inp.read(shape=(n2,n1))&lt;br /&gt;
data = data.transpose() # Example of numpy in action&lt;br /&gt;
&lt;br /&gt;
print data&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[[ 0.  1.  2.  3.  4.  5.  6.  7.  8.]&lt;br /&gt;
 [ 1.  2.  3.  4.  5.  6.  7.  8.  9.]&lt;br /&gt;
 [ 2.  3.  4.  5.  6.  7.  8.  9. 10.]&lt;br /&gt;
 [ 3.  4.  5.  6.  7.  8.  9. 10. 11.]&lt;br /&gt;
 [ 4.  5.  6.  7.  8.  9. 10. 11. 12.]&lt;br /&gt;
 [ 5.  6.  7.  8.  9. 10. 11. 12. 13.]&lt;br /&gt;
 [ 6.  7.  8.  9. 10. 11. 12. 13. 14.]&lt;br /&gt;
 [ 7.  8.  9. 10. 11. 12. 13. 14. 15.]&lt;br /&gt;
 [ 8.  9. 10. 11. 12. 13. 14. 15. 16.]&lt;br /&gt;
 [ 9. 10. 11. 12. 13. 14. 15. 16. 17.]]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code will also work in batch mode in a Python script, not only pasted to the interpreter&#039;s command line. &lt;br /&gt;
&lt;br /&gt;
===Graphics with Matplotlib===&lt;br /&gt;
Python can plot arrays directly from memory, without having to write a file to disk first. [http://matplotlib.sourceforge.net/ Matplotlib] is one of the [http://en.wikipedia.org/wiki/Category:Free_plotting_software several] packages that accomplish this. To create a figure, execute the code in the previous section, followed by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from pylab import *&lt;br /&gt;
imshow(data)&lt;br /&gt;
xlabel(&#039;X (m)&#039;)&lt;br /&gt;
ylabel(&#039;Y (m)&#039;)&lt;br /&gt;
title(&#039;Matplotlib example&#039;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to pop up a figure in an interactive session, after pasting to a Python command line the code shown before, also paste:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
show()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will get Figure 1. The figure will pop up if you run the code in a script too, and the script will stop until the figure is manually closed. You must press the floppy disk button in order to save it. To have the image written to disk automatically, instead of &amp;lt;tt&amp;gt;show()&amp;lt;/tt&amp;gt; use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
savefig(&#039;myfile.png&#039;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:matplotlib_imshow.png]]&lt;br /&gt;
&lt;br /&gt;
Putting it all together, here is a sample script reading a RSF file from stdin and printing out a figure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
#!/usr/bin/env python&lt;br /&gt;
import m8r, numpy, sys, pylab&lt;br /&gt;
&lt;br /&gt;
inp = m8r.Input(&#039;test.rsf&#039;)&lt;br /&gt;
n1 = inp.int(&amp;quot;n1&amp;quot;)&lt;br /&gt;
n2 = inp.int(&amp;quot;n2&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
data=input.read()&lt;br /&gt;
&lt;br /&gt;
pylab.imshow(data)&lt;br /&gt;
pylab.savefig(&#039;out.png&#039;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
===Python interfaces to the standalone programs===&lt;br /&gt;
The &amp;lt;tt&amp;gt;m8r&amp;lt;/tt&amp;gt; module offers a way to call Madagascar standalone programs (including graphics) elegantly from inside a Python program, interactively or in batch mode. The blog contains examples of running the &amp;lt;tt&amp;gt;m8r&amp;lt;/tt&amp;gt; module [http://www.ahay.org/rsflog/index.php?/archives/173-Extending-Python-interface.html from inside a SAGE notebook] or [http://www.ahay.org/rsflog/index.php?/archives/264-Running-Madagascar-in-an-interactive-console.html from inside an iPython shell].&lt;br /&gt;
&lt;br /&gt;
==MATLAB interface==&lt;br /&gt;
&lt;br /&gt;
The MATLAB clip function is listed below.&lt;br /&gt;
&amp;lt;matlab&amp;gt;&lt;br /&gt;
function clip(in,out,clip)&lt;br /&gt;
%CLIP Clip the data&lt;br /&gt;
&lt;br /&gt;
dims = rsf_dim(in);&lt;br /&gt;
n1 = dims(1);           % trace length&lt;br /&gt;
n2 = prod(dims(2:end)); % number of traces&lt;br /&gt;
trace = 1:n1;           % allocate trace&lt;br /&gt;
rsf_create(out,in)      % create an output file&lt;br /&gt;
&lt;br /&gt;
for i2 = 1:n2           % loop over traces&lt;br /&gt;
    rsf_read(trace,in,&#039;same&#039;);&lt;br /&gt;
    trace(trace &amp;gt;   clip) =  clip;&lt;br /&gt;
    trace(trace &amp;lt; - clip) = -clip;&lt;br /&gt;
    rsf_write(trace,out,&#039;same&#039;);&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/matlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let us examine it in detail. &lt;br /&gt;
&amp;lt;matlab&amp;gt;&lt;br /&gt;
dims = rsf_dim(in);&lt;br /&gt;
&amp;lt;/matlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We start by figuring out the input file dimensions.&lt;br /&gt;
&amp;lt;matlab&amp;gt;&lt;br /&gt;
n1 = dims(1);           % trace length&lt;br /&gt;
n2 = prod(dims(2:end)); % number of traces&lt;br /&gt;
&amp;lt;/matlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first dimension is the trace length, the product of all other&lt;br /&gt;
dimensions correspond to the number of traces.&lt;br /&gt;
&amp;lt;matlab&amp;gt;&lt;br /&gt;
trace = 1:n1;           % allocate trace&lt;br /&gt;
rsf_create(out,in)      % create an output file&lt;br /&gt;
&amp;lt;/matlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, we allocate the trace array and create an output file.&lt;br /&gt;
&amp;lt;matlab&amp;gt;&lt;br /&gt;
for i2 = 1:n2           % loop over traces&lt;br /&gt;
    rsf_read(trace,in,&#039;same&#039;);&lt;br /&gt;
    trace(trace &amp;gt;   clip) =  clip;&lt;br /&gt;
    trace(trace &amp;lt; - clip) = -clip;&lt;br /&gt;
    rsf_write(trace,out,&#039;same&#039;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/matlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, we do the actual work: loop over input traces, reading,&lt;br /&gt;
clipping, and writing out each trace.&lt;br /&gt;
===Available functions===&lt;br /&gt;
Only some of the functions in the &amp;lt;tt&amp;gt;rsf&amp;lt;/tt&amp;gt; library have received a MATLAB interface. These functions are &amp;lt;tt&amp;gt;rsf_par&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;rsf_dim&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;rsf_read&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;rsf_write&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;rsf_create&amp;lt;/tt&amp;gt;. All these functions except &amp;lt;tt&amp;gt;rsf_par&amp;lt;/tt&amp;gt; have been illustrated in the example above.&lt;br /&gt;
===Compiling===&lt;br /&gt;
The MATLAB script does not require compilation. Simply make sure that&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;amp;#36;RSFROOT/lib&amp;lt;/tt&amp;gt; is in &amp;lt;tt&amp;gt;MATLABPATH&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;LD_LIBRARY_PATH&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Java Interface==&lt;br /&gt;
There are two interfaces to Java that are available.  New codes should be written to use the SWIG interface ONLY.  The older interface (using the MINES JTK) is deprecated, and is only provided while users migrate their code to the new interface.&lt;br /&gt;
&lt;br /&gt;
===SWIG===&lt;br /&gt;
&lt;br /&gt;
To install the SWIG interface:&lt;br /&gt;
&lt;br /&gt;
1 - Download the Java Standard Development Kit (JDK).  Installation varies by platform.&lt;br /&gt;
&lt;br /&gt;
2 - Create the JAVA_HOME environment variable for your shell.  This should point to the directory where the JDK was installed. Example (for Ubuntu 10.04):&lt;br /&gt;
&amp;lt;bash&amp;gt;&lt;br /&gt;
export JAVA_HOME=/usr/lib/jvm/java-6-opensdk&lt;br /&gt;
&amp;lt;/bash&amp;gt;&lt;br /&gt;
3 - Reconfigure Madagascar:&lt;br /&gt;
&amp;lt;bash&amp;gt;&lt;br /&gt;
./configure API=java&lt;br /&gt;
&amp;lt;/bash&amp;gt;&lt;br /&gt;
4 - Reinstall Madagascar (Ignore the compilation warnings for Java files):&lt;br /&gt;
&amp;lt;bash&amp;gt;&lt;br /&gt;
scons; scons install&lt;br /&gt;
&amp;lt;/bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The installation creates two files:  $RSFROOT/lib/libjrsf.so and $RSFROOT/lib/rsf.jar .&lt;br /&gt;
&lt;br /&gt;
Make sure that you set your LD_LIBRARY_PATH to include $RSFROOT/lib.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A short demonstration of the interface follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;java&amp;gt;&lt;br /&gt;
import rsf.RSF;&lt;br /&gt;
import rsf.Input;&lt;br /&gt;
import rsf.Output;&lt;br /&gt;
&lt;br /&gt;
/* A simple Java program to clip a dataset. */&lt;br /&gt;
&lt;br /&gt;
public class Clip {&lt;br /&gt;
    static {&lt;br /&gt;
        System.loadLibrary(&amp;quot;jrsf&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    public static void main(String[] args){&lt;br /&gt;
        // Initialize command line argument passing&lt;br /&gt;
         RSF par = new RSF(args);&lt;br /&gt;
         // Get the input file name.&lt;br /&gt;
         Input input = new Input(&amp;quot;in&amp;quot;);&lt;br /&gt;
         Output output = new Output(&amp;quot;out&amp;quot;);&lt;br /&gt;
        // Get the value to clip to.&lt;br /&gt;
         float clip = par.getFloat(&amp;quot;clip&amp;quot;,0.0f);&lt;br /&gt;
        // Read our input header&lt;br /&gt;
        int n3 = input.getN(3);&lt;br /&gt;
        int n2 = input.getN(2);&lt;br /&gt;
        int n1 = input.getN(1);&lt;br /&gt;
        //Perform clipping operation on a single trace and write out.&lt;br /&gt;
        float[] data = new float[n1];&lt;br /&gt;
         for(int i = 0; i &amp;lt; n3; ++i){&lt;br /&gt;
            for(int j = 0; j &amp;lt; n2; ++j){&lt;br /&gt;
                input.read(data);&lt;br /&gt;
                for(int k = 0; k &amp;lt; n1; ++k){&lt;br /&gt;
                    if (data[k] &amp;gt; clip) data[k] = clip;&lt;br /&gt;
                    else if (data[k] &amp;lt; -clip) data[k] = -clip;&lt;br /&gt;
                }&lt;br /&gt;
                output.write(data);&lt;br /&gt;
            }&lt;br /&gt;
         }&lt;br /&gt;
         output.setN(1,n1);&lt;br /&gt;
         output.setN(2,n2);&lt;br /&gt;
         output.setN(3,n3);&lt;br /&gt;
         input.close();&lt;br /&gt;
         output.close();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/java&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are only three classes in the interface:&lt;br /&gt;
&lt;br /&gt;
1 -- RSF - The command line argument parser, and the initializer for the native interface.  An RSF object MUST be instantiated BEFORE instantiating an Input or Output object.&lt;br /&gt;
&lt;br /&gt;
2 -- Input - An object that provides read access to an RSF file.  &lt;br /&gt;
&lt;br /&gt;
3 -- Output - An object that provides write access to an RSF file.&lt;br /&gt;
&lt;br /&gt;
Additionally, the shared library (libjrsf.so or libjrsf.dll) must be included via the System.loadLibrary(&amp;quot;jrsf&amp;quot;); as the first command in the file.&lt;br /&gt;
&lt;br /&gt;
To compile on the command line:&lt;br /&gt;
&amp;lt;bash&amp;gt;&lt;br /&gt;
javac -cp $RSFROOT/lib Clip.java&lt;br /&gt;
&amp;lt;/bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To include this as part of a SCons script (SConstruct):&lt;br /&gt;
&amp;lt;python&amp;gt;&lt;br /&gt;
from rsf.proj import *&lt;br /&gt;
&lt;br /&gt;
# Compiles Clip.class&lt;br /&gt;
project.Java(&#039;.&#039;,&#039;Clip.java&#039;)&lt;br /&gt;
&lt;br /&gt;
Flow(&#039;dat&#039;,None,&#039;spike n1=1000 n2=100 n3=10 nsp=1 k1=500 l1=1000&#039;)&lt;br /&gt;
Flow(&#039;clipd&#039;,&#039;dat Clip.class&#039;,&lt;br /&gt;
    &#039;&#039;&#039;&lt;br /&gt;
    %s Clip clip=0.5&lt;br /&gt;
    &#039;&#039;&#039; % WhereIs(&#039;java&#039;))&lt;br /&gt;
Flow(&#039;test.attr&#039;,&#039;clipd&#039;,&#039;sfattr&#039;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/python&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note, that we compile Clip.java using the SCons Java builder.  To execute the command, we have to locate the &amp;quot;java&amp;quot; command, which we do using WhereIs(&#039;java&#039;).  Then we execute the class name, and pass any command line arguments as usual.  The files are read from standard in for this program and written to standard out.  &lt;br /&gt;
&lt;br /&gt;
Please see the [[Library Reference]] for more details on the functions available in the SWIG API.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note: Additional Java packages can included in SCons automatically by setting the CLASSPATH environment variable to point to the JAR files that they are contained in.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Mines JTK===&lt;br /&gt;
&#039;&#039;&#039;THIS INTERFACE IS DEPRECATED AND ONLY PROVIDED AS A REFERENCE.  THIS INTERFACE IS NO LONGER SUPPORTED AND WILL BE REMOVED&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This interface may still be compiled by specifying the MINESJTK environment variable. &lt;br /&gt;
&lt;br /&gt;
The interface to Java is less full featured than others.  Presently, it only allows you to read RSF files with fewer than 4-dimensions into Java, and then export RSF files.  &#039;&#039;&#039;The Java interface does not support reading from standard in, or writing from standard out.  Therefore, the Java Interface does not support piping either.&#039;&#039;&#039; The Java interface at present treats all values as floats, and does not have support for complex numbers.  Java programs are not parsed for self-doc information like other programs are either.  Using javadoc may be a viable alternative to creating a parsing engine for Java programs.&lt;br /&gt;
&lt;br /&gt;
Once the build is complete, the JAR file rsf.jar will be added to your $RSFROOT/lib folder.  &lt;br /&gt;
&lt;br /&gt;
There are two ways to access the API:&lt;br /&gt;
&lt;br /&gt;
1 - From the command line:  point the classpath at BOTH compile and runtime to this location on the command line.&lt;br /&gt;
&amp;lt;bash&amp;gt;&lt;br /&gt;
javac -cp $MINESJTK:$RSFROOT/lib/rsf.jar:. Test.java &lt;br /&gt;
java -cp $MINESJTK:$RSFROOT/lib/rsf.jar:. Test arg1=... arg2=... arg3=...&lt;br /&gt;
&amp;lt;/bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2 - From within a SConstruct script:  BOTH the path for the API ($RSFROOT/lib) and the path to the Mines JTK ($MINESJTK) are automatically added to the environment variable CLASSPATH and JAVACLASSPATH for executions made within an SConstruct.  Additionally, any additional classes that are already in the CLASSPATH environmental variable in the shell that you launch from will be added to your classpath.  This allows you to include additional libraries automatically within your Java programs.  The local directory (.) is also included in the CLASSPATH.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;python&amp;gt;&lt;br /&gt;
from rsf.proj import *&lt;br /&gt;
&lt;br /&gt;
# Compiles Clip.class&lt;br /&gt;
project.Java(&#039;.&#039;,&#039;Clip.java&#039;)&lt;br /&gt;
&lt;br /&gt;
Flow(&#039;dat&#039;,None,&#039;spike n1=1000 n2=100 n3=10 nsp=1 k1=500&#039;)&lt;br /&gt;
Flow(&#039;clipd&#039;,&#039;Clip.class dat&#039;,&lt;br /&gt;
    &#039;&#039;&#039;&lt;br /&gt;
    %s ${SOURCES[0].filebase} clip=0.5 &lt;br /&gt;
    in=${SOURCES[1]} out=$TARGET &lt;br /&gt;
    &#039;&#039;&#039; % WhereIs(&#039;java&#039;),stdin=0,stdout=-1)&lt;br /&gt;
Flow(&#039;test.attr&#039;,&#039;clipd&#039;,&#039;sfattr&#039;)&lt;br /&gt;
&lt;br /&gt;
End()&lt;br /&gt;
&amp;lt;/python&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The interface itself is fairly straightforward.  More details on the methods exposed by the API can be found at the [[Library_Reference#Java_API | Library Reference]].&lt;br /&gt;
&lt;br /&gt;
Data clipping, argument parsing, and IO example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;java&amp;gt;&lt;br /&gt;
import rsf.Par;&lt;br /&gt;
import rsf.Reader;&lt;br /&gt;
import rsf.Writer;&lt;br /&gt;
import rsf.Header;&lt;br /&gt;
&lt;br /&gt;
/* A simple Java program to clip a dataset.&lt;br /&gt;
&lt;br /&gt;
Presently, there is no automatic self-documentation generation for use&lt;br /&gt;
with sfdoc.  Javadoc may be a better way to generate self-doc for Java&lt;br /&gt;
programs.&lt;br /&gt;
&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
public class Clip {&lt;br /&gt;
    public static void main(String[] args){&lt;br /&gt;
        // Initialize command line argument passing&lt;br /&gt;
         Par par = new Par(args);&lt;br /&gt;
         // Get the input file name.&lt;br /&gt;
         String input = par.getString(&amp;quot;in&amp;quot;,&amp;quot;&amp;quot;);&lt;br /&gt;
         // If the input file name is nothing, then quit!&lt;br /&gt;
         if (input.equals(&amp;quot;&amp;quot;)){&lt;br /&gt;
                System.out.println(&amp;quot;Did not find input file!&amp;quot;);&lt;br /&gt;
                System.exit(1);&lt;br /&gt;
         }&lt;br /&gt;
         //If the output file name is nothing, then quit!&lt;br /&gt;
         String output = par.getString(&amp;quot;out&amp;quot;,&amp;quot;&amp;quot;);&lt;br /&gt;
         if (output.equals(&amp;quot;&amp;quot;)){&lt;br /&gt;
                System.out.println(&amp;quot;Did not find output file!&amp;quot;);&lt;br /&gt;
                System.exit(1);&lt;br /&gt;
         }&lt;br /&gt;
        // Get the value to clip to.&lt;br /&gt;
         float clip = par.getFloat(&amp;quot;clip&amp;quot;,0.0f);&lt;br /&gt;
        //Read our header file.&lt;br /&gt;
         Header header = Reader.readHeader(input);&lt;br /&gt;
        // Read our binary data.&lt;br /&gt;
         float[][][] data = Reader.readBinary3D(header);&lt;br /&gt;
        //Initialize our array values.&lt;br /&gt;
         int n3 = header.getN(3);&lt;br /&gt;
         int n2 = header.getN(2);&lt;br /&gt;
         int n1 = header.getN(1);&lt;br /&gt;
        //Perform clipping operation.&lt;br /&gt;
         for(int i = 0; i &amp;lt; n3; ++i){&lt;br /&gt;
            for(int j = 0; j &amp;lt; n2; ++j){&lt;br /&gt;
                for(int k = 0; k &amp;lt; n1; ++k){&lt;br /&gt;
                    float trace = data[i][j][k];&lt;br /&gt;
                    if (trace &amp;gt; clip) data[i][j][k] = clip;&lt;br /&gt;
                    else if (trace &amp;lt; -clip) data[i][j][k] = -clip;&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
         }&lt;br /&gt;
        //Write our data out, using the same header values to the file&lt;br /&gt;
        //located at: output.&lt;br /&gt;
         Writer.writeRSF(header,data,output);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/java&amp;gt;&lt;br /&gt;
&lt;br /&gt;
How to read a file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;java&amp;gt;&lt;br /&gt;
&lt;br /&gt;
import rsf.Header;&lt;br /&gt;
import rsf.Reader;&lt;br /&gt;
import rsf.Writer;&lt;br /&gt;
&lt;br /&gt;
public class Test {&lt;br /&gt;
      public static void main(String[] args){&lt;br /&gt;
&lt;br /&gt;
                Header header = Reader.readHeader(&amp;quot;junk.rsf&amp;quot;); //To read the header file, just feed in the path relative to the execution directory&lt;br /&gt;
                System.out.println(header); //The header file will print out if you ask it to, this is good for debugging&lt;br /&gt;
&lt;br /&gt;
                float[][] data = Reader.readBinary2D(header); //Now I can manipulate my data&lt;br /&gt;
       }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/java&amp;gt;&lt;br /&gt;
&lt;br /&gt;
How to write a file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;java&amp;gt;&lt;br /&gt;
import rsf.Header;&lt;br /&gt;
import rsf.Reader;&lt;br /&gt;
import rsf.Writer;&lt;br /&gt;
&lt;br /&gt;
public class Test {&lt;br /&gt;
      public static void main(String[] args){&lt;br /&gt;
                &lt;br /&gt;
                Header header = Reader.readHeader(&amp;quot;test.rsf&amp;quot;); //To read the header file, just feed in the path relative to the execution directory&lt;br /&gt;
                System.out.println(header); //The header file will print out if you ask it to, this is good for debugging&lt;br /&gt;
&lt;br /&gt;
                float[][] data = Reader.readBinary2D(header); //Now I can manipulate my data&lt;br /&gt;
&lt;br /&gt;
                //...Do something&lt;br /&gt;
                Writer.writeRSF(header,data,&amp;quot;test2.rsf&amp;quot;); //Write out my data!&lt;br /&gt;
       }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/java&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to create a dataset from scratch from within Java, then you can create an array of data, modify the values, create a header, and then write it out to rsf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;java&amp;gt;&lt;br /&gt;
import rsf.Header;&lt;br /&gt;
import rsf.Reader;&lt;br /&gt;
import rsf.Writer;&lt;br /&gt;
&lt;br /&gt;
public class Test {&lt;br /&gt;
      public static void main(String[] args){&lt;br /&gt;
&lt;br /&gt;
                int n1 = 20;&lt;br /&gt;
                int n2 = 40;&lt;br /&gt;
                float[][] data = new float[n2][n1]; &lt;br /&gt;
                //The order for dimensions is reversed, because RSF stores them as column-major arrays (see Python API).&lt;br /&gt;
&lt;br /&gt;
                //...Do something&lt;br /&gt;
&lt;br /&gt;
                Header header = new Header();&lt;br /&gt;
                header.setN(1,n1);&lt;br /&gt;
                /* We set the values using the proper RSF number for the dimension, instead of the Java array index.&lt;br /&gt;
                   Example:  RSF Dimension 1, corresponds to array index 0 in Java.&lt;br /&gt;
                             However, we set the values using index 1.  The mapping is handled behind the scenes.&lt;br /&gt;
                 */&lt;br /&gt;
                header.setN(2,n2); &lt;br /&gt;
                header.setDelta(1,0.0);&lt;br /&gt;
                header.setLabel(1,&amp;quot;time&amp;quot;);&lt;br /&gt;
                header.setUnits(1,&amp;quot;s&amp;quot;);&lt;br /&gt;
                Writer.writeRSF(header,data,&amp;quot;junk2.rsf&amp;quot;); //Write out my data!&lt;br /&gt;
       }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/java&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Karl</name></author>
	</entry>
	<entry>
		<id>https://ahay.org/index.php?title=Guide_to_madagascar_API&amp;diff=3748</id>
		<title>Guide to madagascar API</title>
		<link rel="alternate" type="text/html" href="https://ahay.org/index.php?title=Guide_to_madagascar_API&amp;diff=3748"/>
		<updated>2018-12-13T21:01:26Z</updated>

		<summary type="html">&lt;p&gt;Karl: /* Python interface */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;center&amp;gt;&amp;lt;font size=&amp;quot;-1&amp;quot;&amp;gt;&#039;&#039;This page was created from the LaTeX source in [http://sourceforge.net/p/rsf/code/HEAD/tree/trunk/book/rsf/rsf/api.tex book/rsf/rsf/api.tex] using [[latex2wiki]]&#039;&#039;&amp;lt;/font&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Fotolia_555071_XS.jpg|right|]]&lt;br /&gt;
&lt;br /&gt;
This guide explains the RSF programming interface.  See the &#039;&#039;&#039;[[Library_Reference | Library Reference]]&#039;&#039;&#039; for more information on how to use the particular APIs.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
To work with RSF files in your own programs, you may need to use an&lt;br /&gt;
appropriate programming interface. We will demonstrate the interface in&lt;br /&gt;
different languages using a simple example. The example is a clipping program.&lt;br /&gt;
It reads and writes RSF files and accesses parameters both from the input file&lt;br /&gt;
and the command line. The input is processed trace by trace. This is not&lt;br /&gt;
necessarily the most efficient approach&amp;lt;ref&amp;gt;Compare with the [http://rsf.svn.sourceforge.net/viewvc/rsf/trunk/filt/proc/Mclip.c?view=markup library clip program].&amp;lt;/ref&amp;gt; but it suffices for a simple demonstration.&lt;br /&gt;
&lt;br /&gt;
==Installation== &lt;br /&gt;
Only the C interface is installed by default. To install other APIs, use &amp;lt;tt&amp;gt;API=&amp;lt;/tt&amp;gt;&lt;br /&gt;
parameter in the RSF configuration. For example, to install C++ and&lt;br /&gt;
Fortran-90 API bindings in addition to the basic package, run&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./configure API=c++,fortran-90&lt;br /&gt;
scons install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The configuration parameters are stored in &amp;lt;tt&amp;gt;&amp;amp;#36;RSFROOT/share/madagascar/etc/config.py&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==C interface==&lt;br /&gt;
&lt;br /&gt;
The C clip function is listed below.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
/* Clip the data. */&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;rsf.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char* argv[])&lt;br /&gt;
{&lt;br /&gt;
    int n1, n2, i1, i2;&lt;br /&gt;
    float clip, *trace=NULL;&lt;br /&gt;
    sf_file in=NULL, out=NULL; /* Input and output files */&lt;br /&gt;
&lt;br /&gt;
    /* Initialize RSF */&lt;br /&gt;
    sf_init(argc,argv);&lt;br /&gt;
    /* standard input */&lt;br /&gt;
    in = sf_input(&amp;quot;in&amp;quot;);&lt;br /&gt;
    /* standard output */&lt;br /&gt;
    out = sf_output(&amp;quot;out&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
    /* check that the input is float */&lt;br /&gt;
    if (SF_FLOAT != sf_gettype(in)) &lt;br /&gt;
	sf_error(&amp;quot;Need float input&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
    /* n1 is the fastest dimension (trace length) */&lt;br /&gt;
    if (!sf_histint(in,&amp;quot;n1&amp;quot;,&amp;amp;n1)) &lt;br /&gt;
	sf_error(&amp;quot;No n1= in input&amp;quot;);&lt;br /&gt;
    /* leftsize gets n2*n3*n4*... (the number of traces) */&lt;br /&gt;
    n2 = sf_leftsize(in,1);&lt;br /&gt;
&lt;br /&gt;
    /* parameter from the command line (i.e. clip=1.5 ) */&lt;br /&gt;
    if (!sf_getfloat(&amp;quot;clip&amp;quot;,&amp;amp;clip)) sf_error(&amp;quot;Need clip=&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
    /* allocate floating point array */&lt;br /&gt;
    trace = sf_floatalloc (n1);&lt;br /&gt;
&lt;br /&gt;
    /* loop over traces */&lt;br /&gt;
    for (i2=0; i2 &amp;lt; n2; i2++) {&lt;br /&gt;
&lt;br /&gt;
	/*read a trace */&lt;br /&gt;
	sf_floatread(trace,n1,in);&lt;br /&gt;
&lt;br /&gt;
	/* loop over samples */&lt;br /&gt;
	for (i1=0; i1 &amp;lt; n1; i1++) {&lt;br /&gt;
	    if      (trace[i1] &amp;gt;  clip) trace[i1]= clip;&lt;br /&gt;
	    else if (trace[i1] &amp;lt; -clip) trace[i1]=-clip;&lt;br /&gt;
	}&lt;br /&gt;
    &lt;br /&gt;
	/* write a trace */&lt;br /&gt;
	sf_floatwrite(trace,n1,out);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    free(trace);&lt;br /&gt;
    sf_close();&lt;br /&gt;
    exit(0);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let us examine it in detail. &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;rsf.h&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The include preprocessing directive is required to access the RSF interface. &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
    sf_file in=NULL, out=NULL; /* Input and output files */&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
RSF data files are defined with an abstract &amp;lt;tt&amp;gt;sf_file&amp;lt;/tt&amp;gt; data type. An&lt;br /&gt;
abstract data type means that the contents of it are not publicly declared,&lt;br /&gt;
and all operations on &amp;lt;tt&amp;gt;sf_file&amp;lt;/tt&amp;gt; objects should be performed with&lt;br /&gt;
library functions. This is analogous to &amp;lt;tt&amp;gt;FILE *&amp;lt;/tt&amp;gt; data type used in&lt;br /&gt;
&amp;lt;tt&amp;gt;stdio.h&amp;lt;/tt&amp;gt; and as close as C gets to an object-oriented style of&lt;br /&gt;
programming (Roberts, 1998&amp;lt;ref&amp;gt;Roberts, E. S.,  1998, Programming abstractions in C: Addison-Wesley.&amp;lt;/ref&amp;gt;).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
    /* Initialize RSF */&lt;br /&gt;
    sf_init(argc,argv);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before using any of the other functions, you must call&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_init&amp;lt;/tt&amp;gt;. This function parses the command line and&lt;br /&gt;
initializes an internally stored table of command-line parameters.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
    /* standard input */&lt;br /&gt;
    in = sf_input(&amp;quot;in&amp;quot;);&lt;br /&gt;
    /* standard output */&lt;br /&gt;
    out = sf_output(&amp;quot;out&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The input and output RSF file objects are created with &amp;lt;tt&amp;gt;sf_input&amp;lt;/tt&amp;gt; and&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_output&amp;lt;/tt&amp;gt; constructor functions. Both these functions take a string&lt;br /&gt;
argument. The string may refer to a file name or a file tag. For example, if&lt;br /&gt;
the command line contains &amp;lt;tt&amp;gt;vel=velocity.rsf&amp;lt;/tt&amp;gt;, then both&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_input(&amp;quot;velocity.rsf&amp;quot;)&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;sf_input(&amp;quot;vel&amp;quot;)&amp;lt;/tt&amp;gt; are&lt;br /&gt;
acceptable. Two tags are special: &amp;lt;tt&amp;gt;&amp;quot;in&amp;quot;&amp;lt;/tt&amp;gt; refers to the file in the&lt;br /&gt;
standard input and &amp;lt;tt&amp;gt;&amp;quot;out&amp;quot;&amp;lt;/tt&amp;gt; refers to the file in the standard&lt;br /&gt;
output. &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
    /* check that the input is float */&lt;br /&gt;
    if (SF_FLOAT != sf_gettype(in)) &lt;br /&gt;
	sf_error(&amp;quot;Need float input&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
RSF files can store data of different types (character, integer,&lt;br /&gt;
floating point, complex). We extract the data type of the input file&lt;br /&gt;
with the library &amp;lt;tt&amp;gt;sf_gettype&amp;lt;/tt&amp;gt; function and check if it&lt;br /&gt;
represents floating point numbers. If not, the program is aborted with&lt;br /&gt;
an error message, using the &amp;lt;tt&amp;gt;sf_error&amp;lt;/tt&amp;gt; function.  It is&lt;br /&gt;
generally a good idea to check the input for user errors and, if they&lt;br /&gt;
cannot be corrected, to take a safe exit.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
    /* n1 is the fastest dimension (trace length) */&lt;br /&gt;
    if (!sf_histint(in,&amp;quot;n1&amp;quot;,&amp;amp;n1)) &lt;br /&gt;
	sf_error(&amp;quot;No n1= in input&amp;quot;);&lt;br /&gt;
    /* leftsize gets n2*n3*n4*... (the number of traces) */&lt;br /&gt;
    n2 = sf_leftsize(in,1);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Conceptually, the RSF data model is a multidimensional hypercube. By&lt;br /&gt;
convention, the dimensions of the cube are stored in &amp;lt;tt&amp;gt;n1=&amp;lt;/tt&amp;gt;,&lt;br /&gt;
&amp;lt;tt&amp;gt;n2=&amp;lt;/tt&amp;gt;, etc. parameters. The &amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt; parameter refers to the&lt;br /&gt;
fastest axis. If the input dataset is a collection of traces,&lt;br /&gt;
&amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt; refers to the trace length. We extract it using the&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_histint&amp;lt;/tt&amp;gt; function (integer parameter from history) and&lt;br /&gt;
abort if no value for &amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt; is found. We could proceed in a&lt;br /&gt;
similar fashion, extracting &amp;lt;tt&amp;gt;n2&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;n3&amp;lt;/tt&amp;gt;, etc. If we are&lt;br /&gt;
interested in the total number of traces, like in the clip example, a&lt;br /&gt;
shortcut is to use the &amp;lt;tt&amp;gt;sf_leftsize&amp;lt;/tt&amp;gt; function. Calling&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_leftsize(in,0)&amp;lt;/tt&amp;gt; returns the total number of elements in&lt;br /&gt;
the hypercube (the product of &amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;n2&amp;lt;/tt&amp;gt;, etc.), calling&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_leftsize(in,1)&amp;lt;/tt&amp;gt; returns the number of traces (the product&lt;br /&gt;
of &amp;lt;tt&amp;gt;n2&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;n3&amp;lt;/tt&amp;gt;, etc.), calling&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_leftsize(in,2)&amp;lt;/tt&amp;gt; returns the product of &amp;lt;tt&amp;gt;n3&amp;lt;/tt&amp;gt;,&lt;br /&gt;
&amp;lt;tt&amp;gt;n4&amp;lt;/tt&amp;gt;, etc. By calling &amp;lt;tt&amp;gt;sf_leftsize&amp;lt;/tt&amp;gt;, we avoid the need&lt;br /&gt;
to extract additional parameters for the hypercube dimensions that we&lt;br /&gt;
are not interested in.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
    /* parameter from the command line (i.e. clip=1.5 ) */&lt;br /&gt;
    if (!sf_getfloat(&amp;quot;clip&amp;quot;,&amp;amp;clip)) sf_error(&amp;quot;Need clip=&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
The clip parameter is read from the command line, where it can be&lt;br /&gt;
specified, for example, as &amp;lt;tt&amp;gt;clip=10&amp;lt;/tt&amp;gt;. The parameter has the&lt;br /&gt;
&amp;lt;tt&amp;gt;float&amp;lt;/tt&amp;gt; type, therefore we read it with the&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_getfloat&amp;lt;/tt&amp;gt; function. If no &amp;lt;tt&amp;gt;clip=&amp;lt;/tt&amp;gt; parameter is&lt;br /&gt;
found among the command line arguments, the program is aborted with an&lt;br /&gt;
error message using the &amp;lt;tt&amp;gt;sf_error&amp;lt;/tt&amp;gt; function.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
    /* allocate floating point array */&lt;br /&gt;
    trace = sf_floatalloc (n1);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Next, we allocate an array of floating-point numbers to store a trace&lt;br /&gt;
with the library &amp;lt;tt&amp;gt;sf_floatalloc&amp;lt;/tt&amp;gt; function. Unlike the standard&lt;br /&gt;
&amp;lt;tt&amp;gt;malloc&amp;lt;/tt&amp;gt; the RSF allocation function checks for errors and&lt;br /&gt;
either terminates the program or returns a valid pointer.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
    /* loop over traces */&lt;br /&gt;
    for (i2=0; i2 &amp;lt; n2; i2++) {&lt;br /&gt;
&lt;br /&gt;
	/*read a trace */&lt;br /&gt;
	sf_floatread(trace,n1,in);&lt;br /&gt;
&lt;br /&gt;
	/* loop over samples */&lt;br /&gt;
	for (i1=0; i1 &amp;lt; n1; i1++) {&lt;br /&gt;
	    if      (trace[i1] &amp;gt;  clip) trace[i1]= clip;&lt;br /&gt;
	    else if (trace[i1] &amp;lt; -clip) trace[i1]=-clip;&lt;br /&gt;
	}&lt;br /&gt;
    &lt;br /&gt;
	/* write a trace */&lt;br /&gt;
	sf_floatwrite(trace,n1,out);&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
The rest of the program is straightforward. We loop over all available&lt;br /&gt;
traces, read each trace, clip it and right the output out. The syntax&lt;br /&gt;
of &amp;lt;tt&amp;gt;sf_floatread&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;sf_floatwrite&amp;lt;/tt&amp;gt; functions is&lt;br /&gt;
similar to the syntax of the C standard &amp;lt;tt&amp;gt;fread&amp;lt;/tt&amp;gt; and&lt;br /&gt;
&amp;lt;tt&amp;gt;fwrite&amp;lt;/tt&amp;gt; function except that the type of the element is&lt;br /&gt;
specified explicitly in the function name and that the input and&lt;br /&gt;
output files have the RSF type &amp;lt;tt&amp;gt;sf_file&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
sf_close();&lt;br /&gt;
exit(0)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We explicitly close the input file to avoid leaving a stale temporary file in &amp;lt;tt&amp;gt;$DATAPATH&amp;lt;/tt&amp;gt; if the program is called in a pipe sequence. Then, we close the program by sending the shell the Unix code that tells it no errors were encountered. &lt;br /&gt;
&lt;br /&gt;
Note that this is an introductory example, optimized for clarity, not execution speed. For advanced techniques, see [[Madagascar Code Patterns]].&lt;br /&gt;
&lt;br /&gt;
===Compiling===&lt;br /&gt;
To compile the &amp;lt;tt&amp;gt;clip&amp;lt;/tt&amp;gt; program, run&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cc clip.c -I&amp;amp;#36;RSFROOT/include -L&amp;amp;#36;RSFROOT/lib -lrsf -lm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Change &amp;lt;tt&amp;gt;cc&amp;lt;/tt&amp;gt; to the C compiler appropriate for your system and include&lt;br /&gt;
additional compiler flags if necessary. The flags that RSF typically uses are&lt;br /&gt;
in &amp;lt;tt&amp;gt;&amp;amp;#36;RSFROOT/share/madagascar/etc/config.py&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==C++ interface==&lt;br /&gt;
&lt;br /&gt;
The C++ clip function is listed below.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
/* Clip the data. */&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;valarray&amp;gt;&lt;br /&gt;
#include &amp;lt;rsf.hh&amp;gt;&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char* argv[])&lt;br /&gt;
{&lt;br /&gt;
    sf_init(argc,argv); // Initialize RSF&lt;br /&gt;
    &lt;br /&gt;
    iRSF par(0), in; // input parameter, file&lt;br /&gt;
    oRSF out;        // output file&lt;br /&gt;
&lt;br /&gt;
    int n1, n2;      // trace length, number of traces&lt;br /&gt;
    float clip;&lt;br /&gt;
    &lt;br /&gt;
    in.get(&amp;quot;n1&amp;quot;,n1);&lt;br /&gt;
    n2=in.size(1);&lt;br /&gt;
&lt;br /&gt;
    par.get(&amp;quot;clip&amp;quot;,clip); // parameter from the command line&lt;br /&gt;
&lt;br /&gt;
    std::valarray&amp;lt;float&amp;gt; trace(n1);&lt;br /&gt;
&lt;br /&gt;
    for (int i2=0; i2 &amp;lt; n2; i2++) { // loop over traces&lt;br /&gt;
	in &amp;gt;&amp;gt; trace; // read a trace&lt;br /&gt;
&lt;br /&gt;
	for (int i1=0; i1 &amp;lt; n1; i1++) { // loop over samples&lt;br /&gt;
	    if      (trace[i1] &amp;gt;  clip) trace[i1]=clip;&lt;br /&gt;
	    else if (trace[i1] &amp;lt; -clip) trace[i1]=-clip;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	out &amp;lt;&amp;lt; trace; // write a trace&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    exit(0);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let us examine it line by line. &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;rsf.hh&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Including &amp;quot;&amp;lt;tt&amp;gt;rsf.hh&amp;lt;/tt&amp;gt;&amp;quot; is required for accessing the RSF C++&lt;br /&gt;
interface.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    sf_init(argc,argv); // Initialize RSF&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A call to &amp;lt;tt&amp;gt;sf_init&amp;lt;/tt&amp;gt; is required to initialize the internally stored&lt;br /&gt;
table of command-line arguments.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    iRSF par(0), in; // input parameter, file&lt;br /&gt;
    oRSF out;        // output file&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Two classes: &amp;lt;tt&amp;gt;iRSF&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;oRSF&amp;lt;/tt&amp;gt; are used to define input and&lt;br /&gt;
output files. For simplicity, the command-line parameters are also handled &lt;br /&gt;
as an &amp;lt;tt&amp;gt;iRSF&amp;lt;/tt&amp;gt; object, initialized with zero.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    in.get(&amp;quot;n1&amp;quot;,n1);&lt;br /&gt;
    n2=in.size(1);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, we read the data dimensions from the input RSF file object called&lt;br /&gt;
&amp;lt;tt&amp;gt;in&amp;lt;/tt&amp;gt;: the trace length is a parameter called &amp;quot;&amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt;&amp;quot; and the&lt;br /&gt;
number of traces is the size of &amp;lt;tt&amp;gt;in&amp;lt;/tt&amp;gt; remaining after excluding the&lt;br /&gt;
first dimension. It is extracted with the &amp;lt;tt&amp;gt;size&amp;lt;/tt&amp;gt; method.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    par.get(&amp;quot;clip&amp;quot;,clip); // parameter from the command line&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
The clip parameter should be specified on the command line, for&lt;br /&gt;
example, as &amp;lt;tt&amp;gt;clip=10&amp;lt;/tt&amp;gt;. It is extracted with the &amp;lt;tt&amp;gt;get&amp;lt;/tt&amp;gt;&lt;br /&gt;
method of &amp;lt;tt&amp;gt;iRSF&amp;lt;/tt&amp;gt; class from the &amp;lt;tt&amp;gt;par&amp;lt;/tt&amp;gt; object.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    std::valarray&amp;lt;float&amp;gt; trace(n1);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The trace object has the single-precision floating-point type and is a&lt;br /&gt;
1-D array of length &amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt;. It is declared and allocated using&lt;br /&gt;
the &amp;lt;tt&amp;gt;valarray&amp;lt;/tt&amp;gt; template class from the standard C++ library.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    for (int i2=0; i2 &amp;lt; n2; i2++) { // loop over traces&lt;br /&gt;
	in &amp;gt;&amp;gt; trace; // read a trace&lt;br /&gt;
&lt;br /&gt;
	for (int i1=0; i1 &amp;lt; n1; i1++) { // loop over samples&lt;br /&gt;
	    if      (trace[i1] &amp;gt;  clip) trace[i1]=clip;&lt;br /&gt;
	    else if (trace[i1] &amp;lt; -clip) trace[i1]=-clip;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	out &amp;lt;&amp;lt; trace; // write a trace&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, we loop through the traces, read each trace from &amp;lt;tt&amp;gt;in&amp;lt;/tt&amp;gt;, clip it&lt;br /&gt;
and write the output to &amp;lt;tt&amp;gt;out&amp;lt;/tt&amp;gt;.&lt;br /&gt;
===Compiling===&lt;br /&gt;
To compile the C++ program, run&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
c++ clip.cc -I&amp;amp;#36;RSFROOT/include -L&amp;amp;#36;RSFROOT/lib -lrsf++ -lrsf -lm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Change &amp;lt;tt&amp;gt;c++&amp;lt;/tt&amp;gt; to the C++ compiler appropriate for your system and&lt;br /&gt;
include additional compiler flags if necessary. The flags that RSF typically&lt;br /&gt;
uses are in &amp;lt;tt&amp;gt;&amp;amp;#36;RSFROOT/share/madagascar/etc/config.py&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Fortran-77 interface==&lt;br /&gt;
&lt;br /&gt;
The Fortran-77 clip function is listed below.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
	program Clipit&lt;br /&gt;
	implicit none&lt;br /&gt;
	integer n1, n2, i1, i2, in, out&lt;br /&gt;
	integer sf_input, sf_output, sf_leftsize, sf_gettype&lt;br /&gt;
	logical sf_getfloat, sf_histint&lt;br /&gt;
	real clip, trace(1000)&lt;br /&gt;
&lt;br /&gt;
	call sf_init()&lt;br /&gt;
	in = sf_input(&amp;quot;in&amp;quot;)&lt;br /&gt;
	out = sf_output(&amp;quot;out&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
	if (3 .ne. sf_gettype(in)) &lt;br /&gt;
     &amp;amp;  call sf_error(&amp;quot;Need float input&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
	if (.not. sf_histint(in,&amp;quot;n1&amp;quot;,n1)) then&lt;br /&gt;
	   call sf_error(&amp;quot;No n1= in input&amp;quot;)&lt;br /&gt;
	else if (n1 &amp;gt; 1000) then&lt;br /&gt;
	   call sf_error(&amp;quot;n1 is too long&amp;quot;)&lt;br /&gt;
	end if&lt;br /&gt;
	n2 = sf_leftsize(in,1)&lt;br /&gt;
&lt;br /&gt;
	if (.not. sf_getfloat(&amp;quot;clip&amp;quot;,clip)) &lt;br /&gt;
     &amp;amp;  call sf_error(&amp;quot;Need clip=&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
	do 10 i2=1, n2&lt;br /&gt;
	   call sf_floatread(trace,n1,in)&lt;br /&gt;
&lt;br /&gt;
	   do 20 i1=1, n1&lt;br /&gt;
	      if (trace(i1) &amp;gt;  clip) then&lt;br /&gt;
		 trace(i1)=clip&lt;br /&gt;
	      else if (trace(i1) &amp;lt; -clip) then&lt;br /&gt;
		 trace(i1)=-clip&lt;br /&gt;
	      end if&lt;br /&gt;
 20	   continue&lt;br /&gt;
&lt;br /&gt;
	   call sf_floatwrite(trace,n1,out)&lt;br /&gt;
 10	continue&lt;br /&gt;
&lt;br /&gt;
	stop&lt;br /&gt;
	end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let us examine it in detail.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
	call sf_init()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The program starts with a call to &amp;lt;tt&amp;gt;sf_init&amp;lt;/tt&amp;gt;, which initializes the&lt;br /&gt;
command-line interface.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
	in = sf_input(&amp;quot;in&amp;quot;)&lt;br /&gt;
	out = sf_output(&amp;quot;out&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The input and output files are created with calls to&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_input&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;sf_output&amp;lt;/tt&amp;gt;. Because of the absence of&lt;br /&gt;
derived types in Fortran-77, we use simple integer pointers to&lt;br /&gt;
represent RSF files. Both &amp;lt;tt&amp;gt;sf_input&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;sf_output&amp;lt;/tt&amp;gt;&lt;br /&gt;
accept a character string, which may refer to a file name or a file&lt;br /&gt;
tag. For example, if the command line contains&lt;br /&gt;
&amp;lt;tt&amp;gt;vel=velocity.rsf&amp;lt;/tt&amp;gt;, then both&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_input(&amp;quot;velocity.rsf&amp;quot;)&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;sf_input(&amp;quot;vel&amp;quot;)&amp;lt;/tt&amp;gt; are&lt;br /&gt;
acceptable. Two tags are special: &amp;lt;tt&amp;gt;&amp;quot;in&amp;quot;&amp;lt;/tt&amp;gt; refers to the file in&lt;br /&gt;
the standard input and &amp;lt;tt&amp;gt;&amp;quot;out&amp;quot;&amp;lt;/tt&amp;gt; refers to the file in the&lt;br /&gt;
standard output.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
	if (3 .ne. sf_gettype(in)) &lt;br /&gt;
     &amp;amp;  call sf_error(&amp;quot;Need float input&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
RSF files can store data of different types (character, integer,&lt;br /&gt;
floating point, complex). The function &amp;lt;tt&amp;gt;sf_gettype&amp;lt;/tt&amp;gt; checks the&lt;br /&gt;
type of data stored in the RSF file. We make sure that the type&lt;br /&gt;
corresponds to floating-point numbers. If not, the program is aborted&lt;br /&gt;
with an error message, using the &amp;lt;tt&amp;gt;sf_error&amp;lt;/tt&amp;gt; function.  It is&lt;br /&gt;
generally a good idea to check the input for user errors and, if they&lt;br /&gt;
cannot be corrected, to take a safe exit.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
	if (.not. sf_histint(in,&amp;quot;n1&amp;quot;,n1)) then&lt;br /&gt;
	   call sf_error(&amp;quot;No n1= in input&amp;quot;)&lt;br /&gt;
	else if (n1 &amp;gt; 1000) then&lt;br /&gt;
	   call sf_error(&amp;quot;n1 is too long&amp;quot;)&lt;br /&gt;
	end if&lt;br /&gt;
	n2 = sf_leftsize(in,1)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Conceptually, the RSF data model is a multidimensional hypercube. By&lt;br /&gt;
convention, the dimensions of the cube are stored in &amp;lt;tt&amp;gt;n1=&amp;lt;/tt&amp;gt;,&lt;br /&gt;
&amp;lt;tt&amp;gt;n2=&amp;lt;/tt&amp;gt;, etc. parameters. The &amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt; parameter refers to the&lt;br /&gt;
fastest axis. If the input dataset is a collection of traces,&lt;br /&gt;
&amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt; refers to the trace length. We extract it using the&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_histint&amp;lt;/tt&amp;gt; function (integer parameter from history) and&lt;br /&gt;
abort if no value for &amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt; is found. Since Fortran-77 cannot&lt;br /&gt;
easily handle dynamic allocation, we also need to check that&lt;br /&gt;
&amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt; is not larger than the size of the statically allocated&lt;br /&gt;
array. We could proceed in a similar fashion, extracting &amp;lt;tt&amp;gt;n2&amp;lt;/tt&amp;gt;,&lt;br /&gt;
&amp;lt;tt&amp;gt;n3&amp;lt;/tt&amp;gt;, etc. If we are interested in the total number of traces,&lt;br /&gt;
like in the clip example, a shortcut is to use the&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_leftsize&amp;lt;/tt&amp;gt; function.  Calling &amp;lt;tt&amp;gt;sf_leftsize(in,0)&amp;lt;/tt&amp;gt;&lt;br /&gt;
returns the total number of elements in the hypercube (the product of&lt;br /&gt;
&amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;n2&amp;lt;/tt&amp;gt;, etc.), calling &amp;lt;tt&amp;gt;sf_leftsize(in,1)&amp;lt;/tt&amp;gt;&lt;br /&gt;
returns the number of traces (the product of &amp;lt;tt&amp;gt;n2&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;n3&amp;lt;/tt&amp;gt;,&lt;br /&gt;
etc.), calling &amp;lt;tt&amp;gt;sf_leftsize(in,2)&amp;lt;/tt&amp;gt; returns the product of&lt;br /&gt;
&amp;lt;tt&amp;gt;n3&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;n4&amp;lt;/tt&amp;gt;, etc. By calling &amp;lt;tt&amp;gt;sf_leftsize&amp;lt;/tt&amp;gt;, we&lt;br /&gt;
avoid the need to extract additional parameters for the hypercube&lt;br /&gt;
dimensions that we are not interested in.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
	if (.not. sf_getfloat(&amp;quot;clip&amp;quot;,clip)) &lt;br /&gt;
     &amp;amp;  call sf_error(&amp;quot;Need clip=&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The clip parameter is read from the command line, where it can be&lt;br /&gt;
specified, for example, as &amp;lt;tt&amp;gt;clip=10&amp;lt;/tt&amp;gt;. The parameter has the&lt;br /&gt;
&amp;lt;tt&amp;gt;float&amp;lt;/tt&amp;gt; type, therefore we read it with the&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_getfloat&amp;lt;/tt&amp;gt; function. If no &amp;lt;tt&amp;gt;clip=&amp;lt;/tt&amp;gt; parameter is&lt;br /&gt;
found among the command line arguments, the program is aborted with an&lt;br /&gt;
error message using the &amp;lt;tt&amp;gt;sf_error&amp;lt;/tt&amp;gt; function.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
	do 10 i2=1, n2&lt;br /&gt;
	   call sf_floatread(trace,n1,in)&lt;br /&gt;
&lt;br /&gt;
	   do 20 i1=1, n1&lt;br /&gt;
	      if (trace(i1) &amp;gt;  clip) then&lt;br /&gt;
		 trace(i1)=clip&lt;br /&gt;
	      else if (trace(i1) &amp;lt; -clip) then&lt;br /&gt;
		 trace(i1)=-clip&lt;br /&gt;
	      end if&lt;br /&gt;
 20	   continue&lt;br /&gt;
&lt;br /&gt;
	   call sf_floatwrite(trace,n1,out)&lt;br /&gt;
 10	continue&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, we do the actual work: loop over input traces, reading,&lt;br /&gt;
clipping, and writing out each trace.&lt;br /&gt;
===Compiling===&lt;br /&gt;
To compile the Fortran-77 program, run&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
f77 clip.f -L$RSFROOT/lib -lrsff -lrsf -lm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Change &amp;lt;tt&amp;gt;f77&amp;lt;/tt&amp;gt; to the Fortran compiler appropriate for your system and&lt;br /&gt;
include additional compiler flags if necessary. The flags that RSF typically&lt;br /&gt;
uses are in &amp;lt;tt&amp;gt;&amp;amp;#36;RSFROOT/share/madagascar/etc/config.py&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Fortran-90 interface==&lt;br /&gt;
&lt;br /&gt;
The Fortran-90 clip function is listed below.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
program Clipit&lt;br /&gt;
  use rsf&lt;br /&gt;
&lt;br /&gt;
  implicit none&lt;br /&gt;
  type (file)                      :: in, out&lt;br /&gt;
  integer                          :: n1, n2, i1, i2&lt;br /&gt;
  real                             :: clip&lt;br /&gt;
  real, dimension (:), allocatable :: trace&lt;br /&gt;
&lt;br /&gt;
  call sf_init()            ! initialize RSF&lt;br /&gt;
  in = rsf_input()&lt;br /&gt;
  out = rsf_output()&lt;br /&gt;
&lt;br /&gt;
  if (sf_float /= gettype(in)) call sf_error(&amp;quot;Need float type&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
  call from_par(in,&amp;quot;n1&amp;quot;,n1)&lt;br /&gt;
  n2 = filesize(in,1)&lt;br /&gt;
&lt;br /&gt;
  call from_par(&amp;quot;clip&amp;quot;,clip) ! command-line parameter &lt;br /&gt;
&lt;br /&gt;
  allocate (trace (n1))&lt;br /&gt;
&lt;br /&gt;
  do i2=1, n2                ! loop over traces&lt;br /&gt;
     call rsf_read(in,trace)&lt;br /&gt;
     &lt;br /&gt;
     where (trace &amp;gt;  clip) trace =  clip&lt;br /&gt;
     where (trace &amp;lt; -clip) trace = -clip&lt;br /&gt;
&lt;br /&gt;
     call rsf_write(out,trace)&lt;br /&gt;
  end do&lt;br /&gt;
&lt;br /&gt;
  deallocate (trace)&lt;br /&gt;
&lt;br /&gt;
end program Clipit&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let us examine it in detail.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
  use rsf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The program starts with importing the &amp;lt;tt&amp;gt;rsf&amp;lt;/tt&amp;gt; module.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
  call sf_init()            ! initialize RSF&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A call to &amp;lt;tt&amp;gt;sf_init&amp;lt;/tt&amp;gt; is needed to initialize the command-line&lt;br /&gt;
interface.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
  in = rsf_input()&lt;br /&gt;
  out = rsf_output()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The standard input and output files are initialized with&lt;br /&gt;
&amp;lt;tt&amp;gt;rsf_input&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;rsf_output&amp;lt;/tt&amp;gt; functions. Both functions&lt;br /&gt;
accept optional arguments. For example, if the command line contains&lt;br /&gt;
&amp;lt;tt&amp;gt;vel=velocity.rsf&amp;lt;/tt&amp;gt;, then both&lt;br /&gt;
&amp;lt;tt&amp;gt;rsf_input(&amp;quot;velocity.rsf&amp;quot;)&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;rsf_input(&amp;quot;vel&amp;quot;)&amp;lt;/tt&amp;gt; are&lt;br /&gt;
acceptable.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
  if (sf_float /= gettype(in)) call sf_error(&amp;quot;Need float type&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A call to &amp;lt;tt&amp;gt;from_par&amp;lt;/tt&amp;gt; extracts the &amp;quot;&amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt;&amp;quot; parameter&lt;br /&gt;
from the input file. Conceptually, the RSF data model is a&lt;br /&gt;
multidimensional hypercube.  The &amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt; parameter refers to the&lt;br /&gt;
fastest axis. If the input dataset is a collection of traces,&lt;br /&gt;
&amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt; corresponds to the trace length. We could proceed in a&lt;br /&gt;
similar fashion, extracting &amp;lt;tt&amp;gt;n2&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;n3&amp;lt;/tt&amp;gt;, etc. If we are&lt;br /&gt;
interested in the total number of traces, like in the clip example, a&lt;br /&gt;
shortcut is to use the &amp;lt;tt&amp;gt;filesize&amp;lt;/tt&amp;gt; function.  Calling&lt;br /&gt;
&amp;lt;tt&amp;gt;filesize(in)&amp;lt;/tt&amp;gt; returns the total number of elements in the&lt;br /&gt;
hypercube (the product of &amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;n2&amp;lt;/tt&amp;gt;, etc.), calling&lt;br /&gt;
&amp;lt;tt&amp;gt;filesize(in,1)&amp;lt;/tt&amp;gt; returns the number of traces (the product of&lt;br /&gt;
&amp;lt;tt&amp;gt;n2&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;n3&amp;lt;/tt&amp;gt;, etc.), calling &amp;lt;tt&amp;gt;filesize(in,2)&amp;lt;/tt&amp;gt;&lt;br /&gt;
returns the product of &amp;lt;tt&amp;gt;n3&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;n4&amp;lt;/tt&amp;gt;, etc. By calling&lt;br /&gt;
&amp;lt;tt&amp;gt;filesize&amp;lt;/tt&amp;gt;, we avoid the need to extract additional parameters&lt;br /&gt;
for the hypercube dimensions that we are not interested in.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
  n2 = filesize(in,1)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The clip parameter is read from the command line, where it can be&lt;br /&gt;
specified, for example, as &amp;lt;tt&amp;gt;clip=10&amp;lt;/tt&amp;gt;. If we knew a good default&lt;br /&gt;
value for &amp;lt;tt&amp;gt;clip&amp;lt;/tt&amp;gt;, we could specify it with an optional&lt;br /&gt;
argument, i.e. &amp;lt;tt&amp;gt;call~from_par(&amp;quot;clip&amp;quot;,clip,default)&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
  allocate (trace (n1))&lt;br /&gt;
&lt;br /&gt;
  do i2=1, n2                ! loop over traces&lt;br /&gt;
     call rsf_read(in,trace)&lt;br /&gt;
     &lt;br /&gt;
     where (trace &amp;gt;  clip) trace =  clip&lt;br /&gt;
     where (trace &amp;lt; -clip) trace = -clip&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, we do the actual work: loop over input traces, reading,&lt;br /&gt;
clipping, and writing out each trace.&lt;br /&gt;
===Compiling===&lt;br /&gt;
To compile the Fortran-90 program, run&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
f90 clip.f90 -I&amp;amp;#36;RSFROOT/include -L&amp;amp;#36;RSFROOT/lib -lrsff90 -lrsf -lm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Change &amp;lt;tt&amp;gt;f90&amp;lt;/tt&amp;gt; to the Fortran-90 compiler appropriate for your system and&lt;br /&gt;
include additional compiler flags if necessary. The flags that RSF typically&lt;br /&gt;
uses are in &amp;lt;tt&amp;gt;&amp;amp;#36;RSFROOT/share/madagasacar/etc/config.py&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The complete specification for the F90 API can be found [[Library_Reference#Fortran_90_API | on the Library Reference page]].&lt;br /&gt;
&lt;br /&gt;
==Python interface==&lt;br /&gt;
Examples that use the python interface are in the directory $RSFSRC/api/python/test.&lt;br /&gt;
&lt;br /&gt;
The Python script clip.py is:.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
#!/usr/bin/env python&lt;br /&gt;
&lt;br /&gt;
import numpy&lt;br /&gt;
import m8r&lt;br /&gt;
&lt;br /&gt;
par = m8r.Par()&lt;br /&gt;
inp  = m8r.Input()&lt;br /&gt;
output = m8r.Output()&lt;br /&gt;
assert &#039;float&#039; == inp.type&lt;br /&gt;
&lt;br /&gt;
n1 = inp.int(&amp;quot;n1&amp;quot;)&lt;br /&gt;
n2 = inp.size(1)&lt;br /&gt;
assert n1&lt;br /&gt;
&lt;br /&gt;
clip = par.float(&amp;quot;clip&amp;quot;)&lt;br /&gt;
assert clip&lt;br /&gt;
&lt;br /&gt;
trace = numpy.zeros(n1,&#039;f&#039;)&lt;br /&gt;
&lt;br /&gt;
for i2 in xrange(n2): # loop over traces&lt;br /&gt;
    inp.read(trace)&lt;br /&gt;
    trace = numpy.clip(trace,-clip,clip)&lt;br /&gt;
    output.write(trace)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let us examine it in detail. &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import numpy&lt;br /&gt;
import m8r&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The script starts with importing the &amp;lt;tt&amp;gt;numpy&amp;lt;/tt&amp;gt; module and the&lt;br /&gt;
&amp;lt;tt&amp;gt;m8r&amp;lt;/tt&amp;gt; API.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
par = m8r.Par()&lt;br /&gt;
inp  = m8r.Input()&lt;br /&gt;
output = m8r.Output()&lt;br /&gt;
assert &#039;float&#039; == inp.type&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, we initialize the command line interface and the standard input and&lt;br /&gt;
output files. We also make sure that the input file type is floating point.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
n1 = input.int(&amp;quot;n1&amp;quot;)&lt;br /&gt;
n2 = input.size(1)&lt;br /&gt;
assert n1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We extract the &amp;quot;&amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt;&amp;quot; parameter from the input file.&lt;br /&gt;
Conceptually, the RSF data model is a multidimensional hypercube.  The&lt;br /&gt;
&amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt; parameter refers to the fastest axis. If the input dataset&lt;br /&gt;
is a collection of traces, &amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt; corresponds to the trace&lt;br /&gt;
length. We could proceed in a similar fashion, extracting &amp;lt;tt&amp;gt;n2&amp;lt;/tt&amp;gt;,&lt;br /&gt;
&amp;lt;tt&amp;gt;n3&amp;lt;/tt&amp;gt;, etc. If we are interested in the total number of traces,&lt;br /&gt;
like in the clip example, a shortcut is to use the &amp;lt;tt&amp;gt;size&amp;lt;/tt&amp;gt;&lt;br /&gt;
method of the &amp;lt;tt&amp;gt;Input&amp;lt;/tt&amp;gt; class.  Calling &amp;lt;tt&amp;gt;size(0)&amp;lt;/tt&amp;gt; returns&lt;br /&gt;
the total number of elements in the hypercube (the product of&lt;br /&gt;
&amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;n2&amp;lt;/tt&amp;gt;, etc.), calling &amp;lt;tt&amp;gt;size(1)&amp;lt;/tt&amp;gt; returns the&lt;br /&gt;
number of traces (the product of &amp;lt;tt&amp;gt;n2&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;n3&amp;lt;/tt&amp;gt;, etc.),&lt;br /&gt;
calling &amp;lt;tt&amp;gt;size(2)&amp;lt;/tt&amp;gt; returns the product of &amp;lt;tt&amp;gt;n3&amp;lt;/tt&amp;gt;,&lt;br /&gt;
&amp;lt;tt&amp;gt;n4&amp;lt;/tt&amp;gt;, etc.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
clip = par.float(&amp;quot;clip&amp;quot;)&lt;br /&gt;
assert clip&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The clip parameter is read from the command line, where it can be specified,&lt;br /&gt;
for example, as &amp;lt;tt&amp;gt;clip=10&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
trace = numpy.zeros(n1,&#039;f&#039;)&lt;br /&gt;
for i2 in xrange(n2): # loop over traces&lt;br /&gt;
    inp.read(trace)&lt;br /&gt;
    trace = numpy.clip(trace,-clip,clip)&lt;br /&gt;
    output.write(trace)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, we do the actual work: allocate an array to hold a trace and  loop &lt;br /&gt;
over input traces, reading, clipping, and writing out each trace.&lt;br /&gt;
&lt;br /&gt;
Alternative code use inp.trace to allocate an array and read &lt;br /&gt;
the whole file into memory. The loop is no longer needed:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
alltraces=inp.read()&lt;br /&gt;
alltraces = numpy.clip(alltraces,-clip,clip)&lt;br /&gt;
output.write(alltraces)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Compiling===&lt;br /&gt;
The python script does not require compilation. Simply make sure that&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;amp;#36;RSFROOT/lib&amp;lt;/tt&amp;gt; is in &amp;lt;tt&amp;gt;PYTHONPATH&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;LD_LIBRARY_PATH&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Interactive mode usage without graphics===&lt;br /&gt;
Madagascar&#039;s Python API can be used interactively too. Create an input dataset with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sfmath n1=10 n2=5 output=x1+x2*100 &amp;gt; test.rsf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, start the python interpreter and paste the following to its command line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import numpy, m8r&lt;br /&gt;
&lt;br /&gt;
inp = m8r.Input(&#039;test.rsf&#039;)&lt;br /&gt;
n1 = inp.int(&amp;quot;n1&amp;quot;)&lt;br /&gt;
n2 = inp.int(&amp;quot;n2&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
data =inp.read(shape=(n2,n1))&lt;br /&gt;
data = data.transpose() # Example of numpy in action&lt;br /&gt;
&lt;br /&gt;
print data&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[[  0. 100. 200. 300. 400.]&lt;br /&gt;
 [  1. 101. 201. 301. 401.]&lt;br /&gt;
 [  2. 102. 202. 302. 402.]&lt;br /&gt;
 [  3. 103. 203. 303. 403.]&lt;br /&gt;
 [  4. 104. 204. 304. 404.]&lt;br /&gt;
 [  5. 105. 205. 305. 405.]&lt;br /&gt;
 [  6. 106. 206. 306. 406.]&lt;br /&gt;
 [  7. 107. 207. 307. 407.]&lt;br /&gt;
 [  8. 108. 208. 308. 408.]&lt;br /&gt;
 [  9. 109. 209. 309. 409.]]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code will also work in batch mode in a Python script, not only pasted to the interpreter&#039;s command line. &lt;br /&gt;
&lt;br /&gt;
===Graphics with Matplotlib===&lt;br /&gt;
Python can plot arrays directly from memory, without having to write a file to disk first. [http://matplotlib.sourceforge.net/ Matplotlib] is one of the [http://en.wikipedia.org/wiki/Category:Free_plotting_software several] packages that accomplish this. To create a figure, execute the code in the previous section, followed by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from pylab import *&lt;br /&gt;
imshow(data)&lt;br /&gt;
xlabel(&#039;X (m)&#039;)&lt;br /&gt;
ylabel(&#039;Y (m)&#039;)&lt;br /&gt;
title(&#039;Matplotlib example&#039;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to pop up a figure in an interactive session, after pasting to a Python command line the code shown before, also paste:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
show()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will get Figure 1. The figure will pop up if you run the code in a script too, and the script will stop until the figure is manually closed. You must press the floppy disk button in order to save it. To have the image written to disk automatically, instead of &amp;lt;tt&amp;gt;show()&amp;lt;/tt&amp;gt; use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
savefig(&#039;myfile.png&#039;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:matplotlib_imshow.png]]&lt;br /&gt;
&lt;br /&gt;
Putting it all together, here is a sample script reading a RSF file from stdin and printing out a figure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
#!/usr/bin/env python&lt;br /&gt;
import m8r, numpy, sys, pylab&lt;br /&gt;
&lt;br /&gt;
inp = m8r.Input(&#039;test.rsf&#039;)&lt;br /&gt;
n1 = inp.int(&amp;quot;n1&amp;quot;)&lt;br /&gt;
n2 = inp.int(&amp;quot;n2&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
data=input.read()&lt;br /&gt;
&lt;br /&gt;
pylab.imshow(data)&lt;br /&gt;
pylab.savefig(&#039;out.png&#039;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
===Python interfaces to the standalone programs===&lt;br /&gt;
The &amp;lt;tt&amp;gt;m8r&amp;lt;/tt&amp;gt; module offers a way to call Madagascar standalone programs (including graphics) elegantly from inside a Python program, interactively or in batch mode. The blog contains examples of running the &amp;lt;tt&amp;gt;m8r&amp;lt;/tt&amp;gt; module [http://www.ahay.org/rsflog/index.php?/archives/173-Extending-Python-interface.html from inside a SAGE notebook] or [http://www.ahay.org/rsflog/index.php?/archives/264-Running-Madagascar-in-an-interactive-console.html from inside an iPython shell].&lt;br /&gt;
&lt;br /&gt;
==MATLAB interface==&lt;br /&gt;
&lt;br /&gt;
The MATLAB clip function is listed below.&lt;br /&gt;
&amp;lt;matlab&amp;gt;&lt;br /&gt;
function clip(in,out,clip)&lt;br /&gt;
%CLIP Clip the data&lt;br /&gt;
&lt;br /&gt;
dims = rsf_dim(in);&lt;br /&gt;
n1 = dims(1);           % trace length&lt;br /&gt;
n2 = prod(dims(2:end)); % number of traces&lt;br /&gt;
trace = 1:n1;           % allocate trace&lt;br /&gt;
rsf_create(out,in)      % create an output file&lt;br /&gt;
&lt;br /&gt;
for i2 = 1:n2           % loop over traces&lt;br /&gt;
    rsf_read(trace,in,&#039;same&#039;);&lt;br /&gt;
    trace(trace &amp;gt;   clip) =  clip;&lt;br /&gt;
    trace(trace &amp;lt; - clip) = -clip;&lt;br /&gt;
    rsf_write(trace,out,&#039;same&#039;);&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/matlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let us examine it in detail. &lt;br /&gt;
&amp;lt;matlab&amp;gt;&lt;br /&gt;
dims = rsf_dim(in);&lt;br /&gt;
&amp;lt;/matlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We start by figuring out the input file dimensions.&lt;br /&gt;
&amp;lt;matlab&amp;gt;&lt;br /&gt;
n1 = dims(1);           % trace length&lt;br /&gt;
n2 = prod(dims(2:end)); % number of traces&lt;br /&gt;
&amp;lt;/matlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first dimension is the trace length, the product of all other&lt;br /&gt;
dimensions correspond to the number of traces.&lt;br /&gt;
&amp;lt;matlab&amp;gt;&lt;br /&gt;
trace = 1:n1;           % allocate trace&lt;br /&gt;
rsf_create(out,in)      % create an output file&lt;br /&gt;
&amp;lt;/matlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, we allocate the trace array and create an output file.&lt;br /&gt;
&amp;lt;matlab&amp;gt;&lt;br /&gt;
for i2 = 1:n2           % loop over traces&lt;br /&gt;
    rsf_read(trace,in,&#039;same&#039;);&lt;br /&gt;
    trace(trace &amp;gt;   clip) =  clip;&lt;br /&gt;
    trace(trace &amp;lt; - clip) = -clip;&lt;br /&gt;
    rsf_write(trace,out,&#039;same&#039;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/matlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, we do the actual work: loop over input traces, reading,&lt;br /&gt;
clipping, and writing out each trace.&lt;br /&gt;
===Available functions===&lt;br /&gt;
Only some of the functions in the &amp;lt;tt&amp;gt;rsf&amp;lt;/tt&amp;gt; library have received a MATLAB interface. These functions are &amp;lt;tt&amp;gt;rsf_par&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;rsf_dim&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;rsf_read&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;rsf_write&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;rsf_create&amp;lt;/tt&amp;gt;. All these functions except &amp;lt;tt&amp;gt;rsf_par&amp;lt;/tt&amp;gt; have been illustrated in the example above.&lt;br /&gt;
===Compiling===&lt;br /&gt;
The MATLAB script does not require compilation. Simply make sure that&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;amp;#36;RSFROOT/lib&amp;lt;/tt&amp;gt; is in &amp;lt;tt&amp;gt;MATLABPATH&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;LD_LIBRARY_PATH&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Java Interface==&lt;br /&gt;
There are two interfaces to Java that are available.  New codes should be written to use the SWIG interface ONLY.  The older interface (using the MINES JTK) is deprecated, and is only provided while users migrate their code to the new interface.&lt;br /&gt;
&lt;br /&gt;
===SWIG===&lt;br /&gt;
&lt;br /&gt;
To install the SWIG interface:&lt;br /&gt;
&lt;br /&gt;
1 - Download the Java Standard Development Kit (JDK).  Installation varies by platform.&lt;br /&gt;
&lt;br /&gt;
2 - Create the JAVA_HOME environment variable for your shell.  This should point to the directory where the JDK was installed. Example (for Ubuntu 10.04):&lt;br /&gt;
&amp;lt;bash&amp;gt;&lt;br /&gt;
export JAVA_HOME=/usr/lib/jvm/java-6-opensdk&lt;br /&gt;
&amp;lt;/bash&amp;gt;&lt;br /&gt;
3 - Reconfigure Madagascar:&lt;br /&gt;
&amp;lt;bash&amp;gt;&lt;br /&gt;
./configure API=java&lt;br /&gt;
&amp;lt;/bash&amp;gt;&lt;br /&gt;
4 - Reinstall Madagascar (Ignore the compilation warnings for Java files):&lt;br /&gt;
&amp;lt;bash&amp;gt;&lt;br /&gt;
scons; scons install&lt;br /&gt;
&amp;lt;/bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The installation creates two files:  $RSFROOT/lib/libjrsf.so and $RSFROOT/lib/rsf.jar .&lt;br /&gt;
&lt;br /&gt;
Make sure that you set your LD_LIBRARY_PATH to include $RSFROOT/lib.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A short demonstration of the interface follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;java&amp;gt;&lt;br /&gt;
import rsf.RSF;&lt;br /&gt;
import rsf.Input;&lt;br /&gt;
import rsf.Output;&lt;br /&gt;
&lt;br /&gt;
/* A simple Java program to clip a dataset. */&lt;br /&gt;
&lt;br /&gt;
public class Clip {&lt;br /&gt;
    static {&lt;br /&gt;
        System.loadLibrary(&amp;quot;jrsf&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    public static void main(String[] args){&lt;br /&gt;
        // Initialize command line argument passing&lt;br /&gt;
         RSF par = new RSF(args);&lt;br /&gt;
         // Get the input file name.&lt;br /&gt;
         Input input = new Input(&amp;quot;in&amp;quot;);&lt;br /&gt;
         Output output = new Output(&amp;quot;out&amp;quot;);&lt;br /&gt;
        // Get the value to clip to.&lt;br /&gt;
         float clip = par.getFloat(&amp;quot;clip&amp;quot;,0.0f);&lt;br /&gt;
        // Read our input header&lt;br /&gt;
        int n3 = input.getN(3);&lt;br /&gt;
        int n2 = input.getN(2);&lt;br /&gt;
        int n1 = input.getN(1);&lt;br /&gt;
        //Perform clipping operation on a single trace and write out.&lt;br /&gt;
        float[] data = new float[n1];&lt;br /&gt;
         for(int i = 0; i &amp;lt; n3; ++i){&lt;br /&gt;
            for(int j = 0; j &amp;lt; n2; ++j){&lt;br /&gt;
                input.read(data);&lt;br /&gt;
                for(int k = 0; k &amp;lt; n1; ++k){&lt;br /&gt;
                    if (data[k] &amp;gt; clip) data[k] = clip;&lt;br /&gt;
                    else if (data[k] &amp;lt; -clip) data[k] = -clip;&lt;br /&gt;
                }&lt;br /&gt;
                output.write(data);&lt;br /&gt;
            }&lt;br /&gt;
         }&lt;br /&gt;
         output.setN(1,n1);&lt;br /&gt;
         output.setN(2,n2);&lt;br /&gt;
         output.setN(3,n3);&lt;br /&gt;
         input.close();&lt;br /&gt;
         output.close();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/java&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are only three classes in the interface:&lt;br /&gt;
&lt;br /&gt;
1 -- RSF - The command line argument parser, and the initializer for the native interface.  An RSF object MUST be instantiated BEFORE instantiating an Input or Output object.&lt;br /&gt;
&lt;br /&gt;
2 -- Input - An object that provides read access to an RSF file.  &lt;br /&gt;
&lt;br /&gt;
3 -- Output - An object that provides write access to an RSF file.&lt;br /&gt;
&lt;br /&gt;
Additionally, the shared library (libjrsf.so or libjrsf.dll) must be included via the System.loadLibrary(&amp;quot;jrsf&amp;quot;); as the first command in the file.&lt;br /&gt;
&lt;br /&gt;
To compile on the command line:&lt;br /&gt;
&amp;lt;bash&amp;gt;&lt;br /&gt;
javac -cp $RSFROOT/lib Clip.java&lt;br /&gt;
&amp;lt;/bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To include this as part of a SCons script (SConstruct):&lt;br /&gt;
&amp;lt;python&amp;gt;&lt;br /&gt;
from rsf.proj import *&lt;br /&gt;
&lt;br /&gt;
# Compiles Clip.class&lt;br /&gt;
project.Java(&#039;.&#039;,&#039;Clip.java&#039;)&lt;br /&gt;
&lt;br /&gt;
Flow(&#039;dat&#039;,None,&#039;spike n1=1000 n2=100 n3=10 nsp=1 k1=500 l1=1000&#039;)&lt;br /&gt;
Flow(&#039;clipd&#039;,&#039;dat Clip.class&#039;,&lt;br /&gt;
    &#039;&#039;&#039;&lt;br /&gt;
    %s Clip clip=0.5&lt;br /&gt;
    &#039;&#039;&#039; % WhereIs(&#039;java&#039;))&lt;br /&gt;
Flow(&#039;test.attr&#039;,&#039;clipd&#039;,&#039;sfattr&#039;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/python&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note, that we compile Clip.java using the SCons Java builder.  To execute the command, we have to locate the &amp;quot;java&amp;quot; command, which we do using WhereIs(&#039;java&#039;).  Then we execute the class name, and pass any command line arguments as usual.  The files are read from standard in for this program and written to standard out.  &lt;br /&gt;
&lt;br /&gt;
Please see the [[Library Reference]] for more details on the functions available in the SWIG API.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note: Additional Java packages can included in SCons automatically by setting the CLASSPATH environment variable to point to the JAR files that they are contained in.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Mines JTK===&lt;br /&gt;
&#039;&#039;&#039;THIS INTERFACE IS DEPRECATED AND ONLY PROVIDED AS A REFERENCE.  THIS INTERFACE IS NO LONGER SUPPORTED AND WILL BE REMOVED&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This interface may still be compiled by specifying the MINESJTK environment variable. &lt;br /&gt;
&lt;br /&gt;
The interface to Java is less full featured than others.  Presently, it only allows you to read RSF files with fewer than 4-dimensions into Java, and then export RSF files.  &#039;&#039;&#039;The Java interface does not support reading from standard in, or writing from standard out.  Therefore, the Java Interface does not support piping either.&#039;&#039;&#039; The Java interface at present treats all values as floats, and does not have support for complex numbers.  Java programs are not parsed for self-doc information like other programs are either.  Using javadoc may be a viable alternative to creating a parsing engine for Java programs.&lt;br /&gt;
&lt;br /&gt;
Once the build is complete, the JAR file rsf.jar will be added to your $RSFROOT/lib folder.  &lt;br /&gt;
&lt;br /&gt;
There are two ways to access the API:&lt;br /&gt;
&lt;br /&gt;
1 - From the command line:  point the classpath at BOTH compile and runtime to this location on the command line.&lt;br /&gt;
&amp;lt;bash&amp;gt;&lt;br /&gt;
javac -cp $MINESJTK:$RSFROOT/lib/rsf.jar:. Test.java &lt;br /&gt;
java -cp $MINESJTK:$RSFROOT/lib/rsf.jar:. Test arg1=... arg2=... arg3=...&lt;br /&gt;
&amp;lt;/bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2 - From within a SConstruct script:  BOTH the path for the API ($RSFROOT/lib) and the path to the Mines JTK ($MINESJTK) are automatically added to the environment variable CLASSPATH and JAVACLASSPATH for executions made within an SConstruct.  Additionally, any additional classes that are already in the CLASSPATH environmental variable in the shell that you launch from will be added to your classpath.  This allows you to include additional libraries automatically within your Java programs.  The local directory (.) is also included in the CLASSPATH.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;python&amp;gt;&lt;br /&gt;
from rsf.proj import *&lt;br /&gt;
&lt;br /&gt;
# Compiles Clip.class&lt;br /&gt;
project.Java(&#039;.&#039;,&#039;Clip.java&#039;)&lt;br /&gt;
&lt;br /&gt;
Flow(&#039;dat&#039;,None,&#039;spike n1=1000 n2=100 n3=10 nsp=1 k1=500&#039;)&lt;br /&gt;
Flow(&#039;clipd&#039;,&#039;Clip.class dat&#039;,&lt;br /&gt;
    &#039;&#039;&#039;&lt;br /&gt;
    %s ${SOURCES[0].filebase} clip=0.5 &lt;br /&gt;
    in=${SOURCES[1]} out=$TARGET &lt;br /&gt;
    &#039;&#039;&#039; % WhereIs(&#039;java&#039;),stdin=0,stdout=-1)&lt;br /&gt;
Flow(&#039;test.attr&#039;,&#039;clipd&#039;,&#039;sfattr&#039;)&lt;br /&gt;
&lt;br /&gt;
End()&lt;br /&gt;
&amp;lt;/python&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The interface itself is fairly straightforward.  More details on the methods exposed by the API can be found at the [[Library_Reference#Java_API | Library Reference]].&lt;br /&gt;
&lt;br /&gt;
Data clipping, argument parsing, and IO example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;java&amp;gt;&lt;br /&gt;
import rsf.Par;&lt;br /&gt;
import rsf.Reader;&lt;br /&gt;
import rsf.Writer;&lt;br /&gt;
import rsf.Header;&lt;br /&gt;
&lt;br /&gt;
/* A simple Java program to clip a dataset.&lt;br /&gt;
&lt;br /&gt;
Presently, there is no automatic self-documentation generation for use&lt;br /&gt;
with sfdoc.  Javadoc may be a better way to generate self-doc for Java&lt;br /&gt;
programs.&lt;br /&gt;
&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
public class Clip {&lt;br /&gt;
    public static void main(String[] args){&lt;br /&gt;
        // Initialize command line argument passing&lt;br /&gt;
         Par par = new Par(args);&lt;br /&gt;
         // Get the input file name.&lt;br /&gt;
         String input = par.getString(&amp;quot;in&amp;quot;,&amp;quot;&amp;quot;);&lt;br /&gt;
         // If the input file name is nothing, then quit!&lt;br /&gt;
         if (input.equals(&amp;quot;&amp;quot;)){&lt;br /&gt;
                System.out.println(&amp;quot;Did not find input file!&amp;quot;);&lt;br /&gt;
                System.exit(1);&lt;br /&gt;
         }&lt;br /&gt;
         //If the output file name is nothing, then quit!&lt;br /&gt;
         String output = par.getString(&amp;quot;out&amp;quot;,&amp;quot;&amp;quot;);&lt;br /&gt;
         if (output.equals(&amp;quot;&amp;quot;)){&lt;br /&gt;
                System.out.println(&amp;quot;Did not find output file!&amp;quot;);&lt;br /&gt;
                System.exit(1);&lt;br /&gt;
         }&lt;br /&gt;
        // Get the value to clip to.&lt;br /&gt;
         float clip = par.getFloat(&amp;quot;clip&amp;quot;,0.0f);&lt;br /&gt;
        //Read our header file.&lt;br /&gt;
         Header header = Reader.readHeader(input);&lt;br /&gt;
        // Read our binary data.&lt;br /&gt;
         float[][][] data = Reader.readBinary3D(header);&lt;br /&gt;
        //Initialize our array values.&lt;br /&gt;
         int n3 = header.getN(3);&lt;br /&gt;
         int n2 = header.getN(2);&lt;br /&gt;
         int n1 = header.getN(1);&lt;br /&gt;
        //Perform clipping operation.&lt;br /&gt;
         for(int i = 0; i &amp;lt; n3; ++i){&lt;br /&gt;
            for(int j = 0; j &amp;lt; n2; ++j){&lt;br /&gt;
                for(int k = 0; k &amp;lt; n1; ++k){&lt;br /&gt;
                    float trace = data[i][j][k];&lt;br /&gt;
                    if (trace &amp;gt; clip) data[i][j][k] = clip;&lt;br /&gt;
                    else if (trace &amp;lt; -clip) data[i][j][k] = -clip;&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
         }&lt;br /&gt;
        //Write our data out, using the same header values to the file&lt;br /&gt;
        //located at: output.&lt;br /&gt;
         Writer.writeRSF(header,data,output);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/java&amp;gt;&lt;br /&gt;
&lt;br /&gt;
How to read a file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;java&amp;gt;&lt;br /&gt;
&lt;br /&gt;
import rsf.Header;&lt;br /&gt;
import rsf.Reader;&lt;br /&gt;
import rsf.Writer;&lt;br /&gt;
&lt;br /&gt;
public class Test {&lt;br /&gt;
      public static void main(String[] args){&lt;br /&gt;
&lt;br /&gt;
                Header header = Reader.readHeader(&amp;quot;junk.rsf&amp;quot;); //To read the header file, just feed in the path relative to the execution directory&lt;br /&gt;
                System.out.println(header); //The header file will print out if you ask it to, this is good for debugging&lt;br /&gt;
&lt;br /&gt;
                float[][] data = Reader.readBinary2D(header); //Now I can manipulate my data&lt;br /&gt;
       }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/java&amp;gt;&lt;br /&gt;
&lt;br /&gt;
How to write a file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;java&amp;gt;&lt;br /&gt;
import rsf.Header;&lt;br /&gt;
import rsf.Reader;&lt;br /&gt;
import rsf.Writer;&lt;br /&gt;
&lt;br /&gt;
public class Test {&lt;br /&gt;
      public static void main(String[] args){&lt;br /&gt;
                &lt;br /&gt;
                Header header = Reader.readHeader(&amp;quot;test.rsf&amp;quot;); //To read the header file, just feed in the path relative to the execution directory&lt;br /&gt;
                System.out.println(header); //The header file will print out if you ask it to, this is good for debugging&lt;br /&gt;
&lt;br /&gt;
                float[][] data = Reader.readBinary2D(header); //Now I can manipulate my data&lt;br /&gt;
&lt;br /&gt;
                //...Do something&lt;br /&gt;
                Writer.writeRSF(header,data,&amp;quot;test2.rsf&amp;quot;); //Write out my data!&lt;br /&gt;
       }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/java&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to create a dataset from scratch from within Java, then you can create an array of data, modify the values, create a header, and then write it out to rsf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;java&amp;gt;&lt;br /&gt;
import rsf.Header;&lt;br /&gt;
import rsf.Reader;&lt;br /&gt;
import rsf.Writer;&lt;br /&gt;
&lt;br /&gt;
public class Test {&lt;br /&gt;
      public static void main(String[] args){&lt;br /&gt;
&lt;br /&gt;
                int n1 = 20;&lt;br /&gt;
                int n2 = 40;&lt;br /&gt;
                float[][] data = new float[n2][n1]; &lt;br /&gt;
                //The order for dimensions is reversed, because RSF stores them as column-major arrays (see Python API).&lt;br /&gt;
&lt;br /&gt;
                //...Do something&lt;br /&gt;
&lt;br /&gt;
                Header header = new Header();&lt;br /&gt;
                header.setN(1,n1);&lt;br /&gt;
                /* We set the values using the proper RSF number for the dimension, instead of the Java array index.&lt;br /&gt;
                   Example:  RSF Dimension 1, corresponds to array index 0 in Java.&lt;br /&gt;
                             However, we set the values using index 1.  The mapping is handled behind the scenes.&lt;br /&gt;
                 */&lt;br /&gt;
                header.setN(2,n2); &lt;br /&gt;
                header.setDelta(1,0.0);&lt;br /&gt;
                header.setLabel(1,&amp;quot;time&amp;quot;);&lt;br /&gt;
                header.setUnits(1,&amp;quot;s&amp;quot;);&lt;br /&gt;
                Writer.writeRSF(header,data,&amp;quot;junk2.rsf&amp;quot;); //Write out my data!&lt;br /&gt;
       }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/java&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Karl</name></author>
	</entry>
	<entry>
		<id>https://ahay.org/index.php?title=Guide_to_madagascar_API&amp;diff=3747</id>
		<title>Guide to madagascar API</title>
		<link rel="alternate" type="text/html" href="https://ahay.org/index.php?title=Guide_to_madagascar_API&amp;diff=3747"/>
		<updated>2018-12-13T20:43:32Z</updated>

		<summary type="html">&lt;p&gt;Karl: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;center&amp;gt;&amp;lt;font size=&amp;quot;-1&amp;quot;&amp;gt;&#039;&#039;This page was created from the LaTeX source in [http://sourceforge.net/p/rsf/code/HEAD/tree/trunk/book/rsf/rsf/api.tex book/rsf/rsf/api.tex] using [[latex2wiki]]&#039;&#039;&amp;lt;/font&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Fotolia_555071_XS.jpg|right|]]&lt;br /&gt;
&lt;br /&gt;
This guide explains the RSF programming interface.  See the &#039;&#039;&#039;[[Library_Reference | Library Reference]]&#039;&#039;&#039; for more information on how to use the particular APIs.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
To work with RSF files in your own programs, you may need to use an&lt;br /&gt;
appropriate programming interface. We will demonstrate the interface in&lt;br /&gt;
different languages using a simple example. The example is a clipping program.&lt;br /&gt;
It reads and writes RSF files and accesses parameters both from the input file&lt;br /&gt;
and the command line. The input is processed trace by trace. This is not&lt;br /&gt;
necessarily the most efficient approach&amp;lt;ref&amp;gt;Compare with the [http://rsf.svn.sourceforge.net/viewvc/rsf/trunk/filt/proc/Mclip.c?view=markup library clip program].&amp;lt;/ref&amp;gt; but it suffices for a simple demonstration.&lt;br /&gt;
&lt;br /&gt;
==Installation== &lt;br /&gt;
Only the C interface is installed by default. To install other APIs, use &amp;lt;tt&amp;gt;API=&amp;lt;/tt&amp;gt;&lt;br /&gt;
parameter in the RSF configuration. For example, to install C++ and&lt;br /&gt;
Fortran-90 API bindings in addition to the basic package, run&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./configure API=c++,fortran-90&lt;br /&gt;
scons install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The configuration parameters are stored in &amp;lt;tt&amp;gt;&amp;amp;#36;RSFROOT/share/madagascar/etc/config.py&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==C interface==&lt;br /&gt;
&lt;br /&gt;
The C clip function is listed below.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
/* Clip the data. */&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;rsf.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char* argv[])&lt;br /&gt;
{&lt;br /&gt;
    int n1, n2, i1, i2;&lt;br /&gt;
    float clip, *trace=NULL;&lt;br /&gt;
    sf_file in=NULL, out=NULL; /* Input and output files */&lt;br /&gt;
&lt;br /&gt;
    /* Initialize RSF */&lt;br /&gt;
    sf_init(argc,argv);&lt;br /&gt;
    /* standard input */&lt;br /&gt;
    in = sf_input(&amp;quot;in&amp;quot;);&lt;br /&gt;
    /* standard output */&lt;br /&gt;
    out = sf_output(&amp;quot;out&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
    /* check that the input is float */&lt;br /&gt;
    if (SF_FLOAT != sf_gettype(in)) &lt;br /&gt;
	sf_error(&amp;quot;Need float input&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
    /* n1 is the fastest dimension (trace length) */&lt;br /&gt;
    if (!sf_histint(in,&amp;quot;n1&amp;quot;,&amp;amp;n1)) &lt;br /&gt;
	sf_error(&amp;quot;No n1= in input&amp;quot;);&lt;br /&gt;
    /* leftsize gets n2*n3*n4*... (the number of traces) */&lt;br /&gt;
    n2 = sf_leftsize(in,1);&lt;br /&gt;
&lt;br /&gt;
    /* parameter from the command line (i.e. clip=1.5 ) */&lt;br /&gt;
    if (!sf_getfloat(&amp;quot;clip&amp;quot;,&amp;amp;clip)) sf_error(&amp;quot;Need clip=&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
    /* allocate floating point array */&lt;br /&gt;
    trace = sf_floatalloc (n1);&lt;br /&gt;
&lt;br /&gt;
    /* loop over traces */&lt;br /&gt;
    for (i2=0; i2 &amp;lt; n2; i2++) {&lt;br /&gt;
&lt;br /&gt;
	/*read a trace */&lt;br /&gt;
	sf_floatread(trace,n1,in);&lt;br /&gt;
&lt;br /&gt;
	/* loop over samples */&lt;br /&gt;
	for (i1=0; i1 &amp;lt; n1; i1++) {&lt;br /&gt;
	    if      (trace[i1] &amp;gt;  clip) trace[i1]= clip;&lt;br /&gt;
	    else if (trace[i1] &amp;lt; -clip) trace[i1]=-clip;&lt;br /&gt;
	}&lt;br /&gt;
    &lt;br /&gt;
	/* write a trace */&lt;br /&gt;
	sf_floatwrite(trace,n1,out);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    free(trace);&lt;br /&gt;
    sf_close();&lt;br /&gt;
    exit(0);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let us examine it in detail. &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;rsf.h&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The include preprocessing directive is required to access the RSF interface. &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
    sf_file in=NULL, out=NULL; /* Input and output files */&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
RSF data files are defined with an abstract &amp;lt;tt&amp;gt;sf_file&amp;lt;/tt&amp;gt; data type. An&lt;br /&gt;
abstract data type means that the contents of it are not publicly declared,&lt;br /&gt;
and all operations on &amp;lt;tt&amp;gt;sf_file&amp;lt;/tt&amp;gt; objects should be performed with&lt;br /&gt;
library functions. This is analogous to &amp;lt;tt&amp;gt;FILE *&amp;lt;/tt&amp;gt; data type used in&lt;br /&gt;
&amp;lt;tt&amp;gt;stdio.h&amp;lt;/tt&amp;gt; and as close as C gets to an object-oriented style of&lt;br /&gt;
programming (Roberts, 1998&amp;lt;ref&amp;gt;Roberts, E. S.,  1998, Programming abstractions in C: Addison-Wesley.&amp;lt;/ref&amp;gt;).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
    /* Initialize RSF */&lt;br /&gt;
    sf_init(argc,argv);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before using any of the other functions, you must call&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_init&amp;lt;/tt&amp;gt;. This function parses the command line and&lt;br /&gt;
initializes an internally stored table of command-line parameters.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
    /* standard input */&lt;br /&gt;
    in = sf_input(&amp;quot;in&amp;quot;);&lt;br /&gt;
    /* standard output */&lt;br /&gt;
    out = sf_output(&amp;quot;out&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The input and output RSF file objects are created with &amp;lt;tt&amp;gt;sf_input&amp;lt;/tt&amp;gt; and&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_output&amp;lt;/tt&amp;gt; constructor functions. Both these functions take a string&lt;br /&gt;
argument. The string may refer to a file name or a file tag. For example, if&lt;br /&gt;
the command line contains &amp;lt;tt&amp;gt;vel=velocity.rsf&amp;lt;/tt&amp;gt;, then both&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_input(&amp;quot;velocity.rsf&amp;quot;)&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;sf_input(&amp;quot;vel&amp;quot;)&amp;lt;/tt&amp;gt; are&lt;br /&gt;
acceptable. Two tags are special: &amp;lt;tt&amp;gt;&amp;quot;in&amp;quot;&amp;lt;/tt&amp;gt; refers to the file in the&lt;br /&gt;
standard input and &amp;lt;tt&amp;gt;&amp;quot;out&amp;quot;&amp;lt;/tt&amp;gt; refers to the file in the standard&lt;br /&gt;
output. &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
    /* check that the input is float */&lt;br /&gt;
    if (SF_FLOAT != sf_gettype(in)) &lt;br /&gt;
	sf_error(&amp;quot;Need float input&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
RSF files can store data of different types (character, integer,&lt;br /&gt;
floating point, complex). We extract the data type of the input file&lt;br /&gt;
with the library &amp;lt;tt&amp;gt;sf_gettype&amp;lt;/tt&amp;gt; function and check if it&lt;br /&gt;
represents floating point numbers. If not, the program is aborted with&lt;br /&gt;
an error message, using the &amp;lt;tt&amp;gt;sf_error&amp;lt;/tt&amp;gt; function.  It is&lt;br /&gt;
generally a good idea to check the input for user errors and, if they&lt;br /&gt;
cannot be corrected, to take a safe exit.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
    /* n1 is the fastest dimension (trace length) */&lt;br /&gt;
    if (!sf_histint(in,&amp;quot;n1&amp;quot;,&amp;amp;n1)) &lt;br /&gt;
	sf_error(&amp;quot;No n1= in input&amp;quot;);&lt;br /&gt;
    /* leftsize gets n2*n3*n4*... (the number of traces) */&lt;br /&gt;
    n2 = sf_leftsize(in,1);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Conceptually, the RSF data model is a multidimensional hypercube. By&lt;br /&gt;
convention, the dimensions of the cube are stored in &amp;lt;tt&amp;gt;n1=&amp;lt;/tt&amp;gt;,&lt;br /&gt;
&amp;lt;tt&amp;gt;n2=&amp;lt;/tt&amp;gt;, etc. parameters. The &amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt; parameter refers to the&lt;br /&gt;
fastest axis. If the input dataset is a collection of traces,&lt;br /&gt;
&amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt; refers to the trace length. We extract it using the&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_histint&amp;lt;/tt&amp;gt; function (integer parameter from history) and&lt;br /&gt;
abort if no value for &amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt; is found. We could proceed in a&lt;br /&gt;
similar fashion, extracting &amp;lt;tt&amp;gt;n2&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;n3&amp;lt;/tt&amp;gt;, etc. If we are&lt;br /&gt;
interested in the total number of traces, like in the clip example, a&lt;br /&gt;
shortcut is to use the &amp;lt;tt&amp;gt;sf_leftsize&amp;lt;/tt&amp;gt; function. Calling&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_leftsize(in,0)&amp;lt;/tt&amp;gt; returns the total number of elements in&lt;br /&gt;
the hypercube (the product of &amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;n2&amp;lt;/tt&amp;gt;, etc.), calling&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_leftsize(in,1)&amp;lt;/tt&amp;gt; returns the number of traces (the product&lt;br /&gt;
of &amp;lt;tt&amp;gt;n2&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;n3&amp;lt;/tt&amp;gt;, etc.), calling&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_leftsize(in,2)&amp;lt;/tt&amp;gt; returns the product of &amp;lt;tt&amp;gt;n3&amp;lt;/tt&amp;gt;,&lt;br /&gt;
&amp;lt;tt&amp;gt;n4&amp;lt;/tt&amp;gt;, etc. By calling &amp;lt;tt&amp;gt;sf_leftsize&amp;lt;/tt&amp;gt;, we avoid the need&lt;br /&gt;
to extract additional parameters for the hypercube dimensions that we&lt;br /&gt;
are not interested in.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
    /* parameter from the command line (i.e. clip=1.5 ) */&lt;br /&gt;
    if (!sf_getfloat(&amp;quot;clip&amp;quot;,&amp;amp;clip)) sf_error(&amp;quot;Need clip=&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
The clip parameter is read from the command line, where it can be&lt;br /&gt;
specified, for example, as &amp;lt;tt&amp;gt;clip=10&amp;lt;/tt&amp;gt;. The parameter has the&lt;br /&gt;
&amp;lt;tt&amp;gt;float&amp;lt;/tt&amp;gt; type, therefore we read it with the&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_getfloat&amp;lt;/tt&amp;gt; function. If no &amp;lt;tt&amp;gt;clip=&amp;lt;/tt&amp;gt; parameter is&lt;br /&gt;
found among the command line arguments, the program is aborted with an&lt;br /&gt;
error message using the &amp;lt;tt&amp;gt;sf_error&amp;lt;/tt&amp;gt; function.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
    /* allocate floating point array */&lt;br /&gt;
    trace = sf_floatalloc (n1);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Next, we allocate an array of floating-point numbers to store a trace&lt;br /&gt;
with the library &amp;lt;tt&amp;gt;sf_floatalloc&amp;lt;/tt&amp;gt; function. Unlike the standard&lt;br /&gt;
&amp;lt;tt&amp;gt;malloc&amp;lt;/tt&amp;gt; the RSF allocation function checks for errors and&lt;br /&gt;
either terminates the program or returns a valid pointer.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
    /* loop over traces */&lt;br /&gt;
    for (i2=0; i2 &amp;lt; n2; i2++) {&lt;br /&gt;
&lt;br /&gt;
	/*read a trace */&lt;br /&gt;
	sf_floatread(trace,n1,in);&lt;br /&gt;
&lt;br /&gt;
	/* loop over samples */&lt;br /&gt;
	for (i1=0; i1 &amp;lt; n1; i1++) {&lt;br /&gt;
	    if      (trace[i1] &amp;gt;  clip) trace[i1]= clip;&lt;br /&gt;
	    else if (trace[i1] &amp;lt; -clip) trace[i1]=-clip;&lt;br /&gt;
	}&lt;br /&gt;
    &lt;br /&gt;
	/* write a trace */&lt;br /&gt;
	sf_floatwrite(trace,n1,out);&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
The rest of the program is straightforward. We loop over all available&lt;br /&gt;
traces, read each trace, clip it and right the output out. The syntax&lt;br /&gt;
of &amp;lt;tt&amp;gt;sf_floatread&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;sf_floatwrite&amp;lt;/tt&amp;gt; functions is&lt;br /&gt;
similar to the syntax of the C standard &amp;lt;tt&amp;gt;fread&amp;lt;/tt&amp;gt; and&lt;br /&gt;
&amp;lt;tt&amp;gt;fwrite&amp;lt;/tt&amp;gt; function except that the type of the element is&lt;br /&gt;
specified explicitly in the function name and that the input and&lt;br /&gt;
output files have the RSF type &amp;lt;tt&amp;gt;sf_file&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
sf_close();&lt;br /&gt;
exit(0)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We explicitly close the input file to avoid leaving a stale temporary file in &amp;lt;tt&amp;gt;$DATAPATH&amp;lt;/tt&amp;gt; if the program is called in a pipe sequence. Then, we close the program by sending the shell the Unix code that tells it no errors were encountered. &lt;br /&gt;
&lt;br /&gt;
Note that this is an introductory example, optimized for clarity, not execution speed. For advanced techniques, see [[Madagascar Code Patterns]].&lt;br /&gt;
&lt;br /&gt;
===Compiling===&lt;br /&gt;
To compile the &amp;lt;tt&amp;gt;clip&amp;lt;/tt&amp;gt; program, run&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cc clip.c -I&amp;amp;#36;RSFROOT/include -L&amp;amp;#36;RSFROOT/lib -lrsf -lm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Change &amp;lt;tt&amp;gt;cc&amp;lt;/tt&amp;gt; to the C compiler appropriate for your system and include&lt;br /&gt;
additional compiler flags if necessary. The flags that RSF typically uses are&lt;br /&gt;
in &amp;lt;tt&amp;gt;&amp;amp;#36;RSFROOT/share/madagascar/etc/config.py&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==C++ interface==&lt;br /&gt;
&lt;br /&gt;
The C++ clip function is listed below.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
/* Clip the data. */&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;valarray&amp;gt;&lt;br /&gt;
#include &amp;lt;rsf.hh&amp;gt;&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char* argv[])&lt;br /&gt;
{&lt;br /&gt;
    sf_init(argc,argv); // Initialize RSF&lt;br /&gt;
    &lt;br /&gt;
    iRSF par(0), in; // input parameter, file&lt;br /&gt;
    oRSF out;        // output file&lt;br /&gt;
&lt;br /&gt;
    int n1, n2;      // trace length, number of traces&lt;br /&gt;
    float clip;&lt;br /&gt;
    &lt;br /&gt;
    in.get(&amp;quot;n1&amp;quot;,n1);&lt;br /&gt;
    n2=in.size(1);&lt;br /&gt;
&lt;br /&gt;
    par.get(&amp;quot;clip&amp;quot;,clip); // parameter from the command line&lt;br /&gt;
&lt;br /&gt;
    std::valarray&amp;lt;float&amp;gt; trace(n1);&lt;br /&gt;
&lt;br /&gt;
    for (int i2=0; i2 &amp;lt; n2; i2++) { // loop over traces&lt;br /&gt;
	in &amp;gt;&amp;gt; trace; // read a trace&lt;br /&gt;
&lt;br /&gt;
	for (int i1=0; i1 &amp;lt; n1; i1++) { // loop over samples&lt;br /&gt;
	    if      (trace[i1] &amp;gt;  clip) trace[i1]=clip;&lt;br /&gt;
	    else if (trace[i1] &amp;lt; -clip) trace[i1]=-clip;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	out &amp;lt;&amp;lt; trace; // write a trace&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    exit(0);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let us examine it line by line. &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;rsf.hh&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Including &amp;quot;&amp;lt;tt&amp;gt;rsf.hh&amp;lt;/tt&amp;gt;&amp;quot; is required for accessing the RSF C++&lt;br /&gt;
interface.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    sf_init(argc,argv); // Initialize RSF&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A call to &amp;lt;tt&amp;gt;sf_init&amp;lt;/tt&amp;gt; is required to initialize the internally stored&lt;br /&gt;
table of command-line arguments.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    iRSF par(0), in; // input parameter, file&lt;br /&gt;
    oRSF out;        // output file&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Two classes: &amp;lt;tt&amp;gt;iRSF&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;oRSF&amp;lt;/tt&amp;gt; are used to define input and&lt;br /&gt;
output files. For simplicity, the command-line parameters are also handled &lt;br /&gt;
as an &amp;lt;tt&amp;gt;iRSF&amp;lt;/tt&amp;gt; object, initialized with zero.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    in.get(&amp;quot;n1&amp;quot;,n1);&lt;br /&gt;
    n2=in.size(1);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, we read the data dimensions from the input RSF file object called&lt;br /&gt;
&amp;lt;tt&amp;gt;in&amp;lt;/tt&amp;gt;: the trace length is a parameter called &amp;quot;&amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt;&amp;quot; and the&lt;br /&gt;
number of traces is the size of &amp;lt;tt&amp;gt;in&amp;lt;/tt&amp;gt; remaining after excluding the&lt;br /&gt;
first dimension. It is extracted with the &amp;lt;tt&amp;gt;size&amp;lt;/tt&amp;gt; method.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    par.get(&amp;quot;clip&amp;quot;,clip); // parameter from the command line&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
The clip parameter should be specified on the command line, for&lt;br /&gt;
example, as &amp;lt;tt&amp;gt;clip=10&amp;lt;/tt&amp;gt;. It is extracted with the &amp;lt;tt&amp;gt;get&amp;lt;/tt&amp;gt;&lt;br /&gt;
method of &amp;lt;tt&amp;gt;iRSF&amp;lt;/tt&amp;gt; class from the &amp;lt;tt&amp;gt;par&amp;lt;/tt&amp;gt; object.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    std::valarray&amp;lt;float&amp;gt; trace(n1);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The trace object has the single-precision floating-point type and is a&lt;br /&gt;
1-D array of length &amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt;. It is declared and allocated using&lt;br /&gt;
the &amp;lt;tt&amp;gt;valarray&amp;lt;/tt&amp;gt; template class from the standard C++ library.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    for (int i2=0; i2 &amp;lt; n2; i2++) { // loop over traces&lt;br /&gt;
	in &amp;gt;&amp;gt; trace; // read a trace&lt;br /&gt;
&lt;br /&gt;
	for (int i1=0; i1 &amp;lt; n1; i1++) { // loop over samples&lt;br /&gt;
	    if      (trace[i1] &amp;gt;  clip) trace[i1]=clip;&lt;br /&gt;
	    else if (trace[i1] &amp;lt; -clip) trace[i1]=-clip;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	out &amp;lt;&amp;lt; trace; // write a trace&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, we loop through the traces, read each trace from &amp;lt;tt&amp;gt;in&amp;lt;/tt&amp;gt;, clip it&lt;br /&gt;
and write the output to &amp;lt;tt&amp;gt;out&amp;lt;/tt&amp;gt;.&lt;br /&gt;
===Compiling===&lt;br /&gt;
To compile the C++ program, run&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
c++ clip.cc -I&amp;amp;#36;RSFROOT/include -L&amp;amp;#36;RSFROOT/lib -lrsf++ -lrsf -lm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Change &amp;lt;tt&amp;gt;c++&amp;lt;/tt&amp;gt; to the C++ compiler appropriate for your system and&lt;br /&gt;
include additional compiler flags if necessary. The flags that RSF typically&lt;br /&gt;
uses are in &amp;lt;tt&amp;gt;&amp;amp;#36;RSFROOT/share/madagascar/etc/config.py&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Fortran-77 interface==&lt;br /&gt;
&lt;br /&gt;
The Fortran-77 clip function is listed below.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
	program Clipit&lt;br /&gt;
	implicit none&lt;br /&gt;
	integer n1, n2, i1, i2, in, out&lt;br /&gt;
	integer sf_input, sf_output, sf_leftsize, sf_gettype&lt;br /&gt;
	logical sf_getfloat, sf_histint&lt;br /&gt;
	real clip, trace(1000)&lt;br /&gt;
&lt;br /&gt;
	call sf_init()&lt;br /&gt;
	in = sf_input(&amp;quot;in&amp;quot;)&lt;br /&gt;
	out = sf_output(&amp;quot;out&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
	if (3 .ne. sf_gettype(in)) &lt;br /&gt;
     &amp;amp;  call sf_error(&amp;quot;Need float input&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
	if (.not. sf_histint(in,&amp;quot;n1&amp;quot;,n1)) then&lt;br /&gt;
	   call sf_error(&amp;quot;No n1= in input&amp;quot;)&lt;br /&gt;
	else if (n1 &amp;gt; 1000) then&lt;br /&gt;
	   call sf_error(&amp;quot;n1 is too long&amp;quot;)&lt;br /&gt;
	end if&lt;br /&gt;
	n2 = sf_leftsize(in,1)&lt;br /&gt;
&lt;br /&gt;
	if (.not. sf_getfloat(&amp;quot;clip&amp;quot;,clip)) &lt;br /&gt;
     &amp;amp;  call sf_error(&amp;quot;Need clip=&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
	do 10 i2=1, n2&lt;br /&gt;
	   call sf_floatread(trace,n1,in)&lt;br /&gt;
&lt;br /&gt;
	   do 20 i1=1, n1&lt;br /&gt;
	      if (trace(i1) &amp;gt;  clip) then&lt;br /&gt;
		 trace(i1)=clip&lt;br /&gt;
	      else if (trace(i1) &amp;lt; -clip) then&lt;br /&gt;
		 trace(i1)=-clip&lt;br /&gt;
	      end if&lt;br /&gt;
 20	   continue&lt;br /&gt;
&lt;br /&gt;
	   call sf_floatwrite(trace,n1,out)&lt;br /&gt;
 10	continue&lt;br /&gt;
&lt;br /&gt;
	stop&lt;br /&gt;
	end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let us examine it in detail.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
	call sf_init()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The program starts with a call to &amp;lt;tt&amp;gt;sf_init&amp;lt;/tt&amp;gt;, which initializes the&lt;br /&gt;
command-line interface.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
	in = sf_input(&amp;quot;in&amp;quot;)&lt;br /&gt;
	out = sf_output(&amp;quot;out&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The input and output files are created with calls to&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_input&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;sf_output&amp;lt;/tt&amp;gt;. Because of the absence of&lt;br /&gt;
derived types in Fortran-77, we use simple integer pointers to&lt;br /&gt;
represent RSF files. Both &amp;lt;tt&amp;gt;sf_input&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;sf_output&amp;lt;/tt&amp;gt;&lt;br /&gt;
accept a character string, which may refer to a file name or a file&lt;br /&gt;
tag. For example, if the command line contains&lt;br /&gt;
&amp;lt;tt&amp;gt;vel=velocity.rsf&amp;lt;/tt&amp;gt;, then both&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_input(&amp;quot;velocity.rsf&amp;quot;)&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;sf_input(&amp;quot;vel&amp;quot;)&amp;lt;/tt&amp;gt; are&lt;br /&gt;
acceptable. Two tags are special: &amp;lt;tt&amp;gt;&amp;quot;in&amp;quot;&amp;lt;/tt&amp;gt; refers to the file in&lt;br /&gt;
the standard input and &amp;lt;tt&amp;gt;&amp;quot;out&amp;quot;&amp;lt;/tt&amp;gt; refers to the file in the&lt;br /&gt;
standard output.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
	if (3 .ne. sf_gettype(in)) &lt;br /&gt;
     &amp;amp;  call sf_error(&amp;quot;Need float input&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
RSF files can store data of different types (character, integer,&lt;br /&gt;
floating point, complex). The function &amp;lt;tt&amp;gt;sf_gettype&amp;lt;/tt&amp;gt; checks the&lt;br /&gt;
type of data stored in the RSF file. We make sure that the type&lt;br /&gt;
corresponds to floating-point numbers. If not, the program is aborted&lt;br /&gt;
with an error message, using the &amp;lt;tt&amp;gt;sf_error&amp;lt;/tt&amp;gt; function.  It is&lt;br /&gt;
generally a good idea to check the input for user errors and, if they&lt;br /&gt;
cannot be corrected, to take a safe exit.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
	if (.not. sf_histint(in,&amp;quot;n1&amp;quot;,n1)) then&lt;br /&gt;
	   call sf_error(&amp;quot;No n1= in input&amp;quot;)&lt;br /&gt;
	else if (n1 &amp;gt; 1000) then&lt;br /&gt;
	   call sf_error(&amp;quot;n1 is too long&amp;quot;)&lt;br /&gt;
	end if&lt;br /&gt;
	n2 = sf_leftsize(in,1)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Conceptually, the RSF data model is a multidimensional hypercube. By&lt;br /&gt;
convention, the dimensions of the cube are stored in &amp;lt;tt&amp;gt;n1=&amp;lt;/tt&amp;gt;,&lt;br /&gt;
&amp;lt;tt&amp;gt;n2=&amp;lt;/tt&amp;gt;, etc. parameters. The &amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt; parameter refers to the&lt;br /&gt;
fastest axis. If the input dataset is a collection of traces,&lt;br /&gt;
&amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt; refers to the trace length. We extract it using the&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_histint&amp;lt;/tt&amp;gt; function (integer parameter from history) and&lt;br /&gt;
abort if no value for &amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt; is found. Since Fortran-77 cannot&lt;br /&gt;
easily handle dynamic allocation, we also need to check that&lt;br /&gt;
&amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt; is not larger than the size of the statically allocated&lt;br /&gt;
array. We could proceed in a similar fashion, extracting &amp;lt;tt&amp;gt;n2&amp;lt;/tt&amp;gt;,&lt;br /&gt;
&amp;lt;tt&amp;gt;n3&amp;lt;/tt&amp;gt;, etc. If we are interested in the total number of traces,&lt;br /&gt;
like in the clip example, a shortcut is to use the&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_leftsize&amp;lt;/tt&amp;gt; function.  Calling &amp;lt;tt&amp;gt;sf_leftsize(in,0)&amp;lt;/tt&amp;gt;&lt;br /&gt;
returns the total number of elements in the hypercube (the product of&lt;br /&gt;
&amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;n2&amp;lt;/tt&amp;gt;, etc.), calling &amp;lt;tt&amp;gt;sf_leftsize(in,1)&amp;lt;/tt&amp;gt;&lt;br /&gt;
returns the number of traces (the product of &amp;lt;tt&amp;gt;n2&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;n3&amp;lt;/tt&amp;gt;,&lt;br /&gt;
etc.), calling &amp;lt;tt&amp;gt;sf_leftsize(in,2)&amp;lt;/tt&amp;gt; returns the product of&lt;br /&gt;
&amp;lt;tt&amp;gt;n3&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;n4&amp;lt;/tt&amp;gt;, etc. By calling &amp;lt;tt&amp;gt;sf_leftsize&amp;lt;/tt&amp;gt;, we&lt;br /&gt;
avoid the need to extract additional parameters for the hypercube&lt;br /&gt;
dimensions that we are not interested in.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
	if (.not. sf_getfloat(&amp;quot;clip&amp;quot;,clip)) &lt;br /&gt;
     &amp;amp;  call sf_error(&amp;quot;Need clip=&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The clip parameter is read from the command line, where it can be&lt;br /&gt;
specified, for example, as &amp;lt;tt&amp;gt;clip=10&amp;lt;/tt&amp;gt;. The parameter has the&lt;br /&gt;
&amp;lt;tt&amp;gt;float&amp;lt;/tt&amp;gt; type, therefore we read it with the&lt;br /&gt;
&amp;lt;tt&amp;gt;sf_getfloat&amp;lt;/tt&amp;gt; function. If no &amp;lt;tt&amp;gt;clip=&amp;lt;/tt&amp;gt; parameter is&lt;br /&gt;
found among the command line arguments, the program is aborted with an&lt;br /&gt;
error message using the &amp;lt;tt&amp;gt;sf_error&amp;lt;/tt&amp;gt; function.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
	do 10 i2=1, n2&lt;br /&gt;
	   call sf_floatread(trace,n1,in)&lt;br /&gt;
&lt;br /&gt;
	   do 20 i1=1, n1&lt;br /&gt;
	      if (trace(i1) &amp;gt;  clip) then&lt;br /&gt;
		 trace(i1)=clip&lt;br /&gt;
	      else if (trace(i1) &amp;lt; -clip) then&lt;br /&gt;
		 trace(i1)=-clip&lt;br /&gt;
	      end if&lt;br /&gt;
 20	   continue&lt;br /&gt;
&lt;br /&gt;
	   call sf_floatwrite(trace,n1,out)&lt;br /&gt;
 10	continue&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, we do the actual work: loop over input traces, reading,&lt;br /&gt;
clipping, and writing out each trace.&lt;br /&gt;
===Compiling===&lt;br /&gt;
To compile the Fortran-77 program, run&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
f77 clip.f -L$RSFROOT/lib -lrsff -lrsf -lm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Change &amp;lt;tt&amp;gt;f77&amp;lt;/tt&amp;gt; to the Fortran compiler appropriate for your system and&lt;br /&gt;
include additional compiler flags if necessary. The flags that RSF typically&lt;br /&gt;
uses are in &amp;lt;tt&amp;gt;&amp;amp;#36;RSFROOT/share/madagascar/etc/config.py&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Fortran-90 interface==&lt;br /&gt;
&lt;br /&gt;
The Fortran-90 clip function is listed below.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
program Clipit&lt;br /&gt;
  use rsf&lt;br /&gt;
&lt;br /&gt;
  implicit none&lt;br /&gt;
  type (file)                      :: in, out&lt;br /&gt;
  integer                          :: n1, n2, i1, i2&lt;br /&gt;
  real                             :: clip&lt;br /&gt;
  real, dimension (:), allocatable :: trace&lt;br /&gt;
&lt;br /&gt;
  call sf_init()            ! initialize RSF&lt;br /&gt;
  in = rsf_input()&lt;br /&gt;
  out = rsf_output()&lt;br /&gt;
&lt;br /&gt;
  if (sf_float /= gettype(in)) call sf_error(&amp;quot;Need float type&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
  call from_par(in,&amp;quot;n1&amp;quot;,n1)&lt;br /&gt;
  n2 = filesize(in,1)&lt;br /&gt;
&lt;br /&gt;
  call from_par(&amp;quot;clip&amp;quot;,clip) ! command-line parameter &lt;br /&gt;
&lt;br /&gt;
  allocate (trace (n1))&lt;br /&gt;
&lt;br /&gt;
  do i2=1, n2                ! loop over traces&lt;br /&gt;
     call rsf_read(in,trace)&lt;br /&gt;
     &lt;br /&gt;
     where (trace &amp;gt;  clip) trace =  clip&lt;br /&gt;
     where (trace &amp;lt; -clip) trace = -clip&lt;br /&gt;
&lt;br /&gt;
     call rsf_write(out,trace)&lt;br /&gt;
  end do&lt;br /&gt;
&lt;br /&gt;
  deallocate (trace)&lt;br /&gt;
&lt;br /&gt;
end program Clipit&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let us examine it in detail.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
  use rsf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The program starts with importing the &amp;lt;tt&amp;gt;rsf&amp;lt;/tt&amp;gt; module.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
  call sf_init()            ! initialize RSF&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A call to &amp;lt;tt&amp;gt;sf_init&amp;lt;/tt&amp;gt; is needed to initialize the command-line&lt;br /&gt;
interface.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
  in = rsf_input()&lt;br /&gt;
  out = rsf_output()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The standard input and output files are initialized with&lt;br /&gt;
&amp;lt;tt&amp;gt;rsf_input&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;rsf_output&amp;lt;/tt&amp;gt; functions. Both functions&lt;br /&gt;
accept optional arguments. For example, if the command line contains&lt;br /&gt;
&amp;lt;tt&amp;gt;vel=velocity.rsf&amp;lt;/tt&amp;gt;, then both&lt;br /&gt;
&amp;lt;tt&amp;gt;rsf_input(&amp;quot;velocity.rsf&amp;quot;)&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;rsf_input(&amp;quot;vel&amp;quot;)&amp;lt;/tt&amp;gt; are&lt;br /&gt;
acceptable.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
  if (sf_float /= gettype(in)) call sf_error(&amp;quot;Need float type&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A call to &amp;lt;tt&amp;gt;from_par&amp;lt;/tt&amp;gt; extracts the &amp;quot;&amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt;&amp;quot; parameter&lt;br /&gt;
from the input file. Conceptually, the RSF data model is a&lt;br /&gt;
multidimensional hypercube.  The &amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt; parameter refers to the&lt;br /&gt;
fastest axis. If the input dataset is a collection of traces,&lt;br /&gt;
&amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt; corresponds to the trace length. We could proceed in a&lt;br /&gt;
similar fashion, extracting &amp;lt;tt&amp;gt;n2&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;n3&amp;lt;/tt&amp;gt;, etc. If we are&lt;br /&gt;
interested in the total number of traces, like in the clip example, a&lt;br /&gt;
shortcut is to use the &amp;lt;tt&amp;gt;filesize&amp;lt;/tt&amp;gt; function.  Calling&lt;br /&gt;
&amp;lt;tt&amp;gt;filesize(in)&amp;lt;/tt&amp;gt; returns the total number of elements in the&lt;br /&gt;
hypercube (the product of &amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;n2&amp;lt;/tt&amp;gt;, etc.), calling&lt;br /&gt;
&amp;lt;tt&amp;gt;filesize(in,1)&amp;lt;/tt&amp;gt; returns the number of traces (the product of&lt;br /&gt;
&amp;lt;tt&amp;gt;n2&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;n3&amp;lt;/tt&amp;gt;, etc.), calling &amp;lt;tt&amp;gt;filesize(in,2)&amp;lt;/tt&amp;gt;&lt;br /&gt;
returns the product of &amp;lt;tt&amp;gt;n3&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;n4&amp;lt;/tt&amp;gt;, etc. By calling&lt;br /&gt;
&amp;lt;tt&amp;gt;filesize&amp;lt;/tt&amp;gt;, we avoid the need to extract additional parameters&lt;br /&gt;
for the hypercube dimensions that we are not interested in.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
  n2 = filesize(in,1)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The clip parameter is read from the command line, where it can be&lt;br /&gt;
specified, for example, as &amp;lt;tt&amp;gt;clip=10&amp;lt;/tt&amp;gt;. If we knew a good default&lt;br /&gt;
value for &amp;lt;tt&amp;gt;clip&amp;lt;/tt&amp;gt;, we could specify it with an optional&lt;br /&gt;
argument, i.e. &amp;lt;tt&amp;gt;call~from_par(&amp;quot;clip&amp;quot;,clip,default)&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
  allocate (trace (n1))&lt;br /&gt;
&lt;br /&gt;
  do i2=1, n2                ! loop over traces&lt;br /&gt;
     call rsf_read(in,trace)&lt;br /&gt;
     &lt;br /&gt;
     where (trace &amp;gt;  clip) trace =  clip&lt;br /&gt;
     where (trace &amp;lt; -clip) trace = -clip&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, we do the actual work: loop over input traces, reading,&lt;br /&gt;
clipping, and writing out each trace.&lt;br /&gt;
===Compiling===&lt;br /&gt;
To compile the Fortran-90 program, run&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
f90 clip.f90 -I&amp;amp;#36;RSFROOT/include -L&amp;amp;#36;RSFROOT/lib -lrsff90 -lrsf -lm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Change &amp;lt;tt&amp;gt;f90&amp;lt;/tt&amp;gt; to the Fortran-90 compiler appropriate for your system and&lt;br /&gt;
include additional compiler flags if necessary. The flags that RSF typically&lt;br /&gt;
uses are in &amp;lt;tt&amp;gt;&amp;amp;#36;RSFROOT/share/madagasacar/etc/config.py&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The complete specification for the F90 API can be found [[Library_Reference#Fortran_90_API | on the Library Reference page]].&lt;br /&gt;
&lt;br /&gt;
==Python interface==&lt;br /&gt;
Examples that use the python interface are in the directory $RSFSRC/api/python/test.&lt;br /&gt;
&lt;br /&gt;
The Python script clip.py is:.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
#!/usr/bin/env python&lt;br /&gt;
&lt;br /&gt;
import numpy&lt;br /&gt;
import m8r&lt;br /&gt;
&lt;br /&gt;
par = m8r.Par()&lt;br /&gt;
inp  = m8r.Input()&lt;br /&gt;
output = m8r.Output()&lt;br /&gt;
assert &#039;float&#039; == inp.type&lt;br /&gt;
&lt;br /&gt;
n1 = inp.int(&amp;quot;n1&amp;quot;)&lt;br /&gt;
n2 = inp.size(1)&lt;br /&gt;
assert n1&lt;br /&gt;
&lt;br /&gt;
clip = par.float(&amp;quot;clip&amp;quot;)&lt;br /&gt;
assert clip&lt;br /&gt;
&lt;br /&gt;
trace = numpy.zeros(n1,&#039;f&#039;)&lt;br /&gt;
&lt;br /&gt;
for i2 in xrange(n2): # loop over traces&lt;br /&gt;
    inp.read(trace)&lt;br /&gt;
    trace = numpy.clip(trace,-clip,clip)&lt;br /&gt;
    output.write(trace)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let us examine it in detail. &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import numpy&lt;br /&gt;
import m8r&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The script starts with importing the &amp;lt;tt&amp;gt;numpy&amp;lt;/tt&amp;gt; module and the&lt;br /&gt;
&amp;lt;tt&amp;gt;m8r&amp;lt;/tt&amp;gt; API.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
par = m8r.Par()&lt;br /&gt;
inp  = m8r.Input()&lt;br /&gt;
output = m8r.Output()&lt;br /&gt;
assert &#039;float&#039; == inp.type&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, we initialize the command line interface and the standard input and&lt;br /&gt;
output files. We also make sure that the input file type is floating point.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
n1 = input.int(&amp;quot;n1&amp;quot;)&lt;br /&gt;
n2 = input.size(1)&lt;br /&gt;
assert n1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We extract the &amp;quot;&amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt;&amp;quot; parameter from the input file.&lt;br /&gt;
Conceptually, the RSF data model is a multidimensional hypercube.  The&lt;br /&gt;
&amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt; parameter refers to the fastest axis. If the input dataset&lt;br /&gt;
is a collection of traces, &amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt; corresponds to the trace&lt;br /&gt;
length. We could proceed in a similar fashion, extracting &amp;lt;tt&amp;gt;n2&amp;lt;/tt&amp;gt;,&lt;br /&gt;
&amp;lt;tt&amp;gt;n3&amp;lt;/tt&amp;gt;, etc. If we are interested in the total number of traces,&lt;br /&gt;
like in the clip example, a shortcut is to use the &amp;lt;tt&amp;gt;size&amp;lt;/tt&amp;gt;&lt;br /&gt;
method of the &amp;lt;tt&amp;gt;Input&amp;lt;/tt&amp;gt; class.  Calling &amp;lt;tt&amp;gt;size(0)&amp;lt;/tt&amp;gt; returns&lt;br /&gt;
the total number of elements in the hypercube (the product of&lt;br /&gt;
&amp;lt;tt&amp;gt;n1&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;n2&amp;lt;/tt&amp;gt;, etc.), calling &amp;lt;tt&amp;gt;size(1)&amp;lt;/tt&amp;gt; returns the&lt;br /&gt;
number of traces (the product of &amp;lt;tt&amp;gt;n2&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;n3&amp;lt;/tt&amp;gt;, etc.),&lt;br /&gt;
calling &amp;lt;tt&amp;gt;size(2)&amp;lt;/tt&amp;gt; returns the product of &amp;lt;tt&amp;gt;n3&amp;lt;/tt&amp;gt;,&lt;br /&gt;
&amp;lt;tt&amp;gt;n4&amp;lt;/tt&amp;gt;, etc.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
clip = par.float(&amp;quot;clip&amp;quot;)&lt;br /&gt;
assert clip&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The clip parameter is read from the command line, where it can be specified,&lt;br /&gt;
for example, as &amp;lt;tt&amp;gt;clip=10&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
for i2 in xrange(n2): # loop over traces&lt;br /&gt;
    inp.read(trace)&lt;br /&gt;
    trace = numpy.clip(trace,-clip,clip)&lt;br /&gt;
    output.write(trace)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, we do the actual work: loop over input traces, reading,&lt;br /&gt;
clipping, and writing out each trace.&lt;br /&gt;
&lt;br /&gt;
===Compiling===&lt;br /&gt;
The python script does not require compilation. Simply make sure that&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;amp;#36;RSFROOT/lib&amp;lt;/tt&amp;gt; is in &amp;lt;tt&amp;gt;PYTHONPATH&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;LD_LIBRARY_PATH&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Interactive mode usage without graphics===&lt;br /&gt;
Madagascar&#039;s Python API can be used interactively too. Create an input dataset with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sfmath n1=10 n2=5 output=x1+x2*100 &amp;gt; test.rsf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, start the python interpreter and paste the following to its command line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import numpy, m8r&lt;br /&gt;
&lt;br /&gt;
inp = m8r.Input(&#039;test.rsf&#039;)&lt;br /&gt;
n1 = inp.int(&amp;quot;n1&amp;quot;)&lt;br /&gt;
n2 = inp.int(&amp;quot;n2&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
data =inp.read(shape=(n2,n1))&lt;br /&gt;
data = data.transpose() # Example of numpy in action&lt;br /&gt;
&lt;br /&gt;
print data&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[[  0. 100. 200. 300. 400.]&lt;br /&gt;
 [  1. 101. 201. 301. 401.]&lt;br /&gt;
 [  2. 102. 202. 302. 402.]&lt;br /&gt;
 [  3. 103. 203. 303. 403.]&lt;br /&gt;
 [  4. 104. 204. 304. 404.]&lt;br /&gt;
 [  5. 105. 205. 305. 405.]&lt;br /&gt;
 [  6. 106. 206. 306. 406.]&lt;br /&gt;
 [  7. 107. 207. 307. 407.]&lt;br /&gt;
 [  8. 108. 208. 308. 408.]&lt;br /&gt;
 [  9. 109. 209. 309. 409.]]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code will also work in batch mode in a Python script, not only pasted to the interpreter&#039;s command line. &lt;br /&gt;
&lt;br /&gt;
===Graphics with Matplotlib===&lt;br /&gt;
Python can plot arrays directly from memory, without having to write a file to disk first. [http://matplotlib.sourceforge.net/ Matplotlib] is one of the [http://en.wikipedia.org/wiki/Category:Free_plotting_software several] packages that accomplish this. To create a figure, execute the code in the previous section, followed by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from pylab import *&lt;br /&gt;
imshow(data)&lt;br /&gt;
xlabel(&#039;X (m)&#039;)&lt;br /&gt;
ylabel(&#039;Y (m)&#039;)&lt;br /&gt;
title(&#039;Matplotlib example&#039;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to pop up a figure in an interactive session, after pasting to a Python command line the code shown before, also paste:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
show()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will get Figure 1. The figure will pop up if you run the code in a script too, and the script will stop until the figure is manually closed. You must press the floppy disk button in order to save it. To have the image written to disk automatically, instead of &amp;lt;tt&amp;gt;show()&amp;lt;/tt&amp;gt; use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
savefig(&#039;myfile.png&#039;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:matplotlib_imshow.png]]&lt;br /&gt;
&lt;br /&gt;
Putting it all together, here is a sample script reading a RSF file from stdin and printing out a figure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
#!/usr/bin/env python&lt;br /&gt;
import rsf.api, numpy, sys, pylab&lt;br /&gt;
&lt;br /&gt;
input = rsf.api.Input(&#039;test.rsf&#039;)&lt;br /&gt;
n1 = input.int(&amp;quot;n1&amp;quot;)&lt;br /&gt;
n2 = input.int(&amp;quot;n2&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
data = numpy.zeros((n2,n1),&#039;f&#039;)&lt;br /&gt;
input.read(data)&lt;br /&gt;
&lt;br /&gt;
pylab.imshow(data)&lt;br /&gt;
pylab.savefig(&#039;out.png&#039;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
===Python interfaces to the standalone programs===&lt;br /&gt;
The &amp;lt;tt&amp;gt;m8r&amp;lt;/tt&amp;gt; module offers a way to call Madagascar standalone programs (including graphics) elegantly from inside a Python program, interactively or in batch mode. The blog contains examples of running the &amp;lt;tt&amp;gt;m8r&amp;lt;/tt&amp;gt; module [http://www.ahay.org/rsflog/index.php?/archives/173-Extending-Python-interface.html from inside a SAGE notebook] or [http://www.ahay.org/rsflog/index.php?/archives/264-Running-Madagascar-in-an-interactive-console.html from inside an iPython shell].&lt;br /&gt;
&lt;br /&gt;
==MATLAB interface==&lt;br /&gt;
&lt;br /&gt;
The MATLAB clip function is listed below.&lt;br /&gt;
&amp;lt;matlab&amp;gt;&lt;br /&gt;
function clip(in,out,clip)&lt;br /&gt;
%CLIP Clip the data&lt;br /&gt;
&lt;br /&gt;
dims = rsf_dim(in);&lt;br /&gt;
n1 = dims(1);           % trace length&lt;br /&gt;
n2 = prod(dims(2:end)); % number of traces&lt;br /&gt;
trace = 1:n1;           % allocate trace&lt;br /&gt;
rsf_create(out,in)      % create an output file&lt;br /&gt;
&lt;br /&gt;
for i2 = 1:n2           % loop over traces&lt;br /&gt;
    rsf_read(trace,in,&#039;same&#039;);&lt;br /&gt;
    trace(trace &amp;gt;   clip) =  clip;&lt;br /&gt;
    trace(trace &amp;lt; - clip) = -clip;&lt;br /&gt;
    rsf_write(trace,out,&#039;same&#039;);&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/matlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let us examine it in detail. &lt;br /&gt;
&amp;lt;matlab&amp;gt;&lt;br /&gt;
dims = rsf_dim(in);&lt;br /&gt;
&amp;lt;/matlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We start by figuring out the input file dimensions.&lt;br /&gt;
&amp;lt;matlab&amp;gt;&lt;br /&gt;
n1 = dims(1);           % trace length&lt;br /&gt;
n2 = prod(dims(2:end)); % number of traces&lt;br /&gt;
&amp;lt;/matlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first dimension is the trace length, the product of all other&lt;br /&gt;
dimensions correspond to the number of traces.&lt;br /&gt;
&amp;lt;matlab&amp;gt;&lt;br /&gt;
trace = 1:n1;           % allocate trace&lt;br /&gt;
rsf_create(out,in)      % create an output file&lt;br /&gt;
&amp;lt;/matlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, we allocate the trace array and create an output file.&lt;br /&gt;
&amp;lt;matlab&amp;gt;&lt;br /&gt;
for i2 = 1:n2           % loop over traces&lt;br /&gt;
    rsf_read(trace,in,&#039;same&#039;);&lt;br /&gt;
    trace(trace &amp;gt;   clip) =  clip;&lt;br /&gt;
    trace(trace &amp;lt; - clip) = -clip;&lt;br /&gt;
    rsf_write(trace,out,&#039;same&#039;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/matlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, we do the actual work: loop over input traces, reading,&lt;br /&gt;
clipping, and writing out each trace.&lt;br /&gt;
===Available functions===&lt;br /&gt;
Only some of the functions in the &amp;lt;tt&amp;gt;rsf&amp;lt;/tt&amp;gt; library have received a MATLAB interface. These functions are &amp;lt;tt&amp;gt;rsf_par&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;rsf_dim&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;rsf_read&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;rsf_write&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;rsf_create&amp;lt;/tt&amp;gt;. All these functions except &amp;lt;tt&amp;gt;rsf_par&amp;lt;/tt&amp;gt; have been illustrated in the example above.&lt;br /&gt;
===Compiling===&lt;br /&gt;
The MATLAB script does not require compilation. Simply make sure that&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;amp;#36;RSFROOT/lib&amp;lt;/tt&amp;gt; is in &amp;lt;tt&amp;gt;MATLABPATH&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;LD_LIBRARY_PATH&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Java Interface==&lt;br /&gt;
There are two interfaces to Java that are available.  New codes should be written to use the SWIG interface ONLY.  The older interface (using the MINES JTK) is deprecated, and is only provided while users migrate their code to the new interface.&lt;br /&gt;
&lt;br /&gt;
===SWIG===&lt;br /&gt;
&lt;br /&gt;
To install the SWIG interface:&lt;br /&gt;
&lt;br /&gt;
1 - Download the Java Standard Development Kit (JDK).  Installation varies by platform.&lt;br /&gt;
&lt;br /&gt;
2 - Create the JAVA_HOME environment variable for your shell.  This should point to the directory where the JDK was installed. Example (for Ubuntu 10.04):&lt;br /&gt;
&amp;lt;bash&amp;gt;&lt;br /&gt;
export JAVA_HOME=/usr/lib/jvm/java-6-opensdk&lt;br /&gt;
&amp;lt;/bash&amp;gt;&lt;br /&gt;
3 - Reconfigure Madagascar:&lt;br /&gt;
&amp;lt;bash&amp;gt;&lt;br /&gt;
./configure API=java&lt;br /&gt;
&amp;lt;/bash&amp;gt;&lt;br /&gt;
4 - Reinstall Madagascar (Ignore the compilation warnings for Java files):&lt;br /&gt;
&amp;lt;bash&amp;gt;&lt;br /&gt;
scons; scons install&lt;br /&gt;
&amp;lt;/bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The installation creates two files:  $RSFROOT/lib/libjrsf.so and $RSFROOT/lib/rsf.jar .&lt;br /&gt;
&lt;br /&gt;
Make sure that you set your LD_LIBRARY_PATH to include $RSFROOT/lib.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A short demonstration of the interface follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;java&amp;gt;&lt;br /&gt;
import rsf.RSF;&lt;br /&gt;
import rsf.Input;&lt;br /&gt;
import rsf.Output;&lt;br /&gt;
&lt;br /&gt;
/* A simple Java program to clip a dataset. */&lt;br /&gt;
&lt;br /&gt;
public class Clip {&lt;br /&gt;
    static {&lt;br /&gt;
        System.loadLibrary(&amp;quot;jrsf&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    public static void main(String[] args){&lt;br /&gt;
        // Initialize command line argument passing&lt;br /&gt;
         RSF par = new RSF(args);&lt;br /&gt;
         // Get the input file name.&lt;br /&gt;
         Input input = new Input(&amp;quot;in&amp;quot;);&lt;br /&gt;
         Output output = new Output(&amp;quot;out&amp;quot;);&lt;br /&gt;
        // Get the value to clip to.&lt;br /&gt;
         float clip = par.getFloat(&amp;quot;clip&amp;quot;,0.0f);&lt;br /&gt;
        // Read our input header&lt;br /&gt;
        int n3 = input.getN(3);&lt;br /&gt;
        int n2 = input.getN(2);&lt;br /&gt;
        int n1 = input.getN(1);&lt;br /&gt;
        //Perform clipping operation on a single trace and write out.&lt;br /&gt;
        float[] data = new float[n1];&lt;br /&gt;
         for(int i = 0; i &amp;lt; n3; ++i){&lt;br /&gt;
            for(int j = 0; j &amp;lt; n2; ++j){&lt;br /&gt;
                input.read(data);&lt;br /&gt;
                for(int k = 0; k &amp;lt; n1; ++k){&lt;br /&gt;
                    if (data[k] &amp;gt; clip) data[k] = clip;&lt;br /&gt;
                    else if (data[k] &amp;lt; -clip) data[k] = -clip;&lt;br /&gt;
                }&lt;br /&gt;
                output.write(data);&lt;br /&gt;
            }&lt;br /&gt;
         }&lt;br /&gt;
         output.setN(1,n1);&lt;br /&gt;
         output.setN(2,n2);&lt;br /&gt;
         output.setN(3,n3);&lt;br /&gt;
         input.close();&lt;br /&gt;
         output.close();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/java&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are only three classes in the interface:&lt;br /&gt;
&lt;br /&gt;
1 -- RSF - The command line argument parser, and the initializer for the native interface.  An RSF object MUST be instantiated BEFORE instantiating an Input or Output object.&lt;br /&gt;
&lt;br /&gt;
2 -- Input - An object that provides read access to an RSF file.  &lt;br /&gt;
&lt;br /&gt;
3 -- Output - An object that provides write access to an RSF file.&lt;br /&gt;
&lt;br /&gt;
Additionally, the shared library (libjrsf.so or libjrsf.dll) must be included via the System.loadLibrary(&amp;quot;jrsf&amp;quot;); as the first command in the file.&lt;br /&gt;
&lt;br /&gt;
To compile on the command line:&lt;br /&gt;
&amp;lt;bash&amp;gt;&lt;br /&gt;
javac -cp $RSFROOT/lib Clip.java&lt;br /&gt;
&amp;lt;/bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To include this as part of a SCons script (SConstruct):&lt;br /&gt;
&amp;lt;python&amp;gt;&lt;br /&gt;
from rsf.proj import *&lt;br /&gt;
&lt;br /&gt;
# Compiles Clip.class&lt;br /&gt;
project.Java(&#039;.&#039;,&#039;Clip.java&#039;)&lt;br /&gt;
&lt;br /&gt;
Flow(&#039;dat&#039;,None,&#039;spike n1=1000 n2=100 n3=10 nsp=1 k1=500 l1=1000&#039;)&lt;br /&gt;
Flow(&#039;clipd&#039;,&#039;dat Clip.class&#039;,&lt;br /&gt;
    &#039;&#039;&#039;&lt;br /&gt;
    %s Clip clip=0.5&lt;br /&gt;
    &#039;&#039;&#039; % WhereIs(&#039;java&#039;))&lt;br /&gt;
Flow(&#039;test.attr&#039;,&#039;clipd&#039;,&#039;sfattr&#039;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/python&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note, that we compile Clip.java using the SCons Java builder.  To execute the command, we have to locate the &amp;quot;java&amp;quot; command, which we do using WhereIs(&#039;java&#039;).  Then we execute the class name, and pass any command line arguments as usual.  The files are read from standard in for this program and written to standard out.  &lt;br /&gt;
&lt;br /&gt;
Please see the [[Library Reference]] for more details on the functions available in the SWIG API.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note: Additional Java packages can included in SCons automatically by setting the CLASSPATH environment variable to point to the JAR files that they are contained in.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Mines JTK===&lt;br /&gt;
&#039;&#039;&#039;THIS INTERFACE IS DEPRECATED AND ONLY PROVIDED AS A REFERENCE.  THIS INTERFACE IS NO LONGER SUPPORTED AND WILL BE REMOVED&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This interface may still be compiled by specifying the MINESJTK environment variable. &lt;br /&gt;
&lt;br /&gt;
The interface to Java is less full featured than others.  Presently, it only allows you to read RSF files with fewer than 4-dimensions into Java, and then export RSF files.  &#039;&#039;&#039;The Java interface does not support reading from standard in, or writing from standard out.  Therefore, the Java Interface does not support piping either.&#039;&#039;&#039; The Java interface at present treats all values as floats, and does not have support for complex numbers.  Java programs are not parsed for self-doc information like other programs are either.  Using javadoc may be a viable alternative to creating a parsing engine for Java programs.&lt;br /&gt;
&lt;br /&gt;
Once the build is complete, the JAR file rsf.jar will be added to your $RSFROOT/lib folder.  &lt;br /&gt;
&lt;br /&gt;
There are two ways to access the API:&lt;br /&gt;
&lt;br /&gt;
1 - From the command line:  point the classpath at BOTH compile and runtime to this location on the command line.&lt;br /&gt;
&amp;lt;bash&amp;gt;&lt;br /&gt;
javac -cp $MINESJTK:$RSFROOT/lib/rsf.jar:. Test.java &lt;br /&gt;
java -cp $MINESJTK:$RSFROOT/lib/rsf.jar:. Test arg1=... arg2=... arg3=...&lt;br /&gt;
&amp;lt;/bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2 - From within a SConstruct script:  BOTH the path for the API ($RSFROOT/lib) and the path to the Mines JTK ($MINESJTK) are automatically added to the environment variable CLASSPATH and JAVACLASSPATH for executions made within an SConstruct.  Additionally, any additional classes that are already in the CLASSPATH environmental variable in the shell that you launch from will be added to your classpath.  This allows you to include additional libraries automatically within your Java programs.  The local directory (.) is also included in the CLASSPATH.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;python&amp;gt;&lt;br /&gt;
from rsf.proj import *&lt;br /&gt;
&lt;br /&gt;
# Compiles Clip.class&lt;br /&gt;
project.Java(&#039;.&#039;,&#039;Clip.java&#039;)&lt;br /&gt;
&lt;br /&gt;
Flow(&#039;dat&#039;,None,&#039;spike n1=1000 n2=100 n3=10 nsp=1 k1=500&#039;)&lt;br /&gt;
Flow(&#039;clipd&#039;,&#039;Clip.class dat&#039;,&lt;br /&gt;
    &#039;&#039;&#039;&lt;br /&gt;
    %s ${SOURCES[0].filebase} clip=0.5 &lt;br /&gt;
    in=${SOURCES[1]} out=$TARGET &lt;br /&gt;
    &#039;&#039;&#039; % WhereIs(&#039;java&#039;),stdin=0,stdout=-1)&lt;br /&gt;
Flow(&#039;test.attr&#039;,&#039;clipd&#039;,&#039;sfattr&#039;)&lt;br /&gt;
&lt;br /&gt;
End()&lt;br /&gt;
&amp;lt;/python&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The interface itself is fairly straightforward.  More details on the methods exposed by the API can be found at the [[Library_Reference#Java_API | Library Reference]].&lt;br /&gt;
&lt;br /&gt;
Data clipping, argument parsing, and IO example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;java&amp;gt;&lt;br /&gt;
import rsf.Par;&lt;br /&gt;
import rsf.Reader;&lt;br /&gt;
import rsf.Writer;&lt;br /&gt;
import rsf.Header;&lt;br /&gt;
&lt;br /&gt;
/* A simple Java program to clip a dataset.&lt;br /&gt;
&lt;br /&gt;
Presently, there is no automatic self-documentation generation for use&lt;br /&gt;
with sfdoc.  Javadoc may be a better way to generate self-doc for Java&lt;br /&gt;
programs.&lt;br /&gt;
&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
public class Clip {&lt;br /&gt;
    public static void main(String[] args){&lt;br /&gt;
        // Initialize command line argument passing&lt;br /&gt;
         Par par = new Par(args);&lt;br /&gt;
         // Get the input file name.&lt;br /&gt;
         String input = par.getString(&amp;quot;in&amp;quot;,&amp;quot;&amp;quot;);&lt;br /&gt;
         // If the input file name is nothing, then quit!&lt;br /&gt;
         if (input.equals(&amp;quot;&amp;quot;)){&lt;br /&gt;
                System.out.println(&amp;quot;Did not find input file!&amp;quot;);&lt;br /&gt;
                System.exit(1);&lt;br /&gt;
         }&lt;br /&gt;
         //If the output file name is nothing, then quit!&lt;br /&gt;
         String output = par.getString(&amp;quot;out&amp;quot;,&amp;quot;&amp;quot;);&lt;br /&gt;
         if (output.equals(&amp;quot;&amp;quot;)){&lt;br /&gt;
                System.out.println(&amp;quot;Did not find output file!&amp;quot;);&lt;br /&gt;
                System.exit(1);&lt;br /&gt;
         }&lt;br /&gt;
        // Get the value to clip to.&lt;br /&gt;
         float clip = par.getFloat(&amp;quot;clip&amp;quot;,0.0f);&lt;br /&gt;
        //Read our header file.&lt;br /&gt;
         Header header = Reader.readHeader(input);&lt;br /&gt;
        // Read our binary data.&lt;br /&gt;
         float[][][] data = Reader.readBinary3D(header);&lt;br /&gt;
        //Initialize our array values.&lt;br /&gt;
         int n3 = header.getN(3);&lt;br /&gt;
         int n2 = header.getN(2);&lt;br /&gt;
         int n1 = header.getN(1);&lt;br /&gt;
        //Perform clipping operation.&lt;br /&gt;
         for(int i = 0; i &amp;lt; n3; ++i){&lt;br /&gt;
            for(int j = 0; j &amp;lt; n2; ++j){&lt;br /&gt;
                for(int k = 0; k &amp;lt; n1; ++k){&lt;br /&gt;
                    float trace = data[i][j][k];&lt;br /&gt;
                    if (trace &amp;gt; clip) data[i][j][k] = clip;&lt;br /&gt;
                    else if (trace &amp;lt; -clip) data[i][j][k] = -clip;&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
         }&lt;br /&gt;
        //Write our data out, using the same header values to the file&lt;br /&gt;
        //located at: output.&lt;br /&gt;
         Writer.writeRSF(header,data,output);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/java&amp;gt;&lt;br /&gt;
&lt;br /&gt;
How to read a file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;java&amp;gt;&lt;br /&gt;
&lt;br /&gt;
import rsf.Header;&lt;br /&gt;
import rsf.Reader;&lt;br /&gt;
import rsf.Writer;&lt;br /&gt;
&lt;br /&gt;
public class Test {&lt;br /&gt;
      public static void main(String[] args){&lt;br /&gt;
&lt;br /&gt;
                Header header = Reader.readHeader(&amp;quot;junk.rsf&amp;quot;); //To read the header file, just feed in the path relative to the execution directory&lt;br /&gt;
                System.out.println(header); //The header file will print out if you ask it to, this is good for debugging&lt;br /&gt;
&lt;br /&gt;
                float[][] data = Reader.readBinary2D(header); //Now I can manipulate my data&lt;br /&gt;
       }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/java&amp;gt;&lt;br /&gt;
&lt;br /&gt;
How to write a file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;java&amp;gt;&lt;br /&gt;
import rsf.Header;&lt;br /&gt;
import rsf.Reader;&lt;br /&gt;
import rsf.Writer;&lt;br /&gt;
&lt;br /&gt;
public class Test {&lt;br /&gt;
      public static void main(String[] args){&lt;br /&gt;
                &lt;br /&gt;
                Header header = Reader.readHeader(&amp;quot;test.rsf&amp;quot;); //To read the header file, just feed in the path relative to the execution directory&lt;br /&gt;
                System.out.println(header); //The header file will print out if you ask it to, this is good for debugging&lt;br /&gt;
&lt;br /&gt;
                float[][] data = Reader.readBinary2D(header); //Now I can manipulate my data&lt;br /&gt;
&lt;br /&gt;
                //...Do something&lt;br /&gt;
                Writer.writeRSF(header,data,&amp;quot;test2.rsf&amp;quot;); //Write out my data!&lt;br /&gt;
       }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/java&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to create a dataset from scratch from within Java, then you can create an array of data, modify the values, create a header, and then write it out to rsf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;java&amp;gt;&lt;br /&gt;
import rsf.Header;&lt;br /&gt;
import rsf.Reader;&lt;br /&gt;
import rsf.Writer;&lt;br /&gt;
&lt;br /&gt;
public class Test {&lt;br /&gt;
      public static void main(String[] args){&lt;br /&gt;
&lt;br /&gt;
                int n1 = 20;&lt;br /&gt;
                int n2 = 40;&lt;br /&gt;
                float[][] data = new float[n2][n1]; &lt;br /&gt;
                //The order for dimensions is reversed, because RSF stores them as column-major arrays (see Python API).&lt;br /&gt;
&lt;br /&gt;
                //...Do something&lt;br /&gt;
&lt;br /&gt;
                Header header = new Header();&lt;br /&gt;
                header.setN(1,n1);&lt;br /&gt;
                /* We set the values using the proper RSF number for the dimension, instead of the Java array index.&lt;br /&gt;
                   Example:  RSF Dimension 1, corresponds to array index 0 in Java.&lt;br /&gt;
                             However, we set the values using index 1.  The mapping is handled behind the scenes.&lt;br /&gt;
                 */&lt;br /&gt;
                header.setN(2,n2); &lt;br /&gt;
                header.setDelta(1,0.0);&lt;br /&gt;
                header.setLabel(1,&amp;quot;time&amp;quot;);&lt;br /&gt;
                header.setUnits(1,&amp;quot;s&amp;quot;);&lt;br /&gt;
                Writer.writeRSF(header,data,&amp;quot;junk2.rsf&amp;quot;); //Write out my data!&lt;br /&gt;
       }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/java&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Karl</name></author>
	</entry>
	<entry>
		<id>https://ahay.org/index.php?title=HoustonWW2018&amp;diff=3735</id>
		<title>HoustonWW2018</title>
		<link rel="alternate" type="text/html" href="https://ahay.org/index.php?title=HoustonWW2018&amp;diff=3735"/>
		<updated>2018-10-23T16:30:30Z</updated>

		<summary type="html">&lt;p&gt;Karl: changes introduction section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Houston-ww2018.jpg|1000px]]&lt;br /&gt;
&lt;br /&gt;
==SEG Working Workshop - Python and Julia for Geophysics - August 8-11, 2018==&lt;br /&gt;
 &lt;br /&gt;
In late August, 16 participants from 12 organizations collaborated at the University of Houston to learn how program geophysical applications using Python and Julia. These languages are good for prototyping and applying selected geophysical algorithms. Our goal was to promote more widespread use of these languages.&lt;br /&gt;
 &lt;br /&gt;
[[Working Workshops]] as opposed to &amp;quot;talking workshops&amp;quot; are meetings where the participants work in small teams to develop new software code or to conduct computational experiments addressing a particular problem.  &lt;br /&gt;
&lt;br /&gt;
This is the sixth year that TCCS has organized working workshops where small groups collaborate to develop software or conduct computational experiments addressing a particular problem.  This year participants were students, academic staff, and industry professionals. Projects included machine learning, 3D plotting, parallel processing, wave equation modeling, and well log analysis. For more information visit http://www.ahay.org/wiki/HoustonWW2018.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Objective==&lt;br /&gt;
Python and Julia are good languages for prototyping and applying selected processing.  Lack of good examples that read geophysical data, interface to legacy processing systems, and implement common algorithms are obstacles to more widespread use of these languages in the geophysical community.  The objective of this working workshop is to identify and address these obstacles and promote more widespread use of the languages.&lt;br /&gt;
&lt;br /&gt;
Participants brought their laptops and formed small groups.  They picked projects and started to make examples of geophysical applications written in Python and Julia. About once a day we all checked in to talk about progress.  Sometimes participants collaborated with different groups.  After two and a half days we shared results in a lightning talks (five minute presentations).  Everyone left the workshop with some new skills, ideas, and acquaintances. &lt;br /&gt;
&lt;br /&gt;
The working workshop provided a forum for geophysicist to learn, contribute, and network.&lt;br /&gt;
&lt;br /&gt;
==Link to the original workshop invitation is [[HoustonWW_2018_i]]== &lt;br /&gt;
&lt;br /&gt;
==Agenda==&lt;br /&gt;
*Wednesday afternoon August 8, 2018 1:00-6:00 PM. Optional work session to configure your computer and install open seismic software&lt;br /&gt;
**Do you want help getting your computer up to speed before the working workshop?  Come for informal, one-on-one assistance to:&lt;br /&gt;
*** Install Linux on your computer.&lt;br /&gt;
*** Configure Linux/OSX on your computer.&lt;br /&gt;
*** Install Seismic Unix on your computer&lt;br /&gt;
*** Install Madagascar on your computer.&lt;br /&gt;
*** Install Jupyter and python on your computer.  &lt;br /&gt;
*** Install a virtual Linux system on your Windows computer that will allow you to experiment with a Linux development environment. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Thursday  August 9, 2018 (working workshop starts)&lt;br /&gt;
**8:30-9:00 Coffee&lt;br /&gt;
**9:00-10:00 Introductions, project proposals, and team formations&lt;br /&gt;
**10:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
**1:00-2:00 Group discussion&lt;br /&gt;
**2:00-5:30 Breakout into work teams&lt;br /&gt;
&lt;br /&gt;
*Friday  August 10, 2018&lt;br /&gt;
**8:30-9:00 Coffee. Reform teams.&lt;br /&gt;
**9:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
**1:00-2:00 Group discussion&lt;br /&gt;
**2:00-5:30 Breakout into work teams&lt;br /&gt;
**6:00-8:00 Dinner&lt;br /&gt;
&lt;br /&gt;
*Saturday  August 11, 2018&lt;br /&gt;
**8:30-9:00 Coffee. Reform teams.&lt;br /&gt;
**9:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
** 1:00-2:00 Finalize lightning talks&lt;br /&gt;
**1:00-3:00 Lighting talks&lt;br /&gt;
&lt;br /&gt;
==Synopsis of Results with Links==&lt;br /&gt;
===Summary of all workshop presentations===&lt;br /&gt;
Presentation summarizing all the individual presentations is at the link [https://drive.google.com/open?id=1EM1jIy-osfqBmYBWL7pssIZqjcn8jdxf].&lt;br /&gt;
&lt;br /&gt;
===Derek Parks===&lt;br /&gt;
Some participants found the current BIOS on  Windows computers would not allow them to boot Linux from a USB solid state disk.  Derek created a virtual system that provided a platform that performed for the workshop.  This virtual system can be downloaded at the link [https://drive.google.com/open?id=1sRojofwRbNVYtrzqU2e-CaU651xJmPAl].  Derek provided updates to python files in Madagascar required to make the system run under Python 3.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Derek Parks and Mark Mlella===&lt;br /&gt;
Derek and Mark created Jupyter notebooks with Python to read the Teapot Dome 3D segy final volume and displayed using Matplotlib and Mayavi.  They also read horizon data which they used to flatten horizons and display stratal slices.  They created the amplitude envelope and spectral decomposition volumes and displays. Their presentation is available at the link [https://drive.google.com/file/d/1Wl3MNZotqWMYxPcB5iGL0Kl6lUwih_Gd/view?usp=sharing].&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Matt Griffiths===&lt;br /&gt;
Matt experimented with Apache Spark, a parallel processing tool, that can be used on seismic data.  Spark can be run on a cluster of a single PC with multiple cores.  He found it easy to covert his code to run in parallel.  His Principle Component Analysis ran about 3 times faster on his computer.  His presentation is available at the link [https://drive.google.com/file/d/1mzOurkpcwB_KpG3bK4TyxRHO6R-afF-z/view?usp=sharing].&amp;lt;br&amp;gt;&lt;br /&gt;
His spark code is at the link [https://drive.google.com/file/d/14xONUqo_eaQDYb_qVV_Ykt7rUMDxNcef/view?usp=sharing].&amp;lt;br&amp;gt;&lt;br /&gt;
Matt also experimented with a simple 3D seismic viewer based on pywidgets and matplotlib.  This code is available at the link [https://drive.google.com/file/d/1-28Nj5_r368GfougrABcJvCHgkt-GYHi/view?usp=sharing].&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Rafael Pinto and Thu Nguyen===&lt;br /&gt;
Rafael and Thu processed wells from the Poseidon project in the NW Shelf Australia.  They used lasio to read the data into a Panda data frame, then loaded the data into an sql database.  Lasio processes logs from a single well.  The sql database is good to manipulate multiple wells on a project.  They visualized cross plots in matplotlib and datashader.  Datashader plots were better.  Their jupyter notebook can be downloaded from this link [https://drive.google.com/open?id=16Ul7r32VZRbrs7JxMIuv0ip0a0AG3JoV].&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Lian Jiang===&lt;br /&gt;
Lian worked on Facies classification using Machine Learning.  He used a neural net to address the ML challenge data set from the Brendan Hall&#039;s Leading Edge Article.  Ran trading experiments searching for the best results varying hyper parameters like learning_rate, epochs, and batch_size.  Encouraging results are in his presentation at [https://drive.google.com/file/d/1BaceNSRvlKXsXd1LbhYfX-Wan-9nq8Ss/view?usp=sharing].&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Carlos da Costa===&lt;br /&gt;
Carlos provided a new viewer for Madagascar.  Sfpgreywfl, written in python, will plot a wavefield with a velocity background.  He also wrote a julia version of acoustic finite difference wave equation modeling.  This programs are being added to the Madagascar repository.  His presentation can be downloaded by the link [https://drive.google.com/open?id=1gwGjVsabRADw4-cQwnOPI_x2GcxapO22]&lt;br /&gt;
&lt;br /&gt;
===Sergey Fomel===&lt;br /&gt;
Madagascar already had example of acoustic finite difference wave equation modeling in C, C++, and Fortran90.  Sergey Fomel implemented the same algorithm in Python. and benchmarked the program in all the languages  These are described in the presentation: [https://drive.google.com/file/d/1w302kWFOLPWJwUqAt1NDdBGJ__73XVX1/view?usp=sharing].&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Contact us==&lt;br /&gt;
If you have some ideas about future working workshops, tell us about it!  Send email to [mailto:seismic.working.workshop@gmail.com seismic.working.workshop@gmail.com].&lt;br /&gt;
&lt;br /&gt;
==Workshow Location and Dates==&lt;br /&gt;
The workshop was held in rooms 218 and 219 in Farish Hall at the University of Houston. August 8-11, 2018.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Supporting Organizations==&lt;br /&gt;
===Bureau of Economic Geology, University of Texas at Austin===&lt;br /&gt;
[[Image:Beglogo.jpg]]&lt;br /&gt;
===Society of Exploration Geophysicists===&lt;br /&gt;
[[Image:SEG Logo_Horizontal_SM.png|400px]]&lt;br /&gt;
===SEG Wavelets===&lt;br /&gt;
SEG Wavelets is the University of Houston&#039;s SEG student chapter. It is devoted to promoting education in exploration geophysics. We work with professional organizations, industry professionals, University of Houston faculty, and other student organizations to bring students educational, social, and possible future employment opportunities. More details can be found on our [http://segwavelets.uh.edu/ website].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Karl</name></author>
	</entry>
	<entry>
		<id>https://ahay.org/index.php?title=HoustonWW2018&amp;diff=3734</id>
		<title>HoustonWW2018</title>
		<link rel="alternate" type="text/html" href="https://ahay.org/index.php?title=HoustonWW2018&amp;diff=3734"/>
		<updated>2018-10-12T16:10:31Z</updated>

		<summary type="html">&lt;p&gt;Karl: /* Synopsis of Results with Links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Houston-ww2018.jpg|1000px]]&lt;br /&gt;
==SEG Working Workshop - Python and Julia for Geophysics - August 8-11, 2018==&lt;br /&gt;
&lt;br /&gt;
[[Working Workshops]] as opposed to &amp;quot;talking workshops&amp;quot; are meetings where the participants work in small teams to develop new software code or to conduct computational experiments addressing a particular problem.  This workshop asks participants to create small groups to identify and address obstacles to more widespread use of Python and Julia in the geophysical community.  Results will be shared in lighting talks and code repositories.&lt;br /&gt;
&lt;br /&gt;
This is the sixth year we have organized a working workshop.  Information about previous events is at this [[http://www.ahay.org/wiki/Working_Workshops website]].&lt;br /&gt;
&lt;br /&gt;
==Objective==&lt;br /&gt;
Python and Julia are good languages for prototyping and applying selected processing.  Lack of good examples that read geophysical data, interface to legacy processing systems, and implement common algorithms are obstacles to more widespread use of these languages in the geophysical community.  The objective of this working workshop is to identify and address these obstacles and promote more widespread use of the languages.&lt;br /&gt;
&lt;br /&gt;
Participants brought their laptops and formed small groups.  They picked projects and started to make examples of geophysical applications written in Python and Julia. About once a day we all checked in to talk about progress.  Sometimes participants collaborated with different groups.  After two and a half days we shared results in a lightning talks (five minute presentations).  Everyone left the workshop with some new skills, ideas, and acquaintances. &lt;br /&gt;
&lt;br /&gt;
The working workshop provided a forum for geophysicist to learn, contribute, and network.&lt;br /&gt;
&lt;br /&gt;
==Link to the original workshop invitation is [[HoustonWW_2018_i]]== &lt;br /&gt;
&lt;br /&gt;
==Agenda==&lt;br /&gt;
*Wednesday afternoon August 8, 2018 1:00-6:00 PM. Optional work session to configure your computer and install open seismic software&lt;br /&gt;
**Do you want help getting your computer up to speed before the working workshop?  Come for informal, one-on-one assistance to:&lt;br /&gt;
*** Install Linux on your computer.&lt;br /&gt;
*** Configure Linux/OSX on your computer.&lt;br /&gt;
*** Install Seismic Unix on your computer&lt;br /&gt;
*** Install Madagascar on your computer.&lt;br /&gt;
*** Install Jupyter and python on your computer.  &lt;br /&gt;
*** Install a virtual Linux system on your Windows computer that will allow you to experiment with a Linux development environment. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Thursday  August 9, 2018 (working workshop starts)&lt;br /&gt;
**8:30-9:00 Coffee&lt;br /&gt;
**9:00-10:00 Introductions, project proposals, and team formations&lt;br /&gt;
**10:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
**1:00-2:00 Group discussion&lt;br /&gt;
**2:00-5:30 Breakout into work teams&lt;br /&gt;
&lt;br /&gt;
*Friday  August 10, 2018&lt;br /&gt;
**8:30-9:00 Coffee. Reform teams.&lt;br /&gt;
**9:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
**1:00-2:00 Group discussion&lt;br /&gt;
**2:00-5:30 Breakout into work teams&lt;br /&gt;
**6:00-8:00 Dinner&lt;br /&gt;
&lt;br /&gt;
*Saturday  August 11, 2018&lt;br /&gt;
**8:30-9:00 Coffee. Reform teams.&lt;br /&gt;
**9:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
** 1:00-2:00 Finalize lightning talks&lt;br /&gt;
**1:00-3:00 Lighting talks&lt;br /&gt;
&lt;br /&gt;
==Synopsis of Results with Links==&lt;br /&gt;
===Summary of all workshop presentations===&lt;br /&gt;
Presentation summarizing all the individual presentations is at the link [https://drive.google.com/open?id=1EM1jIy-osfqBmYBWL7pssIZqjcn8jdxf].&lt;br /&gt;
&lt;br /&gt;
===Derek Parks===&lt;br /&gt;
Some participants found the current BIOS on  Windows computers would not allow them to boot Linux from a USB solid state disk.  Derek created a virtual system that provided a platform that performed for the workshop.  This virtual system can be downloaded at the link [https://drive.google.com/open?id=1sRojofwRbNVYtrzqU2e-CaU651xJmPAl].  Derek provided updates to python files in Madagascar required to make the system run under Python 3.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Derek Parks and Mark Mlella===&lt;br /&gt;
Derek and Mark created Jupyter notebooks with Python to read the Teapot Dome 3D segy final volume and displayed using Matplotlib and Mayavi.  They also read horizon data which they used to flatten horizons and display stratal slices.  They created the amplitude envelope and spectral decomposition volumes and displays. Their presentation is available at the link [https://drive.google.com/file/d/1Wl3MNZotqWMYxPcB5iGL0Kl6lUwih_Gd/view?usp=sharing].&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Matt Griffiths===&lt;br /&gt;
Matt experimented with Apache Spark, a parallel processing tool, that can be used on seismic data.  Spark can be run on a cluster of a single PC with multiple cores.  He found it easy to covert his code to run in parallel.  His Principle Component Analysis ran about 3 times faster on his computer.  His presentation is available at the link [https://drive.google.com/file/d/1mzOurkpcwB_KpG3bK4TyxRHO6R-afF-z/view?usp=sharing].&amp;lt;br&amp;gt;&lt;br /&gt;
His spark code is at the link [https://drive.google.com/file/d/14xONUqo_eaQDYb_qVV_Ykt7rUMDxNcef/view?usp=sharing].&amp;lt;br&amp;gt;&lt;br /&gt;
Matt also experimented with a simple 3D seismic viewer based on pywidgets and matplotlib.  This code is available at the link [https://drive.google.com/file/d/1-28Nj5_r368GfougrABcJvCHgkt-GYHi/view?usp=sharing].&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Rafael Pinto and Thu Nguyen===&lt;br /&gt;
Rafael and Thu processed wells from the Poseidon project in the NW Shelf Australia.  They used lasio to read the data into a Panda data frame, then loaded the data into an sql database.  Lasio processes logs from a single well.  The sql database is good to manipulate multiple wells on a project.  They visualized cross plots in matplotlib and datashader.  Datashader plots were better.  Their jupyter notebook can be downloaded from this link [https://drive.google.com/open?id=16Ul7r32VZRbrs7JxMIuv0ip0a0AG3JoV].&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Lian Jiang===&lt;br /&gt;
Lian worked on Facies classification using Machine Learning.  He used a neural net to address the ML challenge data set from the Brendan Hall&#039;s Leading Edge Article.  Ran trading experiments searching for the best results varying hyper parameters like learning_rate, epochs, and batch_size.  Encouraging results are in his presentation at [https://drive.google.com/file/d/1BaceNSRvlKXsXd1LbhYfX-Wan-9nq8Ss/view?usp=sharing].&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Carlos da Costa===&lt;br /&gt;
Carlos provided a new viewer for Madagascar.  Sfpgreywfl, written in python, will plot a wavefield with a velocity background.  He also wrote a julia version of acoustic finite difference wave equation modeling.  This programs are being added to the Madagascar repository.  His presentation can be downloaded by the link [https://drive.google.com/open?id=1gwGjVsabRADw4-cQwnOPI_x2GcxapO22]&lt;br /&gt;
&lt;br /&gt;
===Sergey Fomel===&lt;br /&gt;
Madagascar already had example of acoustic finite difference wave equation modeling in C, C++, and Fortran90.  Sergey Fomel implemented the same algorithm in Python. and benchmarked the program in all the languages  These are described in the presentation: [https://drive.google.com/file/d/1w302kWFOLPWJwUqAt1NDdBGJ__73XVX1/view?usp=sharing].&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Contact us==&lt;br /&gt;
If you have some ideas about future working workshops, tell us about it!  Send email to [mailto:seismic.working.workshop@gmail.com seismic.working.workshop@gmail.com].&lt;br /&gt;
&lt;br /&gt;
==Workshow Location and Dates==&lt;br /&gt;
The workshop was held in rooms 218 and 219 in Farish Hall at the University of Houston. August 8-11, 2018.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Supporting Organizations==&lt;br /&gt;
===Bureau of Economic Geology, University of Texas at Austin===&lt;br /&gt;
[[Image:Beglogo.jpg]]&lt;br /&gt;
===Society of Exploration Geophysicists===&lt;br /&gt;
[[Image:SEG Logo_Horizontal_SM.png|400px]]&lt;br /&gt;
===SEG Wavelets===&lt;br /&gt;
SEG Wavelets is the University of Houston&#039;s SEG student chapter. It is devoted to promoting education in exploration geophysics. We work with professional organizations, industry professionals, University of Houston faculty, and other student organizations to bring students educational, social, and possible future employment opportunities. More details can be found on our [http://segwavelets.uh.edu/ website].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Karl</name></author>
	</entry>
	<entry>
		<id>https://ahay.org/index.php?title=HoustonWW2018&amp;diff=3733</id>
		<title>HoustonWW2018</title>
		<link rel="alternate" type="text/html" href="https://ahay.org/index.php?title=HoustonWW2018&amp;diff=3733"/>
		<updated>2018-10-12T16:10:12Z</updated>

		<summary type="html">&lt;p&gt;Karl: /* Synopsis of Results with Links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Houston-ww2018.jpg|1000px]]&lt;br /&gt;
==SEG Working Workshop - Python and Julia for Geophysics - August 8-11, 2018==&lt;br /&gt;
&lt;br /&gt;
[[Working Workshops]] as opposed to &amp;quot;talking workshops&amp;quot; are meetings where the participants work in small teams to develop new software code or to conduct computational experiments addressing a particular problem.  This workshop asks participants to create small groups to identify and address obstacles to more widespread use of Python and Julia in the geophysical community.  Results will be shared in lighting talks and code repositories.&lt;br /&gt;
&lt;br /&gt;
This is the sixth year we have organized a working workshop.  Information about previous events is at this [[http://www.ahay.org/wiki/Working_Workshops website]].&lt;br /&gt;
&lt;br /&gt;
==Objective==&lt;br /&gt;
Python and Julia are good languages for prototyping and applying selected processing.  Lack of good examples that read geophysical data, interface to legacy processing systems, and implement common algorithms are obstacles to more widespread use of these languages in the geophysical community.  The objective of this working workshop is to identify and address these obstacles and promote more widespread use of the languages.&lt;br /&gt;
&lt;br /&gt;
Participants brought their laptops and formed small groups.  They picked projects and started to make examples of geophysical applications written in Python and Julia. About once a day we all checked in to talk about progress.  Sometimes participants collaborated with different groups.  After two and a half days we shared results in a lightning talks (five minute presentations).  Everyone left the workshop with some new skills, ideas, and acquaintances. &lt;br /&gt;
&lt;br /&gt;
The working workshop provided a forum for geophysicist to learn, contribute, and network.&lt;br /&gt;
&lt;br /&gt;
==Link to the original workshop invitation is [[HoustonWW_2018_i]]== &lt;br /&gt;
&lt;br /&gt;
==Agenda==&lt;br /&gt;
*Wednesday afternoon August 8, 2018 1:00-6:00 PM. Optional work session to configure your computer and install open seismic software&lt;br /&gt;
**Do you want help getting your computer up to speed before the working workshop?  Come for informal, one-on-one assistance to:&lt;br /&gt;
*** Install Linux on your computer.&lt;br /&gt;
*** Configure Linux/OSX on your computer.&lt;br /&gt;
*** Install Seismic Unix on your computer&lt;br /&gt;
*** Install Madagascar on your computer.&lt;br /&gt;
*** Install Jupyter and python on your computer.  &lt;br /&gt;
*** Install a virtual Linux system on your Windows computer that will allow you to experiment with a Linux development environment. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Thursday  August 9, 2018 (working workshop starts)&lt;br /&gt;
**8:30-9:00 Coffee&lt;br /&gt;
**9:00-10:00 Introductions, project proposals, and team formations&lt;br /&gt;
**10:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
**1:00-2:00 Group discussion&lt;br /&gt;
**2:00-5:30 Breakout into work teams&lt;br /&gt;
&lt;br /&gt;
*Friday  August 10, 2018&lt;br /&gt;
**8:30-9:00 Coffee. Reform teams.&lt;br /&gt;
**9:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
**1:00-2:00 Group discussion&lt;br /&gt;
**2:00-5:30 Breakout into work teams&lt;br /&gt;
**6:00-8:00 Dinner&lt;br /&gt;
&lt;br /&gt;
*Saturday  August 11, 2018&lt;br /&gt;
**8:30-9:00 Coffee. Reform teams.&lt;br /&gt;
**9:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
** 1:00-2:00 Finalize lightning talks&lt;br /&gt;
**1:00-3:00 Lighting talks&lt;br /&gt;
&lt;br /&gt;
==Synopsis of Results with Links==&lt;br /&gt;
===Summary of all workshop presentation===&lt;br /&gt;
Presentation summarizing all the individual presentations is at the link [https://drive.google.com/open?id=1EM1jIy-osfqBmYBWL7pssIZqjcn8jdxf].&lt;br /&gt;
&lt;br /&gt;
===Derek Parks===&lt;br /&gt;
Some participants found the current BIOS on  Windows computers would not allow them to boot Linux from a USB solid state disk.  Derek created a virtual system that provided a platform that performed for the workshop.  This virtual system can be downloaded at the link [https://drive.google.com/open?id=1sRojofwRbNVYtrzqU2e-CaU651xJmPAl].  Derek provided updates to python files in Madagascar required to make the system run under Python 3.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Derek Parks and Mark Mlella===&lt;br /&gt;
Derek and Mark created Jupyter notebooks with Python to read the Teapot Dome 3D segy final volume and displayed using Matplotlib and Mayavi.  They also read horizon data which they used to flatten horizons and display stratal slices.  They created the amplitude envelope and spectral decomposition volumes and displays. Their presentation is available at the link [https://drive.google.com/file/d/1Wl3MNZotqWMYxPcB5iGL0Kl6lUwih_Gd/view?usp=sharing].&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Matt Griffiths===&lt;br /&gt;
Matt experimented with Apache Spark, a parallel processing tool, that can be used on seismic data.  Spark can be run on a cluster of a single PC with multiple cores.  He found it easy to covert his code to run in parallel.  His Principle Component Analysis ran about 3 times faster on his computer.  His presentation is available at the link [https://drive.google.com/file/d/1mzOurkpcwB_KpG3bK4TyxRHO6R-afF-z/view?usp=sharing].&amp;lt;br&amp;gt;&lt;br /&gt;
His spark code is at the link [https://drive.google.com/file/d/14xONUqo_eaQDYb_qVV_Ykt7rUMDxNcef/view?usp=sharing].&amp;lt;br&amp;gt;&lt;br /&gt;
Matt also experimented with a simple 3D seismic viewer based on pywidgets and matplotlib.  This code is available at the link [https://drive.google.com/file/d/1-28Nj5_r368GfougrABcJvCHgkt-GYHi/view?usp=sharing].&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Rafael Pinto and Thu Nguyen===&lt;br /&gt;
Rafael and Thu processed wells from the Poseidon project in the NW Shelf Australia.  They used lasio to read the data into a Panda data frame, then loaded the data into an sql database.  Lasio processes logs from a single well.  The sql database is good to manipulate multiple wells on a project.  They visualized cross plots in matplotlib and datashader.  Datashader plots were better.  Their jupyter notebook can be downloaded from this link [https://drive.google.com/open?id=16Ul7r32VZRbrs7JxMIuv0ip0a0AG3JoV].&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Lian Jiang===&lt;br /&gt;
Lian worked on Facies classification using Machine Learning.  He used a neural net to address the ML challenge data set from the Brendan Hall&#039;s Leading Edge Article.  Ran trading experiments searching for the best results varying hyper parameters like learning_rate, epochs, and batch_size.  Encouraging results are in his presentation at [https://drive.google.com/file/d/1BaceNSRvlKXsXd1LbhYfX-Wan-9nq8Ss/view?usp=sharing].&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Carlos da Costa===&lt;br /&gt;
Carlos provided a new viewer for Madagascar.  Sfpgreywfl, written in python, will plot a wavefield with a velocity background.  He also wrote a julia version of acoustic finite difference wave equation modeling.  This programs are being added to the Madagascar repository.  His presentation can be downloaded by the link [https://drive.google.com/open?id=1gwGjVsabRADw4-cQwnOPI_x2GcxapO22]&lt;br /&gt;
&lt;br /&gt;
===Sergey Fomel===&lt;br /&gt;
Madagascar already had example of acoustic finite difference wave equation modeling in C, C++, and Fortran90.  Sergey Fomel implemented the same algorithm in Python. and benchmarked the program in all the languages  These are described in the presentation: [https://drive.google.com/file/d/1w302kWFOLPWJwUqAt1NDdBGJ__73XVX1/view?usp=sharing].&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Contact us==&lt;br /&gt;
If you have some ideas about future working workshops, tell us about it!  Send email to [mailto:seismic.working.workshop@gmail.com seismic.working.workshop@gmail.com].&lt;br /&gt;
&lt;br /&gt;
==Workshow Location and Dates==&lt;br /&gt;
The workshop was held in rooms 218 and 219 in Farish Hall at the University of Houston. August 8-11, 2018.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Supporting Organizations==&lt;br /&gt;
===Bureau of Economic Geology, University of Texas at Austin===&lt;br /&gt;
[[Image:Beglogo.jpg]]&lt;br /&gt;
===Society of Exploration Geophysicists===&lt;br /&gt;
[[Image:SEG Logo_Horizontal_SM.png|400px]]&lt;br /&gt;
===SEG Wavelets===&lt;br /&gt;
SEG Wavelets is the University of Houston&#039;s SEG student chapter. It is devoted to promoting education in exploration geophysics. We work with professional organizations, industry professionals, University of Houston faculty, and other student organizations to bring students educational, social, and possible future employment opportunities. More details can be found on our [http://segwavelets.uh.edu/ website].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Karl</name></author>
	</entry>
	<entry>
		<id>https://ahay.org/index.php?title=HoustonWW2018&amp;diff=3732</id>
		<title>HoustonWW2018</title>
		<link rel="alternate" type="text/html" href="https://ahay.org/index.php?title=HoustonWW2018&amp;diff=3732"/>
		<updated>2018-10-12T16:09:28Z</updated>

		<summary type="html">&lt;p&gt;Karl: add link to ppt presentation summarizing all the individual presentation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Houston-ww2018.jpg|1000px]]&lt;br /&gt;
==SEG Working Workshop - Python and Julia for Geophysics - August 8-11, 2018==&lt;br /&gt;
&lt;br /&gt;
[[Working Workshops]] as opposed to &amp;quot;talking workshops&amp;quot; are meetings where the participants work in small teams to develop new software code or to conduct computational experiments addressing a particular problem.  This workshop asks participants to create small groups to identify and address obstacles to more widespread use of Python and Julia in the geophysical community.  Results will be shared in lighting talks and code repositories.&lt;br /&gt;
&lt;br /&gt;
This is the sixth year we have organized a working workshop.  Information about previous events is at this [[http://www.ahay.org/wiki/Working_Workshops website]].&lt;br /&gt;
&lt;br /&gt;
==Objective==&lt;br /&gt;
Python and Julia are good languages for prototyping and applying selected processing.  Lack of good examples that read geophysical data, interface to legacy processing systems, and implement common algorithms are obstacles to more widespread use of these languages in the geophysical community.  The objective of this working workshop is to identify and address these obstacles and promote more widespread use of the languages.&lt;br /&gt;
&lt;br /&gt;
Participants brought their laptops and formed small groups.  They picked projects and started to make examples of geophysical applications written in Python and Julia. About once a day we all checked in to talk about progress.  Sometimes participants collaborated with different groups.  After two and a half days we shared results in a lightning talks (five minute presentations).  Everyone left the workshop with some new skills, ideas, and acquaintances. &lt;br /&gt;
&lt;br /&gt;
The working workshop provided a forum for geophysicist to learn, contribute, and network.&lt;br /&gt;
&lt;br /&gt;
==Link to the original workshop invitation is [[HoustonWW_2018_i]]== &lt;br /&gt;
&lt;br /&gt;
==Agenda==&lt;br /&gt;
*Wednesday afternoon August 8, 2018 1:00-6:00 PM. Optional work session to configure your computer and install open seismic software&lt;br /&gt;
**Do you want help getting your computer up to speed before the working workshop?  Come for informal, one-on-one assistance to:&lt;br /&gt;
*** Install Linux on your computer.&lt;br /&gt;
*** Configure Linux/OSX on your computer.&lt;br /&gt;
*** Install Seismic Unix on your computer&lt;br /&gt;
*** Install Madagascar on your computer.&lt;br /&gt;
*** Install Jupyter and python on your computer.  &lt;br /&gt;
*** Install a virtual Linux system on your Windows computer that will allow you to experiment with a Linux development environment. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Thursday  August 9, 2018 (working workshop starts)&lt;br /&gt;
**8:30-9:00 Coffee&lt;br /&gt;
**9:00-10:00 Introductions, project proposals, and team formations&lt;br /&gt;
**10:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
**1:00-2:00 Group discussion&lt;br /&gt;
**2:00-5:30 Breakout into work teams&lt;br /&gt;
&lt;br /&gt;
*Friday  August 10, 2018&lt;br /&gt;
**8:30-9:00 Coffee. Reform teams.&lt;br /&gt;
**9:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
**1:00-2:00 Group discussion&lt;br /&gt;
**2:00-5:30 Breakout into work teams&lt;br /&gt;
**6:00-8:00 Dinner&lt;br /&gt;
&lt;br /&gt;
*Saturday  August 11, 2018&lt;br /&gt;
**8:30-9:00 Coffee. Reform teams.&lt;br /&gt;
**9:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
** 1:00-2:00 Finalize lightning talks&lt;br /&gt;
**1:00-3:00 Lighting talks&lt;br /&gt;
&lt;br /&gt;
==Synopsis of Results with Links==&lt;br /&gt;
===powerPoint presentation summarizing the workshop===&lt;br /&gt;
Presentation summarizing all the individual presentations is at the link [https://drive.google.com/open?id=1EM1jIy-osfqBmYBWL7pssIZqjcn8jdxf].&lt;br /&gt;
&lt;br /&gt;
===Derek Parks===&lt;br /&gt;
Some participants found the current BIOS on  Windows computers would not allow them to boot Linux from a USB solid state disk.  Derek created a virtual system that provided a platform that performed for the workshop.  This virtual system can be downloaded at the link [https://drive.google.com/open?id=1sRojofwRbNVYtrzqU2e-CaU651xJmPAl].  Derek provided updates to python files in Madagascar required to make the system run under Python 3.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Derek Parks and Mark Mlella===&lt;br /&gt;
Derek and Mark created Jupyter notebooks with Python to read the Teapot Dome 3D segy final volume and displayed using Matplotlib and Mayavi.  They also read horizon data which they used to flatten horizons and display stratal slices.  They created the amplitude envelope and spectral decomposition volumes and displays. Their presentation is available at the link [https://drive.google.com/file/d/1Wl3MNZotqWMYxPcB5iGL0Kl6lUwih_Gd/view?usp=sharing].&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Matt Griffiths===&lt;br /&gt;
Matt experimented with Apache Spark, a parallel processing tool, that can be used on seismic data.  Spark can be run on a cluster of a single PC with multiple cores.  He found it easy to covert his code to run in parallel.  His Principle Component Analysis ran about 3 times faster on his computer.  His presentation is available at the link [https://drive.google.com/file/d/1mzOurkpcwB_KpG3bK4TyxRHO6R-afF-z/view?usp=sharing].&amp;lt;br&amp;gt;&lt;br /&gt;
His spark code is at the link [https://drive.google.com/file/d/14xONUqo_eaQDYb_qVV_Ykt7rUMDxNcef/view?usp=sharing].&amp;lt;br&amp;gt;&lt;br /&gt;
Matt also experimented with a simple 3D seismic viewer based on pywidgets and matplotlib.  This code is available at the link [https://drive.google.com/file/d/1-28Nj5_r368GfougrABcJvCHgkt-GYHi/view?usp=sharing].&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Rafael Pinto and Thu Nguyen===&lt;br /&gt;
Rafael and Thu processed wells from the Poseidon project in the NW Shelf Australia.  They used lasio to read the data into a Panda data frame, then loaded the data into an sql database.  Lasio processes logs from a single well.  The sql database is good to manipulate multiple wells on a project.  They visualized cross plots in matplotlib and datashader.  Datashader plots were better.  Their jupyter notebook can be downloaded from this link [https://drive.google.com/open?id=16Ul7r32VZRbrs7JxMIuv0ip0a0AG3JoV].&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Lian Jiang===&lt;br /&gt;
Lian worked on Facies classification using Machine Learning.  He used a neural net to address the ML challenge data set from the Brendan Hall&#039;s Leading Edge Article.  Ran trading experiments searching for the best results varying hyper parameters like learning_rate, epochs, and batch_size.  Encouraging results are in his presentation at [https://drive.google.com/file/d/1BaceNSRvlKXsXd1LbhYfX-Wan-9nq8Ss/view?usp=sharing].&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Carlos da Costa===&lt;br /&gt;
Carlos provided a new viewer for Madagascar.  Sfpgreywfl, written in python, will plot a wavefield with a velocity background.  He also wrote a julia version of acoustic finite difference wave equation modeling.  This programs are being added to the Madagascar repository.  His presentation can be downloaded by the link [https://drive.google.com/open?id=1gwGjVsabRADw4-cQwnOPI_x2GcxapO22]&lt;br /&gt;
&lt;br /&gt;
===Sergey Fomel===&lt;br /&gt;
Madagascar already had example of acoustic finite difference wave equation modeling in C, C++, and Fortran90.  Sergey Fomel implemented the same algorithm in Python. and benchmarked the program in all the languages  These are described in the presentation: [https://drive.google.com/file/d/1w302kWFOLPWJwUqAt1NDdBGJ__73XVX1/view?usp=sharing].&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Contact us==&lt;br /&gt;
If you have some ideas about future working workshops, tell us about it!  Send email to [mailto:seismic.working.workshop@gmail.com seismic.working.workshop@gmail.com].&lt;br /&gt;
&lt;br /&gt;
==Workshow Location and Dates==&lt;br /&gt;
The workshop was held in rooms 218 and 219 in Farish Hall at the University of Houston. August 8-11, 2018.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Supporting Organizations==&lt;br /&gt;
===Bureau of Economic Geology, University of Texas at Austin===&lt;br /&gt;
[[Image:Beglogo.jpg]]&lt;br /&gt;
===Society of Exploration Geophysicists===&lt;br /&gt;
[[Image:SEG Logo_Horizontal_SM.png|400px]]&lt;br /&gt;
===SEG Wavelets===&lt;br /&gt;
SEG Wavelets is the University of Houston&#039;s SEG student chapter. It is devoted to promoting education in exploration geophysics. We work with professional organizations, industry professionals, University of Houston faculty, and other student organizations to bring students educational, social, and possible future employment opportunities. More details can be found on our [http://segwavelets.uh.edu/ website].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Karl</name></author>
	</entry>
	<entry>
		<id>https://ahay.org/index.php?title=HoustonWW2017&amp;diff=3731</id>
		<title>HoustonWW2017</title>
		<link rel="alternate" type="text/html" href="https://ahay.org/index.php?title=HoustonWW2017&amp;diff=3731"/>
		<updated>2018-10-11T15:58:07Z</updated>

		<summary type="html">&lt;p&gt;Karl: corrected dates and other minor typos&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:HoustonWW2017.JPG|center|frame|800px]]&lt;br /&gt;
&lt;br /&gt;
==SEG Seismic Working Workshop - Reproducible Tutorials - August 9-13, 2017==&lt;br /&gt;
&lt;br /&gt;
[[Working Workshops]] as opposed to &amp;quot;talking workshops&amp;quot; are meetings where the participants work in pairs or small teams to develop new software code or to conduct computational experiments addressing a particular problem.  In this workshop participants will work in small groups to create short, reproducible, geophysical tutorials.  These tutorials are inspired by The Leading Edge geophysical tutorial [http://wiki.seg.org/wiki/A_user_guide_to_the_geophysical_tutorials articles]. Groups will make lightning talks (a five minute presentation) at then end of the workshop.  An open repository will be created to share presentations and code after the workshop.&lt;br /&gt;
&lt;br /&gt;
==Objective==&lt;br /&gt;
Groups of two or three participant were formed at the working workshop to create reproducible tutorials.  The tutorial should be on a topic of interest to seismic interpreters, applied geophysicists, and general earth scientists.  It should be about 1500 words, two or three figures, and code to makes the figures.  Groups used any system to create and share the code that allows the tutorial figures to be reproduced by readers after the workshop.  The tutorials may be candidates for publication (eg The Leading Edge geophysical tutorial [http://wiki.seg.org/wiki/A_user_guide_to_the_geophysical_tutorials articles] or the software section of Geophysics).  groups came up with their own ideas or read [http://wiki.seg.org/wiki/Geophysical_tutorials previous TLE tutorials], Geophysical Image Estimation by Example (http://sepwww.stanford.edu/sep/prof/), Seismic Unix demos, Madagascar reproducible [http://www.reproducibility.org/RSF/book/gee/lmn/paper_html/node6.html documents], or Geophysical Society of Houston “Tutorial Nuggets”.   Study, extend, or translate some of this material to another system.  Collaborate and share your experience in a lightning talk (a five minute presentation).&lt;br /&gt;
&lt;br /&gt;
Participants used their own laptops and software to create a tutorial during the workshop. Wifi internet access was available.&lt;br /&gt;
&lt;br /&gt;
This working workshop provided a forum for geophysicist to learn, contribute, and network.&lt;br /&gt;
&lt;br /&gt;
Previous tutorials from The Leading Edge can be downloaded with:&lt;br /&gt;
&lt;br /&gt;
git clone https://github.com/seg/tutorials-2014&amp;lt;br&amp;gt;&lt;br /&gt;
git clone https://github.com/seg/tutorials-2015&amp;lt;br&amp;gt;&lt;br /&gt;
git clone https://github.com/seg/tutorials-2016&amp;lt;br&amp;gt;&lt;br /&gt;
git clone https://github.com/seg/tutorials-2017&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Link to the original workshop invitation is [[HoustonWW 2017 i]]==&lt;br /&gt;
&lt;br /&gt;
==Workshop agenda==&lt;br /&gt;
*Wednesday afternoon August 9, 2017 3:00-6:00 PM. Optional work session to configure your computer and install open seismic software&lt;br /&gt;
**Do you want help getting your computer up to speed before the working workshop?  Come for informal, one-on-one assistance to:&lt;br /&gt;
*** Install Linux on your computer.&lt;br /&gt;
*** Configure Linux/OSX on your computer.&lt;br /&gt;
*** Install Seismic Unix on your computer&lt;br /&gt;
*** Install Madagascar on your computer.&lt;br /&gt;
*** Install Jupyter and python on your computer.  &lt;br /&gt;
*** Install a virtual Linux system on your Windows computer that will allow you to experiment with a Linux development environment. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Thursday  August 10, 2017 (working workshop starts)&lt;br /&gt;
**8:30-9:00 Coffee&lt;br /&gt;
**9:00-10:00 Introductions, project proposals, and team formations&lt;br /&gt;
**10:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
**1:00-2:00 Group discussion&lt;br /&gt;
**2:00-5:30 Breakout into work teams&lt;br /&gt;
&lt;br /&gt;
*Friday  August 11, 2017&lt;br /&gt;
**8:30-9:00 Coffee. Reform teams.&lt;br /&gt;
**9:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
**1:00-2:00 Group discussion&lt;br /&gt;
**2:00-5:30 Breakout into work teams&lt;br /&gt;
**6:00-8:00 Dinner&lt;br /&gt;
&lt;br /&gt;
*Saturday  August 12, 2017&lt;br /&gt;
**8:30-9:00 Coffee. Reform teams.&lt;br /&gt;
**9:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
** 1:00-2:00 Finalize lightning talks&lt;br /&gt;
**2:00-3:00 Lighting talks&lt;br /&gt;
&lt;br /&gt;
==Synopsis of results with links ==&lt;br /&gt;
===Overview Presentation of Results=== &lt;br /&gt;
Karl Schleicher completed a report of the highlights of the working workshop.&lt;br /&gt;
[https://drive.google.com/open?id=1ZdpWMpLyKVXLEf6Ng2rUQ1mN3ZbekmXL view Schleicher&#039;s overview presentation] &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Keynote Presentation by Matt Hall===&lt;br /&gt;
Matt Hall made a presentation via Skype at the beginning of the workshop describing his experience in participatory meetings.  He has organized several Geophysics Hackathons.  He provided an overview of the Tutorials in The Leading Edge.&lt;br /&gt;
[https://drive.google.com/open?id=1tyoOuKUYXr90iADph7hi2LosrVaTH09q view Hall&#039;s Keynote presentation.]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Luke Decker, Matt Sexton, Will Sanger===&lt;br /&gt;
This group created tutorial material on Kirchhoff migration.  Started with an SEP tutorial from the Madagascar source code repository they implemented least squares migration in Madagascar and  Kirchhoff migration and modeling in a Jupyter notebook.  A seperate accomplishment was to identify a web site that describes how to install Madagascar using Docker.&lt;br /&gt;
[https://drive.google.com/open?id=12GbwZjGUaASvmX0UQaoFluzpT_1CSFpC view Sanger&#039;s presentation]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Pongthep Thongsang, Lian Jiang, Hoa Li===&lt;br /&gt;
This group created a Madagascar modeling and processing tutorial.  Starting with a modeling and processing papers in the Madagascar source code repository they created a beginners tutorial for the Madagascar software package.  Their tutorial demonstrates finite difference modeling of cary of there Marmots 2 model and simple processing including NMO, stack, and post stack depth migration. The paper will soon be added to the Madagascar repository and the online reproducible papers.  [https://drive.google.com/open?id=1shMEfaDUfE-JGMtrmJgQTKyoemuy1wWN view paper by Thongsang et al ]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Wenyuan Zhang===&lt;br /&gt;
Wenyuan Zhang encounterred problems running parallel Madagascar programs on the University of Houston Cluster.  These are due to onitereaction between Madagascar patella options, the cluster configuration, the slum queueing system, and the scons environment.  He was able to make small updates to Madagascar source code files api.c and config.py and his scripts now run.  These updates have been included in the Madagascar distribution repository.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Karl Schleicher===&lt;br /&gt;
Reproduces one to &amp;quot;The Leading Edge Tutorials&amp;quot;,  Linear Inversion.  The Jupyter notebook must be changed if you want to run using Python 2.7 instead of 3.5.  This work lead to a new tutorial for :The Leading Edge&amp;quot; on the Conjugate Gradient Method.  This tutorial is tentatively scheduled to be published in April 2018. &lt;br /&gt;
[https://drive.google.com/open?id=1g3qWvzcUFwHCnTAHtt7c94GJo8UfYLVz view schleicher&#039;s tle tutorial]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===tar file of results===&lt;br /&gt;
The scripts created at the working workshop are saved in a a zipped tar file that can be downloaded.  &lt;br /&gt;
[https://drive.google.com/open?id=13WANvsd5jNn0pqJSHcYkrPb-mZV9PehL download ww-hou17.tar.gz]&lt;br /&gt;
&lt;br /&gt;
==Contact us==&lt;br /&gt;
If you have some ideas about working workshops, tell us about it!  Send email to [mailto:seismic.working.workshop@gmail.com seismic.working.workshop@gmail.com].&lt;br /&gt;
&lt;br /&gt;
==Location==&lt;br /&gt;
Rm 223, Science &amp;amp; Research Bld1&amp;lt;br&amp;gt;&lt;br /&gt;
University of Houston&amp;lt;br&amp;gt;&lt;br /&gt;
3507 Cullen Boulevard&amp;lt;br&amp;gt;&lt;br /&gt;
Houston, TX 77204-5007&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Use these maps to the location of the school:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Uhmapoverview.gif|600px]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Uhmapdetail.gif|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Supporting Organizations==&lt;br /&gt;
&lt;br /&gt;
[[Image:Beglogo.jpg]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Seglogo.png]]&lt;br /&gt;
&lt;br /&gt;
===SEG Wavelets===&lt;br /&gt;
SEG Wavelets is the University of Houston&#039;s SEG student chapter. It is devoted to promoting education in exploration geophysics. We work with professional organizations, industry professionals, University of Houston faculty, and other student organizations to bring students educational, social, and possible future employment opportunities. More details can be found on our [http://segwavelets.uh.edu/ website].&lt;br /&gt;
&lt;br /&gt;
[[Image:Ricelogo.jpg|left]] [[Image:TRIP.png]] [http://www.trip.caam.rice.edu/ The Rice Inversion Project]&amp;lt;br&amp;gt;&lt;br /&gt;
Department of Computational and Applied Mathematics&amp;lt;br&amp;gt;&lt;br /&gt;
Rice University&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Karl</name></author>
	</entry>
	<entry>
		<id>https://ahay.org/index.php?title=Main_Page&amp;diff=3730</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://ahay.org/index.php?title=Main_Page&amp;diff=3730"/>
		<updated>2018-09-21T16:05:19Z</updated>

		<summary type="html">&lt;p&gt;Karl: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;big&amp;gt;&#039;&#039;&#039;Madagascar&#039;&#039;&#039;&amp;lt;/big&amp;gt; is an open-source software package for multidimensional data analysis and [[Reproducibility|reproducible]] computational experiments. Its mission is to provide&lt;br /&gt;
* a convenient and powerful environment&lt;br /&gt;
* a convenient technology transfer tool&lt;br /&gt;
for researchers working with digital image and data processing in geophysics and related fields. Technology developed using the Madagascar project management system is transferred in the form of recorded processing histories, which become &amp;quot;computational recipes&amp;quot; to be verified, exchanged, and modified by users of the system.&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
[[Image:Crystal_Clear_app_katomic.png|left|30px|Modern]]&lt;br /&gt;
Madagascar is a &amp;lt;u&amp;gt;modern&amp;lt;/u&amp;gt;  package. Started in 2003 and publicly released in 2006, it was developed almost entirely from scratch. Being a relatively new package, it follows modern software engineering practices such as module encapsulation and test-driven development. A rapid development of a project of this scope (more than 1,000 main programs and more than 5,000 tests) would not be possible without standing on the shoulders of giants and learning from the 30 years of previous experience in open packages such as SEPlib and Seismic Unix. We have borrowed and reimplemented functionality and ideas from these other packages. &lt;br /&gt;
&lt;br /&gt;
[[Image:Crystal_Clear_app_vcalendar.png|left|30px|Test-driven]]&lt;br /&gt;
Madagascar is a &amp;lt;u&amp;gt;test-driven&amp;lt;/u&amp;gt;  package. Test-driven development is not only an agile software programming practice but also a way of bringing scientific foundation to geophysical research that involves numerical experiments. Bringing reproducibility and peer review, the backbone of any real science, to the field of computational geophysics is the main motivation for Madagascar development. The package consists of two levels: low-level main programs (typically developed in the C programming language and working as data filters) and high-level processing flows (described using the Python programming language) that combine main programs and completely document data processing histories for testing and reproducibility. Experience shows that high-level programming is easily mastered even by beginning students who have no previous programming experience. &lt;br /&gt;
&lt;br /&gt;
[[Image:Crystal_Clear_app_gadu.png|left|30px|Open]]&lt;br /&gt;
Madagascar is an &amp;lt;u&amp;gt;open-source&amp;lt;/u&amp;gt;  package. It is distributed under the standard GPL open-source license, which places no restriction on the usage and modification of the code. Moreover, access to modifying the source repository is not controlled by one organization but shared equally among different developers. This enables an open collaboration among different groups spread all over the world, in the true spirit of the open-source movement. &lt;br /&gt;
&lt;br /&gt;
[[Image:Crystal_Clear_filesystem_blockdevice.png|left|30px|Simple,flexible]]&lt;br /&gt;
Madagascar uses a &amp;lt;u&amp;gt;simple, flexible, and universal&amp;lt;/u&amp;gt;  data format that can handle very large datasets but is not tied specifically to seismic data or data of any other particular kind. This &amp;quot;regularly sampled&amp;quot; format is borrowed from the traditional SEPlib. A universal data format allows us to share general-purpose data processing tools with scientists from other disciplines such as petroleum engineers working on large-scale reservoir simulations.&lt;br /&gt;
&lt;br /&gt;
== Latest News ==&lt;br /&gt;
&lt;br /&gt;
{{#widget:Feed&lt;br /&gt;
|feedurl=http://ahay.org/blog/feed/&lt;br /&gt;
|num=7&lt;br /&gt;
|desc=100&lt;br /&gt;
|date=n&lt;br /&gt;
|targ=n&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Karl</name></author>
	</entry>
	<entry>
		<id>https://ahay.org/index.php?title=HoustonWW2018&amp;diff=3723</id>
		<title>HoustonWW2018</title>
		<link rel="alternate" type="text/html" href="https://ahay.org/index.php?title=HoustonWW2018&amp;diff=3723"/>
		<updated>2018-08-17T20:15:21Z</updated>

		<summary type="html">&lt;p&gt;Karl: /* Synopsis of Results with Links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Houston-ww2018.jpg|1000px]]&lt;br /&gt;
==SEG Working Workshop - Python and Julia for Geophysics - August 8-11, 2018==&lt;br /&gt;
&lt;br /&gt;
[[Working Workshops]] as opposed to &amp;quot;talking workshops&amp;quot; are meetings where the participants work in small teams to develop new software code or to conduct computational experiments addressing a particular problem.  This workshop asks participants to create small groups to identify and address obstacles to more widespread use of Python and Julia in the geophysical community.  Results will be shared in lighting talks and code repositories.&lt;br /&gt;
&lt;br /&gt;
This is the sixth year we have organized a working workshop.  Information about previous events is at this [[http://www.ahay.org/wiki/Working_Workshops website]].&lt;br /&gt;
&lt;br /&gt;
==Objective==&lt;br /&gt;
Python and Julia are good languages for prototyping and applying selected processing.  Lack of good examples that read geophysical data, interface to legacy processing systems, and implement common algorithms are obstacles to more widespread use of these languages in the geophysical community.  The objective of this working workshop is to identify and address these obstacles and promote more widespread use of the languages.&lt;br /&gt;
&lt;br /&gt;
Participants brought their laptops and formed small groups.  They picked projects and started to make examples of geophysical applications written in Python and Julia. About once a day we all checked in to talk about progress.  Sometimes participants collaborated with different groups.  After two and a half days we shared results in a lightning talks (five minute presentations).  Everyone left the workshop with some new skills, ideas, and acquaintances. &lt;br /&gt;
&lt;br /&gt;
The working workshop provided a forum for geophysicist to learn, contribute, and network.&lt;br /&gt;
&lt;br /&gt;
==Link to the original workshop invitation is [[HoustonWW_2018_i]]== &lt;br /&gt;
&lt;br /&gt;
==Agenda==&lt;br /&gt;
*Wednesday afternoon August 8, 2018 1:00-6:00 PM. Optional work session to configure your computer and install open seismic software&lt;br /&gt;
**Do you want help getting your computer up to speed before the working workshop?  Come for informal, one-on-one assistance to:&lt;br /&gt;
*** Install Linux on your computer.&lt;br /&gt;
*** Configure Linux/OSX on your computer.&lt;br /&gt;
*** Install Seismic Unix on your computer&lt;br /&gt;
*** Install Madagascar on your computer.&lt;br /&gt;
*** Install Jupyter and python on your computer.  &lt;br /&gt;
*** Install a virtual Linux system on your Windows computer that will allow you to experiment with a Linux development environment. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Thursday  August 9, 2018 (working workshop starts)&lt;br /&gt;
**8:30-9:00 Coffee&lt;br /&gt;
**9:00-10:00 Introductions, project proposals, and team formations&lt;br /&gt;
**10:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
**1:00-2:00 Group discussion&lt;br /&gt;
**2:00-5:30 Breakout into work teams&lt;br /&gt;
&lt;br /&gt;
*Friday  August 10, 2018&lt;br /&gt;
**8:30-9:00 Coffee. Reform teams.&lt;br /&gt;
**9:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
**1:00-2:00 Group discussion&lt;br /&gt;
**2:00-5:30 Breakout into work teams&lt;br /&gt;
**6:00-8:00 Dinner&lt;br /&gt;
&lt;br /&gt;
*Saturday  August 11, 2018&lt;br /&gt;
**8:30-9:00 Coffee. Reform teams.&lt;br /&gt;
**9:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
** 1:00-2:00 Finalize lightning talks&lt;br /&gt;
**1:00-3:00 Lighting talks&lt;br /&gt;
&lt;br /&gt;
==Synopsis of Results with Links==&lt;br /&gt;
===Derek Parks===&lt;br /&gt;
Some participants found the current BIOS on  Windows computers would not allow them to boot Linux from a USB solid state disk.  Derek created a virtual system that provided a platform that performed for the workshop.  This virtual system can be downloaded at the link [https://drive.google.com/open?id=1sRojofwRbNVYtrzqU2e-CaU651xJmPAl].  Derek provided updates to python files in Madagascar required to make the system run under Python 3.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Derek Parks and Mark Mlella===&lt;br /&gt;
Derek and Mark created Jupyter notebooks with Python to read the Teapot Dome 3D segy final volume and displayed using Matplotlib and Mayavi.  They also read horizon data which they used to flatten horizons and display stratal slices.  They created the amplitude envelope and spectral decomposition volumes and displays. Their presentation is available at the link [https://drive.google.com/file/d/1Wl3MNZotqWMYxPcB5iGL0Kl6lUwih_Gd/view?usp=sharing].&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Matt Griffiths===&lt;br /&gt;
Matt experimented with Apache Spark, a parallel processing tool, that can be used on seismic data.  Spark can be run on a cluster of a single PC with multiple cores.  He found it easy to covert his code to run in parallel.  His Principle Component Analysis ran about 3 times faster on his computer.  His presentation is available at the link [https://drive.google.com/file/d/1mzOurkpcwB_KpG3bK4TyxRHO6R-afF-z/view?usp=sharing].&amp;lt;br&amp;gt;&lt;br /&gt;
His spark code is at the link [https://drive.google.com/file/d/14xONUqo_eaQDYb_qVV_Ykt7rUMDxNcef/view?usp=sharing].&amp;lt;br&amp;gt;&lt;br /&gt;
Matt also experimented with a simple 3D seismic viewer based on pywidgets and matplotlib.  This code is available at the link [https://drive.google.com/file/d/1-28Nj5_r368GfougrABcJvCHgkt-GYHi/view?usp=sharing].&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Rafael Pinto and Thu Nguyen===&lt;br /&gt;
Rafael and Thu processed wells from the Poseidon project in the NW Shelf Australia.  They used lasio to read the data into a Panda data frame, then loaded the data into an sql database.  Lasio processes logs from a single well.  The sql database is good to manipulate multiple wells on a project.  They visualized cross plots in matplotlib and datashader.  Datashader plots were better.  Their jupyter notebook can be downloaded from this link [https://drive.google.com/open?id=16Ul7r32VZRbrs7JxMIuv0ip0a0AG3JoV].&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Lian Jiang===&lt;br /&gt;
Lian worked on Facies classification using Machine Learning.  He used a neural net to address the ML challenge data set from the Brendan Hall&#039;s Leading Edge Article.  Ran trading experiments searching for the best results varying hyper parameters like learning_rate, epochs, and batch_size.  Encouraging results are in his presentation at [https://drive.google.com/file/d/1BaceNSRvlKXsXd1LbhYfX-Wan-9nq8Ss/view?usp=sharing].&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Carlos da Costa===&lt;br /&gt;
Carlos provided a new viewer for Madagascar.  Sfpgreywfl, written in python, will plot a wavefield with a velocity background.  He also wrote a julia version of acoustic finite difference wave equation modeling.  This programs are being added to the Madagascar repository.  His presentation can be downloaded by the link [https://drive.google.com/open?id=1gwGjVsabRADw4-cQwnOPI_x2GcxapO22]&lt;br /&gt;
&lt;br /&gt;
===Sergey Fomel===&lt;br /&gt;
Madagascar already had example of acoustic finite difference wave equation modeling in C, C++, and Fortran90.  Sergey Fomel implemented the same algorithm in Python. and benchmarked the program in all the languages  These are described in the presentation: [https://drive.google.com/file/d/1w302kWFOLPWJwUqAt1NDdBGJ__73XVX1/view?usp=sharing].&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Contact us==&lt;br /&gt;
If you have some ideas about future working workshops, tell us about it!  Send email to [mailto:seismic.working.workshop@gmail.com seismic.working.workshop@gmail.com].&lt;br /&gt;
&lt;br /&gt;
==Workshow Location and Dates==&lt;br /&gt;
The workshop was held in rooms 218 and 219 in Farish Hall at the University of Houston. August 8-11, 2018.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Supporting Organizations==&lt;br /&gt;
===Bureau of Economic Geology, University of Texas at Austin===&lt;br /&gt;
[[Image:Beglogo.jpg]]&lt;br /&gt;
===Society of Exploration Geophysicists===&lt;br /&gt;
[[Image:SEG Logo_Horizontal_SM.png|400px]]&lt;br /&gt;
===SEG Wavelets===&lt;br /&gt;
SEG Wavelets is the University of Houston&#039;s SEG student chapter. It is devoted to promoting education in exploration geophysics. We work with professional organizations, industry professionals, University of Houston faculty, and other student organizations to bring students educational, social, and possible future employment opportunities. More details can be found on our [http://segwavelets.uh.edu/ website].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Karl</name></author>
	</entry>
	<entry>
		<id>https://ahay.org/index.php?title=HoustonWW2018&amp;diff=3722</id>
		<title>HoustonWW2018</title>
		<link rel="alternate" type="text/html" href="https://ahay.org/index.php?title=HoustonWW2018&amp;diff=3722"/>
		<updated>2018-08-17T19:13:25Z</updated>

		<summary type="html">&lt;p&gt;Karl: /* Matt Griffiths */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Houston-ww2018.jpg|1000px]]&lt;br /&gt;
==SEG Working Workshop - Python and Julia for Geophysics - August 8-11, 2018==&lt;br /&gt;
&lt;br /&gt;
[[Working Workshops]] as opposed to &amp;quot;talking workshops&amp;quot; are meetings where the participants work in small teams to develop new software code or to conduct computational experiments addressing a particular problem.  This workshop asks participants to create small groups to identify and address obstacles to more widespread use of Python and Julia in the geophysical community.  Results will be shared in lighting talks and code repositories.&lt;br /&gt;
&lt;br /&gt;
This is the sixth year we have organized a working workshop.  Information about previous events is at this [[http://www.ahay.org/wiki/Working_Workshops website]].&lt;br /&gt;
&lt;br /&gt;
==Objective==&lt;br /&gt;
Python and Julia are good languages for prototyping and applying selected processing.  Lack of good examples that read geophysical data, interface to legacy processing systems, and implement common algorithms are obstacles to more widespread use of these languages in the geophysical community.  The objective of this working workshop is to identify and address these obstacles and promote more widespread use of the languages.&lt;br /&gt;
&lt;br /&gt;
Participants brought their laptops and formed small groups.  They picked projects and started to make examples of geophysical applications written in Python and Julia. About once a day we all checked in to talk about progress.  Sometimes participants collaborated with different groups.  After two and a half days we shared results in a lightning talks (five minute presentations).  Everyone left the workshop with some new skills, ideas, and acquaintances. &lt;br /&gt;
&lt;br /&gt;
The working workshop provided a forum for geophysicist to learn, contribute, and network.&lt;br /&gt;
&lt;br /&gt;
==Link to the original workshop invitation is [[HoustonWW_2018_i]]== &lt;br /&gt;
&lt;br /&gt;
==Agenda==&lt;br /&gt;
*Wednesday afternoon August 8, 2018 1:00-6:00 PM. Optional work session to configure your computer and install open seismic software&lt;br /&gt;
**Do you want help getting your computer up to speed before the working workshop?  Come for informal, one-on-one assistance to:&lt;br /&gt;
*** Install Linux on your computer.&lt;br /&gt;
*** Configure Linux/OSX on your computer.&lt;br /&gt;
*** Install Seismic Unix on your computer&lt;br /&gt;
*** Install Madagascar on your computer.&lt;br /&gt;
*** Install Jupyter and python on your computer.  &lt;br /&gt;
*** Install a virtual Linux system on your Windows computer that will allow you to experiment with a Linux development environment. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Thursday  August 9, 2018 (working workshop starts)&lt;br /&gt;
**8:30-9:00 Coffee&lt;br /&gt;
**9:00-10:00 Introductions, project proposals, and team formations&lt;br /&gt;
**10:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
**1:00-2:00 Group discussion&lt;br /&gt;
**2:00-5:30 Breakout into work teams&lt;br /&gt;
&lt;br /&gt;
*Friday  August 10, 2018&lt;br /&gt;
**8:30-9:00 Coffee. Reform teams.&lt;br /&gt;
**9:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
**1:00-2:00 Group discussion&lt;br /&gt;
**2:00-5:30 Breakout into work teams&lt;br /&gt;
**6:00-8:00 Dinner&lt;br /&gt;
&lt;br /&gt;
*Saturday  August 11, 2018&lt;br /&gt;
**8:30-9:00 Coffee. Reform teams.&lt;br /&gt;
**9:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
** 1:00-2:00 Finalize lightning talks&lt;br /&gt;
**1:00-3:00 Lighting talks&lt;br /&gt;
&lt;br /&gt;
==Synopsis of Results with Links==&lt;br /&gt;
===Derek Parks===&lt;br /&gt;
Some participants found the current BIOS on  Windows computers would not allow them to boot Linux from a USB solid state disk.  Derek created a virtual system that provided a platform that performed for the workshop.  This virtual system can be downloaded at the link [link to be created].  Derek provided updates to python files in Madagascar required to make the system run under Python 3.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Derek Parks and Mark Mlella===&lt;br /&gt;
Derek and Mark created Jupyter notebooks with Python to read the Teapot Dome 3D segy final volume and displayed using Matplotlib and Mayavi.  They also read horizon data which they used to flatten horizons and display stratal slices.  They created the amplitude envelope and spectral decomposition volumes and displays. Their presentation is available at the link [https://drive.google.com/file/d/1Wl3MNZotqWMYxPcB5iGL0Kl6lUwih_Gd/view?usp=sharing].&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Matt Griffiths===&lt;br /&gt;
Matt experimented with Apache Spark, a parallel processing tool, that can be used on seismic data.  Spark can be run on a cluster of a single PC with multiple cores.  He found it easy to covert his code to run in parallel.  His Principle Component Analysis ran about 3 times faster on his computer.  His presentation is available at the link [https://drive.google.com/file/d/1mzOurkpcwB_KpG3bK4TyxRHO6R-afF-z/view?usp=sharing].&amp;lt;br&amp;gt;&lt;br /&gt;
His spark code is at the link [https://drive.google.com/file/d/14xONUqo_eaQDYb_qVV_Ykt7rUMDxNcef/view?usp=sharing].&amp;lt;br&amp;gt;&lt;br /&gt;
Matt also experimented with a simple 3D seismic viewer based on pywidgets and matplotlib.  This code is available at the link [https://drive.google.com/file/d/1-28Nj5_r368GfougrABcJvCHgkt-GYHi/view?usp=sharing].&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Lian Jiang===&lt;br /&gt;
Lian worked on Facies classification using Machine Learning.  He used a neural net to address the ML challenge data set from the Brendan Hall&#039;s Leading Edge Article.  Ran trading experiments searching for the best results varying hyper parameters like learning_rate, epochs, and batch_size.  Encouraging results are in his presentation at [https://drive.google.com/file/d/1BaceNSRvlKXsXd1LbhYfX-Wan-9nq8Ss/view?usp=sharing].&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Carlos da Costa===&lt;br /&gt;
&lt;br /&gt;
===Sergey Fomel and Karl Schleicher===&lt;br /&gt;
&lt;br /&gt;
==Contact us==&lt;br /&gt;
If you have some ideas about future working workshops, tell us about it!  Send email to [mailto:seismic.working.workshop@gmail.com seismic.working.workshop@gmail.com].&lt;br /&gt;
&lt;br /&gt;
==Workshow Location and Dates==&lt;br /&gt;
The workshop was held in rooms 218 and 219 in Farish Hall at the University of Houston. August 8-11, 2018.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Supporting Organizations==&lt;br /&gt;
===Bureau of Economic Geology, University of Texas at Austin===&lt;br /&gt;
[[Image:Beglogo.jpg]]&lt;br /&gt;
===Society of Exploration Geophysicists===&lt;br /&gt;
[[Image:SEG Logo_Horizontal_SM.png|400px]]&lt;br /&gt;
===SEG Wavelets===&lt;br /&gt;
SEG Wavelets is the University of Houston&#039;s SEG student chapter. It is devoted to promoting education in exploration geophysics. We work with professional organizations, industry professionals, University of Houston faculty, and other student organizations to bring students educational, social, and possible future employment opportunities. More details can be found on our [http://segwavelets.uh.edu/ website].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Karl</name></author>
	</entry>
	<entry>
		<id>https://ahay.org/index.php?title=HoustonWW2018&amp;diff=3721</id>
		<title>HoustonWW2018</title>
		<link rel="alternate" type="text/html" href="https://ahay.org/index.php?title=HoustonWW2018&amp;diff=3721"/>
		<updated>2018-08-17T19:12:52Z</updated>

		<summary type="html">&lt;p&gt;Karl: /* Derek Parks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Houston-ww2018.jpg|1000px]]&lt;br /&gt;
==SEG Working Workshop - Python and Julia for Geophysics - August 8-11, 2018==&lt;br /&gt;
&lt;br /&gt;
[[Working Workshops]] as opposed to &amp;quot;talking workshops&amp;quot; are meetings where the participants work in small teams to develop new software code or to conduct computational experiments addressing a particular problem.  This workshop asks participants to create small groups to identify and address obstacles to more widespread use of Python and Julia in the geophysical community.  Results will be shared in lighting talks and code repositories.&lt;br /&gt;
&lt;br /&gt;
This is the sixth year we have organized a working workshop.  Information about previous events is at this [[http://www.ahay.org/wiki/Working_Workshops website]].&lt;br /&gt;
&lt;br /&gt;
==Objective==&lt;br /&gt;
Python and Julia are good languages for prototyping and applying selected processing.  Lack of good examples that read geophysical data, interface to legacy processing systems, and implement common algorithms are obstacles to more widespread use of these languages in the geophysical community.  The objective of this working workshop is to identify and address these obstacles and promote more widespread use of the languages.&lt;br /&gt;
&lt;br /&gt;
Participants brought their laptops and formed small groups.  They picked projects and started to make examples of geophysical applications written in Python and Julia. About once a day we all checked in to talk about progress.  Sometimes participants collaborated with different groups.  After two and a half days we shared results in a lightning talks (five minute presentations).  Everyone left the workshop with some new skills, ideas, and acquaintances. &lt;br /&gt;
&lt;br /&gt;
The working workshop provided a forum for geophysicist to learn, contribute, and network.&lt;br /&gt;
&lt;br /&gt;
==Link to the original workshop invitation is [[HoustonWW_2018_i]]== &lt;br /&gt;
&lt;br /&gt;
==Agenda==&lt;br /&gt;
*Wednesday afternoon August 8, 2018 1:00-6:00 PM. Optional work session to configure your computer and install open seismic software&lt;br /&gt;
**Do you want help getting your computer up to speed before the working workshop?  Come for informal, one-on-one assistance to:&lt;br /&gt;
*** Install Linux on your computer.&lt;br /&gt;
*** Configure Linux/OSX on your computer.&lt;br /&gt;
*** Install Seismic Unix on your computer&lt;br /&gt;
*** Install Madagascar on your computer.&lt;br /&gt;
*** Install Jupyter and python on your computer.  &lt;br /&gt;
*** Install a virtual Linux system on your Windows computer that will allow you to experiment with a Linux development environment. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Thursday  August 9, 2018 (working workshop starts)&lt;br /&gt;
**8:30-9:00 Coffee&lt;br /&gt;
**9:00-10:00 Introductions, project proposals, and team formations&lt;br /&gt;
**10:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
**1:00-2:00 Group discussion&lt;br /&gt;
**2:00-5:30 Breakout into work teams&lt;br /&gt;
&lt;br /&gt;
*Friday  August 10, 2018&lt;br /&gt;
**8:30-9:00 Coffee. Reform teams.&lt;br /&gt;
**9:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
**1:00-2:00 Group discussion&lt;br /&gt;
**2:00-5:30 Breakout into work teams&lt;br /&gt;
**6:00-8:00 Dinner&lt;br /&gt;
&lt;br /&gt;
*Saturday  August 11, 2018&lt;br /&gt;
**8:30-9:00 Coffee. Reform teams.&lt;br /&gt;
**9:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
** 1:00-2:00 Finalize lightning talks&lt;br /&gt;
**1:00-3:00 Lighting talks&lt;br /&gt;
&lt;br /&gt;
==Synopsis of Results with Links==&lt;br /&gt;
===Derek Parks===&lt;br /&gt;
Some participants found the current BIOS on  Windows computers would not allow them to boot Linux from a USB solid state disk.  Derek created a virtual system that provided a platform that performed for the workshop.  This virtual system can be downloaded at the link [link to be created].  Derek provided updates to python files in Madagascar required to make the system run under Python 3.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Derek Parks and Mark Mlella===&lt;br /&gt;
Derek and Mark created Jupyter notebooks with Python to read the Teapot Dome 3D segy final volume and displayed using Matplotlib and Mayavi.  They also read horizon data which they used to flatten horizons and display stratal slices.  They created the amplitude envelope and spectral decomposition volumes and displays. Their presentation is available at the link [https://drive.google.com/file/d/1Wl3MNZotqWMYxPcB5iGL0Kl6lUwih_Gd/view?usp=sharing].&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Matt Griffiths===&lt;br /&gt;
Matt experimented with Apache Spark, a parallel processing tool, that can be used on seismic data.  Spark can be run on a cluster of a single PC with multiple cores.  He found it easy to covert his code to run in parallel.  His Principle Component Analysis ran about 3 times faster on his computer.  His presentation is available at the link [https://drive.google.com/file/d/1mzOurkpcwB_KpG3bK4TyxRHO6R-afF-z/view?usp=sharing].&amp;lt;br&amp;gt;&lt;br /&gt;
His spark code is at the link [https://drive.google.com/file/d/14xONUqo_eaQDYb_qVV_Ykt7rUMDxNcef/view?usp=sharing].&amp;lt;br&amp;gt;   &lt;br /&gt;
He also experimented with a simple 3D seismic viewer based on pywidgets and matplotlib.  This code is available at the link [https://drive.google.com/file/d/1-28Nj5_r368GfougrABcJvCHgkt-GYHi/view?usp=sharing].&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Lian Jiang===&lt;br /&gt;
Lian worked on Facies classification using Machine Learning.  He used a neural net to address the ML challenge data set from the Brendan Hall&#039;s Leading Edge Article.  Ran trading experiments searching for the best results varying hyper parameters like learning_rate, epochs, and batch_size.  Encouraging results are in his presentation at [https://drive.google.com/file/d/1BaceNSRvlKXsXd1LbhYfX-Wan-9nq8Ss/view?usp=sharing].&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Carlos da Costa===&lt;br /&gt;
&lt;br /&gt;
===Sergey Fomel and Karl Schleicher===&lt;br /&gt;
&lt;br /&gt;
==Contact us==&lt;br /&gt;
If you have some ideas about future working workshops, tell us about it!  Send email to [mailto:seismic.working.workshop@gmail.com seismic.working.workshop@gmail.com].&lt;br /&gt;
&lt;br /&gt;
==Workshow Location and Dates==&lt;br /&gt;
The workshop was held in rooms 218 and 219 in Farish Hall at the University of Houston. August 8-11, 2018.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Supporting Organizations==&lt;br /&gt;
===Bureau of Economic Geology, University of Texas at Austin===&lt;br /&gt;
[[Image:Beglogo.jpg]]&lt;br /&gt;
===Society of Exploration Geophysicists===&lt;br /&gt;
[[Image:SEG Logo_Horizontal_SM.png|400px]]&lt;br /&gt;
===SEG Wavelets===&lt;br /&gt;
SEG Wavelets is the University of Houston&#039;s SEG student chapter. It is devoted to promoting education in exploration geophysics. We work with professional organizations, industry professionals, University of Houston faculty, and other student organizations to bring students educational, social, and possible future employment opportunities. More details can be found on our [http://segwavelets.uh.edu/ website].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Karl</name></author>
	</entry>
	<entry>
		<id>https://ahay.org/index.php?title=HoustonWW2018&amp;diff=3720</id>
		<title>HoustonWW2018</title>
		<link rel="alternate" type="text/html" href="https://ahay.org/index.php?title=HoustonWW2018&amp;diff=3720"/>
		<updated>2018-08-17T19:10:47Z</updated>

		<summary type="html">&lt;p&gt;Karl: /* Objective */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Houston-ww2018.jpg|1000px]]&lt;br /&gt;
==SEG Working Workshop - Python and Julia for Geophysics - August 8-11, 2018==&lt;br /&gt;
&lt;br /&gt;
[[Working Workshops]] as opposed to &amp;quot;talking workshops&amp;quot; are meetings where the participants work in small teams to develop new software code or to conduct computational experiments addressing a particular problem.  This workshop asks participants to create small groups to identify and address obstacles to more widespread use of Python and Julia in the geophysical community.  Results will be shared in lighting talks and code repositories.&lt;br /&gt;
&lt;br /&gt;
This is the sixth year we have organized a working workshop.  Information about previous events is at this [[http://www.ahay.org/wiki/Working_Workshops website]].&lt;br /&gt;
&lt;br /&gt;
==Objective==&lt;br /&gt;
Python and Julia are good languages for prototyping and applying selected processing.  Lack of good examples that read geophysical data, interface to legacy processing systems, and implement common algorithms are obstacles to more widespread use of these languages in the geophysical community.  The objective of this working workshop is to identify and address these obstacles and promote more widespread use of the languages.&lt;br /&gt;
&lt;br /&gt;
Participants brought their laptops and formed small groups.  They picked projects and started to make examples of geophysical applications written in Python and Julia. About once a day we all checked in to talk about progress.  Sometimes participants collaborated with different groups.  After two and a half days we shared results in a lightning talks (five minute presentations).  Everyone left the workshop with some new skills, ideas, and acquaintances. &lt;br /&gt;
&lt;br /&gt;
The working workshop provided a forum for geophysicist to learn, contribute, and network.&lt;br /&gt;
&lt;br /&gt;
==Link to the original workshop invitation is [[HoustonWW_2018_i]]== &lt;br /&gt;
&lt;br /&gt;
==Agenda==&lt;br /&gt;
*Wednesday afternoon August 8, 2018 1:00-6:00 PM. Optional work session to configure your computer and install open seismic software&lt;br /&gt;
**Do you want help getting your computer up to speed before the working workshop?  Come for informal, one-on-one assistance to:&lt;br /&gt;
*** Install Linux on your computer.&lt;br /&gt;
*** Configure Linux/OSX on your computer.&lt;br /&gt;
*** Install Seismic Unix on your computer&lt;br /&gt;
*** Install Madagascar on your computer.&lt;br /&gt;
*** Install Jupyter and python on your computer.  &lt;br /&gt;
*** Install a virtual Linux system on your Windows computer that will allow you to experiment with a Linux development environment. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Thursday  August 9, 2018 (working workshop starts)&lt;br /&gt;
**8:30-9:00 Coffee&lt;br /&gt;
**9:00-10:00 Introductions, project proposals, and team formations&lt;br /&gt;
**10:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
**1:00-2:00 Group discussion&lt;br /&gt;
**2:00-5:30 Breakout into work teams&lt;br /&gt;
&lt;br /&gt;
*Friday  August 10, 2018&lt;br /&gt;
**8:30-9:00 Coffee. Reform teams.&lt;br /&gt;
**9:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
**1:00-2:00 Group discussion&lt;br /&gt;
**2:00-5:30 Breakout into work teams&lt;br /&gt;
**6:00-8:00 Dinner&lt;br /&gt;
&lt;br /&gt;
*Saturday  August 11, 2018&lt;br /&gt;
**8:30-9:00 Coffee. Reform teams.&lt;br /&gt;
**9:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
** 1:00-2:00 Finalize lightning talks&lt;br /&gt;
**1:00-3:00 Lighting talks&lt;br /&gt;
&lt;br /&gt;
==Synopsis of Results with Links==&lt;br /&gt;
===Derek Parks===&lt;br /&gt;
Some participants found the current BIOS on  windows computers would not allow them to boot Linux from a USB solid state disk.  Derek created a virtual system that provided a platform that performed for the workshop.  This virtual system can be downloaded at the link [link to be created].&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Derek Parks and Mark Mlella===&lt;br /&gt;
Derek and Mark created Jupyter notebooks with Python to read the Teapot Dome 3D segy final volume and displayed using Matplotlib and Mayavi.  They also read horizon data which they used to flatten horizons and display stratal slices.  They created the amplitude envelope and spectral decomposition volumes and displays. Their presentation is available at the link [https://drive.google.com/file/d/1Wl3MNZotqWMYxPcB5iGL0Kl6lUwih_Gd/view?usp=sharing].&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Matt Griffiths===&lt;br /&gt;
Matt experimented with Apache Spark, a parallel processing tool, that can be used on seismic data.  Spark can be run on a cluster of a single PC with multiple cores.  He found it easy to covert his code to run in parallel.  His Principle Component Analysis ran about 3 times faster on his computer.  His presentation is available at the link [https://drive.google.com/file/d/1mzOurkpcwB_KpG3bK4TyxRHO6R-afF-z/view?usp=sharing].&amp;lt;br&amp;gt;&lt;br /&gt;
His spark code is at the link [https://drive.google.com/file/d/14xONUqo_eaQDYb_qVV_Ykt7rUMDxNcef/view?usp=sharing].&amp;lt;br&amp;gt;   &lt;br /&gt;
He also experimented with a simple 3D seismic viewer based on pywidgets and matplotlib.  This code is available at the link [https://drive.google.com/file/d/1-28Nj5_r368GfougrABcJvCHgkt-GYHi/view?usp=sharing].&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Lian Jiang===&lt;br /&gt;
Lian worked on Facies classification using Machine Learning.  He used a neural net to address the ML challenge data set from the Brendan Hall&#039;s Leading Edge Article.  Ran trading experiments searching for the best results varying hyper parameters like learning_rate, epochs, and batch_size.  Encouraging results are in his presentation at [https://drive.google.com/file/d/1BaceNSRvlKXsXd1LbhYfX-Wan-9nq8Ss/view?usp=sharing].&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Carlos da Costa===&lt;br /&gt;
&lt;br /&gt;
===Sergey Fomel and Karl Schleicher===&lt;br /&gt;
&lt;br /&gt;
==Contact us==&lt;br /&gt;
If you have some ideas about future working workshops, tell us about it!  Send email to [mailto:seismic.working.workshop@gmail.com seismic.working.workshop@gmail.com].&lt;br /&gt;
&lt;br /&gt;
==Workshow Location and Dates==&lt;br /&gt;
The workshop was held in rooms 218 and 219 in Farish Hall at the University of Houston. August 8-11, 2018.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Supporting Organizations==&lt;br /&gt;
===Bureau of Economic Geology, University of Texas at Austin===&lt;br /&gt;
[[Image:Beglogo.jpg]]&lt;br /&gt;
===Society of Exploration Geophysicists===&lt;br /&gt;
[[Image:SEG Logo_Horizontal_SM.png|400px]]&lt;br /&gt;
===SEG Wavelets===&lt;br /&gt;
SEG Wavelets is the University of Houston&#039;s SEG student chapter. It is devoted to promoting education in exploration geophysics. We work with professional organizations, industry professionals, University of Houston faculty, and other student organizations to bring students educational, social, and possible future employment opportunities. More details can be found on our [http://segwavelets.uh.edu/ website].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Karl</name></author>
	</entry>
	<entry>
		<id>https://ahay.org/index.php?title=HoustonWW2018&amp;diff=3719</id>
		<title>HoustonWW2018</title>
		<link rel="alternate" type="text/html" href="https://ahay.org/index.php?title=HoustonWW2018&amp;diff=3719"/>
		<updated>2018-08-17T13:36:16Z</updated>

		<summary type="html">&lt;p&gt;Karl: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Houston-ww2018.jpg|1000px]]&lt;br /&gt;
==SEG Working Workshop - Python and Julia for Geophysics - August 8-11, 2018==&lt;br /&gt;
&lt;br /&gt;
[[Working Workshops]] as opposed to &amp;quot;talking workshops&amp;quot; are meetings where the participants work in small teams to develop new software code or to conduct computational experiments addressing a particular problem.  This workshop asks participants to create small groups to identify and address obstacles to more widespread use of Python and Julia in the geophysical community.  Results will be shared in lighting talks and code repositories.&lt;br /&gt;
&lt;br /&gt;
This is the sixth year we have organized a working workshop.  Information about previous events is at this [[http://www.ahay.org/wiki/Working_Workshops website]].&lt;br /&gt;
&lt;br /&gt;
==Objective==&lt;br /&gt;
Python and Julia are good languages for prototyping and applying selected processing.  Lack of good examples that read geophysical data, interface to legacy processing systems, and implement common algorithms are obstacles to more widespread use of these languages in the geophysical community.  The objective of this working workshop is to identify and address these obstacles and promote more widespread use of the languages.&lt;br /&gt;
&lt;br /&gt;
Participants brough their own laptops and formed small groups.  These groups picked projects and started to make examples of geophysical applications written in Python and Julia. About once a day we all checked in to talk about progress.  Sometimes participants collaborated with different groups.  After two and a half days we shared results in a lightning talks (five minute presentations).  I think everyone left the workshop with some new skills, ideas, and acquaintances. &lt;br /&gt;
&lt;br /&gt;
The working workshop provided a forum for geophysicist to learn, contribute, and network.&lt;br /&gt;
&lt;br /&gt;
==Link to the original workshop invitation is [[HoustonWW_2018_i]]== &lt;br /&gt;
&lt;br /&gt;
==Agenda==&lt;br /&gt;
*Wednesday afternoon August 8, 2018 1:00-6:00 PM. Optional work session to configure your computer and install open seismic software&lt;br /&gt;
**Do you want help getting your computer up to speed before the working workshop?  Come for informal, one-on-one assistance to:&lt;br /&gt;
*** Install Linux on your computer.&lt;br /&gt;
*** Configure Linux/OSX on your computer.&lt;br /&gt;
*** Install Seismic Unix on your computer&lt;br /&gt;
*** Install Madagascar on your computer.&lt;br /&gt;
*** Install Jupyter and python on your computer.  &lt;br /&gt;
*** Install a virtual Linux system on your Windows computer that will allow you to experiment with a Linux development environment. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Thursday  August 9, 2018 (working workshop starts)&lt;br /&gt;
**8:30-9:00 Coffee&lt;br /&gt;
**9:00-10:00 Introductions, project proposals, and team formations&lt;br /&gt;
**10:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
**1:00-2:00 Group discussion&lt;br /&gt;
**2:00-5:30 Breakout into work teams&lt;br /&gt;
&lt;br /&gt;
*Friday  August 10, 2018&lt;br /&gt;
**8:30-9:00 Coffee. Reform teams.&lt;br /&gt;
**9:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
**1:00-2:00 Group discussion&lt;br /&gt;
**2:00-5:30 Breakout into work teams&lt;br /&gt;
**6:00-8:00 Dinner&lt;br /&gt;
&lt;br /&gt;
*Saturday  August 11, 2018&lt;br /&gt;
**8:30-9:00 Coffee. Reform teams.&lt;br /&gt;
**9:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
** 1:00-2:00 Finalize lightning talks&lt;br /&gt;
**1:00-3:00 Lighting talks&lt;br /&gt;
&lt;br /&gt;
==Synopsis of Results with Links==&lt;br /&gt;
===Derek Parks===&lt;br /&gt;
Some participants found the current BIOS on  windows computers would not allow them to boot Linux from a USB solid state disk.  Derek created a virtual system that provided a platform that performed for the workshop.  This virtual system can be downloaded at the link [link to be created].&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Derek Parks and Mark Mlella===&lt;br /&gt;
Derek and Mark created Jupyter notebooks with Python to read the Teapot Dome 3D segy final volume and displayed using Matplotlib and Mayavi.  They also read horizon data which they used to flatten horizons and display stratal slices.  They created the amplitude envelope and spectral decomposition volumes and displays. Their presentation is available at the link [https://drive.google.com/file/d/1Wl3MNZotqWMYxPcB5iGL0Kl6lUwih_Gd/view?usp=sharing].&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Matt Griffiths===&lt;br /&gt;
Matt experimented with Apache Spark, a parallel processing tool, that can be used on seismic data.  Spark can be run on a cluster of a single PC with multiple cores.  He found it easy to covert his code to run in parallel.  His Principle Component Analysis ran about 3 times faster on his computer.  His presentation is available at the link [https://drive.google.com/file/d/1mzOurkpcwB_KpG3bK4TyxRHO6R-afF-z/view?usp=sharing].&amp;lt;br&amp;gt;&lt;br /&gt;
His spark code is at the link [https://drive.google.com/file/d/14xONUqo_eaQDYb_qVV_Ykt7rUMDxNcef/view?usp=sharing].&amp;lt;br&amp;gt;   &lt;br /&gt;
He also experimented with a simple 3D seismic viewer based on pywidgets and matplotlib.  This code is available at the link [https://drive.google.com/file/d/1-28Nj5_r368GfougrABcJvCHgkt-GYHi/view?usp=sharing].&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Lian Jiang===&lt;br /&gt;
Lian worked on Facies classification using Machine Learning.  He used a neural net to address the ML challenge data set from the Brendan Hall&#039;s Leading Edge Article.  Ran trading experiments searching for the best results varying hyper parameters like learning_rate, epochs, and batch_size.  Encouraging results are in his presentation at [https://drive.google.com/file/d/1BaceNSRvlKXsXd1LbhYfX-Wan-9nq8Ss/view?usp=sharing].&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Carlos da Costa===&lt;br /&gt;
&lt;br /&gt;
===Sergey Fomel and Karl Schleicher===&lt;br /&gt;
&lt;br /&gt;
==Contact us==&lt;br /&gt;
If you have some ideas about future working workshops, tell us about it!  Send email to [mailto:seismic.working.workshop@gmail.com seismic.working.workshop@gmail.com].&lt;br /&gt;
&lt;br /&gt;
==Workshow Location and Dates==&lt;br /&gt;
The workshop was held in rooms 218 and 219 in Farish Hall at the University of Houston. August 8-11, 2018.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Supporting Organizations==&lt;br /&gt;
===Bureau of Economic Geology, University of Texas at Austin===&lt;br /&gt;
[[Image:Beglogo.jpg]]&lt;br /&gt;
===Society of Exploration Geophysicists===&lt;br /&gt;
[[Image:SEG Logo_Horizontal_SM.png|400px]]&lt;br /&gt;
===SEG Wavelets===&lt;br /&gt;
SEG Wavelets is the University of Houston&#039;s SEG student chapter. It is devoted to promoting education in exploration geophysics. We work with professional organizations, industry professionals, University of Houston faculty, and other student organizations to bring students educational, social, and possible future employment opportunities. More details can be found on our [http://segwavelets.uh.edu/ website].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Karl</name></author>
	</entry>
	<entry>
		<id>https://ahay.org/index.php?title=HoustonWW2018&amp;diff=3718</id>
		<title>HoustonWW2018</title>
		<link rel="alternate" type="text/html" href="https://ahay.org/index.php?title=HoustonWW2018&amp;diff=3718"/>
		<updated>2018-08-17T12:11:28Z</updated>

		<summary type="html">&lt;p&gt;Karl: /* Draft agenda */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Houston-ww2018.jpg|1000px]]&lt;br /&gt;
==SEG Working Workshop - Python and Julia for Geophysics - August 8-11, 2018==&lt;br /&gt;
&lt;br /&gt;
[[Working Workshops]] as opposed to &amp;quot;talking workshops&amp;quot; are meetings where the participants work in small teams to develop new software code or to conduct computational experiments addressing a particular problem.  This workshop asks participants to create small groups to identify and address obstacles to more widespread use of Python and Julia in the geophysical community.  Results will be shared in lighting talks and code repositories.&lt;br /&gt;
&lt;br /&gt;
This is the sixth year we have organized a working workshop.  Information about previous events is at this [[http://www.ahay.org/wiki/Working_Workshops website]].&lt;br /&gt;
&lt;br /&gt;
==Objective==&lt;br /&gt;
Python and Julia are good languages for prototyping and applying selected processing.  Lack of good examples that read geophysical data, interface to legacy processing systems, and implement common algorithms are obstacles to more widespread use of these languages in the geophysical community.  The objective of this working workshop is to identify and address these obstacles and promote more widespread use of the languages.&lt;br /&gt;
&lt;br /&gt;
Participants brough their own laptops and formed small groups.  These groups picked projects and started to make examples of geophysical applications written in Python and Julia. About once a day we all checked in to talk about progress.  Sometimes participants collaborated with different groups.  After two and a half days we shared results in a lightning talks (five minute presentations).  I think everyone left the workshop with some new skills, ideas, and acquaintances. &lt;br /&gt;
&lt;br /&gt;
The working workshop provided a forum for geophysicist to learn, contribute, and network.&lt;br /&gt;
&lt;br /&gt;
==Link to the original workshop invitation is [[HoustonWW_2018_i]]== &lt;br /&gt;
&lt;br /&gt;
==Agenda==&lt;br /&gt;
*Wednesday afternoon August 8, 2017 1:00-6:00 PM. Optional work session to configure your computer and install open seismic software&lt;br /&gt;
**Do you want help getting your computer up to speed before the working workshop?  Come for informal, one-on-one assistance to:&lt;br /&gt;
*** Install Linux on your computer.&lt;br /&gt;
*** Configure Linux/OSX on your computer.&lt;br /&gt;
*** Install Seismic Unix on your computer&lt;br /&gt;
*** Install Madagascar on your computer.&lt;br /&gt;
*** Install Jupyter and python on your computer.  &lt;br /&gt;
*** Install a virtual Linux system on your Windows computer that will allow you to experiment with a Linux development environment. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Thursday  August 9, 2017 (working workshop starts)&lt;br /&gt;
**8:30-9:00 Coffee&lt;br /&gt;
**9:00-10:00 Introductions, project proposals, and team formations&lt;br /&gt;
**10:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
**1:00-2:00 Group discussion&lt;br /&gt;
**2:00-5:30 Breakout into work teams&lt;br /&gt;
&lt;br /&gt;
*Friday  August 10, 2016&lt;br /&gt;
**8:30-9:00 Coffee. Reform teams.&lt;br /&gt;
**9:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
**1:00-2:00 Group discussion&lt;br /&gt;
**2:00-5:30 Breakout into work teams&lt;br /&gt;
**6:00-8:00 Dinner&lt;br /&gt;
&lt;br /&gt;
*Saturday  August 11, 2016&lt;br /&gt;
**8:30-9:00 Coffee. Reform teams.&lt;br /&gt;
**9:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
** 1:00-2:00 Finalize lightning talks&lt;br /&gt;
**1:00-3:00 Lighting talks&lt;br /&gt;
&lt;br /&gt;
==Synopsis of Results with Links==&lt;br /&gt;
&lt;br /&gt;
==Contact us==&lt;br /&gt;
If you have some ideas about working workshops, tell us about it!  Send email to [mailto:seismic.working.workshop@gmail.com seismic.working.workshop@gmail.com].&lt;br /&gt;
&lt;br /&gt;
==Workshow Location==&lt;br /&gt;
The workshop was held in rooms 218 and 219 in Farish Hall at the University of Houston.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Supporting Organizations==&lt;br /&gt;
===Bureau of Economic Geology, University of Texas at Austin===&lt;br /&gt;
[[Image:Beglogo.jpg]]&lt;br /&gt;
===Society of Exploration Geophysicists===&lt;br /&gt;
[[Image:SEG Logo_Horizontal_SM.png|400px]]&lt;br /&gt;
===SEG Wavelets===&lt;br /&gt;
SEG Wavelets is the University of Houston&#039;s SEG student chapter. It is devoted to promoting education in exploration geophysics. We work with professional organizations, industry professionals, University of Houston faculty, and other student organizations to bring students educational, social, and possible future employment opportunities. More details can be found on our [http://segwavelets.uh.edu/ website].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Karl</name></author>
	</entry>
	<entry>
		<id>https://ahay.org/index.php?title=HoustonWW2018&amp;diff=3717</id>
		<title>HoustonWW2018</title>
		<link rel="alternate" type="text/html" href="https://ahay.org/index.php?title=HoustonWW2018&amp;diff=3717"/>
		<updated>2018-08-17T12:10:53Z</updated>

		<summary type="html">&lt;p&gt;Karl: /* SEG Working Workshop - Python and Julia for Geophysics - August 8-11, 2018 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Houston-ww2018.jpg|1000px]]&lt;br /&gt;
==SEG Working Workshop - Python and Julia for Geophysics - August 8-11, 2018==&lt;br /&gt;
&lt;br /&gt;
[[Working Workshops]] as opposed to &amp;quot;talking workshops&amp;quot; are meetings where the participants work in small teams to develop new software code or to conduct computational experiments addressing a particular problem.  This workshop asks participants to create small groups to identify and address obstacles to more widespread use of Python and Julia in the geophysical community.  Results will be shared in lighting talks and code repositories.&lt;br /&gt;
&lt;br /&gt;
This is the sixth year we have organized a working workshop.  Information about previous events is at this [[http://www.ahay.org/wiki/Working_Workshops website]].&lt;br /&gt;
&lt;br /&gt;
==Objective==&lt;br /&gt;
Python and Julia are good languages for prototyping and applying selected processing.  Lack of good examples that read geophysical data, interface to legacy processing systems, and implement common algorithms are obstacles to more widespread use of these languages in the geophysical community.  The objective of this working workshop is to identify and address these obstacles and promote more widespread use of the languages.&lt;br /&gt;
&lt;br /&gt;
Participants brough their own laptops and formed small groups.  These groups picked projects and started to make examples of geophysical applications written in Python and Julia. About once a day we all checked in to talk about progress.  Sometimes participants collaborated with different groups.  After two and a half days we shared results in a lightning talks (five minute presentations).  I think everyone left the workshop with some new skills, ideas, and acquaintances. &lt;br /&gt;
&lt;br /&gt;
The working workshop provided a forum for geophysicist to learn, contribute, and network.&lt;br /&gt;
&lt;br /&gt;
==Link to the original workshop invitation is [[HoustonWW_2018_i]]== &lt;br /&gt;
&lt;br /&gt;
==Draft agenda==&lt;br /&gt;
*Wednesday afternoon August 8, 2017 1:00-6:00 PM. Optional work session to configure your computer and install open seismic software&lt;br /&gt;
**Do you want help getting your computer up to speed before the working workshop?  Come for informal, one-on-one assistance to:&lt;br /&gt;
*** Install Linux on your computer.&lt;br /&gt;
*** Configure Linux/OSX on your computer.&lt;br /&gt;
*** Install Seismic Unix on your computer&lt;br /&gt;
*** Install Madagascar on your computer.&lt;br /&gt;
*** Install Jupyter and python on your computer.  &lt;br /&gt;
*** Install a virtual Linux system on your Windows computer that will allow you to experiment with a Linux development environment. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Thursday  August 9, 2017 (working workshop starts)&lt;br /&gt;
**8:30-9:00 Coffee&lt;br /&gt;
**9:00-10:00 Introductions, project proposals, and team formations&lt;br /&gt;
**10:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
**1:00-2:00 Group discussion&lt;br /&gt;
**2:00-5:30 Breakout into work teams&lt;br /&gt;
&lt;br /&gt;
*Friday  August 10, 2016&lt;br /&gt;
**8:30-9:00 Coffee. Reform teams.&lt;br /&gt;
**9:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
**1:00-2:00 Group discussion&lt;br /&gt;
**2:00-5:30 Breakout into work teams&lt;br /&gt;
**6:00-8:00 Dinner&lt;br /&gt;
&lt;br /&gt;
*Saturday  August 11, 2016&lt;br /&gt;
**8:30-9:00 Coffee. Reform teams.&lt;br /&gt;
**9:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
** 1:00-2:00 Finalize lightning talks&lt;br /&gt;
**1:00-3:00 Lighting talks&lt;br /&gt;
&lt;br /&gt;
==Synopsis of Results with Links==&lt;br /&gt;
&lt;br /&gt;
==Contact us==&lt;br /&gt;
If you have some ideas about working workshops, tell us about it!  Send email to [mailto:seismic.working.workshop@gmail.com seismic.working.workshop@gmail.com].&lt;br /&gt;
&lt;br /&gt;
==Workshow Location==&lt;br /&gt;
The workshop was held in rooms 218 and 219 in Farish Hall at the University of Houston.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Supporting Organizations==&lt;br /&gt;
===Bureau of Economic Geology, University of Texas at Austin===&lt;br /&gt;
[[Image:Beglogo.jpg]]&lt;br /&gt;
===Society of Exploration Geophysicists===&lt;br /&gt;
[[Image:SEG Logo_Horizontal_SM.png|400px]]&lt;br /&gt;
===SEG Wavelets===&lt;br /&gt;
SEG Wavelets is the University of Houston&#039;s SEG student chapter. It is devoted to promoting education in exploration geophysics. We work with professional organizations, industry professionals, University of Houston faculty, and other student organizations to bring students educational, social, and possible future employment opportunities. More details can be found on our [http://segwavelets.uh.edu/ website].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Karl</name></author>
	</entry>
	<entry>
		<id>https://ahay.org/index.php?title=HoustonWW2018&amp;diff=3716</id>
		<title>HoustonWW2018</title>
		<link rel="alternate" type="text/html" href="https://ahay.org/index.php?title=HoustonWW2018&amp;diff=3716"/>
		<updated>2018-08-15T22:29:15Z</updated>

		<summary type="html">&lt;p&gt;Karl: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Houston-ww2018.jpg|1000px]]&lt;br /&gt;
==SEG Working Workshop - Python and Julia for Geophysics - August 8-11, 2018==&lt;br /&gt;
&lt;br /&gt;
[[Working Workshops]] as opposed to &amp;quot;talking workshops&amp;quot; are meetings where the participants work in small teams to develop new software code or to conduct computational experiments addressing a particular problem.  This workshop asks participants to create small groups to identify and address obstacles to more widespread use of Python and Julia in the geophysical community.  Results will be shared in lighting talks and code repositories.&lt;br /&gt;
&lt;br /&gt;
==Objective==&lt;br /&gt;
Python and Julia are good languages for prototyping and applying selected processing.  Lack of good examples that read geophysical data, interface to legacy processing systems, and implement common algorithms are obstacles to more widespread use of these languages in the geophysical community.  The objective of this working workshop is to identify and address these obstacles and promote more widespread use of the languages.&lt;br /&gt;
&lt;br /&gt;
Participants brough their own laptops and formed small groups.  These groups picked projects and started to make examples of geophysical applications written in Python and Julia. About once a day we all checked in to talk about progress.  Sometimes participants collaborated with different groups.  After two and a half days we shared results in a lightning talks (five minute presentations).  I think everyone left the workshop with some new skills, ideas, and acquaintances. &lt;br /&gt;
&lt;br /&gt;
The working workshop provided a forum for geophysicist to learn, contribute, and network.&lt;br /&gt;
&lt;br /&gt;
==Link to the original workshop invitation is [[HoustonWW_2018_i]]== &lt;br /&gt;
&lt;br /&gt;
==Draft agenda==&lt;br /&gt;
*Wednesday afternoon August 8, 2017 1:00-6:00 PM. Optional work session to configure your computer and install open seismic software&lt;br /&gt;
**Do you want help getting your computer up to speed before the working workshop?  Come for informal, one-on-one assistance to:&lt;br /&gt;
*** Install Linux on your computer.&lt;br /&gt;
*** Configure Linux/OSX on your computer.&lt;br /&gt;
*** Install Seismic Unix on your computer&lt;br /&gt;
*** Install Madagascar on your computer.&lt;br /&gt;
*** Install Jupyter and python on your computer.  &lt;br /&gt;
*** Install a virtual Linux system on your Windows computer that will allow you to experiment with a Linux development environment. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Thursday  August 9, 2017 (working workshop starts)&lt;br /&gt;
**8:30-9:00 Coffee&lt;br /&gt;
**9:00-10:00 Introductions, project proposals, and team formations&lt;br /&gt;
**10:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
**1:00-2:00 Group discussion&lt;br /&gt;
**2:00-5:30 Breakout into work teams&lt;br /&gt;
&lt;br /&gt;
*Friday  August 10, 2016&lt;br /&gt;
**8:30-9:00 Coffee. Reform teams.&lt;br /&gt;
**9:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
**1:00-2:00 Group discussion&lt;br /&gt;
**2:00-5:30 Breakout into work teams&lt;br /&gt;
**6:00-8:00 Dinner&lt;br /&gt;
&lt;br /&gt;
*Saturday  August 11, 2016&lt;br /&gt;
**8:30-9:00 Coffee. Reform teams.&lt;br /&gt;
**9:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
** 1:00-2:00 Finalize lightning talks&lt;br /&gt;
**1:00-3:00 Lighting talks&lt;br /&gt;
&lt;br /&gt;
==Synopsis of Results with Links==&lt;br /&gt;
&lt;br /&gt;
==Contact us==&lt;br /&gt;
If you have some ideas about working workshops, tell us about it!  Send email to [mailto:seismic.working.workshop@gmail.com seismic.working.workshop@gmail.com].&lt;br /&gt;
&lt;br /&gt;
==Workshow Location==&lt;br /&gt;
The workshop was held in rooms 218 and 219 in Farish Hall at the University of Houston.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Supporting Organizations==&lt;br /&gt;
===Bureau of Economic Geology, University of Texas at Austin===&lt;br /&gt;
[[Image:Beglogo.jpg]]&lt;br /&gt;
===Society of Exploration Geophysicists===&lt;br /&gt;
[[Image:SEG Logo_Horizontal_SM.png|400px]]&lt;br /&gt;
===SEG Wavelets===&lt;br /&gt;
SEG Wavelets is the University of Houston&#039;s SEG student chapter. It is devoted to promoting education in exploration geophysics. We work with professional organizations, industry professionals, University of Houston faculty, and other student organizations to bring students educational, social, and possible future employment opportunities. More details can be found on our [http://segwavelets.uh.edu/ website].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Karl</name></author>
	</entry>
	<entry>
		<id>https://ahay.org/index.php?title=File:Houston-ww2018.jpg&amp;diff=3715</id>
		<title>File:Houston-ww2018.jpg</title>
		<link rel="alternate" type="text/html" href="https://ahay.org/index.php?title=File:Houston-ww2018.jpg&amp;diff=3715"/>
		<updated>2018-08-15T22:24:09Z</updated>

		<summary type="html">&lt;p&gt;Karl: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Karl</name></author>
	</entry>
	<entry>
		<id>https://ahay.org/index.php?title=HoustonWW2018&amp;diff=3714</id>
		<title>HoustonWW2018</title>
		<link rel="alternate" type="text/html" href="https://ahay.org/index.php?title=HoustonWW2018&amp;diff=3714"/>
		<updated>2018-08-15T22:21:01Z</updated>

		<summary type="html">&lt;p&gt;Karl: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==SEG Working Workshop - Python and Julia for Geophysics - August 8-11, 2018==&lt;br /&gt;
&lt;br /&gt;
[[Working Workshops]] as opposed to &amp;quot;talking workshops&amp;quot; are meetings where the participants work in small teams to develop new software code or to conduct computational experiments addressing a particular problem.  This workshop asks participants to create small groups to identify and address obstacles to more widespread use of Python and Julia in the geophysical community.  Results will be shared in lighting talks and code repositories.&lt;br /&gt;
&lt;br /&gt;
==Objective==&lt;br /&gt;
Python and Julia are good languages for prototyping and applying selected processing.  Lack of good examples that read geophysical data, interface to legacy processing systems, and implement common algorithms are obstacles to more widespread use of these languages in the geophysical community.  The objective of this working workshop is to identify and address these obstacles and promote more widespread use of the languages.&lt;br /&gt;
&lt;br /&gt;
Participants brough their own laptops and formed small groups.  These groups picked projects and started to make examples of geophysical applications written in Python and Julia. About once a day we all checked in to talk about progress.  Sometimes participants collaborated with different groups.  After two and a half days we shared results in a lightning talks (five minute presentations).  I think everyone left the workshop with some new skills, ideas, and acquaintances. &lt;br /&gt;
&lt;br /&gt;
The working workshop provided a forum for geophysicist to learn, contribute, and network.&lt;br /&gt;
&lt;br /&gt;
==Link to the original workshop invitation is [[HoustonWW_2018_i]]== &lt;br /&gt;
&lt;br /&gt;
==Draft agenda==&lt;br /&gt;
*Wednesday afternoon August 8, 2017 1:00-6:00 PM. Optional work session to configure your computer and install open seismic software&lt;br /&gt;
**Do you want help getting your computer up to speed before the working workshop?  Come for informal, one-on-one assistance to:&lt;br /&gt;
*** Install Linux on your computer.&lt;br /&gt;
*** Configure Linux/OSX on your computer.&lt;br /&gt;
*** Install Seismic Unix on your computer&lt;br /&gt;
*** Install Madagascar on your computer.&lt;br /&gt;
*** Install Jupyter and python on your computer.  &lt;br /&gt;
*** Install a virtual Linux system on your Windows computer that will allow you to experiment with a Linux development environment. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Thursday  August 9, 2017 (working workshop starts)&lt;br /&gt;
**8:30-9:00 Coffee&lt;br /&gt;
**9:00-10:00 Introductions, project proposals, and team formations&lt;br /&gt;
**10:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
**1:00-2:00 Group discussion&lt;br /&gt;
**2:00-5:30 Breakout into work teams&lt;br /&gt;
&lt;br /&gt;
*Friday  August 10, 2016&lt;br /&gt;
**8:30-9:00 Coffee. Reform teams.&lt;br /&gt;
**9:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
**1:00-2:00 Group discussion&lt;br /&gt;
**2:00-5:30 Breakout into work teams&lt;br /&gt;
**6:00-8:00 Dinner&lt;br /&gt;
&lt;br /&gt;
*Saturday  August 11, 2016&lt;br /&gt;
**8:30-9:00 Coffee. Reform teams.&lt;br /&gt;
**9:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
** 1:00-2:00 Finalize lightning talks&lt;br /&gt;
**1:00-3:00 Lighting talks&lt;br /&gt;
&lt;br /&gt;
==Synopsis of Results with Links==&lt;br /&gt;
&lt;br /&gt;
==Contact us==&lt;br /&gt;
If you have some ideas about working workshops, tell us about it!  Send email to [mailto:seismic.working.workshop@gmail.com seismic.working.workshop@gmail.com].&lt;br /&gt;
&lt;br /&gt;
==Workshow Location==&lt;br /&gt;
The workshop was held in rooms 218 and 219 in Farish Hall at the University of Houston.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Supporting Organizations==&lt;br /&gt;
===Bureau of Economic Geology, University of Texas at Austin===&lt;br /&gt;
[[Image:Beglogo.jpg]]&lt;br /&gt;
===Society of Exploration Geophysicists===&lt;br /&gt;
[[Image:SEG Logo_Horizontal_SM.png|400px]]&lt;br /&gt;
===SEG Wavelets===&lt;br /&gt;
SEG Wavelets is the University of Houston&#039;s SEG student chapter. It is devoted to promoting education in exploration geophysics. We work with professional organizations, industry professionals, University of Houston faculty, and other student organizations to bring students educational, social, and possible future employment opportunities. More details can be found on our [http://segwavelets.uh.edu/ website].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Karl</name></author>
	</entry>
	<entry>
		<id>https://ahay.org/index.php?title=Working_Workshops&amp;diff=3712</id>
		<title>Working Workshops</title>
		<link rel="alternate" type="text/html" href="https://ahay.org/index.php?title=Working_Workshops&amp;diff=3712"/>
		<updated>2018-08-08T17:48:32Z</updated>

		<summary type="html">&lt;p&gt;Karl: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;quot;Working workshops&amp;quot; as opposed to &amp;quot;talking workshops&amp;quot; are meetings where the participants work together (possibly divided into pairs or small teams) to develop new software code or to conduct computational experiments addressing a particular problem. Working workshops are a cross between scientific workshops and [http://en.wikipedia.org/wiki/Sprint_%28software_development%29 coding sprints] or [http://en.wikipedia.org/wiki/Hackathon hackathons] common among open-source software communities. &lt;br /&gt;
&lt;br /&gt;
== Previous workshops ==&lt;br /&gt;
&lt;br /&gt;
===[[Austin_2013|1st Madagascar Working Workshop Reproducibility and Migration Gallery]]===&lt;br /&gt;
&lt;br /&gt;
==== Reproducibility ====&lt;br /&gt;
&lt;br /&gt;
During this workshop, published papers that are not currently reproducible would be made reproducible and included with Madagascar (with permission from the authors). This includes both recent papers and old historical papers.&lt;br /&gt;
&lt;br /&gt;
==== Migration Gallery ====&lt;br /&gt;
&lt;br /&gt;
Migration gallery is a matrix where rows are different benchmark datasets and columns are different seismic migration methods. The goal of the workshop is to fill missing entries in the matrix and to add new rows and columns to it.&lt;br /&gt;
&lt;br /&gt;
===[[Houston_2014|2nd Madagascar Working Workshop Parallel Computing]]===&lt;br /&gt;
&lt;br /&gt;
The parallel computing workshop uses resources of a supercomputing center. The goal is to peform a number of large-scale parallel computations and to test and document different styles of simplifying parallel computing tasks in Madagascar.&lt;br /&gt;
&lt;br /&gt;
===[[Houston_2015|3rd Working Workshop - 3D land Seismic processing]]===&lt;br /&gt;
&lt;br /&gt;
In the data processing workshop, a particular field seismic dataset is selected for processing by different people and possibly different processing packages. A clear metric is developed for comparing results at different stages of data processing. The goal is to learn about the best data processing practices, to improve the existing tools, and to build reproducible examples.&lt;br /&gt;
&lt;br /&gt;
===[[SEG_3D_Seismic_Processing_Working_Workshop_Houston_2016-_Land_3D | 4th Working Workshop - 3D land Seismic processing]]===&lt;br /&gt;
&lt;br /&gt;
In this working workshop we revisted 3D land seismic processing. The goal was to learn about the best data processing practices, to improve the existing tools, and to build reproducible examples.&lt;br /&gt;
&lt;br /&gt;
===[[HoustonWW2017 | 5th Working Workshop - Tutorials]]===&lt;br /&gt;
In the tutorial workshop created reproducible tutorials on topics of interest to seismic interpreters, applied geophysicists, and other earth scientists. &lt;br /&gt;
&lt;br /&gt;
===[[HoustonWW2018 | 6th Working Workshop - Python and Julia for Geophysics]]===&lt;br /&gt;
In this workshop participants worked on interfacing seismic data to Python and Julia and creating examples using these languages to solve geophysical problems.&lt;br /&gt;
&lt;br /&gt;
==Future workshops==&lt;br /&gt;
&lt;br /&gt;
Here are some suggestions for future working workshops for the Madagascar community.&lt;br /&gt;
&lt;br /&gt;
=== Documentation ===&lt;br /&gt;
&lt;br /&gt;
The goal of this workshop would be to improve the existing Madagascar documentation and to create new documents (books, papers, user manuals).&lt;br /&gt;
&lt;br /&gt;
=== Seismic Interpretation ===&lt;br /&gt;
&lt;br /&gt;
Seismic interpreters can access the Madagascar functionality through the [http://opendtect.org OpendTect] interface. However, they are lacking particular examples of data analysis tasks relevant to seismic interpretation. This workshop will bring together Madagascar/OpendTect developers and practicing interpreters to go through case studies and to build necessary tools.&lt;br /&gt;
&lt;br /&gt;
=== C++/Java/Python/Fortran/Matlab/Julia Interface ===&lt;br /&gt;
&lt;br /&gt;
The goal of this workshop would be to extend the [[Guide_to_madagascar_API|Madagascar interface]] to the corresponding language and to create examples of its usage.&lt;br /&gt;
&lt;br /&gt;
=== Non-seismic Geophysics ===&lt;br /&gt;
&lt;br /&gt;
Develop programs and examples for non-seismic geophysics: potential-field methods (gravity and magnetics), controlled-source electromagnetics (CSEM), ground-penetrating radar (GPR), etc.&lt;/div&gt;</summary>
		<author><name>Karl</name></author>
	</entry>
	<entry>
		<id>https://ahay.org/index.php?title=HoustonWW_2018_i&amp;diff=3711</id>
		<title>HoustonWW 2018 i</title>
		<link rel="alternate" type="text/html" href="https://ahay.org/index.php?title=HoustonWW_2018_i&amp;diff=3711"/>
		<updated>2018-08-06T19:09:29Z</updated>

		<summary type="html">&lt;p&gt;Karl: /* Draft agenda */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==SEG Working Workshop - Python and Julia for Geophysics - August 8-11, 2018==&lt;br /&gt;
&lt;br /&gt;
[[Working Workshops]] as opposed to &amp;quot;talking workshops&amp;quot; are meetings where the participants work in small teams to develop new software code or to conduct computational experiments addressing a particular problem.  This workshop asks participants to create small groups to identify and address obstacles to more widespread use of Python and Julia in the geophysical community.  Results will be shared in lighting talks and code repositories.&lt;br /&gt;
&lt;br /&gt;
==Objective==&lt;br /&gt;
Python and Julia are good languages for prototyping and applying selected processing.  Lack of good examples that read geophysical data, interface to legacy processing systems, and implement common algorithms are obstacles to more widespread use of these languages in the geophysical community.  The objective of this working workshop is to identify and address these obstacles and promote more widespread use of the languages.&lt;br /&gt;
&lt;br /&gt;
Small groups of participants will form at the working workshop to address these issues.  You might work on I/O functions or a processing algorithm.  You might work on interfacing to Madagascar or Seismic Unix. You might want to produce examples of importing data into machine learning systems like tensor flow. Come to the workshop with ideas or listen to ideas presented by others. Create a small group and work on the project for three days.  Share your project at the end of the workshop in a lightning talk (a five minute presentation).  You&#039;re likely learn new skills, get some new ideas, and meet some new people that will help you in the future.  The working workshop is open to beginners and professionals.  &lt;br /&gt;
&lt;br /&gt;
Participants are expected to bring laptops with the software and data they will use during the workshop. Wifi internet access will be available.&lt;br /&gt;
&lt;br /&gt;
This working workshop hopes to provide a forum for geophysicist to learn, contribute, and network.&lt;br /&gt;
&lt;br /&gt;
==[https://docs.google.com/forms/d/e/1FAIpQLSc1W25g5phkB0HXnjiMGhBoTSfkCSctBeY_MWNN3oGK12V_uw/viewform?usp=sf_link  Registration]== &lt;br /&gt;
&lt;br /&gt;
The workshop participation is free but requires an application.  Space is limited.  The application deadline is August 1, 2018.&lt;br /&gt;
[https://docs.google.com/forms/d/e/1FAIpQLSc1W25g5phkB0HXnjiMGhBoTSfkCSctBeY_MWNN3oGK12V_uw/viewform?usp=sf_link Link to the application form]&lt;br /&gt;
&lt;br /&gt;
==Draft agenda==&lt;br /&gt;
*Wednesday afternoon August 8, 2017 1:00-6:00 PM. Optional work session to configure your computer and install open seismic software&lt;br /&gt;
**Do you want help getting your computer up to speed before the working workshop?  Come for informal, one-on-one assistance to:&lt;br /&gt;
*** Install Linux on your computer.&lt;br /&gt;
*** Configure Linux/OSX on your computer.&lt;br /&gt;
*** Install Seismic Unix on your computer&lt;br /&gt;
*** Install Madagascar on your computer.&lt;br /&gt;
*** Install Jupyter and python on your computer.  &lt;br /&gt;
*** Install a virtual Linux system on your Windows computer that will allow you to experiment with a Linux development environment. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Thursday  August 9, 2017 (working workshop starts)&lt;br /&gt;
**8:30-9:00 Coffee&lt;br /&gt;
**9:00-10:00 Introductions, project proposals, and team formations&lt;br /&gt;
**10:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
**1:00-2:00 Group discussion&lt;br /&gt;
**2:00-5:30 Breakout into work teams&lt;br /&gt;
&lt;br /&gt;
*Friday  August 10, 2016&lt;br /&gt;
**8:30-9:00 Coffee. Reform teams.&lt;br /&gt;
**9:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
**1:00-2:00 Group discussion&lt;br /&gt;
**2:00-5:30 Breakout into work teams&lt;br /&gt;
**6:00-8:00 Dinner&lt;br /&gt;
&lt;br /&gt;
*Saturday  August 11, 2016&lt;br /&gt;
**8:30-9:00 Coffee. Reform teams.&lt;br /&gt;
**9:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
** 1:00-2:00 Finalize lightning talks&lt;br /&gt;
**1:00-3:00 Lighting talks&lt;br /&gt;
&lt;br /&gt;
==Contact us==&lt;br /&gt;
If you have some ideas about working workshops, tell us about it!  Send email to [mailto:seismic.working.workshop@gmail.com seismic.working.workshop@gmail.com].&lt;br /&gt;
&lt;br /&gt;
==Workshow Location==&lt;br /&gt;
We will meet in room #219 Farish Hall at the University of Houston.  Below are area and campus maps.&lt;br /&gt;
&lt;br /&gt;
[[File:Uhlocation.png  | 500px ]]&lt;br /&gt;
[[File:Uhfarishhall.png  | 500px ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Supporting Organizations==&lt;br /&gt;
===Bureau of Economic Geology, University of Texas at Austin===&lt;br /&gt;
[[Image:Beglogo.jpg]]&lt;br /&gt;
===Society of Exploration Geophysicists===&lt;br /&gt;
[[Image:SEG Logo_Horizontal_SM.png|400px]]&lt;br /&gt;
===SEG Wavelets===&lt;br /&gt;
SEG Wavelets is the University of Houston&#039;s SEG student chapter. It is devoted to promoting education in exploration geophysics. We work with professional organizations, industry professionals, University of Houston faculty, and other student organizations to bring students educational, social, and possible future employment opportunities. More details can be found on our [http://segwavelets.uh.edu/ website].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Karl</name></author>
	</entry>
	<entry>
		<id>https://ahay.org/index.php?title=HoustonWW_2018_i&amp;diff=3710</id>
		<title>HoustonWW 2018 i</title>
		<link rel="alternate" type="text/html" href="https://ahay.org/index.php?title=HoustonWW_2018_i&amp;diff=3710"/>
		<updated>2018-07-26T19:09:11Z</updated>

		<summary type="html">&lt;p&gt;Karl: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==SEG Working Workshop - Python and Julia for Geophysics - August 8-11, 2018==&lt;br /&gt;
&lt;br /&gt;
[[Working Workshops]] as opposed to &amp;quot;talking workshops&amp;quot; are meetings where the participants work in small teams to develop new software code or to conduct computational experiments addressing a particular problem.  This workshop asks participants to create small groups to identify and address obstacles to more widespread use of Python and Julia in the geophysical community.  Results will be shared in lighting talks and code repositories.&lt;br /&gt;
&lt;br /&gt;
==Objective==&lt;br /&gt;
Python and Julia are good languages for prototyping and applying selected processing.  Lack of good examples that read geophysical data, interface to legacy processing systems, and implement common algorithms are obstacles to more widespread use of these languages in the geophysical community.  The objective of this working workshop is to identify and address these obstacles and promote more widespread use of the languages.&lt;br /&gt;
&lt;br /&gt;
Small groups of participants will form at the working workshop to address these issues.  You might work on I/O functions or a processing algorithm.  You might work on interfacing to Madagascar or Seismic Unix. You might want to produce examples of importing data into machine learning systems like tensor flow. Come to the workshop with ideas or listen to ideas presented by others. Create a small group and work on the project for three days.  Share your project at the end of the workshop in a lightning talk (a five minute presentation).  You&#039;re likely learn new skills, get some new ideas, and meet some new people that will help you in the future.  The working workshop is open to beginners and professionals.  &lt;br /&gt;
&lt;br /&gt;
Participants are expected to bring laptops with the software and data they will use during the workshop. Wifi internet access will be available.&lt;br /&gt;
&lt;br /&gt;
This working workshop hopes to provide a forum for geophysicist to learn, contribute, and network.&lt;br /&gt;
&lt;br /&gt;
==[https://docs.google.com/forms/d/e/1FAIpQLSc1W25g5phkB0HXnjiMGhBoTSfkCSctBeY_MWNN3oGK12V_uw/viewform?usp=sf_link  Registration]== &lt;br /&gt;
&lt;br /&gt;
The workshop participation is free but requires an application.  Space is limited.  The application deadline is August 1, 2018.&lt;br /&gt;
[https://docs.google.com/forms/d/e/1FAIpQLSc1W25g5phkB0HXnjiMGhBoTSfkCSctBeY_MWNN3oGK12V_uw/viewform?usp=sf_link Link to the application form]&lt;br /&gt;
&lt;br /&gt;
==Draft agenda==&lt;br /&gt;
*Wednesday afternoon August 8, 2017 3:00-6:00 PM. Optional work session to configure your computer and install open seismic software&lt;br /&gt;
**Do you want help getting your computer up to speed before the working workshop?  Come for informal, one-on-one assistance to:&lt;br /&gt;
*** Install Linux on your computer.&lt;br /&gt;
*** Configure Linux/OSX on your computer.&lt;br /&gt;
*** Install Seismic Unix on your computer&lt;br /&gt;
*** Install Madagascar on your computer.&lt;br /&gt;
*** Install Jupyter and python on your computer.  &lt;br /&gt;
*** Install a virtual Linux system on your Windows computer that will allow you to experiment with a Linux development environment. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Thursday  August 9, 2017 (working workshop starts)&lt;br /&gt;
**8:30-9:00 Coffee&lt;br /&gt;
**9:00-10:00 Introductions, project proposals, and team formations&lt;br /&gt;
**10:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
**1:00-2:00 Group discussion&lt;br /&gt;
**2:00-5:30 Breakout into work teams&lt;br /&gt;
&lt;br /&gt;
*Friday  August 10, 2016&lt;br /&gt;
**8:30-9:00 Coffee. Reform teams.&lt;br /&gt;
**9:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
**1:00-2:00 Group discussion&lt;br /&gt;
**2:00-5:30 Breakout into work teams&lt;br /&gt;
**6:00-8:00 Dinner&lt;br /&gt;
&lt;br /&gt;
*Saturday  August 11, 2016&lt;br /&gt;
**8:30-9:00 Coffee. Reform teams.&lt;br /&gt;
**9:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
** 1:00-2:00 Finalize lightning talks&lt;br /&gt;
**1:00-3:00 Lighting talks&lt;br /&gt;
&lt;br /&gt;
==Contact us==&lt;br /&gt;
If you have some ideas about working workshops, tell us about it!  Send email to [mailto:seismic.working.workshop@gmail.com seismic.working.workshop@gmail.com].&lt;br /&gt;
&lt;br /&gt;
==Workshow Location==&lt;br /&gt;
We will meet in room #219 Farish Hall at the University of Houston.  Below are area and campus maps.&lt;br /&gt;
&lt;br /&gt;
[[File:Uhlocation.png  | 500px ]]&lt;br /&gt;
[[File:Uhfarishhall.png  | 500px ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Supporting Organizations==&lt;br /&gt;
===Bureau of Economic Geology, University of Texas at Austin===&lt;br /&gt;
[[Image:Beglogo.jpg]]&lt;br /&gt;
===Society of Exploration Geophysicists===&lt;br /&gt;
[[Image:SEG Logo_Horizontal_SM.png|400px]]&lt;br /&gt;
===SEG Wavelets===&lt;br /&gt;
SEG Wavelets is the University of Houston&#039;s SEG student chapter. It is devoted to promoting education in exploration geophysics. We work with professional organizations, industry professionals, University of Houston faculty, and other student organizations to bring students educational, social, and possible future employment opportunities. More details can be found on our [http://segwavelets.uh.edu/ website].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Karl</name></author>
	</entry>
	<entry>
		<id>https://ahay.org/index.php?title=HoustonWW_2018_i&amp;diff=3709</id>
		<title>HoustonWW 2018 i</title>
		<link rel="alternate" type="text/html" href="https://ahay.org/index.php?title=HoustonWW_2018_i&amp;diff=3709"/>
		<updated>2018-07-26T18:55:53Z</updated>

		<summary type="html">&lt;p&gt;Karl: add meeting location and provide maps&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==SEG Working Workshop - Python and Julia for Geophysics - August 8-11, 2018==&lt;br /&gt;
&lt;br /&gt;
[[Working Workshops]] as opposed to &amp;quot;talking workshops&amp;quot; are meetings where the participants work in small teams to develop new software code or to conduct computational experiments addressing a particular problem.  This workshop asks participants to create small groups to identify and address obstacles to more widespread use of Python and Julia in the geophysical community.  Results will be shared in lighting talks and code repositories.&lt;br /&gt;
&lt;br /&gt;
==Objective==&lt;br /&gt;
Python and Julia are good languages for prototyping and applying selected processing.  Lack of good examples that read geophysical data, interface to legacy processing systems, and implement common algorithms are obstacles to more widespread use of these languages in the geophysical community.  The objective of this working workshop is to identify and address these obstacles and promote more widespread use of the languages.&lt;br /&gt;
&lt;br /&gt;
Small groups of participants will form at the working workshop to address these issues.  You might work on I/O functions or a processing algorithm.  You might work on interfacing to Madagascar or Seismic Unix. You might want to produce examples of importing data into machine learning systems like tensor flow. Come to the workshop with ideas or listen to ideas presented by others. Create a small group and work on the project for three days.  Share your project at the end of the workshop in a lightning talk (a five minute presentation).  You&#039;re likely learn new skills, get some new ideas, and meet some new people that will help you in the future.  The working workshop is open to beginners and professionals.  &lt;br /&gt;
&lt;br /&gt;
Participants are expected to bring laptops with the software and data they will use during the workshop. Wifi internet access will be available.&lt;br /&gt;
&lt;br /&gt;
This working workshop hopes to provide a forum for geophysicist to learn, contribute, and network.&lt;br /&gt;
&lt;br /&gt;
==[https://docs.google.com/forms/d/e/1FAIpQLSc1W25g5phkB0HXnjiMGhBoTSfkCSctBeY_MWNN3oGK12V_uw/viewform?usp=sf_link  Registration]== &lt;br /&gt;
&lt;br /&gt;
The workshop participation is free but requires an application.  Space is limited.  The application deadline is August 1, 2018.&lt;br /&gt;
[https://docs.google.com/forms/d/e/1FAIpQLSc1W25g5phkB0HXnjiMGhBoTSfkCSctBeY_MWNN3oGK12V_uw/viewform?usp=sf_link Link to the application form]&lt;br /&gt;
&lt;br /&gt;
==Draft agenda==&lt;br /&gt;
*Wednesday afternoon August 8, 2017 3:00-6:00 PM. Optional work session to configure your computer and install open seismic software&lt;br /&gt;
**Do you want help getting your computer up to speed before the working workshop?  Come for informal, one-on-one assistance to:&lt;br /&gt;
*** Install Linux on your computer.&lt;br /&gt;
*** Configure Linux/OSX on your computer.&lt;br /&gt;
*** Install Seismic Unix on your computer&lt;br /&gt;
*** Install Madagascar on your computer.&lt;br /&gt;
*** Install Jupyter and python on your computer.  &lt;br /&gt;
*** Install a virtual Linux system on your Windows computer that will allow you to experiment with a Linux development environment. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Thursday  August 9, 2017 (working workshop starts)&lt;br /&gt;
**8:30-9:00 Coffee&lt;br /&gt;
**9:00-10:00 Introductions, project proposals, and team formations&lt;br /&gt;
**10:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
**1:00-2:00 Group discussion&lt;br /&gt;
**2:00-5:30 Breakout into work teams&lt;br /&gt;
&lt;br /&gt;
*Friday  August 10, 2016&lt;br /&gt;
**8:30-9:00 Coffee. Reform teams.&lt;br /&gt;
**9:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
**1:00-2:00 Group discussion&lt;br /&gt;
**2:00-5:30 Breakout into work teams&lt;br /&gt;
**6:00-8:00 Dinner&lt;br /&gt;
&lt;br /&gt;
*Saturday  August 11, 2016&lt;br /&gt;
**8:30-9:00 Coffee. Reform teams.&lt;br /&gt;
**9:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
** 1:00-2:00 Finalize lightning talks&lt;br /&gt;
**1:00-3:00 Lighting talks&lt;br /&gt;
&lt;br /&gt;
==Contact us==&lt;br /&gt;
If you have some ideas about working workshops, tell us about it!  Send email to [mailto:seismic.working.workshop@gmail.com seismic.working.workshop@gmail.com].&lt;br /&gt;
&lt;br /&gt;
==Location==&lt;br /&gt;
===The working workshop will be in room #219 Farish Hall at the University of Houston.  Below are area and campus maps.===&lt;br /&gt;
&lt;br /&gt;
[[File:Uhlocation.png  | 500px ]]&lt;br /&gt;
[[File:Uhfarishhall.png  | 500px ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Supporting Organizations==&lt;br /&gt;
===Bureau of Economic Geology, University of Texas at Austin===&lt;br /&gt;
[[Image:Beglogo.jpg]]&lt;br /&gt;
===Society of Exploration Geophysicists===&lt;br /&gt;
[[Image:SEG Logo_Horizontal_SM.png|400px]]&lt;br /&gt;
===SEG Wavelets===&lt;br /&gt;
SEG Wavelets is the University of Houston&#039;s SEG student chapter. It is devoted to promoting education in exploration geophysics. We work with professional organizations, industry professionals, University of Houston faculty, and other student organizations to bring students educational, social, and possible future employment opportunities. More details can be found on our [http://segwavelets.uh.edu/ website].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Karl</name></author>
	</entry>
	<entry>
		<id>https://ahay.org/index.php?title=File:Uhfarishhall.png&amp;diff=3708</id>
		<title>File:Uhfarishhall.png</title>
		<link rel="alternate" type="text/html" href="https://ahay.org/index.php?title=File:Uhfarishhall.png&amp;diff=3708"/>
		<updated>2018-07-26T18:52:10Z</updated>

		<summary type="html">&lt;p&gt;Karl: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Karl</name></author>
	</entry>
	<entry>
		<id>https://ahay.org/index.php?title=HoustonWW_2018_i&amp;diff=3707</id>
		<title>HoustonWW 2018 i</title>
		<link rel="alternate" type="text/html" href="https://ahay.org/index.php?title=HoustonWW_2018_i&amp;diff=3707"/>
		<updated>2018-07-26T18:40:50Z</updated>

		<summary type="html">&lt;p&gt;Karl: /* Location */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==SEG Working Workshop - Python and Julia for Geophysics - August 8-11, 2018==&lt;br /&gt;
&lt;br /&gt;
[[Working Workshops]] as opposed to &amp;quot;talking workshops&amp;quot; are meetings where the participants work in small teams to develop new software code or to conduct computational experiments addressing a particular problem.  This workshop asks participants to create small groups to identify and address obstacles to more widespread use of Python and Julia in the geophysical community.  Results will be shared in lighting talks and code repositories.&lt;br /&gt;
&lt;br /&gt;
==Objective==&lt;br /&gt;
Python and Julia are good languages for prototyping and applying selected processing.  Lack of good examples that read geophysical data, interface to legacy processing systems, and implement common algorithms are obstacles to more widespread use of these languages in the geophysical community.  The objective of this working workshop is to identify and address these obstacles and promote more widespread use of the languages.&lt;br /&gt;
&lt;br /&gt;
Small groups of participants will form at the working workshop to address these issues.  You might work on I/O functions or a processing algorithm.  You might work on interfacing to Madagascar or Seismic Unix. You might want to produce examples of importing data into machine learning systems like tensor flow. Come to the workshop with ideas or listen to ideas presented by others. Create a small group and work on the project for three days.  Share your project at the end of the workshop in a lightning talk (a five minute presentation).  You&#039;re likely learn new skills, get some new ideas, and meet some new people that will help you in the future.  The working workshop is open to beginners and professionals.  &lt;br /&gt;
&lt;br /&gt;
Participants are expected to bring laptops with the software and data they will use during the workshop. Wifi internet access will be available.&lt;br /&gt;
&lt;br /&gt;
This working workshop hopes to provide a forum for geophysicist to learn, contribute, and network.&lt;br /&gt;
&lt;br /&gt;
==[https://docs.google.com/forms/d/e/1FAIpQLSc1W25g5phkB0HXnjiMGhBoTSfkCSctBeY_MWNN3oGK12V_uw/viewform?usp=sf_link  Registration]== &lt;br /&gt;
&lt;br /&gt;
The workshop participation is free but requires an application.  Space is limited.  The application deadline is August 1, 2018.&lt;br /&gt;
[https://docs.google.com/forms/d/e/1FAIpQLSc1W25g5phkB0HXnjiMGhBoTSfkCSctBeY_MWNN3oGK12V_uw/viewform?usp=sf_link Link to the application form]&lt;br /&gt;
&lt;br /&gt;
==Draft agenda==&lt;br /&gt;
*Wednesday afternoon August 8, 2017 3:00-6:00 PM. Optional work session to configure your computer and install open seismic software&lt;br /&gt;
**Do you want help getting your computer up to speed before the working workshop?  Come for informal, one-on-one assistance to:&lt;br /&gt;
*** Install Linux on your computer.&lt;br /&gt;
*** Configure Linux/OSX on your computer.&lt;br /&gt;
*** Install Seismic Unix on your computer&lt;br /&gt;
*** Install Madagascar on your computer.&lt;br /&gt;
*** Install Jupyter and python on your computer.  &lt;br /&gt;
*** Install a virtual Linux system on your Windows computer that will allow you to experiment with a Linux development environment. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Thursday  August 9, 2017 (working workshop starts)&lt;br /&gt;
**8:30-9:00 Coffee&lt;br /&gt;
**9:00-10:00 Introductions, project proposals, and team formations&lt;br /&gt;
**10:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
**1:00-2:00 Group discussion&lt;br /&gt;
**2:00-5:30 Breakout into work teams&lt;br /&gt;
&lt;br /&gt;
*Friday  August 10, 2016&lt;br /&gt;
**8:30-9:00 Coffee. Reform teams.&lt;br /&gt;
**9:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
**1:00-2:00 Group discussion&lt;br /&gt;
**2:00-5:30 Breakout into work teams&lt;br /&gt;
**6:00-8:00 Dinner&lt;br /&gt;
&lt;br /&gt;
*Saturday  August 11, 2016&lt;br /&gt;
**8:30-9:00 Coffee. Reform teams.&lt;br /&gt;
**9:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
** 1:00-2:00 Finalize lightning talks&lt;br /&gt;
**1:00-3:00 Lighting talks&lt;br /&gt;
&lt;br /&gt;
==Contact us==&lt;br /&gt;
If you have some ideas about working workshops, tell us about it!  Send email to [mailto:seismic.working.workshop@gmail.com seismic.working.workshop@gmail.com].&lt;br /&gt;
&lt;br /&gt;
==Location==&lt;br /&gt;
The working workshop with be in Houston.  The location has not been selected.  Possible locations are the University of Houston or UT&#039;s Houston Research Center&lt;br /&gt;
&lt;br /&gt;
[[Uhlocation.png  | Location University of Houston]]&lt;br /&gt;
* Nearby hotels&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Supporting Organizations==&lt;br /&gt;
===Bureau of Economic Geology, University of Texas at Austin===&lt;br /&gt;
[[Image:Beglogo.jpg]]&lt;br /&gt;
===Society of Exploration Geophysicists===&lt;br /&gt;
[[Image:SEG Logo_Horizontal_SM.png|400px]]&lt;br /&gt;
===SEG Wavelets===&lt;br /&gt;
SEG Wavelets is the University of Houston&#039;s SEG student chapter. It is devoted to promoting education in exploration geophysics. We work with professional organizations, industry professionals, University of Houston faculty, and other student organizations to bring students educational, social, and possible future employment opportunities. More details can be found on our [http://segwavelets.uh.edu/ website].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Karl</name></author>
	</entry>
	<entry>
		<id>https://ahay.org/index.php?title=File:Uhlocation.png&amp;diff=3706</id>
		<title>File:Uhlocation.png</title>
		<link rel="alternate" type="text/html" href="https://ahay.org/index.php?title=File:Uhlocation.png&amp;diff=3706"/>
		<updated>2018-07-26T18:36:36Z</updated>

		<summary type="html">&lt;p&gt;Karl: location of 2018 working workshop&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;location of 2018 working workshop&lt;/div&gt;</summary>
		<author><name>Karl</name></author>
	</entry>
	<entry>
		<id>https://ahay.org/index.php?title=Advanced_Installation&amp;diff=3705</id>
		<title>Advanced Installation</title>
		<link rel="alternate" type="text/html" href="https://ahay.org/index.php?title=Advanced_Installation&amp;diff=3705"/>
		<updated>2018-05-21T11:46:59Z</updated>

		<summary type="html">&lt;p&gt;Karl: /* Ubuntu */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:Fotolia_419157_XS.jpg|right|]]&lt;br /&gt;
Before reading this document, please familiarize yourself with the [[Installation|short Installation guide]].&lt;br /&gt;
=What the installation process does=&lt;br /&gt;
The term &amp;quot;installation&amp;quot; in the title is used for brevity, and it actually covers all three steps: configuration, build and install.&lt;br /&gt;
# Configure: determine what tools are available on the system and how they should be used to built the software. Creates a layer of abstraction so that the build is platform-independent. Should ideally either solve or flag all problems, so that the build either works, or does not proceed at all.&lt;br /&gt;
# Build: compiles the software and documentation using RSFSRC/build as a &amp;quot;workplace&amp;quot;&lt;br /&gt;
# Install: moves the compiled executables and the documentation to the final locations in $RSFROOT, sometimes changing filenames. Kept separate from build so that it can be done by root, and to avoid build failures leaving junk files all over the system.&lt;br /&gt;
A successful installation will have created in &amp;lt;tt&amp;gt;$RSFROOT&amp;lt;/tt&amp;gt; the following directories:&lt;br /&gt;
* &amp;lt;tt&amp;gt;bin/&amp;lt;/tt&amp;gt;: executable programs&lt;br /&gt;
* &amp;lt;tt&amp;gt;doc/&amp;lt;/tt&amp;gt;: auto-generated HTML documentation&lt;br /&gt;
* &amp;lt;tt&amp;gt;include/&amp;lt;/tt&amp;gt;: header files with info on library procedures; fonts&lt;br /&gt;
* &amp;lt;tt&amp;gt;lib/&amp;lt;/tt&amp;gt;: libraries and Python modules&lt;br /&gt;
&lt;br /&gt;
=Old (1.0 and 1.1) version installation=&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;tt&amp;gt;$RSFROOT/etc/madagascar/&amp;lt;/tt&amp;gt; as the location of &amp;lt;tt&amp;gt;env&amp;lt;/tt&amp;gt; scripts instead of &amp;lt;tt&amp;gt;$RSFROOT/share/madagascar/etc/&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=Old (0.9.9) version installation=&lt;br /&gt;
&lt;br /&gt;
====Environment variables====&lt;br /&gt;
Example configuration for &amp;lt;tt&amp;gt;bash&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
export RSFROOT=/usr/local/rsf # directory where Madagascar will be installed. &lt;br /&gt;
if [ -n &amp;quot;$PYTHONPATH&amp;quot; ]; then&lt;br /&gt;
export PYTHONPATH=${PYTHONPATH}:$RSFROOT/lib&lt;br /&gt;
else&lt;br /&gt;
export PYTHONPATH=$RSFROOT/lib&lt;br /&gt;
fi&lt;br /&gt;
export PATH=$RSFROOT/bin:$PATH&lt;br /&gt;
export DATAPATH=/var/tmp/&lt;br /&gt;
export MANPATH=$RSFROOT/share/man:$(manpath)&lt;br /&gt;
export LD_LIBRARY_PATH=$RSFROOT/lib:$LD_LIBRARY_PATH&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Notice the slash at the end of the &amp;lt;tt&amp;gt;DATAPATH&amp;lt;/tt&amp;gt; variable. &lt;br /&gt;
&lt;br /&gt;
Example configuration for &amp;lt;tt&amp;gt;csh&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;tcsh&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
setenv RSFROOT /usr/local/rsf&lt;br /&gt;
if ($?PYTHONPATH) then&lt;br /&gt;
setenv PYTHONPATH ${PYTHONPATH}:$RSFROOT/lib&lt;br /&gt;
else&lt;br /&gt;
setenv PYTHONPATH $RSFROOT/lib&lt;br /&gt;
endif&lt;br /&gt;
set path = ($RSFROOT/bin $path)&lt;br /&gt;
setenv DATAPATH /var/tmp/&lt;br /&gt;
setenv MANPATH $RSFROOT/share/man:`manpath`&lt;br /&gt;
setenv LD_LIBRARY_PATH $RSFROOT/lib:$LD_LIBRARY_PATH&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Notice the backticks surrounding the call to &amp;lt;tt&amp;gt;manpath&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Be aware that on some systems /var/tmp gets automatically cleaned at some intervals, so if you want to keep your data binaries for a long time, set &amp;lt;tt&amp;gt;DATAPATH&amp;lt;/tt&amp;gt; to another location where you have write access and that allows large files.&lt;br /&gt;
&lt;br /&gt;
====Software construction====&lt;br /&gt;
  &lt;br /&gt;
#Configuration. Change to the top source directory and run &amp;lt;pre&amp;gt;./configure&amp;lt;/pre&amp;gt; You can examine the &amp;lt;tt&amp;gt;config.py&amp;lt;/tt&amp;gt; file that this command generates.  Additional options are available. You can obtain a full list of customizable variables by running &amp;lt;tt&amp;gt;scons -h&amp;lt;/tt&amp;gt;. For example, to install C++ and Fortran-90 API bindings in addition to the basic package, run &amp;lt;pre&amp;gt;./configure API=c++,fortran-90&amp;lt;/pre&amp;gt; &lt;br /&gt;
#Building and installing the package. Run &amp;lt;tt&amp;gt;scons install&amp;lt;/tt&amp;gt; or the following two commands in succession:  &amp;lt;pre&amp;gt;make; make install&amp;lt;/pre&amp;gt; or &amp;lt;pre&amp;gt;scons; scons install&amp;lt;/pre&amp;gt; If you need &amp;quot;root&amp;quot; privileges for installing under &amp;lt;tt&amp;gt;&amp;amp;#36;RSFROOT&amp;lt;/tt&amp;gt;, you may need to run &amp;lt;pre&amp;gt;su; scons install &amp;lt;/pre&amp;gt; or &amp;lt;pre&amp;gt;sudo scons install&amp;lt;/pre&amp;gt;&lt;br /&gt;
#Cleaning. To clean all intermediate files generated by SCons, run &amp;lt;pre&amp;gt;make clean&amp;lt;/pre&amp;gt; or &amp;lt;pre&amp;gt;scons -c&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Prerequisites=&lt;br /&gt;
Basic prerequisites are described in the [[Installation|short Installation guide]]. Here are some additional details. &lt;br /&gt;
==Compilers==&lt;br /&gt;
Madagascar has been built successfully with the following compilers, and possibly with others:&lt;br /&gt;
* gcc&lt;br /&gt;
* Intel (icc/ifort)&lt;br /&gt;
* open64&lt;br /&gt;
* clang&lt;br /&gt;
* cc (Solaris)&lt;br /&gt;
&lt;br /&gt;
==Python and SCons==&lt;br /&gt;
As described below under [[Advanced Installation#Platform-specific installation advice | Platform-specific installation advice]], Madagascar supports the oldest non-deprecated Python version currently supported by the latest stable version of [http://scons.org/ SCons].  If your version of Python is older and you experience problems you should probably [http://www.python.org/ upgrade].&lt;br /&gt;
&lt;br /&gt;
Madagascar includes the latest stable version of SCons and the configure scripts will try to install it for you in RSFROOT if you don&#039;t have it already.  However, if you have an older version of SCons the configure scripts will not try to install the newer version. Your older version might work fine, but Madagascar attempts to support only the latest stable version of SCons, so if you have problems you should upgrade.&lt;br /&gt;
&lt;br /&gt;
To install the SCons bundled with Madagascar go to &amp;lt;tt&amp;gt;RSFSRC/scons&amp;lt;/tt&amp;gt;, unpack the tar file, and type&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
python setup.py install&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will install SCons in the standard location. You might need root privileges. If you don&#039;t have root privileges, or you don&#039;t want to interfere with the system SCons you can install it somewhere else with a --prefix option. A logical choice is to put it in RSFROOT like this:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
python setup.py install --prefix=$RSFROOT&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Location==&lt;br /&gt;
As long as you set the environment variables and directory permissions correctly, it does not matter in what part of your filesystem you place the install. If you have the luxury of installing anywhere, it is good practice to follow the [http://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard Filesystem Hierarchy Standard] and either:&lt;br /&gt;
# Install everything (including &amp;lt;tt&amp;gt;figs&amp;lt;/tt&amp;gt; if you do testing) under &amp;lt;tt&amp;gt;/usr/local/rsf&amp;lt;/tt&amp;gt;, with the source tree in &amp;lt;tt&amp;gt;/usr/local/rsf/src&amp;lt;/tt&amp;gt;, OR &lt;br /&gt;
# Put the source tree in &amp;lt;tt&amp;gt;/usr/local/src/rsf&amp;lt;/tt&amp;gt;, and specify &amp;lt;tt&amp;gt;RSFROOT=/usr/local&amp;lt;/tt&amp;gt;, so that header files and binaries go in &amp;lt;tt&amp;gt;/usr/local/bin&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;/usr/local/include&amp;lt;/tt&amp;gt;. To follow the standard, before installing set &amp;lt;tt&amp;gt;RSFDOC=/usr/local/share/rsf/doc&amp;lt;/tt&amp;gt; and create the appropriate directories. The auto-generated HTML documentation will get put there. Also, if installed, the figs directory for testing should be &amp;lt;tt&amp;gt;/usr/local/share/rsf/figs/&amp;lt;/tt&amp;gt;.&lt;br /&gt;
# Package Madagascar (i.e. build a RPM, etc) and install it in the default locations. For RPMs, those are as like the ones from the previous option, just directly in the &amp;lt;tt&amp;gt;/usr/&amp;lt;/tt&amp;gt; hierarchy, instead of in the &amp;lt;tt&amp;gt;/usr/local/&amp;lt;/tt&amp;gt; one.&lt;br /&gt;
&lt;br /&gt;
==Disk space==&lt;br /&gt;
At present (Feb 2007, r2530), the source directory containing the build tree from the development version was approx. 200Mb, the full installation (&amp;lt;tt&amp;gt;bin/&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;doc/&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;include/&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;lib&amp;lt;/tt&amp;gt;) is 31Mb, and &amp;lt;tt&amp;gt;figs/&amp;lt;/tt&amp;gt; (the optional directory if you want to do testing) is about 10 Gb. The stable version is significantly smaller.&lt;br /&gt;
&lt;br /&gt;
The only Madagascar-related directory where disk space can be an issue is &amp;lt;tt&amp;gt;$DATAPATH&amp;lt;/tt&amp;gt;. Real 3-D seismic datasets can be measured in Terabytes. Buggy programs/processing flows can fill up &amp;lt;tt&amp;gt;$DATAPATH&amp;lt;/tt&amp;gt;. A real problem are &amp;quot;disk memory leaks&amp;quot; -- removing header files with anything else than &amp;lt;tt&amp;gt;sfrm&amp;lt;/tt&amp;gt; will leave the binaries intact. Crashed jobs which start to write to binary but never get to write the header also produce &amp;quot;leaks&amp;quot;. Experience has shown that over time &amp;lt;tt&amp;gt;$DATAPATH&amp;lt;/tt&amp;gt; inexorably fills up. You may need to &lt;br /&gt;
# keep irreplaceable data and expensive results in a separate place;&lt;br /&gt;
# remove the oldest files in &amp;lt;tt&amp;gt;$DATAPATH&amp;lt;/tt&amp;gt; whenever the amount of free space declines under a preset threshold.&lt;br /&gt;
&lt;br /&gt;
==Dependencies==&lt;br /&gt;
Some platforms feature complete lists of dependencies. See [[Advanced Installation#Platform-specific installation advice | Platform-specific installation advice]] for details.&lt;br /&gt;
===C++ API===&lt;br /&gt;
A C++ compiler. SCons is smart and will try to find it for you. If it does not work specify the path to your compiler in the &amp;lt;tt&amp;gt;CXX&amp;lt;/tt&amp;gt; environment variable (can be passed as an option to the configuration script, like the &amp;lt;tt&amp;gt;API&amp;lt;/tt&amp;gt; one).&lt;br /&gt;
===F77 API===&lt;br /&gt;
A Fortran 77 compiler. If SCons does not find one, then you can either specify its path through the &amp;lt;tt&amp;gt;F77&amp;lt;/tt&amp;gt; variable, or if the executable is in your path, add its name to the list of F77 compilers in &amp;lt;tt&amp;gt;RSFSRC/configure.py&amp;lt;/tt&amp;gt; .&lt;br /&gt;
===F90 API===&lt;br /&gt;
Same as for Fortran 77 &amp;amp;ndash; just substitute &amp;lt;tt&amp;gt;F90&amp;lt;/tt&amp;gt;. If using the &amp;lt;tt&amp;gt;gfortran&amp;lt;/tt&amp;gt; compiler, make sure to get [http://gcc.gnu.org/wiki/GFortranBinaries the latest version]. If you have more than one compiler installed on your system, specify the desired one at configuration time:&lt;br /&gt;
&amp;lt;bash&amp;gt;&lt;br /&gt;
./configure API=f90 F90=/path/to/preferred/compiler&lt;br /&gt;
&amp;lt;/bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Java API===&lt;br /&gt;
There are two styles of API, old (1.0 release and previous) and new. The two APIs are not compatible with each other.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;old&amp;quot; interface requires the Mines Java Toolkit for fast Java file IO. The Mines JTK, is an open-source Java package that can be downloaded from [http://inside.mines.edu/~dhale/jtk/ Mines JTK]. Currently, the &amp;quot;old&amp;quot; interface will also build alongside the new one if the MINESJTK environment variable exists, and can be used as was previously.&lt;br /&gt;
&lt;br /&gt;
To install the new API, you need the (Oracle) JDK. Set your JAVA_HOME environment variable to the location of the jdk (on Ubuntu 10.04 this is: /usr/lib/jvm/java-6-openjdk), then reconfigure (./configure API=java ...) and reinstall.  &lt;br /&gt;
&lt;br /&gt;
Ignore the SWIG warnings (there are lots). &lt;br /&gt;
&lt;br /&gt;
Make sure to set your LD_LIBRARY_PATH to $RSFROOT/lib .&lt;br /&gt;
&lt;br /&gt;
If you want to include additional Java packages, you can set them using your shell&#039;s CLASSPATH variable.  This environment variable is now automatically passed onto all Java classes in SCons.&lt;br /&gt;
&lt;br /&gt;
The installation can be tested using the example demonstrating the new API in api/java/test .&lt;br /&gt;
&lt;br /&gt;
===Matlab API===&lt;br /&gt;
Besides Matlab itself, you need Mex, which compiles C code into regular Matlab functions. Use the &amp;lt;tt&amp;gt;MATLAB&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;MEX&amp;lt;/tt&amp;gt; environment variables to specify their paths if they are installed, but not found.&lt;br /&gt;
===Octave API===&lt;br /&gt;
The Octave function compiler (&amp;lt;tt&amp;gt;mkoctfile&amp;lt;/tt&amp;gt;) is sometimes bundled in a separate package, so it may be missing from the Octave installation.&lt;br /&gt;
&lt;br /&gt;
===Python API===&lt;br /&gt;
This API requires [http://www.swig.org/ SWIG], [http://numpy.scipy.org/ numpy] and the Python development kit. Numpy requires Python 2.4 or newer (i.e. RHEL 5 or newer). However, these dependencies are unnecessary for the common case when Python is just used as [http://en.wikipedia.org/wiki/Glue_language glue] to create chains of programs, and it only needs to read the RSF header, and not the binary. To allow Python [http://en.wikipedia.org/wiki/Meta-programs metaprograms] in madagascar to function, and programming in this style to be done, a fallback development kit implementing only the header-related functionality will be installed in the lack of these dependencies.&lt;br /&gt;
&lt;br /&gt;
===Python modules in user space===&lt;br /&gt;
Python is an evolving language. Many large systems have old versions for stability reasons, and administrators of such large systems tend to not install all software users may wish, and to not allow access to rpm either. To install a module in your user space, download the tarball, unzip it, cd into the directory and run: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;python setup.py install --prefix=/path/to/your/place&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The installer will create a subdirectory named &amp;lt;tt&amp;gt;lib&amp;lt;/tt&amp;gt;, or &amp;lt;tt&amp;gt;lib64&amp;lt;/tt&amp;gt; under the directory above. These &amp;lt;tt&amp;gt;lib*&amp;lt;/tt&amp;gt; dirs will have a directory named &amp;lt;tt&amp;gt;python&amp;lt;/tt&amp;gt;, or &amp;lt;tt&amp;gt;python2.3&amp;lt;/tt&amp;gt; for example, and those will have a subdirectory named &amp;lt;tt&amp;gt;site-packages&amp;lt;/tt&amp;gt;. Add all paths to these &amp;lt;tt&amp;gt;site-packages&amp;lt;/tt&amp;gt; subdirectories in your &amp;lt;tt&amp;gt;PYTHONPATH&amp;lt;/tt&amp;gt; environment variable. Some (&amp;lt;tt&amp;gt;numpy&amp;lt;/tt&amp;gt;) may create a &amp;lt;tt&amp;gt;bin&amp;lt;/tt&amp;gt; directory that needs to be added to &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=Environment variables=&lt;br /&gt;
Besides the variables defined in env.sh or env.csh (see the [[Installation|short Installation guide]]), Madagascar programs may read the variables below. They usually have reasonable defaults and were introduced just to provide more power to the advanced user.&lt;br /&gt;
&lt;br /&gt;
For future documentation writers: the environment variables read by Madagascar that have not been documented below can be found by running the script &amp;lt;tt&amp;gt;$RSFSRC/admin/find_env_var.py&amp;lt;/tt&amp;gt;. If the script does not exist or does not work, a summary of all environment variable calls can be obtained by going to $RSFSRC, temporarily moving the directory &amp;lt;tt&amp;gt;build/&amp;lt;/tt&amp;gt; outside RSFSRC, and typing&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
grep environ.get *.py */*.py */*/*.py */*/*/*.py&lt;br /&gt;
grep getenv           */*.c  */*/*.c  */*/*/*.c&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Used by the Madagascar core==&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; style=&amp;quot;background:#ffdead;&amp;quot;|Variables introduced by Madagascar&#039;s non-graphic programs&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Name&#039;&#039;&#039; || &#039;&#039;&#039;Default&#039;&#039;&#039; || Meaning&lt;br /&gt;
|-&lt;br /&gt;
| RSF_DATASERVER || &amp;lt;nowiki&amp;gt;ftp://egl.beg.utexas.edu/&amp;lt;/nowiki&amp;gt; || Data server for benchmark datasets&lt;br /&gt;
|-&lt;br /&gt;
| RSFDOC || $RSFROOT/doc || Directory for the HTML self-doc&lt;br /&gt;
|-&lt;br /&gt;
| RSFFIGS || $RSFROOT/figs || Directory with figures for testing examples in $RSFSRC/book&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| RSFALTFIGS || $RSFFIGS || Alternate directory with figures for testing examples not in $RSFSRC/book&lt;br /&gt;
|-&lt;br /&gt;
| RSFMEMSIZE || 100 || Maximum RAM (Mb) to be used by some programs  &lt;br /&gt;
|-&lt;br /&gt;
| RSFSRC || undefined || Root of the Madagascar source tree&lt;br /&gt;
|-&lt;br /&gt;
| TMPDATAPATH || $DATAPATH || Datapath for temporary files on local disk.&lt;br /&gt;
|-&lt;br /&gt;
| LATEX2HTML || undefined || LateX2HTML customization directory&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; style=&amp;quot;background:#ffdead;&amp;quot;|Variables introduced by Madagascar graphics programs &lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Name&#039;&#039;&#039; || &#039;&#039;&#039;Default&#039;&#039;&#039; || Meaning&lt;br /&gt;
|-&lt;br /&gt;
| DEFAULT_PAPER_SIZE || &amp;quot;letter&amp;quot; || For pspen. Other options: legal, a3, a4, a5.&lt;br /&gt;
|-&lt;br /&gt;
| FATMULT || ? || Fatness multiplication factor. &lt;br /&gt;
|-&lt;br /&gt;
| GIFBORDER || 0.25 || For vplot2gif (spacing)&lt;br /&gt;
|-&lt;br /&gt;
| GIFDELAY || 100 || For vplot2gif (for animations)&lt;br /&gt;
|-&lt;br /&gt;
| IMAGE_TYPE || &#039;png&#039; || Icon type for LateX2HTML &lt;br /&gt;
|-&lt;br /&gt;
| PATTERNMULT || None || Pattern multiplication factor  &lt;br /&gt;
|-&lt;br /&gt;
| PLOTSTYLE || None || Used in vplot&lt;br /&gt;
|-&lt;br /&gt;
| PPI || 75 || For vplot2gif (screen resolution)&lt;br /&gt;
|-&lt;br /&gt;
| PPMSCALE || 1 || For vplot2gif&lt;br /&gt;
|-&lt;br /&gt;
| PSBORDER || 0.05 || For vplot2eps (border around the plot)&lt;br /&gt;
|-&lt;br /&gt;
| PSPRINTER || postscript or colorps || For pspen&lt;br /&gt;
|-&lt;br /&gt;
| PSTEXPENOPTS || color=n fat=1 fatmult=1.5 invras=y || Other vplot2eps options &lt;br /&gt;
|-&lt;br /&gt;
| VPLOTFONTDIR || $RSFROOT/include || Dir with backup fonts in case the runtime-loaded vplot fonts are not found&lt;br /&gt;
|-&lt;br /&gt;
| VPLOTSPOOLDIR || /tmp || Where to put vplot tmp files&lt;br /&gt;
|-&lt;br /&gt;
| WSTYPE || &amp;quot;default&amp;quot; || Workstation type.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:#ffdead;&amp;quot;| Variables set by OS/other apps, read-only to Madagascar&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Name&#039;&#039;&#039; || &#039;&#039;&#039;Primarily used/set by&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| CWPROOT || Seismic Unix&lt;br /&gt;
|-&lt;br /&gt;
| DISPLAY || Operating System (OS)&lt;br /&gt;
|-&lt;br /&gt;
| HOME || OS&lt;br /&gt;
|-&lt;br /&gt;
| LD_LIBRARY_PATH || linker&lt;br /&gt;
|-&lt;br /&gt;
| MATLABPATH || Matlab&lt;br /&gt;
|-&lt;br /&gt;
| XAUTHORITY || X-Windows&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Used by the Madagascar build process and parallelization utilities==&lt;br /&gt;
Type &amp;lt;tt&amp;gt;scons -h&amp;lt;/tt&amp;gt; in RSFSRC to get a list of environment variables that affect the build process, with explanations, defaults and actual values. Below are more detailed explanations for some of them:&lt;br /&gt;
* &amp;lt;tt&amp;gt;RSF_THREADS&amp;lt;/tt&amp;gt;: used by &amp;lt;tt&amp;gt;pscons&amp;lt;/tt&amp;gt; to determine on how many threads to run on the local node, overriding the number of threads detected by Madagascar&lt;br /&gt;
* &amp;lt;tt&amp;gt;RSF_CLUSTER&amp;lt;/tt&amp;gt;: used by &amp;lt;tt&amp;gt;pscons&amp;lt;/tt&amp;gt; to determine on which cluster nodes to run, and on how many CPUs&lt;br /&gt;
&lt;br /&gt;
==Used by the Matlab API==&lt;br /&gt;
To use the Matlab API, you need to add &amp;lt;tt&amp;gt;$RSFROOT/lib&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;MATLABPATH&amp;lt;/tt&amp;gt;&lt;br /&gt;
==Used by the Octave API==&lt;br /&gt;
To use the Octave API, you need to add &amp;lt;tt&amp;gt;$RSFROOT/lib&amp;lt;/tt&amp;gt; to Octave&#039;s path. Determine Octave&#039;s version with&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
octave -v | head -1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
If your version is lower than 2.9.6, type at a Unix command line:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
echo &#039;LOADPATH = &amp;quot;::$RSFROOT/lib/octave&amp;quot;&#039; &amp;gt;&amp;gt; ~/.octaverc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
For later versions, use:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
echo &#039;addpath([getenv(&amp;quot;RSFROOT&amp;quot;) &amp;quot;/lib/octave&amp;quot;])&#039; &amp;gt;&amp;gt; ~/.octaverc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
==Used by the Java API==&lt;br /&gt;
New-style (post-1.0) API: Needs &amp;lt;tt&amp;gt;JAVA_HOME&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Old-style API (1.0 and before): The path to the downloaded Mines JTK must be specified in the MINESJTK environment variable in order to install the Java API. For example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
export MINESJTK=/home/user/edu_mines_jtk.jar&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==RSFROOT for NFS-shared user home directories==&lt;br /&gt;
Heterogeneous networks with user home directories shared through [http://en.wikipedia.org/wiki/Network_File_System_(protocol) NFS] are quite common in many institutions. In addition, even when the architecture is the same (i.e. 64-bit) and the operating system is the same (i.e. [http://en.wikipedia.org/wiki/RHEL RHEL]), the difference between operating system versions may be very significant because clusters may run legacy versions, while desktop workstations may run the latest-and-greatest (even beta), and entirely different Madagascar versions may be needed to support both. &lt;br /&gt;
&lt;br /&gt;
One possible solution of detecting the distribution version and architecture and setting RSFROOT appropriately is shown below. In the example network, all RHEL4 machines have the same architecture, but there are RHEL 3 machines with several architectures:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
REDHAT_RELEASE=`awk -F&#039;release&#039; &#039;{ print $2 }&#039; /etc/redhat-release | awk -F&#039; &#039; &#039;{ print $1 }&#039;`&lt;br /&gt;
&lt;br /&gt;
RSFROOT=/usr/local/rsf/rhel$REDHAT_RELEASE&lt;br /&gt;
&lt;br /&gt;
if [ $REDHAT_RELEASE == &#039;4&#039; ] ; then&lt;br /&gt;
    export RSFROOT&lt;br /&gt;
elif [ $REDHAT_RELEASE == &#039;3&#039; ] ; then&lt;br /&gt;
    export RSFROOT=$RSFROOT/$ARCH&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Of course, the Madagascar administrator will have to download appropriate versions of Madagascar to each $RSFROOT, and compile them on the appropriate system.&lt;br /&gt;
&lt;br /&gt;
If you have many kinds of systems to maintain, with multiple versions of Madagascar, and users have more than one shell, you may find it easy to outsource the complex logic to the easy-to-debug Python, i.e.:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
export RSFROOT=`$M8R_SETUP/get_rsfroot.py`&lt;br /&gt;
export PYTHONPATH=`$M8R_SETUP/edit_pythonpath.py`&lt;br /&gt;
export PATH=`$M8R_SETUP/edit_path.py`&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and similarly for (t)csh. The Python scripts determine the operating system and its version, determine the machine name, and simply print to stdout the desired string.&lt;br /&gt;
&lt;br /&gt;
==Eclipse + Pydev==&lt;br /&gt;
If you use [http://eclipse.org/ Eclipse] with [http://pydev.org/ Pydev], [http://pydev.org/manual_101_interpreter.html#id2 configure the interpreter] by adding &amp;lt;tt&amp;gt;$RSFROOT/lib&amp;lt;/tt&amp;gt; to the &amp;lt;tt&amp;gt;PYTHONPATH&amp;lt;/tt&amp;gt; for your chosen interpreter.&lt;br /&gt;
&lt;br /&gt;
=Platform-specific installation advice=&lt;br /&gt;
==Supported platforms==&lt;br /&gt;
Madagascar attempts to support any [http://en.wikipedia.org/wiki/POSIX POSIX-compliant] operating system demanded by users. For systems that bundle Python (i.e. Linux distributions, BSDs), backwards compatibility will attempt to cover those systems that were bundled with the oldest non-deprecated Python version currently supported by the latest stable version of [http://scons.org/ SCons]. For example, in early 2009 the stable SCons release (1.2) supported Python 2.2 or newer. [http://distrowatch.com/table.php?distribution=redhat Python 2.2 was bundled by RHEL3], so RHEL 3 and newer are supported. &lt;br /&gt;
&lt;br /&gt;
Attempts for backward compatibility with a given operating system are also stopped if the operating system itself becomes unsupported. For example, Python 2.2 was bundled by Fedora 1 and newer, but in January 2010 only Fedora 11 and 12 are actively maintained. Thus, in January 2010 Madagascar was not attempting to support Fedora 1, even though it included Python 2.2.&lt;br /&gt;
&lt;br /&gt;
Please keep in mind that the above statements constitute only general guidelines for what will be attempted, and do not constitute in any way a warranty of support. An application of the above guidelines to some Linux distributions follows:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Support info&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Distribution&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Life Cycle&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Supported versions&lt;br /&gt;
|-&lt;br /&gt;
| RHEL/CentOS/Scientific Linux&lt;br /&gt;
| [https://www.redhat.com/security/updates/errata/ 7 years]&lt;br /&gt;
| &lt;br /&gt;
* 6 until 2017-11-30&lt;br /&gt;
* 5 until 2014-03-31&lt;br /&gt;
|-&lt;br /&gt;
| Fedora&lt;br /&gt;
| [http://fedoraproject.org/wiki/Fedora_Release_Life_Cycle Release X maintained until one month after the release of X+2]&lt;br /&gt;
| &lt;br /&gt;
* 15 until 2012-06-24&lt;br /&gt;
* 14 until 2011-12-02&lt;br /&gt;
|-&lt;br /&gt;
| Ubuntu&lt;br /&gt;
| [https://wiki.ubuntu.com/Releases Releases every 6 mo, maintained for 1.5 yrs; LTS versions every 2 yrs, maintained for 5 yrs]&lt;br /&gt;
| &lt;br /&gt;
* 15.10 until July 2016&lt;br /&gt;
* 14.04 LTS until end of April 2019&lt;br /&gt;
* 12.04.4 LTS until end of April 2017&lt;br /&gt;
|-&lt;br /&gt;
| Debian&lt;br /&gt;
| [http://wiki.debian.org/DebianLenny Usually: stable releases every 1.5-3 yrs, release X maintained 1 yr after release X+1]&lt;br /&gt;
| &lt;br /&gt;
* 6 until its TBD end of life (approx. 2014)&lt;br /&gt;
* 5 until 2012-04&lt;br /&gt;
|- &lt;br /&gt;
| openSUSE&lt;br /&gt;
| [http://en.opensuse.org/Lifetime openSUSE releases Lifetime of 1.5-2.5 years]&lt;br /&gt;
| &lt;br /&gt;
* 11.4 until 2012-09-10&lt;br /&gt;
* 11.3 until 2012-01-15&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Ubuntu==&lt;br /&gt;
In &#039;&#039;&#039;Ubuntu 18.04&#039;&#039;&#039;, you can install the essential Madagascar depenency by running&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install libxaw7-dev freeglut3-dev libnetpbm10-dev libgd-dev libplplot-dev \&lt;br /&gt;
libavcodec-dev libcairo2-dev libjpeg-dev swig python-dev python-numpy g++ gfortran \&lt;br /&gt;
libopenmpi-dev libfftw3-dev libsuitesparse-dev python-epydoc scons git emacs25&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In &#039;&#039;&#039;Ubuntu 15.10 &#039;&#039;Wily Werewolf&#039;&#039;&#039;&#039;&#039; (as well as some previous versions), you can install the essential Madagascar depenency by running&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install libxaw7-dev &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and (optionally) all of Madagascar&#039;s dependencies by running&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install libxaw7-dev freeglut3-dev libnetpbm10-dev libgd-dev libplplot-dev \&lt;br /&gt;
libavcodec-dev libcairo2-dev libjpeg-dev swig python-dev python-numpy g++ gfortran \&lt;br /&gt;
libopenmpi-dev libfftw3-dev libsuitesparse-dev python-epydoc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In Ubuntu 13.04 &#039;&#039;Raring Ringtail&#039;&#039;, you can install all of Madagascar&#039;s dependencies by running&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install freeglut3-dev g++ gfortran libgd2-xpm-dev libx11-dev libxaw7-dev \&lt;br /&gt;
libnetpbm10-dev swig python-dev python-numpy libblas-dev libcairo2-dev liblapack-dev \&lt;br /&gt;
libavcodec-dev python-epydoc scons&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In Ubuntu 12.10 &#039;&#039;Quantal Quetzal&#039;&#039;, you can install all of Madagascar&#039;s dependencies by running&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install freeglut3-dev g++ gfortran libgd2-xpm-dev libx11-dev libxaw7-dev \&lt;br /&gt;
libnetpbm10-dev swig python-dev python-numpy libblas-dev libcairo2-dev liblapack-dev \&lt;br /&gt;
libavcodec-dev python-epydoc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In Ubuntu 12.04 &#039;&#039;Precise Pangolin&#039;&#039;, you can install all of Madagascar&#039;s dependencies by running&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install scons openmpi-bin libopenmpi-dev freeglut3-dev g++ gfortran libgd2-xpm-dev \&lt;br /&gt;
libglew1.6-dev libx11-dev libxaw7-dev libnetpbm10-dev swig python-dev python-scipy python-numpy \&lt;br /&gt;
libtiff4-dev scons units libblas-dev libcairo2-dev liblapack-dev libavcodec-dev python-epydoc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In Ubuntu 10.10 &#039;&#039;Maverick Meerkat&#039;&#039;, you can install all of Madagascar&#039;s dependencies by running &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install freeglut3-dev g++ gfortran libgd2-xpm-dev libglew1.5-dev libjpeg62-dev \&lt;br /&gt;
libx11-dev libxaw7-dev libnetpbm10-dev swig python-dev python-scipy python-numpy libtiff4-dev \&lt;br /&gt;
scons units libblas-dev libcairo2-dev libavcodec-dev libplplot-dev &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In Ubuntu 9.04 &#039;&#039;Jaunty Jackalope&#039;&#039;, the corresponding command is&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install freeglut3-dev g++ gfortran libc6-dev libgd2-xpm-dev libglew1.5-dev libjpeg62-dev \&lt;br /&gt;
libx11-dev libxaw7-dev libnetpbm10-dev swig python-dev python-scipy python-numpy libtiff4-dev scons units &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Earlier versions may work with&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install mesa-libGL-devel g++ g77 libc6-dev libgd2-xpm-dev libglew-dev libjpeg62-dev \&lt;br /&gt;
libx11-dev libxaw7-dev libnetpbm10-dev swig python-dev python-scipy python-numpy libtiff4-dev scons units &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If working with the development version, you will also need &amp;lt;tt&amp;gt;git&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;subversion&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Fedora, RedHat, CentOS, Scientific Linux, openSUSE==&lt;br /&gt;
&lt;br /&gt;
Install essential Madagascar dependencies with&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo yum install gcc libXaw-devel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dependency package names, sorted by Linux distribution and Madagascar feature they provide. Packages that are not included in the standard distro repositories are hyperlinked to their providers. The tables below cover build dependencies. &lt;br /&gt;
&lt;br /&gt;
Names of packages that are runtime dependencies are &#039;&#039;&#039;highlighted&#039;&#039;&#039; in the tables below (task under construction).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note: In the future, it should be possible for the configuration scripts to output the dependency tables below, so that they are guaranteed to be in synch with a given Madagascar version&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Minimal install (&amp;quot;Core&amp;quot;), publishing and development&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Core&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | LaTeX&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Development version&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | C++ API&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | F77 API, F90 API&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Python API&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Java API&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Octave API&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Matlab API&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Fedora 15&lt;br /&gt;
| binutils, gcc, glibc-headers, python&lt;br /&gt;
| texlive-latex&lt;br /&gt;
| subversion&lt;br /&gt;
| gcc-c++&lt;br /&gt;
| gcc-gfortran&lt;br /&gt;
| numpy, swig, python-devel&lt;br /&gt;
| Java (Sun&#039;s? IcedTea?)&lt;br /&gt;
| octave, octave-devel&lt;br /&gt;
| [http://www.mathworks.com/ Matlab] with Mex&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Fedora 14&lt;br /&gt;
| binutils, gcc, glibc-headers, python&lt;br /&gt;
| texlive-latex&lt;br /&gt;
| subversion&lt;br /&gt;
| gcc-c++&lt;br /&gt;
| gcc-gfortran&lt;br /&gt;
| numpy, swig&lt;br /&gt;
| Java (Sun&#039;s? IcedTea?)&lt;br /&gt;
| octave, octave-devel&lt;br /&gt;
| [http://www.mathworks.com/ Matlab] with Mex&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Fedora 13&lt;br /&gt;
| binutils, gcc, glibc-headers, python&lt;br /&gt;
| texlive-latex&lt;br /&gt;
| subversion&lt;br /&gt;
| gcc-c++&lt;br /&gt;
| gcc-gfortran&lt;br /&gt;
| numpy, swig&lt;br /&gt;
| Java (Sun&#039;s? IcedTea?)&lt;br /&gt;
| octave, octave-devel&lt;br /&gt;
| [http://www.mathworks.com/ Matlab]&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | CentOS 5&lt;br /&gt;
| binutils, gcc, glibc-headers; python (needs [http://dag.wieers.com/rpm/FAQ.php#B2 RPMforge&#039;s RHEL5 repository])&lt;br /&gt;
| ?&lt;br /&gt;
| subversion&lt;br /&gt;
| gcc-c++&lt;br /&gt;
| gcc-gfortran&lt;br /&gt;
| numpy, swig&lt;br /&gt;
| Java (Sun&#039;s? IcedTea?), [http://inside.mines.edu/~dhale/jtk/ Mines JTK]&lt;br /&gt;
| [http://www.gnu.org/software/octave/ Octave, octave-devel]&lt;br /&gt;
| [http://www.mathworks.com/ Matlab]&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | openSUSE 11.0&lt;br /&gt;
| gcc, python&lt;br /&gt;
| texlive-latex&lt;br /&gt;
| subversion&lt;br /&gt;
| gcc-c++&lt;br /&gt;
| gcc-fortran&lt;br /&gt;
| [http://numpy.scipy.org/ NumPy], swig&lt;br /&gt;
| Java (Sun&#039;s? IcedTea?), [http://inside.mines.edu/~dhale/jtk/ Mines JTK]&lt;br /&gt;
| [http://www.gnu.org/software/octave/ Octave]&lt;br /&gt;
| [http://www.mathworks.com/ Matlab]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Graphics and visualization&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The minimum requirement is X11 graphics for running &#039;&#039;&#039;xtpen&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | X11 graphics&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | vplot2gif&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | vplot2avi&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Some sort of movies?&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | TIFF output&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | JPEG output&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | PLplot graphics&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | OpenGL graphics&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | ppm (?)&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | unknown&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Fedora 13&lt;br /&gt;
| libXaw-devel&lt;br /&gt;
| gifsicle&lt;br /&gt;
| ffmpeg (needs the [http://rpmfusion.org/ RPM Fusion] repository enabled)&lt;br /&gt;
| ffmpeg-devel (needs the [http://rpmfusion.org/ RPM Fusion] repository enabled)&lt;br /&gt;
| libtiff-devel&lt;br /&gt;
| libjpeg-devel&lt;br /&gt;
| plplot-devel&lt;br /&gt;
| mesa-libGL-devel, freeglut, freeglut-devel&lt;br /&gt;
| netpbm-devel&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | openSUSE 11.0&lt;br /&gt;
| xorg-x11-devel&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
| libtiff-devel&lt;br /&gt;
| libjpeg-devel&lt;br /&gt;
| plplot-devel&lt;br /&gt;
| mesa-libGL-devel, freeglut, freeglut-devel&lt;br /&gt;
| netpbm-devel&lt;br /&gt;
| cairo-devel, gd-devel, glew-devel&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Numerical and file manipulation utilities&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | OpenMP&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | MPI&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | BLAS/ATLAS&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Interface to the Fast Discrete Curvelet Transform&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | sfunits&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Fedora 13&lt;br /&gt;
| libgomp&lt;br /&gt;
| openmpi, openmpi-devel; openmpi-libs (?)&lt;br /&gt;
| blas, blas-devel, atlas, atlas-devel&lt;br /&gt;
| [https://wave.eos.ubc.ca/Software/Licenced/ pyct]&lt;br /&gt;
| units&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | CentOS 5&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
| [https://wave.eos.ubc.ca/Software/Licenced/ pyct]&lt;br /&gt;
| [http://www.gnu.org/software/units/units.html Gnu Units]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Other&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Inclusions from Seismic Unix&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Fedora 14, 15&lt;br /&gt;
| [http://www.cwp.mines.edu/cwpcodes/ Seismic Unix]&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | CentOS 5&lt;br /&gt;
| [http://www.cwp.mines.edu/cwpcodes/ Seismic Unix]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Command to install all dependencies present in the public repositories&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Usually package management software will not install again a package that is already installed, so it should be safe to copy and paste the command below to a command line:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Fedora 15&lt;br /&gt;
| &#039;&#039;&#039;yum -y install&#039;&#039;&#039; binutils gcc glibc-headers scons texlive-latex subversion gcc-c++ gcc-gfortran numpy python python-devel swig octave octave-devel libgomp openmpi openmpi-devel blas blas-devel atlas atlas-devel units gifsicle ffmpeg ffmpeg-devel libtiff-devel libjpeg-devel plplot-devel mesa-libGL-devel freeglut freeglut-devel libXaw-devel netpbm-devel&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Fedora 13&lt;br /&gt;
| &#039;&#039;&#039;yum -y install&#039;&#039;&#039; binutils gcc glibc-headers scons texlive-latex subversion gcc-c++ gcc-gfortran numpy python swig octave octave-devel libgomp openmpi openmpi-devel blas blas-devel atlas atlas-devel units gifsicle ffmpeg ffmpeg-devel libtiff-devel libjpeg-devel plplot-devel mesa-libGL-devel freeglut freeglut-devel libXaw-devel netpbm-devel&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | CentOS 5&lt;br /&gt;
| &#039;&#039;&#039;yum -y install&#039;&#039;&#039; binutils freeglut freeglut-devel gcc gcc-c++ gcc-gfortran glibc-headers libjpeg-devel libXaw-devel netpbm-devel&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | openSUSE 11.0&lt;br /&gt;
| &#039;&#039;&#039;zypper install&#039;&#039;&#039; cairo-devel gcc gcc-c++ gcc-fortran gd-devel glew-devel libjpeg-devel libtiff-devel octave scons subversion texlive-latex xorg-x11-devel&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;List of runtime dependencies only&#039;&#039;&#039;&lt;br /&gt;
(needed by packagers of Madagascar in order to properly list dependencies):&lt;br /&gt;
UNDER CONSTRUCTION&lt;br /&gt;
&lt;br /&gt;
===Fedora 25===&lt;br /&gt;
The following explains how to install madagascar on Fedora 25.&lt;br /&gt;
&lt;br /&gt;
We use the following compiler: &amp;lt;code&amp;gt;gcc&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;g++&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;gfortran&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* Install some packages&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; inline style=&amp;quot;white-space:wrap&amp;quot;&amp;gt;sudo dnf install scons lapack-static lapack64-static atlas-static fftw-static gd gd-devel libtool-ltdl-devel \&lt;br /&gt;
libXaw-devel mesa-libGL-devel freeglut-devel netpbm-devel plplot-devel ffmpeg-devel swig openmpi openmpi-devel suitesparse-devel&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This installed the following packages:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
scons-2.5.1-1.fc25.noarch&lt;br /&gt;
lapack-static-3.6.1-2.fc25.x86_64&lt;br /&gt;
lapack64-static-3.6.1-2.fc25.x86_64&lt;br /&gt;
atlas-static-3.10.2-14.fc25.x86_64&lt;br /&gt;
fftw-static-3.3.5-3.fc25.x86_64&lt;br /&gt;
gd-2.2.4-1.fc25.x86_64&lt;br /&gt;
gd-devel-2.2.4-1.fc25.x86_64&lt;br /&gt;
libtool-ltdl-devel-2.4.6-13.fc25.x86_64&lt;br /&gt;
libXaw-devel-1.0.13-4.fc25.x86_64&lt;br /&gt;
mesa-libGL-devel-17.0.5-3.fc25.x86_64&lt;br /&gt;
freeglut-devel-3.0.0-3.fc24.x86_64&lt;br /&gt;
netpbm-devel-10.78.00-1.fc25.x86_64&lt;br /&gt;
plplot-devel-5.11.1-13.fc25.x86_64&lt;br /&gt;
ffmpeg-devel-3.1.9-1.fc25.x86_64&lt;br /&gt;
swig-3.0.11-1.fc25.x86_64&lt;br /&gt;
openmpi-1.10.5-1.fc25.x86_64&lt;br /&gt;
openmpi-devel-1.10.5-1.fc25.x86_64&lt;br /&gt;
suitesparse-devel-4.4.6-7.fc25.x86_64&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and many other dependencies.&lt;br /&gt;
&lt;br /&gt;
* Get the sources from the git repository&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;git clone https://github.com/ahay/src&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you run now the &amp;lt;code&amp;gt;configure&amp;lt;/code&amp;gt; script, you will get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
checking for Python ... /usr/bin/python&lt;br /&gt;
checking Python version ... 2.7.13&lt;br /&gt;
checking for RSFROOT ... /usr/local/rsf&lt;br /&gt;
checking for SCons ... /usr/bin/scons&lt;br /&gt;
checking SCons version ... v2.5.1.rel_2.5.1:3735:9dc6cee5c168[MODIFIED]&lt;br /&gt;
Running RSFROOT=/usr/local/rsf /usr/bin/scons  config ...&lt;br /&gt;
------------------------&lt;br /&gt;
scons: Reading SConscript files ...&lt;br /&gt;
checking platform ... (cached) linux [fedora]&lt;br /&gt;
checking for C compiler ... (cached) gcc&lt;br /&gt;
checking if gcc works ... yes&lt;br /&gt;
checking if gcc accepts &#039;-x c -std=gnu99 -Wall -pedantic&#039; ... yes&lt;br /&gt;
checking for ar ... (cached) ar&lt;br /&gt;
checking for libraries ... [&#039;m&#039;]&lt;br /&gt;
checking complex support ... yes&lt;br /&gt;
checking for X11 headers ... /usr/include&lt;br /&gt;
checking for X11 libraries ... /usr/lib&lt;br /&gt;
checking for OpenGL ... yes&lt;br /&gt;
checking for sfpen ... (cached) xtpen&lt;br /&gt;
checking for ppm ... yes&lt;br /&gt;
checking for tiff ... yes&lt;br /&gt;
checking for GD (PNG) ... yes&lt;br /&gt;
checking for GD (GIF) ... yes&lt;br /&gt;
checking for plplot ... no&lt;br /&gt;
&lt;br /&gt;
  Optional package: plplot-devel&lt;br /&gt;
checking for ffmpeg ... yes&lt;br /&gt;
checking for cairo (PNG) ... yes&lt;br /&gt;
checking for cairo (SVG) ... yes&lt;br /&gt;
checking for cairo (PDF) ... yes&lt;br /&gt;
checking for jpeg ... yes&lt;br /&gt;
checking for BLAS ... yes&lt;br /&gt;
checking for LAPACK ... no&lt;br /&gt;
&lt;br /&gt;
  Optional package: blas + blas-devel + atlas + atlas-devel&lt;br /&gt;
checking for SWIG ... (cached) /usr/bin/swig&lt;br /&gt;
checking for numpy ... (cached) yes&lt;br /&gt;
checking API options ... (cached) []&lt;br /&gt;
checking for C++ compiler ... (cached) g++&lt;br /&gt;
checking if g++ works ... yes&lt;br /&gt;
checking if g++ accepts &#039;-std=c++11 -U__STRICT_ANSI__ -Wall -pedantic&#039; ... yes&lt;br /&gt;
checking for MPICC ... (cached) /usr/lib64/openmpi/bin/mpicc&lt;br /&gt;
checking if /usr/lib64/openmpi/bin/mpicc works ... yes&lt;br /&gt;
checking for MPICXX ... (cached) /usr/lib64/openmpi/bin/mpicxx&lt;br /&gt;
checking if /usr/lib64/openmpi/bin/mpicxx works ... yes&lt;br /&gt;
checking for MPIRUN ... (cached) /usr/lib64/openmpi/bin/mpirun&lt;br /&gt;
checking for Posix threads ... yes&lt;br /&gt;
checking for OpenMP ... yes&lt;br /&gt;
checking for CUDA ... (cached) no&lt;br /&gt;
checking for FFTW ... yes&lt;br /&gt;
checking if FFTW supports threads ... yes&lt;br /&gt;
checking for SuiteSparse ... yes&lt;br /&gt;
checking for pfft ... no&lt;br /&gt;
scons: done reading SConscript files.&lt;br /&gt;
scons: Building targets ...&lt;br /&gt;
shell_script([&amp;quot;env.sh&amp;quot;], [])&lt;br /&gt;
shell_script([&amp;quot;env.csh&amp;quot;], [])&lt;br /&gt;
scons: done building targets.&lt;br /&gt;
------------------------&lt;br /&gt;
Done with configuration.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Libraries &amp;lt;code&amp;gt;plplot&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;lapack&amp;lt;/code&amp;gt; are not found. File &amp;lt;code&amp;gt;config.log&amp;lt;/code&amp;gt; says&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/bin/ld: cannot find -lplplotd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gcc -o .sconf_temp/sfconftest_21 .sconf_temp/conftest_21.o -L/usr/lib64/atlas -lm -lf77blas -lcblas -latlas -llapack -lcblas&lt;br /&gt;
/usr/lib64/atlas/liblapack.a(dgesv.o): In function `dgesv_&#039;:&lt;br /&gt;
(.text+0x69): undefined reference to `xerbla_&#039;&lt;br /&gt;
/usr/lib64/atlas/liblapack.a(ATL_f77wrap_dgesv.o): In function `atl_f77wrap_dgesv_&#039;:&lt;br /&gt;
(.text+0x10d): undefined reference to `ATL_xerbla&#039;&lt;br /&gt;
/usr/lib64/atlas/liblapack.a(ATL_dgetf2.o): In function `ATL_dgetf2&#039;:&lt;br /&gt;
(.text+0x184): undefined reference to `ATL_dger&#039;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So library &amp;lt;code&amp;gt;plplotd&amp;lt;/code&amp;gt; doesn&#039;t exist on Fedora 25 and the &amp;lt;code&amp;gt;configure&amp;lt;/code&amp;gt; script is looking for the wrong &amp;lt;code&amp;gt;lapack&amp;lt;/code&amp;gt; library.&lt;br /&gt;
&lt;br /&gt;
If compiling now, 2 other libraries won&#039;t be found: &amp;lt;code&amp;gt;gfortran&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;quadmath&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Regarding the &amp;lt;code&amp;gt;plplotd&amp;lt;/code&amp;gt; library, edit file &amp;lt;code&amp;gt;framework/configure.py&amp;lt;/code&amp;gt; and change the line 724:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line start=&amp;quot;724&amp;quot;&amp;gt;plplot = context.env.get(&#039;PLPLOT&#039;,&#039;plplotd&#039;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
to&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line start=&amp;quot;724&amp;quot;&amp;gt;plplot = context.env.get(&#039;PLPLOT&#039;,&#039;plplot&#039;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* As for the libraries&lt;br /&gt;
** &amp;lt;code&amp;gt;lapack&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;gfortran&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;quadmath&amp;lt;/code&amp;gt;&lt;br /&gt;
We must use the &amp;lt;code&amp;gt;lapack&amp;lt;/code&amp;gt; library installed in &amp;lt;code&amp;gt;/usr/lib64&amp;lt;/code&amp;gt;, not the one installed in &amp;lt;code&amp;gt;/usr/lib64/atlas&amp;lt;/code&amp;gt;. And libraries &amp;lt;code&amp;gt;gfortran&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;quadmath&amp;lt;/code&amp;gt; are installed in &amp;lt;code&amp;gt;/usr/lib/gcc/x86_64-redhat-linux/6.3.1/&amp;lt;/code&amp;gt;.&lt;br /&gt;
Edit file &amp;lt;code&amp;gt;framework/configure.py&amp;lt;/code&amp;gt; and add the following 4 lines:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[&#039;/usr/lib/gcc/x86_64-redhat-linux/6.3.1/&#039;,&lt;br /&gt;
 &#039;/usr/lib64/&#039;,&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LIBS.append(&#039;gfortran&#039;)&lt;br /&gt;
LIBS.append(&#039;quadmath&#039;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
so that we end up with the following &amp;lt;code&amp;gt;blas&amp;lt;/code&amp;gt; function: &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line start=&amp;quot;971&amp;quot;&amp;gt;def blas(context):&lt;br /&gt;
    context.Message(&amp;quot;checking for BLAS ... &amp;quot;)&lt;br /&gt;
    text = &#039;&#039;&#039;&lt;br /&gt;
    #ifdef __APPLE__&lt;br /&gt;
    #include &amp;lt;Accelerate/Accelerate.h&amp;gt;&lt;br /&gt;
    #else&lt;br /&gt;
    #ifdef HAVE_MKL&lt;br /&gt;
    #include &amp;lt;mkl.h&amp;gt;&lt;br /&gt;
    #else&lt;br /&gt;
    #include &amp;lt;cblas.h&amp;gt;&lt;br /&gt;
    #endif&lt;br /&gt;
    #endif&lt;br /&gt;
    int main(int argc,char* argv[]) {&lt;br /&gt;
    float d, x[]={1.,2.,3.}, y[]={3.,2.,1.};&lt;br /&gt;
    d = cblas_sdot(3,x,1,y,1);&lt;br /&gt;
    return 0;&lt;br /&gt;
    }\n&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    if plat[&#039;OS&#039;] == &#039;cygwin&#039;:&lt;br /&gt;
        context.env[&#039;ENV&#039;][&#039;PATH&#039;] = context.env[&#039;ENV&#039;][&#039;PATH&#039;] + \&lt;br /&gt;
                                         &#039;:/lib/lapack&#039;&lt;br /&gt;
&lt;br /&gt;
    res = context.TryLink(text,&#039;.c&#039;)&lt;br /&gt;
    if res: &lt;br /&gt;
        context.Result(res)&lt;br /&gt;
        context.env[&#039;BLAS&#039;] = True &lt;br /&gt;
    else:&lt;br /&gt;
        # first try blas&lt;br /&gt;
        LIBS = path_get(context,&#039;LIBS&#039;)&lt;br /&gt;
        blas = context.env.get(&#039;BLAS&#039;,&#039;blas&#039;)&lt;br /&gt;
        LIBS.append(blas)&lt;br /&gt;
        res = context.TryLink(text,&#039;.c&#039;)&lt;br /&gt;
        if res: &lt;br /&gt;
            context.Result(res)&lt;br /&gt;
            context.env[&#039;LIBS&#039;] = LIBS &lt;br /&gt;
            context.env[&#039;BLAS&#039;] = blas &lt;br /&gt;
        else:&lt;br /&gt;
            # some systems require cblas and atlas&lt;br /&gt;
            for atlas_dir in filter(os.path.isdir,&lt;br /&gt;
                                    [&#039;/usr/lib/gcc/x86_64-redhat-linux/6.3.1/&#039;,  # &amp;lt;--- add this line&lt;br /&gt;
                                     &#039;/usr/lib64/&#039;,                              # &amp;lt;--- add this line&lt;br /&gt;
                                     &#039;/usr/lib64/atlas/&#039;,&lt;br /&gt;
                                     &#039;/usr/lib/atlas/&#039;]):&lt;br /&gt;
                context.env[&#039;LIBPATH&#039;].append(atlas_dir)&lt;br /&gt;
            LIBS.pop()&lt;br /&gt;
            LIBS.append(&#039;f77blas&#039;)&lt;br /&gt;
            LIBS.append(&#039;cblas&#039;)&lt;br /&gt;
            LIBS.append(&#039;atlas&#039;)&lt;br /&gt;
            LIBS.append(&#039;gfortran&#039;)  # &amp;lt;----------------------------------------------- add this line&lt;br /&gt;
            LIBS.append(&#039;quadmath&#039;)  # &amp;lt;----------------------------------------------- add this line&lt;br /&gt;
            res = context.TryLink(text,&#039;.c&#039;)&lt;br /&gt;
            if res: &lt;br /&gt;
                context.Result(res)&lt;br /&gt;
                context.env[&#039;LIBS&#039;] = LIBS &lt;br /&gt;
                context.env[&#039;BLAS&#039;] = &#039;cblas&#039;&lt;br /&gt;
            else:&lt;br /&gt;
                context.Result(context_failure)&lt;br /&gt;
                context.env[&#039;CPPDEFINES&#039;] = \&lt;br /&gt;
                    path_get(context,&#039;CPPDEFINES&#039;,&#039;NO_BLAS&#039;)&lt;br /&gt;
                LIBS.pop()&lt;br /&gt;
                LIBS.pop()&lt;br /&gt;
                LIBS.pop()&lt;br /&gt;
                context.env[&#039;BLAS&#039;] = None &lt;br /&gt;
                need_pkg(&#039;blas&#039;, fatal=False)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* Run the &amp;lt;code&amp;gt;configure&amp;lt;/code&amp;gt; script, for example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;./configure --prefix=/usr/local/rsf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Output should give:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
checking for Python ... /usr/bin/python&lt;br /&gt;
checking Python version ... 2.7.13&lt;br /&gt;
checking for RSFROOT ... /usr/local/rsf&lt;br /&gt;
checking for SCons ... /usr/bin/scons&lt;br /&gt;
checking SCons version ... v2.5.1.rel_2.5.1:3735:9dc6cee5c168[MODIFIED]&lt;br /&gt;
Running RSFROOT=/usr/local/rsf /usr/bin/scons  config ...&lt;br /&gt;
------------------------&lt;br /&gt;
scons: Reading SConscript files ...&lt;br /&gt;
checking platform ... (cached) linux [fedora]&lt;br /&gt;
checking for C compiler ... (cached) gcc&lt;br /&gt;
checking if gcc works ... yes&lt;br /&gt;
checking if gcc accepts &#039;-x c -std=gnu99 -Wall -pedantic&#039; ... yes&lt;br /&gt;
checking for ar ... (cached) ar&lt;br /&gt;
checking for libraries ... [&#039;m&#039;]&lt;br /&gt;
checking complex support ... yes&lt;br /&gt;
checking for X11 headers ... /usr/include&lt;br /&gt;
checking for X11 libraries ... /usr/lib&lt;br /&gt;
checking for OpenGL ... yes&lt;br /&gt;
checking for sfpen ... (cached) xtpen&lt;br /&gt;
checking for ppm ... yes&lt;br /&gt;
checking for tiff ... yes&lt;br /&gt;
checking for GD (PNG) ... yes&lt;br /&gt;
checking for GD (GIF) ... yes&lt;br /&gt;
checking for plplot ... yes&lt;br /&gt;
checking for ffmpeg ... yes&lt;br /&gt;
checking for cairo (PNG) ... yes&lt;br /&gt;
checking for cairo (SVG) ... yes&lt;br /&gt;
checking for cairo (PDF) ... yes&lt;br /&gt;
checking for jpeg ... yes&lt;br /&gt;
checking for BLAS ... yes&lt;br /&gt;
checking for LAPACK ... yes&lt;br /&gt;
checking for SWIG ... (cached) /usr/bin/swig&lt;br /&gt;
checking for numpy ... (cached) yes&lt;br /&gt;
checking API options ... (cached) []&lt;br /&gt;
checking for C++ compiler ... (cached) g++&lt;br /&gt;
checking if g++ works ... yes&lt;br /&gt;
checking if g++ accepts &#039;-std=c++11 -U__STRICT_ANSI__ -Wall -pedantic&#039; ... yes&lt;br /&gt;
checking for MPICC ... (cached) /usr/lib64/openmpi/bin/mpicc&lt;br /&gt;
checking if /usr/lib64/openmpi/bin/mpicc works ... yes&lt;br /&gt;
checking for MPICXX ... (cached) /usr/lib64/openmpi/bin/mpicxx&lt;br /&gt;
checking if /usr/lib64/openmpi/bin/mpicxx works ... yes&lt;br /&gt;
checking for MPIRUN ... (cached) /usr/lib64/openmpi/bin/mpirun&lt;br /&gt;
checking for Posix threads ... yes&lt;br /&gt;
checking for OpenMP ... yes&lt;br /&gt;
checking for CUDA ... (cached) no&lt;br /&gt;
checking for FFTW ... yes&lt;br /&gt;
checking if FFTW supports threads ... yes&lt;br /&gt;
checking for SuiteSparse ... yes&lt;br /&gt;
checking for pfft ... no&lt;br /&gt;
scons: done reading SConscript files.&lt;br /&gt;
scons: Building targets ...&lt;br /&gt;
shell_script([&amp;quot;env.sh&amp;quot;], [])&lt;br /&gt;
shell_script([&amp;quot;env.csh&amp;quot;], [])&lt;br /&gt;
scons: done building targets.&lt;br /&gt;
------------------------&lt;br /&gt;
Done with configuration.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* Then run the compilation:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;make&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* and finally the installation&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;sudo make install&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Debian 5==&lt;br /&gt;
Specific dependencies:&lt;br /&gt;
* Debian 5.0 (&amp;quot;Lenny&amp;quot;): Please make sure you have the &amp;lt;tt&amp;gt;libc6-dev&amp;lt;/tt&amp;gt; package before trying to compile from source. The &amp;lt;tt&amp;gt;libXaw7-dev&amp;lt;/tt&amp;gt; package might be a dependency for &amp;lt;tt&amp;gt;xtpen&amp;lt;/tt&amp;gt; (was in Debian 4.0)&lt;br /&gt;
&lt;br /&gt;
==Yellow Dog Linux 6.1 on Sony PlayStation 3==&lt;br /&gt;
See [http://www.reproducibility.org/rsflog/uploads/Friday_Seminar_Madagascar_on_PS3.ppt Will Burnett&#039;s guide (PowerPoint)]&lt;br /&gt;
&lt;br /&gt;
==Mac OS X==&lt;br /&gt;
&lt;br /&gt;
Install necessary Mac OS X applications using:&lt;br /&gt;
* [http://www.macports.org/ MacPorts], an easy-to-use system for compiling, installing, and upgrading open-source software on Mac OS X.&lt;br /&gt;
* [http://www.finkproject.org/ Fink], a tool that brings the full world of Unix Open Source software to Mac OS X. &lt;br /&gt;
&lt;br /&gt;
Installation on Mac OS X Mountain Lion requires the following:&lt;br /&gt;
# &amp;lt;b&amp;gt;Xcode&amp;lt;/b&amp;gt;: Download and install [https://developer.apple.com/xcode/ XCode] from Apple using App Store application. In Xcode, make sure to enable and install the command-line tools in Xcode/Preferences/Downloads &lt;br /&gt;
# (Optionally) &amp;lt;b&amp;gt;X11&amp;lt;/b&amp;gt;: Install X11 libraries from [http://xquartz.macosforge.org Xquartz]. &lt;br /&gt;
# (Optionally) &amp;lt;b&amp;gt;gcc&amp;lt;/b&amp;gt;: Install the Gnu C compiler from [http://hpc.sourceforge.net HPC Mac OS X]. &lt;br /&gt;
# (Optionally) [[SEGTeX]]: To use &amp;lt;b&amp;gt;SEGTeX&amp;lt;/b&amp;gt;, you may need [http://www.tug.org/texlive/ TeX Live]. &amp;lt;b&amp;gt;MacPorts&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;Fink&amp;lt;/b&amp;gt; provide an easy way to install it with commands &amp;lt;pre&amp;gt;sudo port install texlive&amp;lt;/pre&amp;gt; or &amp;lt;pre&amp;gt;sudo fink install texlive&amp;lt;/pre&amp;gt;&lt;br /&gt;
# (Optionally) &amp;lt;b&amp;gt;FFTW&amp;lt;/b&amp;gt;: Using &amp;lt;b&amp;gt;MacPorts&amp;lt;/b&amp;gt;, run &amp;lt;pre&amp;gt;sudo port install fftw-3-single&amp;lt;/pre&amp;gt;&amp;lt;pre&amp;gt;sudo port install fftw-3 +gfortran&amp;lt;/pre&amp;gt;&lt;br /&gt;
# (Optionally) &amp;lt;b&amp;gt;MPI&amp;lt;/b&amp;gt;: Using &amp;lt;b&amp;gt;MacPorts&amp;lt;/b&amp;gt;, run &amp;lt;pre&amp;gt;sudo port install openmpi&amp;lt;/pre&amp;gt;&amp;lt;pre&amp;gt;sudo port select --set mpi openmpi-mp-fortran&amp;lt;/pre&amp;gt;&lt;br /&gt;
# (Optionally) &amp;lt;b&amp;gt;ppmpen&amp;lt;/b&amp;gt;: Using &amp;lt;b&amp;gt;MacPorts&amp;lt;/b&amp;gt;, run &amp;lt;pre&amp;gt;sudo port install libnetpbm&amp;lt;/pre&amp;gt;&lt;br /&gt;
# (Optionally) &amp;lt;b&amp;gt;Open vplots using double click&amp;lt;/b&amp;gt;: [[machacks|Instructions]].&lt;br /&gt;
Proceed with configuration and installation following the normal procedure.  You may need to use Apple&#039;s compiler (clang) instead of gcc.  Use one of these commands in the $RSFSRC directory&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure CC=clang CXX=clang++&amp;lt;/pre&amp;gt; or &amp;lt;pre&amp;gt;./configure CC=clang CXX=clang++ API=f90,matlab --prefix=/directory/where/you/want/madagascar/installed&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==OpenSolaris==&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;tt&amp;gt;pkg&amp;lt;/tt&amp;gt; to install missing components such as X11 headers.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
pfexec pkg install SUNWxorg-headers&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==MS Windows==&lt;br /&gt;
Due to its size, this topic has been assigned [[Windows | its own Wiki page]].&lt;br /&gt;
&lt;br /&gt;
==How to adapt Madagascar to a new platform==&lt;br /&gt;
The most laborious part of adapting madagascar to a new platform is finding the proper dependency names. This usually proceeds as follows: dependency X fails with a &amp;quot;missing file&amp;quot; error either as a header file in &amp;lt;tt&amp;gt;config.log&amp;lt;/tt&amp;gt;, or a missing library during the build step. Possible package names are found through an internet search for the missing file name and the distribution name or by using specific [http://rpm.pbone.net/ rpm search tools]. Packages are installed and the configure (and, if necessary) build processes are repeated until the error goes away.&lt;br /&gt;
&lt;br /&gt;
=Multi-user installs=&lt;br /&gt;
Some organizations may find it desirable to deny write access of some users to all RSFSRC/RSFROOT except their own user directory. Fortunately, this can be easily done by placing the restricted user dirs outside RSFSRC/RSFROOT, i.e. in their home dirs, say /home/joe/rsfsrc. In order to move a user&#039;s directory out of RSFSRC, you must:&lt;br /&gt;
* &amp;quot;tell&amp;quot; the SConstruct in the user&#039;s dir where to find RSFSRC so that when the user builds in his directory, it can import &amp;lt;tt&amp;gt;configure.py&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;config.py&amp;lt;/tt&amp;gt; You do that by setting the environment variable RSFSRC to the absolute path of the Madagascar source root, and by making sure that lines 2 and 3 in the users&#039; SConstruct files are&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
srcroot = os.environ.get(&#039;RSFSRC&#039;, &#039;../..&#039;)&lt;br /&gt;
sys.path.append(srcroot)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
and then replace &amp;lt;tt&amp;gt;../..&amp;lt;/tt&amp;gt; throughout the SConstruct using &amp;lt;tt&amp;gt;os.path.join&amp;lt;/tt&amp;gt; and the &amp;lt;tt&amp;gt;srcroot&amp;lt;/tt&amp;gt; variable.&lt;br /&gt;
* &amp;quot;tell&amp;quot; the build scripts about the user&#039;s dir, so that it is included in the builds launched from RSFSRC. You do that with a symbolic link:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ln -s /home/joe/rsfsrc $RSFSRC/user/joe&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&#039;&#039;When the link exists&#039;&#039;, those of Joe&#039;s programs that are mentioned in the &amp;quot;prog&amp;quot; string in SConstruct get included in the distribution, complete with self-doc. If Joe is just learning how to code and his stuff breaks the build, just remove the symbolic link. Even if build+installs are done after the link is removed, his stable programs and self-doc will continue to remain installed system-wide as long as the admin does not type &amp;lt;tt&amp;gt;scons -c install&amp;lt;/tt&amp;gt; (not likely).&lt;br /&gt;
* point the user&#039;s RSFDOC environment variable to a location where the user has write access&lt;br /&gt;
* edit the users&#039; SConstruct so that it uses the RSF library and headers already installed in $RSFROOT/lib and $RSFROOT/include , instead of building again the whole &amp;lt;tt&amp;gt;librsf&amp;lt;/tt&amp;gt; with user-specific flags in &amp;lt;tt&amp;gt;RSFSRC/filt/lib/&amp;lt;/tt&amp;gt;. To do that, replace in the user&#039;s SConstruct the env.Prepend statement with&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
rsfroot = os.environ.get(&#039;RSFROOT&#039;,&#039;/usr/local/rsf&#039;)&lt;br /&gt;
&lt;br /&gt;
env.Prepend(CPPPATH=[os.path.join(rsfroot,&#039;include&#039;)],&lt;br /&gt;
            LIBPATH=[os.path.join(rsfroot,&#039;lib&#039;)],&lt;br /&gt;
            LIBS=[&#039;rsf&#039;])&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* If the link from RSFSRC to Joe&#039;s directory was not made, add Joe&#039;s directory to his own path so that he can execute his own binaries.&lt;br /&gt;
&lt;br /&gt;
To understand how $DATAPATH disk space issues may become an issue in a multi-user environment, refer to the [[Advanced_Installation#Disk_space|Disk Space subsection]] at the beginning of this document.&lt;br /&gt;
&lt;br /&gt;
=Keeping your stuff separate=&lt;br /&gt;
A user may add his own programs and recipes to the Madagascar system. He may also create his own computational examples, data, and locked figures for testing. All of these components can be placed in their default locations, but it is not necessary to make them public. To keep these items private simply do not add them to the repository.&lt;br /&gt;
&lt;br /&gt;
However, it might be desirable to keep these components in separate places. For example, if you keep your private programs in RSFSRC/user you will have to remember to make a copy somewhere else if you ever want to delete the Madagascar installation to perform a fresh install. Yup, I deleted all my programs that way once. Good thing I had a back up! Fortunately, it is easy to keep each of these components in a separate place if desired.&lt;br /&gt;
&lt;br /&gt;
==Keeping programs separate==&lt;br /&gt;
User programs are ordinarily kept in a subdirectory of RSFSRC/user.  However, if you want to keep your programs separate all you have to do is put your subdirectory somewhere else and make a link to it in RSFSRC/user:&lt;br /&gt;
&amp;lt;bash&amp;gt;&lt;br /&gt;
ln -s path_to_my_programs $RSFSRC/user/my_programs&lt;br /&gt;
&amp;lt;/bash&amp;gt;&lt;br /&gt;
The additional instructions above for &amp;quot;multi-user installs&amp;quot; are for the case where the other users do not have write access to RSFSRC.  However, if you have full write access and only want to keep the programs in a separate place the link is the only thing you need.&lt;br /&gt;
&lt;br /&gt;
===Problems when symbolic linking and using SVN=== &lt;br /&gt;
If you decide to use a symbolic link e.g. &amp;quot;ln -s ...&amp;quot; as above, you will have difficulties checking in your code into the SVN repository.  SVN typically does not follow the symbolic link but will only the save the symbolic link.   &lt;br /&gt;
&lt;br /&gt;
See this answer from Stackoverflow (http://stackoverflow.com/questions/24850844/follow-symlinks-in-svn)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If I understand your problem, you have:&lt;br /&gt;
&lt;br /&gt;
project1/&lt;br /&gt;
project1/link1 -&amp;gt; ../../some/where/else&lt;br /&gt;
&lt;br /&gt;
If you do a simple svn add link1 it adds a symlink entry to the subversion repository, but what you&#039;re trying to accomplish is getting the stuff under somewhere else into the tree.&lt;br /&gt;
&lt;br /&gt;
If this is the case, then you&#039;re fighting in the wrong direction, you should make the real files and directories under link1, and make the target locations symlinks into the link1 directory. That would be a simple solution to the problem.&lt;br /&gt;
&lt;br /&gt;
Another solution would be to make the location ../../some/where/else an svn location in it&#039;s own right, and make link1 an externals definition to that location. When you commit in the main directory, the externals would be committed at the same time which would achieve storing the information; however to ensure that the other location was kept in sync, you would have to make sure to update it to the same version as the stored data.&lt;br /&gt;
&lt;br /&gt;
In my case, on my desktop, I have a settings directory:&lt;br /&gt;
&lt;br /&gt;
$HOME/settings&lt;br /&gt;
&lt;br /&gt;
This is a checked out copy of a directory containing .bashrc, .profile, .vimrc, .vim, etc. files and folders from an svn repo. All my profile files and directories were symlinks into this folder, so for example .profile -&amp;gt; settings/.profile, etc. When I make changes, they are reflected in the svn tree, which I can commit back to in order to ensure that I don&#039;t lose my config settings when I go to another system.&lt;br /&gt;
&lt;br /&gt;
If you really want svn to follow symlinks as hardlinks (You can&#039;t make directory hardlinks because it would be a bad thing™), then you&#039;ll have to hack the svn client source so that it did what you wanted; but this would be a maintenance nightmare.&lt;br /&gt;
&lt;br /&gt;
You could get away with making the symlink into a bind mount point directed at the target, but that has it&#039;s own issues - you would need to be root to accomplish this, and it ends up leaving funny entries in your /proc/mounts to accomplish this:&lt;br /&gt;
&lt;br /&gt;
mount --bind /absolute/path/to/some/where/else project1/link1&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Keeping recipes separate==&lt;br /&gt;
Computational recipes written in Python and imported by the SConstruct file of a workflow are normally stored in RSFSRC/book/Recipes.  The install process copies these recipes to a directory like $RSFROOT/lib/python2.5/site-packages/rsf/recipes and adds this directory to your PYTHONPATH so that Python can find them.&lt;br /&gt;
&lt;br /&gt;
However, you can put you own recipes anywhere you want.  You only have to add that place to your PYTHONPATH like this (bash):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
export PYTHONPATH=${PYTHONPATH}:path_to_my_recipes&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Or like this (csh):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
setenv PYTHONPATH ${PYTHONPATH}:path_to_my_recipes&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Keeping examples separate==&lt;br /&gt;
Madagascar&#039;s public collection of example workflows are stored in RSFSRC/book, but you can put your private workflows anywhere you want.  No special instructions are required.&lt;br /&gt;
&lt;br /&gt;
However, Madagascar assumes that the workflows are organized into a three-level book/chapter/section directory hierarchy when it creates a directory tree for the data and locked figures associated with your workflow. It is not required, but it might be easier to find the data and locked figures if you put your workflows in a three-level directory tree something like this: path_to_my_book/chapter/section/SConstruct.&lt;br /&gt;
&lt;br /&gt;
==Keeping data separate==&lt;br /&gt;
The location of the data portion of your *.rsf files is controlled by your DATAPATH environment variable.  However, you may want to keep the data for your private workflows in a different place, or several different places, than the data created by the public examples in RSFSRC/book.  The way to do that is to temporarily change the DATAPATH variable in the SConstruct &#039;&#039;before&#039;&#039; importing rsf.proj like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import os&lt;br /&gt;
os.environ[&#039;DATAPATH&#039;] = &#039;path_to_my_private_data&#039;&lt;br /&gt;
&lt;br /&gt;
from rsf.proj import *&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Keeping locked figures separate==&lt;br /&gt;
The command &amp;quot;scons lock&amp;quot; in the directory of a workflow will store a &amp;quot;locked&amp;quot; copy of your figures for regression testing.  Normally these figures are stored in the location pointed to by your RSFFIGS variable, and that is where the figures from the figures repository should be stored for testing in RSFSRC/book.&lt;br /&gt;
&lt;br /&gt;
However, you may want to keep your private figures in a different place.  The way to do that is to temporarily change the RSFFIGS variable in the SConstruct &#039;&#039;before&#039;&#039; importing rsf.proj like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import os&lt;br /&gt;
os.environ[&#039;RSFFIGS&#039;] = &#039;path_to_my_private_figures&#039;&lt;br /&gt;
&lt;br /&gt;
from rsf.proj import *&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
If you also create a RSFALTFIGS environment variable pointing to path_to_my_private_figures, then the testing script sffiglist will automatically test your figures against those in RSFALTFIGS when the sffiglist command is executed from a location outside of RSFSRC/book.&lt;br /&gt;
&lt;br /&gt;
=Capturing error and warning messages=&lt;br /&gt;
The messages during configuration are few and their importance quite high, so they should be watched &amp;quot;in person&amp;quot;. A complete log of the configuration process is recorded in RSFSRC/configure.log&lt;br /&gt;
&lt;br /&gt;
Console messages generated during the build step can be captured to a log file and observed at the same time with a command like this (tcsh):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
nice +10 nohup /usr/bin/time -p scons -k |&amp;amp; tee log_build.asc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The log file can be of course named otherwise than &amp;lt;tt&amp;gt;log_build.asc&amp;lt;/tt&amp;gt;. The file can be later grepped for error and warnings with commands such as:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
grep -c error log_build.asc&lt;br /&gt;
grep error log_build.asc | awk &#039;/error.c/ {next}; /error.h/ {next}; /error.o/ {next}; {print}&#039;&lt;br /&gt;
grep -c warning log_build.asc&lt;br /&gt;
grep warning log_build.asc | awk &#039;/imaginary constants are a GCC extension/ {next}; {print}&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Advanced troubleshooting=&lt;br /&gt;
* If you removed one of your programs or changed its name, and &amp;lt;tt&amp;gt;scons install&amp;lt;/tt&amp;gt; fails with &amp;quot;Source &amp;lt;tt&amp;gt;oldprogname&amp;lt;/tt&amp;gt; not found, needed by target install&amp;quot;, and you cleaned everything there was to clean but still get this message, remove &amp;lt;tt&amp;gt;RSFSRC/.sconsign*&amp;lt;/tt&amp;gt;&lt;br /&gt;
* If during &amp;lt;tt&amp;gt;scons install&amp;lt;/tt&amp;gt; you get a &amp;lt;tt&amp;gt;DBAccessError : (13, &#039;Permission denied&#039;)&amp;lt;/tt&amp;gt; in some reproducible papers, check permissions in your &amp;lt;tt&amp;gt;$DATAPATH&amp;lt;/tt&amp;gt; directory. This is where SCons places database &amp;quot;.sconsign&amp;quot; files for its dependencies (according to the rules in &amp;lt;tt&amp;gt;rsf.proj&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;rsf.tex&amp;lt;/tt&amp;gt;).&lt;br /&gt;
* If &amp;lt;tt&amp;gt;scons&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;scons install&amp;lt;/tt&amp;gt; fail due to an a bug introduced in a tool you are certain you will not use, a quick workaround for the problem is already built into scons: the &amp;lt;tt&amp;gt;-k&amp;lt;/tt&amp;gt; option, which means &amp;quot;keep going&amp;quot;. Thus, if you use &amp;lt;tt&amp;gt;scons -k&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;scons -k install&amp;lt;/tt&amp;gt;, SCons will not be able to build the failed component, or anything that depends on it, but it will keep going and make everything else that it can.&lt;br /&gt;
&lt;br /&gt;
=Further support=&lt;br /&gt;
Subscribe to the [https://lists.sourceforge.net/lists/listinfo/rsf-user rsf-user mailing list].&lt;/div&gt;</summary>
		<author><name>Karl</name></author>
	</entry>
	<entry>
		<id>https://ahay.org/index.php?title=Installation&amp;diff=3704</id>
		<title>Installation</title>
		<link rel="alternate" type="text/html" href="https://ahay.org/index.php?title=Installation&amp;diff=3704"/>
		<updated>2018-05-19T14:59:45Z</updated>

		<summary type="html">&lt;p&gt;Karl: /* General instructions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:Fotolia_4727725_XS.jpg|right|]]&lt;br /&gt;
Madagascar has been installed and is periodically tested on&lt;br /&gt;
*Different Linux distributions (Fedora, RedHat, Ubuntu, etc.) &lt;br /&gt;
*Solaris &lt;br /&gt;
*MacOS X &lt;br /&gt;
*Windows under the [http://www.cygwin.com/ Cygwin] environment.&lt;br /&gt;
&lt;br /&gt;
It was previously tested on&lt;br /&gt;
*FreeBSD &lt;br /&gt;
*HP-UX&lt;br /&gt;
*SGI Irix&lt;br /&gt;
*Windows under Microsoft&#039;s Services for UNIX environment.&lt;br /&gt;
&lt;br /&gt;
==Precompiled binary packages==&lt;br /&gt;
&lt;br /&gt;
See the [[Download|Madagascar download page]] for availability of binary packages.&lt;br /&gt;
&lt;br /&gt;
==Installation from source==&lt;br /&gt;
&lt;br /&gt;
===Platform-specific instructions===&lt;br /&gt;
&lt;br /&gt;
[[Windows|Specific instructions are provided]] for &#039;&#039;&#039;Windows&#039;&#039;&#039; users.&lt;br /&gt;
&lt;br /&gt;
For other platform-specific instructions, please consult the [[Advanced Installation#Platform-specific_installation_advice|Advanced Installation]] guide.&lt;br /&gt;
&lt;br /&gt;
===Prerequisites===&lt;br /&gt;
  &lt;br /&gt;
#C compiler. Any ANSI-compliant compiler such as [http://gcc.gnu.org/ GCC] should work. GCC usually comes pre-installed on Linux machines. &lt;br /&gt;
#Python interpreter. [http://www.python.org/ Python] is an interpretable programming language. It is used in Madagascar installation scripts and project management scripts. Python comes pre-installed on some platforms. The preferred Python version is 2.7 but older versions are also supported. If you experience problems and you have an earlier version, you should probably upgrade.&lt;br /&gt;
&lt;br /&gt;
Each API option has [[Advanced Installation#Dependencies|its own prerequisites]].&lt;br /&gt;
&lt;br /&gt;
Prerequisites for optional add-on functionality are [[Advanced Installation#Platform specific installation advice|platform-specific]]. &lt;br /&gt;
&lt;br /&gt;
[[Windows|Building under cygwin on Windows]] requires several preparatory steps.&lt;br /&gt;
&lt;br /&gt;
===General instructions===&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Configuration:&#039;&#039;&#039; Open a terminal window, change to the top Madagascar source directory, and run &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;./configure --prefix=/directory/where/you/want/madagascar/installed&amp;lt;/syntaxhighlight&amp;gt; You can examine the &amp;lt;tt&amp;gt;config.py&amp;lt;/tt&amp;gt; file that this command generates.  Additional options are available. You can obtain a full list of customizable variables by running &amp;lt;tt&amp;gt;scons -h&amp;lt;/tt&amp;gt;. For example, to install Fortran-90 API bindings in addition to the basic package, run &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;./configure API=f90 --prefix=/directory/where/you/want/madagascar/installed&amp;lt;/syntaxhighlight&amp;gt; After running &amp;lt;tt&amp;gt;./configure&amp;lt;/tt&amp;gt; you may see a list of dependencies that your system does not have installed (the items that have &amp;quot;no&amp;quot; next to them). Most of them are optional. If you decide to install additional packages for your platform, rerun the &amp;lt;tt&amp;gt;./configure&amp;lt;/tt&amp;gt; command.&lt;br /&gt;
# &#039;&#039;&#039;Building and installing the package:&#039;&#039;&#039; Run &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;make install&amp;lt;/syntaxhighlight&amp;gt; If you need &amp;quot;root&amp;quot; privileges for installing under &amp;lt;tt&amp;gt;&amp;amp;#36;RSFROOT&amp;lt;/tt&amp;gt;, you may need to run &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;make; su; make install&amp;lt;/syntaxhighlight&amp;gt; or &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;make; sudo make install&amp;lt;/syntaxhighlight&amp;gt; If &amp;lt;tt&amp;gt;make&amp;lt;/tt&amp;gt; does not exist on your system, an alternative procedure can be found in the [[#Troubleshooting|Troubleshooting]] section. &lt;br /&gt;
# &#039;&#039;&#039;User setup:&#039;&#039;&#039; If your shell is &amp;lt;tt&amp;gt;sh&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;bash&amp;lt;/tt&amp;gt;, add to your &amp;lt;tt&amp;gt;$HOME/.bashrc&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;$HOME/.profile&amp;lt;/tt&amp;gt; files the line &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;source ~/RSFSRC/share/madagascar/etc/env.sh&amp;lt;/syntaxhighlight&amp;gt; (if used somthing different in the &amp;lt;tt&amp;gt;--prefix&amp;lt;/tt&amp;gt; option to &amp;lt;tt&amp;gt;./configure&amp;lt;/tt&amp;gt;, use that instead of ~/RSFSRC). If your shell is &amp;lt;tt&amp;gt;(t)csh&amp;lt;/tt&amp;gt;, add to your &amp;lt;tt&amp;gt;$HOME/.cshrc&amp;lt;/tt&amp;gt; file the line &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;source ~/RSFSRC/share/madagascar/etc/env.csh&amp;lt;/syntaxhighlight&amp;gt; (if used somthing different in the &amp;lt;tt&amp;gt;--prefix&amp;lt;/tt&amp;gt; option to &amp;lt;tt&amp;gt;./configure&amp;lt;/tt&amp;gt;, use that instead of ~/RSFSRC.) Please be aware that, on some systems, the default value for DATAPATH set in the script above may get automatically cleaned at some intervals, so if you want to keep your data binaries for a long time, set &amp;lt;tt&amp;gt;DATAPATH&amp;lt;/tt&amp;gt; in your resource file to another location where you have write access and that allows large files. Remember that the value of DATAPATH should have a slash at the end. e.g. add &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;export DATAPATH=~/RSFDATA/ &amp;lt;/syntaxhighlight&amp;gt; to ~/.bashrc and ~/.profile after the source  ~/RSFSRC/share/madagascar/etc/env.csh.  You will also need to create that directory with: &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;mkdir ~/RSFDATA/ &amp;lt;/syntaxhighlight&amp;gt; using the command line in a terminal window.&lt;br /&gt;
&lt;br /&gt;
==Uninstall==&lt;br /&gt;
To clean all intermediate files and all installed files, run &amp;lt;pre&amp;gt;scons -c install&amp;lt;/pre&amp;gt; or &amp;lt;pre&amp;gt;make distclean&amp;lt;/pre&amp;gt; in the source code directory.&lt;br /&gt;
&lt;br /&gt;
==Troubleshooting==&lt;br /&gt;
===Alternative build/install procedure===&lt;br /&gt;
# &#039;&#039;&#039;Set the environment variables:&#039;&#039;&#039; If your shell is &amp;lt;tt&amp;gt;sh&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;bash&amp;lt;/tt&amp;gt;, type &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;source env.sh&amp;lt;/syntaxhighlight&amp;gt; Else, if your shell is &amp;lt;tt&amp;gt;csh&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;tcsh&amp;lt;/tt&amp;gt;, type &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;source env.csh&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
# &#039;&#039;&#039;Build:&#039;&#039;&#039; Type &amp;lt;tt&amp;gt;scons&amp;lt;/tt&amp;gt;&lt;br /&gt;
# &#039;&#039;&#039;Install:&#039;&#039;&#039;  Run &amp;lt;tt&amp;gt;scons install&amp;lt;/tt&amp;gt; . If you need &amp;quot;root&amp;quot; privileges for installing under &amp;lt;tt&amp;gt;&amp;amp;#36;RSFROOT&amp;lt;/tt&amp;gt;, you may need to run &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;su; scons install &amp;lt;/syntaxhighlight&amp;gt; or &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;sudo scons install&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Other issues===&lt;br /&gt;
Note that &amp;lt;tt&amp;gt;scons&amp;lt;/tt&amp;gt; does not inherit your environmental variables including &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt;. &lt;br /&gt;
If the configuration part ends with the message like&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
checking if cc works ... failed&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
the problem may be that your compiler is in unusual place. Try&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./configure CC=/full/path/to/cc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./configure CC=`which cc`&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
On Windows under SFU, use the &amp;lt;tt&amp;gt;gcc&amp;lt;/tt&amp;gt; compiler&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./configure CC=/opt/gcc.3.3/bin/gcc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For more information, please consult the [[Advanced Installation]] guide.&lt;br /&gt;
&lt;br /&gt;
==Testing and quick start==&lt;br /&gt;
&lt;br /&gt;
Here are a few simple tests and and a brief introduction to Madagascar:&lt;br /&gt;
&lt;br /&gt;
Typing any Madagascar command in a terminal window without parameters should generate a brief documentation on that command. Try one of the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sfin&lt;br /&gt;
sfattr&lt;br /&gt;
sfspike&lt;br /&gt;
sfbandpass&lt;br /&gt;
sfwiggle&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you get an error like &amp;quot;Command not found&amp;quot;, you may not have your &amp;lt;tt&amp;gt;&amp;amp;#36;PATH&amp;lt;/tt&amp;gt; environment variable set correctly, or you may need to issue the &amp;lt;tt&amp;gt;rehash&amp;lt;/tt&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
Now try making a simple Madagascar data file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sfspike n1=1000 k1=300 &amp;gt; spike.rsf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command generates a one dimensional list of 1000 numbers, all zero except for a spike equal to one at position 300. If this generates an error like&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Cannot write to data file /path/spike.rsf@: Bad file descriptor&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
you may need to create the directory pointed to by your &amp;lt;tt&amp;gt;&amp;amp;#36;DATAPATH&amp;lt;/tt&amp;gt; environment variable.&lt;br /&gt;
&lt;br /&gt;
The file &amp;lt;tt&amp;gt;spike.rsf&amp;lt;/tt&amp;gt; is a text header.  The actual data are stored in the binary file pointed to by the &amp;lt;tt&amp;gt;in=&amp;lt;/tt&amp;gt; parameter in the header.  You can look at the header file directly with &amp;lt;tt&amp;gt;more&amp;lt;/tt&amp;gt;, or better, examine the file properties with&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sfin spike.rsf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can learn more about the contents of &amp;lt;tt&amp;gt;spike.rsf&amp;lt;/tt&amp;gt; with&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sfattr &amp;lt; spike.rsf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following command applies a bandpass filter to &amp;lt;tt&amp;gt;spike.rsf&amp;lt;/tt&amp;gt; and puts the result in &amp;lt;tt&amp;gt;filter.rsf&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sfbandpass fhi=2 phase=y &amp;lt; spike.rsf &amp;gt; filter.rsf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following command makes a graphics file from &amp;lt;tt&amp;gt;filter.rsf&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sfwiggle clip=0.02 title=&amp;quot;Welcome to Madagascar&amp;quot; &amp;lt; filter.rsf &amp;gt; filter.vpl&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have an X11 display program running, and your &amp;lt;tt&amp;gt;&amp;amp;#36;DISPLAY&amp;lt;/tt&amp;gt; environment variable is set correctly, you can display the graphics file with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sfpen &amp;lt; filter.vpl&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can pipe Madagascar commands together and do the whole thing at once like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sfspike n1=1000 k1=300 | sfbandpass fhi=2 phase=y | \&lt;br /&gt;
sfwiggle clip=0.02 title=&amp;quot;Welcome to Madagascar&amp;quot; | sfpen&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have SCons installed, you can use it to automate Madagascar processing.  Here is a simple &amp;lt;tt&amp;gt;SConstruct&amp;lt;/tt&amp;gt; file to make &amp;lt;tt&amp;gt;filter.rsf&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;filter.vpl&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
# Setting up&lt;br /&gt;
#&lt;br /&gt;
from rsf.proj import *&lt;br /&gt;
&lt;br /&gt;
#&lt;br /&gt;
# Make filter.rsf&lt;br /&gt;
#&lt;br /&gt;
Flow(&#039;filter&#039;,None,&#039;spike n1=1000 k1=300 | bandpass fhi=2 phase=y&#039;)&lt;br /&gt;
&lt;br /&gt;
#&lt;br /&gt;
# Make filter.vpl&lt;br /&gt;
#&lt;br /&gt;
Result(&#039;filter&#039;,&#039;wiggle clip=0.02 title=&amp;quot;Welcome to Madagascar&amp;quot;&#039;)&lt;br /&gt;
&lt;br /&gt;
End()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Put the file in an empty directory, give it the name &amp;lt;tt&amp;gt;SConstruct&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;cd&amp;lt;/tt&amp;gt; to that directory, and issue the command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
scons&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The graphics file is now stored in the &amp;lt;tt&amp;gt;Fig&amp;lt;/tt&amp;gt; subdirectory.  You can view it manually with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sfpen Fig/filter.vpl&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
... or you can use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
scons view&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When an SConstruct file makes more than one graphics file, the  &amp;lt;tt&amp;gt;scons view&amp;lt;/tt&amp;gt; command will display all of them in sequence. &lt;br /&gt;
[[Image:filter.png|frame|center|Welcome to Madagascar.]]&lt;br /&gt;
Now edit the &amp;lt;tt&amp;gt;SConstruct&amp;lt;/tt&amp;gt; file: change the title string on the &amp;lt;tt&amp;gt;Result&amp;lt;/tt&amp;gt; line to &amp;quot;Hello World!&amp;quot;, save the file, and rerun the scons command. You will see that scons has figured out that the file &amp;lt;tt&amp;gt;filter.rsf&amp;lt;/tt&amp;gt; does not need to be rebuilt because nothing that affects it has changed. Only the file &amp;lt;tt&amp;gt;filter.vpl&amp;lt;/tt&amp;gt; is rebuilt.&lt;/div&gt;</summary>
		<author><name>Karl</name></author>
	</entry>
	<entry>
		<id>https://ahay.org/index.php?title=Installation&amp;diff=3703</id>
		<title>Installation</title>
		<link rel="alternate" type="text/html" href="https://ahay.org/index.php?title=Installation&amp;diff=3703"/>
		<updated>2018-05-19T14:49:57Z</updated>

		<summary type="html">&lt;p&gt;Karl: /* General instructions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:Fotolia_4727725_XS.jpg|right|]]&lt;br /&gt;
Madagascar has been installed and is periodically tested on&lt;br /&gt;
*Different Linux distributions (Fedora, RedHat, Ubuntu, etc.) &lt;br /&gt;
*Solaris &lt;br /&gt;
*MacOS X &lt;br /&gt;
*Windows under the [http://www.cygwin.com/ Cygwin] environment.&lt;br /&gt;
&lt;br /&gt;
It was previously tested on&lt;br /&gt;
*FreeBSD &lt;br /&gt;
*HP-UX&lt;br /&gt;
*SGI Irix&lt;br /&gt;
*Windows under Microsoft&#039;s Services for UNIX environment.&lt;br /&gt;
&lt;br /&gt;
==Precompiled binary packages==&lt;br /&gt;
&lt;br /&gt;
See the [[Download|Madagascar download page]] for availability of binary packages.&lt;br /&gt;
&lt;br /&gt;
==Installation from source==&lt;br /&gt;
&lt;br /&gt;
===Platform-specific instructions===&lt;br /&gt;
&lt;br /&gt;
[[Windows|Specific instructions are provided]] for &#039;&#039;&#039;Windows&#039;&#039;&#039; users.&lt;br /&gt;
&lt;br /&gt;
For other platform-specific instructions, please consult the [[Advanced Installation#Platform-specific_installation_advice|Advanced Installation]] guide.&lt;br /&gt;
&lt;br /&gt;
===Prerequisites===&lt;br /&gt;
  &lt;br /&gt;
#C compiler. Any ANSI-compliant compiler such as [http://gcc.gnu.org/ GCC] should work. GCC usually comes pre-installed on Linux machines. &lt;br /&gt;
#Python interpreter. [http://www.python.org/ Python] is an interpretable programming language. It is used in Madagascar installation scripts and project management scripts. Python comes pre-installed on some platforms. The preferred Python version is 2.7 but older versions are also supported. If you experience problems and you have an earlier version, you should probably upgrade.&lt;br /&gt;
&lt;br /&gt;
Each API option has [[Advanced Installation#Dependencies|its own prerequisites]].&lt;br /&gt;
&lt;br /&gt;
Prerequisites for optional add-on functionality are [[Advanced Installation#Platform specific installation advice|platform-specific]]. &lt;br /&gt;
&lt;br /&gt;
[[Windows|Building under cygwin on Windows]] requires several preparatory steps.&lt;br /&gt;
&lt;br /&gt;
===General instructions===&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Configuration:&#039;&#039;&#039; Open a terminal window, change to the top Madagascar source directory, and run &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;./configure --prefix=/directory/where/you/want/madagascar/installed&amp;lt;/syntaxhighlight&amp;gt; You can examine the &amp;lt;tt&amp;gt;config.py&amp;lt;/tt&amp;gt; file that this command generates.  Additional options are available. You can obtain a full list of customizable variables by running &amp;lt;tt&amp;gt;scons -h&amp;lt;/tt&amp;gt;. For example, to install Fortran-90 API bindings in addition to the basic package, run &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;./configure API=f90 --prefix=/directory/where/you/want/madagascar/installed&amp;lt;/syntaxhighlight&amp;gt; After running &amp;lt;tt&amp;gt;./configure&amp;lt;/tt&amp;gt; you may see a list of dependencies that your system does not have installed (the items that have &amp;quot;no&amp;quot; next to them). Most of them are optional. If you decide to install additional packages for your platform, rerun the &amp;lt;tt&amp;gt;./configure&amp;lt;/tt&amp;gt; command.&lt;br /&gt;
# &#039;&#039;&#039;Building and installing the package:&#039;&#039;&#039; Run &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;make install&amp;lt;/syntaxhighlight&amp;gt; If you need &amp;quot;root&amp;quot; privileges for installing under &amp;lt;tt&amp;gt;&amp;amp;#36;RSFROOT&amp;lt;/tt&amp;gt;, you may need to run &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;make; su; make install&amp;lt;/syntaxhighlight&amp;gt; or &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;make; sudo make install&amp;lt;/syntaxhighlight&amp;gt; If &amp;lt;tt&amp;gt;make&amp;lt;/tt&amp;gt; does not exist on your system, an alternative procedure can be found in the [[#Troubleshooting|Troubleshooting]] section. &lt;br /&gt;
# &#039;&#039;&#039;User setup:&#039;&#039;&#039; If your shell is &amp;lt;tt&amp;gt;sh&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;bash&amp;lt;/tt&amp;gt;, add to your &amp;lt;tt&amp;gt;$HOME/.bashrc&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;$HOME/.profile&amp;lt;/tt&amp;gt; files the line &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;source ~/RSFSRC/share/madagascar/etc/env.sh&amp;lt;/syntaxhighlight&amp;gt; (if used somthing different in the &amp;lt;tt&amp;gt;--prefix&amp;lt;/tt&amp;gt; option to &amp;lt;tt&amp;gt;./configure&amp;lt;/tt&amp;gt;, use that instead of ~/RSFSRC). If your shell is &amp;lt;tt&amp;gt;(t)csh&amp;lt;/tt&amp;gt;, add to your &amp;lt;tt&amp;gt;$HOME/.cshrc&amp;lt;/tt&amp;gt; file the line &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;source ~/RSFSRC/share/madagascar/etc/env.csh&amp;lt;/syntaxhighlight&amp;gt; (if used somthing different in the &amp;lt;tt&amp;gt;--prefix&amp;lt;/tt&amp;gt; option to &amp;lt;tt&amp;gt;./configure&amp;lt;/tt&amp;gt;, use that instead of ~/RSFSRC.) Please be aware that, on some systems, the default value for DATAPATH set in the script above may get automatically cleaned at some intervals, so if you want to keep your data binaries for a long time, set &amp;lt;tt&amp;gt;DATAPATH&amp;lt;/tt&amp;gt; in your resource file to another location where you have write access and that allows large files. Remember that the value of DATAPATH should have a slash at the end. e.g. add &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;export DATAPATH=~/DATAPATH/ &amp;lt;/syntaxhighlight&amp;gt; to ~/.bashrc and ~/.profile after the source  ~/RSFSRC/share/madagascar/etc/env.csh&lt;br /&gt;
&lt;br /&gt;
==Uninstall==&lt;br /&gt;
To clean all intermediate files and all installed files, run &amp;lt;pre&amp;gt;scons -c install&amp;lt;/pre&amp;gt; or &amp;lt;pre&amp;gt;make distclean&amp;lt;/pre&amp;gt; in the source code directory.&lt;br /&gt;
&lt;br /&gt;
==Troubleshooting==&lt;br /&gt;
===Alternative build/install procedure===&lt;br /&gt;
# &#039;&#039;&#039;Set the environment variables:&#039;&#039;&#039; If your shell is &amp;lt;tt&amp;gt;sh&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;bash&amp;lt;/tt&amp;gt;, type &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;source env.sh&amp;lt;/syntaxhighlight&amp;gt; Else, if your shell is &amp;lt;tt&amp;gt;csh&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;tcsh&amp;lt;/tt&amp;gt;, type &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;source env.csh&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
# &#039;&#039;&#039;Build:&#039;&#039;&#039; Type &amp;lt;tt&amp;gt;scons&amp;lt;/tt&amp;gt;&lt;br /&gt;
# &#039;&#039;&#039;Install:&#039;&#039;&#039;  Run &amp;lt;tt&amp;gt;scons install&amp;lt;/tt&amp;gt; . If you need &amp;quot;root&amp;quot; privileges for installing under &amp;lt;tt&amp;gt;&amp;amp;#36;RSFROOT&amp;lt;/tt&amp;gt;, you may need to run &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;su; scons install &amp;lt;/syntaxhighlight&amp;gt; or &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;sudo scons install&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Other issues===&lt;br /&gt;
Note that &amp;lt;tt&amp;gt;scons&amp;lt;/tt&amp;gt; does not inherit your environmental variables including &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt;. &lt;br /&gt;
If the configuration part ends with the message like&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
checking if cc works ... failed&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
the problem may be that your compiler is in unusual place. Try&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./configure CC=/full/path/to/cc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./configure CC=`which cc`&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
On Windows under SFU, use the &amp;lt;tt&amp;gt;gcc&amp;lt;/tt&amp;gt; compiler&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./configure CC=/opt/gcc.3.3/bin/gcc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For more information, please consult the [[Advanced Installation]] guide.&lt;br /&gt;
&lt;br /&gt;
==Testing and quick start==&lt;br /&gt;
&lt;br /&gt;
Here are a few simple tests and and a brief introduction to Madagascar:&lt;br /&gt;
&lt;br /&gt;
Typing any Madagascar command in a terminal window without parameters should generate a brief documentation on that command. Try one of the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sfin&lt;br /&gt;
sfattr&lt;br /&gt;
sfspike&lt;br /&gt;
sfbandpass&lt;br /&gt;
sfwiggle&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you get an error like &amp;quot;Command not found&amp;quot;, you may not have your &amp;lt;tt&amp;gt;&amp;amp;#36;PATH&amp;lt;/tt&amp;gt; environment variable set correctly, or you may need to issue the &amp;lt;tt&amp;gt;rehash&amp;lt;/tt&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
Now try making a simple Madagascar data file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sfspike n1=1000 k1=300 &amp;gt; spike.rsf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command generates a one dimensional list of 1000 numbers, all zero except for a spike equal to one at position 300. If this generates an error like&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Cannot write to data file /path/spike.rsf@: Bad file descriptor&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
you may need to create the directory pointed to by your &amp;lt;tt&amp;gt;&amp;amp;#36;DATAPATH&amp;lt;/tt&amp;gt; environment variable.&lt;br /&gt;
&lt;br /&gt;
The file &amp;lt;tt&amp;gt;spike.rsf&amp;lt;/tt&amp;gt; is a text header.  The actual data are stored in the binary file pointed to by the &amp;lt;tt&amp;gt;in=&amp;lt;/tt&amp;gt; parameter in the header.  You can look at the header file directly with &amp;lt;tt&amp;gt;more&amp;lt;/tt&amp;gt;, or better, examine the file properties with&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sfin spike.rsf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can learn more about the contents of &amp;lt;tt&amp;gt;spike.rsf&amp;lt;/tt&amp;gt; with&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sfattr &amp;lt; spike.rsf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following command applies a bandpass filter to &amp;lt;tt&amp;gt;spike.rsf&amp;lt;/tt&amp;gt; and puts the result in &amp;lt;tt&amp;gt;filter.rsf&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sfbandpass fhi=2 phase=y &amp;lt; spike.rsf &amp;gt; filter.rsf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following command makes a graphics file from &amp;lt;tt&amp;gt;filter.rsf&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sfwiggle clip=0.02 title=&amp;quot;Welcome to Madagascar&amp;quot; &amp;lt; filter.rsf &amp;gt; filter.vpl&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have an X11 display program running, and your &amp;lt;tt&amp;gt;&amp;amp;#36;DISPLAY&amp;lt;/tt&amp;gt; environment variable is set correctly, you can display the graphics file with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sfpen &amp;lt; filter.vpl&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can pipe Madagascar commands together and do the whole thing at once like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sfspike n1=1000 k1=300 | sfbandpass fhi=2 phase=y | \&lt;br /&gt;
sfwiggle clip=0.02 title=&amp;quot;Welcome to Madagascar&amp;quot; | sfpen&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have SCons installed, you can use it to automate Madagascar processing.  Here is a simple &amp;lt;tt&amp;gt;SConstruct&amp;lt;/tt&amp;gt; file to make &amp;lt;tt&amp;gt;filter.rsf&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;filter.vpl&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
# Setting up&lt;br /&gt;
#&lt;br /&gt;
from rsf.proj import *&lt;br /&gt;
&lt;br /&gt;
#&lt;br /&gt;
# Make filter.rsf&lt;br /&gt;
#&lt;br /&gt;
Flow(&#039;filter&#039;,None,&#039;spike n1=1000 k1=300 | bandpass fhi=2 phase=y&#039;)&lt;br /&gt;
&lt;br /&gt;
#&lt;br /&gt;
# Make filter.vpl&lt;br /&gt;
#&lt;br /&gt;
Result(&#039;filter&#039;,&#039;wiggle clip=0.02 title=&amp;quot;Welcome to Madagascar&amp;quot;&#039;)&lt;br /&gt;
&lt;br /&gt;
End()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Put the file in an empty directory, give it the name &amp;lt;tt&amp;gt;SConstruct&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;cd&amp;lt;/tt&amp;gt; to that directory, and issue the command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
scons&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The graphics file is now stored in the &amp;lt;tt&amp;gt;Fig&amp;lt;/tt&amp;gt; subdirectory.  You can view it manually with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sfpen Fig/filter.vpl&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
... or you can use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
scons view&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When an SConstruct file makes more than one graphics file, the  &amp;lt;tt&amp;gt;scons view&amp;lt;/tt&amp;gt; command will display all of them in sequence. &lt;br /&gt;
[[Image:filter.png|frame|center|Welcome to Madagascar.]]&lt;br /&gt;
Now edit the &amp;lt;tt&amp;gt;SConstruct&amp;lt;/tt&amp;gt; file: change the title string on the &amp;lt;tt&amp;gt;Result&amp;lt;/tt&amp;gt; line to &amp;quot;Hello World!&amp;quot;, save the file, and rerun the scons command. You will see that scons has figured out that the file &amp;lt;tt&amp;gt;filter.rsf&amp;lt;/tt&amp;gt; does not need to be rebuilt because nothing that affects it has changed. Only the file &amp;lt;tt&amp;gt;filter.vpl&amp;lt;/tt&amp;gt; is rebuilt.&lt;/div&gt;</summary>
		<author><name>Karl</name></author>
	</entry>
	<entry>
		<id>https://ahay.org/index.php?title=Advanced_Installation&amp;diff=3702</id>
		<title>Advanced Installation</title>
		<link rel="alternate" type="text/html" href="https://ahay.org/index.php?title=Advanced_Installation&amp;diff=3702"/>
		<updated>2018-05-19T13:26:01Z</updated>

		<summary type="html">&lt;p&gt;Karl: /* Ubuntu */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:Fotolia_419157_XS.jpg|right|]]&lt;br /&gt;
Before reading this document, please familiarize yourself with the [[Installation|short Installation guide]].&lt;br /&gt;
=What the installation process does=&lt;br /&gt;
The term &amp;quot;installation&amp;quot; in the title is used for brevity, and it actually covers all three steps: configuration, build and install.&lt;br /&gt;
# Configure: determine what tools are available on the system and how they should be used to built the software. Creates a layer of abstraction so that the build is platform-independent. Should ideally either solve or flag all problems, so that the build either works, or does not proceed at all.&lt;br /&gt;
# Build: compiles the software and documentation using RSFSRC/build as a &amp;quot;workplace&amp;quot;&lt;br /&gt;
# Install: moves the compiled executables and the documentation to the final locations in $RSFROOT, sometimes changing filenames. Kept separate from build so that it can be done by root, and to avoid build failures leaving junk files all over the system.&lt;br /&gt;
A successful installation will have created in &amp;lt;tt&amp;gt;$RSFROOT&amp;lt;/tt&amp;gt; the following directories:&lt;br /&gt;
* &amp;lt;tt&amp;gt;bin/&amp;lt;/tt&amp;gt;: executable programs&lt;br /&gt;
* &amp;lt;tt&amp;gt;doc/&amp;lt;/tt&amp;gt;: auto-generated HTML documentation&lt;br /&gt;
* &amp;lt;tt&amp;gt;include/&amp;lt;/tt&amp;gt;: header files with info on library procedures; fonts&lt;br /&gt;
* &amp;lt;tt&amp;gt;lib/&amp;lt;/tt&amp;gt;: libraries and Python modules&lt;br /&gt;
&lt;br /&gt;
=Old (1.0 and 1.1) version installation=&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;tt&amp;gt;$RSFROOT/etc/madagascar/&amp;lt;/tt&amp;gt; as the location of &amp;lt;tt&amp;gt;env&amp;lt;/tt&amp;gt; scripts instead of &amp;lt;tt&amp;gt;$RSFROOT/share/madagascar/etc/&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=Old (0.9.9) version installation=&lt;br /&gt;
&lt;br /&gt;
====Environment variables====&lt;br /&gt;
Example configuration for &amp;lt;tt&amp;gt;bash&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
export RSFROOT=/usr/local/rsf # directory where Madagascar will be installed. &lt;br /&gt;
if [ -n &amp;quot;$PYTHONPATH&amp;quot; ]; then&lt;br /&gt;
export PYTHONPATH=${PYTHONPATH}:$RSFROOT/lib&lt;br /&gt;
else&lt;br /&gt;
export PYTHONPATH=$RSFROOT/lib&lt;br /&gt;
fi&lt;br /&gt;
export PATH=$RSFROOT/bin:$PATH&lt;br /&gt;
export DATAPATH=/var/tmp/&lt;br /&gt;
export MANPATH=$RSFROOT/share/man:$(manpath)&lt;br /&gt;
export LD_LIBRARY_PATH=$RSFROOT/lib:$LD_LIBRARY_PATH&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Notice the slash at the end of the &amp;lt;tt&amp;gt;DATAPATH&amp;lt;/tt&amp;gt; variable. &lt;br /&gt;
&lt;br /&gt;
Example configuration for &amp;lt;tt&amp;gt;csh&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;tcsh&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
setenv RSFROOT /usr/local/rsf&lt;br /&gt;
if ($?PYTHONPATH) then&lt;br /&gt;
setenv PYTHONPATH ${PYTHONPATH}:$RSFROOT/lib&lt;br /&gt;
else&lt;br /&gt;
setenv PYTHONPATH $RSFROOT/lib&lt;br /&gt;
endif&lt;br /&gt;
set path = ($RSFROOT/bin $path)&lt;br /&gt;
setenv DATAPATH /var/tmp/&lt;br /&gt;
setenv MANPATH $RSFROOT/share/man:`manpath`&lt;br /&gt;
setenv LD_LIBRARY_PATH $RSFROOT/lib:$LD_LIBRARY_PATH&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Notice the backticks surrounding the call to &amp;lt;tt&amp;gt;manpath&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Be aware that on some systems /var/tmp gets automatically cleaned at some intervals, so if you want to keep your data binaries for a long time, set &amp;lt;tt&amp;gt;DATAPATH&amp;lt;/tt&amp;gt; to another location where you have write access and that allows large files.&lt;br /&gt;
&lt;br /&gt;
====Software construction====&lt;br /&gt;
  &lt;br /&gt;
#Configuration. Change to the top source directory and run &amp;lt;pre&amp;gt;./configure&amp;lt;/pre&amp;gt; You can examine the &amp;lt;tt&amp;gt;config.py&amp;lt;/tt&amp;gt; file that this command generates.  Additional options are available. You can obtain a full list of customizable variables by running &amp;lt;tt&amp;gt;scons -h&amp;lt;/tt&amp;gt;. For example, to install C++ and Fortran-90 API bindings in addition to the basic package, run &amp;lt;pre&amp;gt;./configure API=c++,fortran-90&amp;lt;/pre&amp;gt; &lt;br /&gt;
#Building and installing the package. Run &amp;lt;tt&amp;gt;scons install&amp;lt;/tt&amp;gt; or the following two commands in succession:  &amp;lt;pre&amp;gt;make; make install&amp;lt;/pre&amp;gt; or &amp;lt;pre&amp;gt;scons; scons install&amp;lt;/pre&amp;gt; If you need &amp;quot;root&amp;quot; privileges for installing under &amp;lt;tt&amp;gt;&amp;amp;#36;RSFROOT&amp;lt;/tt&amp;gt;, you may need to run &amp;lt;pre&amp;gt;su; scons install &amp;lt;/pre&amp;gt; or &amp;lt;pre&amp;gt;sudo scons install&amp;lt;/pre&amp;gt;&lt;br /&gt;
#Cleaning. To clean all intermediate files generated by SCons, run &amp;lt;pre&amp;gt;make clean&amp;lt;/pre&amp;gt; or &amp;lt;pre&amp;gt;scons -c&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Prerequisites=&lt;br /&gt;
Basic prerequisites are described in the [[Installation|short Installation guide]]. Here are some additional details. &lt;br /&gt;
==Compilers==&lt;br /&gt;
Madagascar has been built successfully with the following compilers, and possibly with others:&lt;br /&gt;
* gcc&lt;br /&gt;
* Intel (icc/ifort)&lt;br /&gt;
* open64&lt;br /&gt;
* clang&lt;br /&gt;
* cc (Solaris)&lt;br /&gt;
&lt;br /&gt;
==Python and SCons==&lt;br /&gt;
As described below under [[Advanced Installation#Platform-specific installation advice | Platform-specific installation advice]], Madagascar supports the oldest non-deprecated Python version currently supported by the latest stable version of [http://scons.org/ SCons].  If your version of Python is older and you experience problems you should probably [http://www.python.org/ upgrade].&lt;br /&gt;
&lt;br /&gt;
Madagascar includes the latest stable version of SCons and the configure scripts will try to install it for you in RSFROOT if you don&#039;t have it already.  However, if you have an older version of SCons the configure scripts will not try to install the newer version. Your older version might work fine, but Madagascar attempts to support only the latest stable version of SCons, so if you have problems you should upgrade.&lt;br /&gt;
&lt;br /&gt;
To install the SCons bundled with Madagascar go to &amp;lt;tt&amp;gt;RSFSRC/scons&amp;lt;/tt&amp;gt;, unpack the tar file, and type&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
python setup.py install&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will install SCons in the standard location. You might need root privileges. If you don&#039;t have root privileges, or you don&#039;t want to interfere with the system SCons you can install it somewhere else with a --prefix option. A logical choice is to put it in RSFROOT like this:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
python setup.py install --prefix=$RSFROOT&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Location==&lt;br /&gt;
As long as you set the environment variables and directory permissions correctly, it does not matter in what part of your filesystem you place the install. If you have the luxury of installing anywhere, it is good practice to follow the [http://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard Filesystem Hierarchy Standard] and either:&lt;br /&gt;
# Install everything (including &amp;lt;tt&amp;gt;figs&amp;lt;/tt&amp;gt; if you do testing) under &amp;lt;tt&amp;gt;/usr/local/rsf&amp;lt;/tt&amp;gt;, with the source tree in &amp;lt;tt&amp;gt;/usr/local/rsf/src&amp;lt;/tt&amp;gt;, OR &lt;br /&gt;
# Put the source tree in &amp;lt;tt&amp;gt;/usr/local/src/rsf&amp;lt;/tt&amp;gt;, and specify &amp;lt;tt&amp;gt;RSFROOT=/usr/local&amp;lt;/tt&amp;gt;, so that header files and binaries go in &amp;lt;tt&amp;gt;/usr/local/bin&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;/usr/local/include&amp;lt;/tt&amp;gt;. To follow the standard, before installing set &amp;lt;tt&amp;gt;RSFDOC=/usr/local/share/rsf/doc&amp;lt;/tt&amp;gt; and create the appropriate directories. The auto-generated HTML documentation will get put there. Also, if installed, the figs directory for testing should be &amp;lt;tt&amp;gt;/usr/local/share/rsf/figs/&amp;lt;/tt&amp;gt;.&lt;br /&gt;
# Package Madagascar (i.e. build a RPM, etc) and install it in the default locations. For RPMs, those are as like the ones from the previous option, just directly in the &amp;lt;tt&amp;gt;/usr/&amp;lt;/tt&amp;gt; hierarchy, instead of in the &amp;lt;tt&amp;gt;/usr/local/&amp;lt;/tt&amp;gt; one.&lt;br /&gt;
&lt;br /&gt;
==Disk space==&lt;br /&gt;
At present (Feb 2007, r2530), the source directory containing the build tree from the development version was approx. 200Mb, the full installation (&amp;lt;tt&amp;gt;bin/&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;doc/&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;include/&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;lib&amp;lt;/tt&amp;gt;) is 31Mb, and &amp;lt;tt&amp;gt;figs/&amp;lt;/tt&amp;gt; (the optional directory if you want to do testing) is about 10 Gb. The stable version is significantly smaller.&lt;br /&gt;
&lt;br /&gt;
The only Madagascar-related directory where disk space can be an issue is &amp;lt;tt&amp;gt;$DATAPATH&amp;lt;/tt&amp;gt;. Real 3-D seismic datasets can be measured in Terabytes. Buggy programs/processing flows can fill up &amp;lt;tt&amp;gt;$DATAPATH&amp;lt;/tt&amp;gt;. A real problem are &amp;quot;disk memory leaks&amp;quot; -- removing header files with anything else than &amp;lt;tt&amp;gt;sfrm&amp;lt;/tt&amp;gt; will leave the binaries intact. Crashed jobs which start to write to binary but never get to write the header also produce &amp;quot;leaks&amp;quot;. Experience has shown that over time &amp;lt;tt&amp;gt;$DATAPATH&amp;lt;/tt&amp;gt; inexorably fills up. You may need to &lt;br /&gt;
# keep irreplaceable data and expensive results in a separate place;&lt;br /&gt;
# remove the oldest files in &amp;lt;tt&amp;gt;$DATAPATH&amp;lt;/tt&amp;gt; whenever the amount of free space declines under a preset threshold.&lt;br /&gt;
&lt;br /&gt;
==Dependencies==&lt;br /&gt;
Some platforms feature complete lists of dependencies. See [[Advanced Installation#Platform-specific installation advice | Platform-specific installation advice]] for details.&lt;br /&gt;
===C++ API===&lt;br /&gt;
A C++ compiler. SCons is smart and will try to find it for you. If it does not work specify the path to your compiler in the &amp;lt;tt&amp;gt;CXX&amp;lt;/tt&amp;gt; environment variable (can be passed as an option to the configuration script, like the &amp;lt;tt&amp;gt;API&amp;lt;/tt&amp;gt; one).&lt;br /&gt;
===F77 API===&lt;br /&gt;
A Fortran 77 compiler. If SCons does not find one, then you can either specify its path through the &amp;lt;tt&amp;gt;F77&amp;lt;/tt&amp;gt; variable, or if the executable is in your path, add its name to the list of F77 compilers in &amp;lt;tt&amp;gt;RSFSRC/configure.py&amp;lt;/tt&amp;gt; .&lt;br /&gt;
===F90 API===&lt;br /&gt;
Same as for Fortran 77 &amp;amp;ndash; just substitute &amp;lt;tt&amp;gt;F90&amp;lt;/tt&amp;gt;. If using the &amp;lt;tt&amp;gt;gfortran&amp;lt;/tt&amp;gt; compiler, make sure to get [http://gcc.gnu.org/wiki/GFortranBinaries the latest version]. If you have more than one compiler installed on your system, specify the desired one at configuration time:&lt;br /&gt;
&amp;lt;bash&amp;gt;&lt;br /&gt;
./configure API=f90 F90=/path/to/preferred/compiler&lt;br /&gt;
&amp;lt;/bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Java API===&lt;br /&gt;
There are two styles of API, old (1.0 release and previous) and new. The two APIs are not compatible with each other.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;old&amp;quot; interface requires the Mines Java Toolkit for fast Java file IO. The Mines JTK, is an open-source Java package that can be downloaded from [http://inside.mines.edu/~dhale/jtk/ Mines JTK]. Currently, the &amp;quot;old&amp;quot; interface will also build alongside the new one if the MINESJTK environment variable exists, and can be used as was previously.&lt;br /&gt;
&lt;br /&gt;
To install the new API, you need the (Oracle) JDK. Set your JAVA_HOME environment variable to the location of the jdk (on Ubuntu 10.04 this is: /usr/lib/jvm/java-6-openjdk), then reconfigure (./configure API=java ...) and reinstall.  &lt;br /&gt;
&lt;br /&gt;
Ignore the SWIG warnings (there are lots). &lt;br /&gt;
&lt;br /&gt;
Make sure to set your LD_LIBRARY_PATH to $RSFROOT/lib .&lt;br /&gt;
&lt;br /&gt;
If you want to include additional Java packages, you can set them using your shell&#039;s CLASSPATH variable.  This environment variable is now automatically passed onto all Java classes in SCons.&lt;br /&gt;
&lt;br /&gt;
The installation can be tested using the example demonstrating the new API in api/java/test .&lt;br /&gt;
&lt;br /&gt;
===Matlab API===&lt;br /&gt;
Besides Matlab itself, you need Mex, which compiles C code into regular Matlab functions. Use the &amp;lt;tt&amp;gt;MATLAB&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;MEX&amp;lt;/tt&amp;gt; environment variables to specify their paths if they are installed, but not found.&lt;br /&gt;
===Octave API===&lt;br /&gt;
The Octave function compiler (&amp;lt;tt&amp;gt;mkoctfile&amp;lt;/tt&amp;gt;) is sometimes bundled in a separate package, so it may be missing from the Octave installation.&lt;br /&gt;
&lt;br /&gt;
===Python API===&lt;br /&gt;
This API requires [http://www.swig.org/ SWIG], [http://numpy.scipy.org/ numpy] and the Python development kit. Numpy requires Python 2.4 or newer (i.e. RHEL 5 or newer). However, these dependencies are unnecessary for the common case when Python is just used as [http://en.wikipedia.org/wiki/Glue_language glue] to create chains of programs, and it only needs to read the RSF header, and not the binary. To allow Python [http://en.wikipedia.org/wiki/Meta-programs metaprograms] in madagascar to function, and programming in this style to be done, a fallback development kit implementing only the header-related functionality will be installed in the lack of these dependencies.&lt;br /&gt;
&lt;br /&gt;
===Python modules in user space===&lt;br /&gt;
Python is an evolving language. Many large systems have old versions for stability reasons, and administrators of such large systems tend to not install all software users may wish, and to not allow access to rpm either. To install a module in your user space, download the tarball, unzip it, cd into the directory and run: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;python setup.py install --prefix=/path/to/your/place&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The installer will create a subdirectory named &amp;lt;tt&amp;gt;lib&amp;lt;/tt&amp;gt;, or &amp;lt;tt&amp;gt;lib64&amp;lt;/tt&amp;gt; under the directory above. These &amp;lt;tt&amp;gt;lib*&amp;lt;/tt&amp;gt; dirs will have a directory named &amp;lt;tt&amp;gt;python&amp;lt;/tt&amp;gt;, or &amp;lt;tt&amp;gt;python2.3&amp;lt;/tt&amp;gt; for example, and those will have a subdirectory named &amp;lt;tt&amp;gt;site-packages&amp;lt;/tt&amp;gt;. Add all paths to these &amp;lt;tt&amp;gt;site-packages&amp;lt;/tt&amp;gt; subdirectories in your &amp;lt;tt&amp;gt;PYTHONPATH&amp;lt;/tt&amp;gt; environment variable. Some (&amp;lt;tt&amp;gt;numpy&amp;lt;/tt&amp;gt;) may create a &amp;lt;tt&amp;gt;bin&amp;lt;/tt&amp;gt; directory that needs to be added to &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=Environment variables=&lt;br /&gt;
Besides the variables defined in env.sh or env.csh (see the [[Installation|short Installation guide]]), Madagascar programs may read the variables below. They usually have reasonable defaults and were introduced just to provide more power to the advanced user.&lt;br /&gt;
&lt;br /&gt;
For future documentation writers: the environment variables read by Madagascar that have not been documented below can be found by running the script &amp;lt;tt&amp;gt;$RSFSRC/admin/find_env_var.py&amp;lt;/tt&amp;gt;. If the script does not exist or does not work, a summary of all environment variable calls can be obtained by going to $RSFSRC, temporarily moving the directory &amp;lt;tt&amp;gt;build/&amp;lt;/tt&amp;gt; outside RSFSRC, and typing&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
grep environ.get *.py */*.py */*/*.py */*/*/*.py&lt;br /&gt;
grep getenv           */*.c  */*/*.c  */*/*/*.c&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Used by the Madagascar core==&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; style=&amp;quot;background:#ffdead;&amp;quot;|Variables introduced by Madagascar&#039;s non-graphic programs&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Name&#039;&#039;&#039; || &#039;&#039;&#039;Default&#039;&#039;&#039; || Meaning&lt;br /&gt;
|-&lt;br /&gt;
| RSF_DATASERVER || &amp;lt;nowiki&amp;gt;ftp://egl.beg.utexas.edu/&amp;lt;/nowiki&amp;gt; || Data server for benchmark datasets&lt;br /&gt;
|-&lt;br /&gt;
| RSFDOC || $RSFROOT/doc || Directory for the HTML self-doc&lt;br /&gt;
|-&lt;br /&gt;
| RSFFIGS || $RSFROOT/figs || Directory with figures for testing examples in $RSFSRC/book&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| RSFALTFIGS || $RSFFIGS || Alternate directory with figures for testing examples not in $RSFSRC/book&lt;br /&gt;
|-&lt;br /&gt;
| RSFMEMSIZE || 100 || Maximum RAM (Mb) to be used by some programs  &lt;br /&gt;
|-&lt;br /&gt;
| RSFSRC || undefined || Root of the Madagascar source tree&lt;br /&gt;
|-&lt;br /&gt;
| TMPDATAPATH || $DATAPATH || Datapath for temporary files on local disk.&lt;br /&gt;
|-&lt;br /&gt;
| LATEX2HTML || undefined || LateX2HTML customization directory&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; style=&amp;quot;background:#ffdead;&amp;quot;|Variables introduced by Madagascar graphics programs &lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Name&#039;&#039;&#039; || &#039;&#039;&#039;Default&#039;&#039;&#039; || Meaning&lt;br /&gt;
|-&lt;br /&gt;
| DEFAULT_PAPER_SIZE || &amp;quot;letter&amp;quot; || For pspen. Other options: legal, a3, a4, a5.&lt;br /&gt;
|-&lt;br /&gt;
| FATMULT || ? || Fatness multiplication factor. &lt;br /&gt;
|-&lt;br /&gt;
| GIFBORDER || 0.25 || For vplot2gif (spacing)&lt;br /&gt;
|-&lt;br /&gt;
| GIFDELAY || 100 || For vplot2gif (for animations)&lt;br /&gt;
|-&lt;br /&gt;
| IMAGE_TYPE || &#039;png&#039; || Icon type for LateX2HTML &lt;br /&gt;
|-&lt;br /&gt;
| PATTERNMULT || None || Pattern multiplication factor  &lt;br /&gt;
|-&lt;br /&gt;
| PLOTSTYLE || None || Used in vplot&lt;br /&gt;
|-&lt;br /&gt;
| PPI || 75 || For vplot2gif (screen resolution)&lt;br /&gt;
|-&lt;br /&gt;
| PPMSCALE || 1 || For vplot2gif&lt;br /&gt;
|-&lt;br /&gt;
| PSBORDER || 0.05 || For vplot2eps (border around the plot)&lt;br /&gt;
|-&lt;br /&gt;
| PSPRINTER || postscript or colorps || For pspen&lt;br /&gt;
|-&lt;br /&gt;
| PSTEXPENOPTS || color=n fat=1 fatmult=1.5 invras=y || Other vplot2eps options &lt;br /&gt;
|-&lt;br /&gt;
| VPLOTFONTDIR || $RSFROOT/include || Dir with backup fonts in case the runtime-loaded vplot fonts are not found&lt;br /&gt;
|-&lt;br /&gt;
| VPLOTSPOOLDIR || /tmp || Where to put vplot tmp files&lt;br /&gt;
|-&lt;br /&gt;
| WSTYPE || &amp;quot;default&amp;quot; || Workstation type.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:#ffdead;&amp;quot;| Variables set by OS/other apps, read-only to Madagascar&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Name&#039;&#039;&#039; || &#039;&#039;&#039;Primarily used/set by&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| CWPROOT || Seismic Unix&lt;br /&gt;
|-&lt;br /&gt;
| DISPLAY || Operating System (OS)&lt;br /&gt;
|-&lt;br /&gt;
| HOME || OS&lt;br /&gt;
|-&lt;br /&gt;
| LD_LIBRARY_PATH || linker&lt;br /&gt;
|-&lt;br /&gt;
| MATLABPATH || Matlab&lt;br /&gt;
|-&lt;br /&gt;
| XAUTHORITY || X-Windows&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Used by the Madagascar build process and parallelization utilities==&lt;br /&gt;
Type &amp;lt;tt&amp;gt;scons -h&amp;lt;/tt&amp;gt; in RSFSRC to get a list of environment variables that affect the build process, with explanations, defaults and actual values. Below are more detailed explanations for some of them:&lt;br /&gt;
* &amp;lt;tt&amp;gt;RSF_THREADS&amp;lt;/tt&amp;gt;: used by &amp;lt;tt&amp;gt;pscons&amp;lt;/tt&amp;gt; to determine on how many threads to run on the local node, overriding the number of threads detected by Madagascar&lt;br /&gt;
* &amp;lt;tt&amp;gt;RSF_CLUSTER&amp;lt;/tt&amp;gt;: used by &amp;lt;tt&amp;gt;pscons&amp;lt;/tt&amp;gt; to determine on which cluster nodes to run, and on how many CPUs&lt;br /&gt;
&lt;br /&gt;
==Used by the Matlab API==&lt;br /&gt;
To use the Matlab API, you need to add &amp;lt;tt&amp;gt;$RSFROOT/lib&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;MATLABPATH&amp;lt;/tt&amp;gt;&lt;br /&gt;
==Used by the Octave API==&lt;br /&gt;
To use the Octave API, you need to add &amp;lt;tt&amp;gt;$RSFROOT/lib&amp;lt;/tt&amp;gt; to Octave&#039;s path. Determine Octave&#039;s version with&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
octave -v | head -1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
If your version is lower than 2.9.6, type at a Unix command line:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
echo &#039;LOADPATH = &amp;quot;::$RSFROOT/lib/octave&amp;quot;&#039; &amp;gt;&amp;gt; ~/.octaverc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
For later versions, use:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
echo &#039;addpath([getenv(&amp;quot;RSFROOT&amp;quot;) &amp;quot;/lib/octave&amp;quot;])&#039; &amp;gt;&amp;gt; ~/.octaverc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
==Used by the Java API==&lt;br /&gt;
New-style (post-1.0) API: Needs &amp;lt;tt&amp;gt;JAVA_HOME&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Old-style API (1.0 and before): The path to the downloaded Mines JTK must be specified in the MINESJTK environment variable in order to install the Java API. For example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
export MINESJTK=/home/user/edu_mines_jtk.jar&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==RSFROOT for NFS-shared user home directories==&lt;br /&gt;
Heterogeneous networks with user home directories shared through [http://en.wikipedia.org/wiki/Network_File_System_(protocol) NFS] are quite common in many institutions. In addition, even when the architecture is the same (i.e. 64-bit) and the operating system is the same (i.e. [http://en.wikipedia.org/wiki/RHEL RHEL]), the difference between operating system versions may be very significant because clusters may run legacy versions, while desktop workstations may run the latest-and-greatest (even beta), and entirely different Madagascar versions may be needed to support both. &lt;br /&gt;
&lt;br /&gt;
One possible solution of detecting the distribution version and architecture and setting RSFROOT appropriately is shown below. In the example network, all RHEL4 machines have the same architecture, but there are RHEL 3 machines with several architectures:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
REDHAT_RELEASE=`awk -F&#039;release&#039; &#039;{ print $2 }&#039; /etc/redhat-release | awk -F&#039; &#039; &#039;{ print $1 }&#039;`&lt;br /&gt;
&lt;br /&gt;
RSFROOT=/usr/local/rsf/rhel$REDHAT_RELEASE&lt;br /&gt;
&lt;br /&gt;
if [ $REDHAT_RELEASE == &#039;4&#039; ] ; then&lt;br /&gt;
    export RSFROOT&lt;br /&gt;
elif [ $REDHAT_RELEASE == &#039;3&#039; ] ; then&lt;br /&gt;
    export RSFROOT=$RSFROOT/$ARCH&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Of course, the Madagascar administrator will have to download appropriate versions of Madagascar to each $RSFROOT, and compile them on the appropriate system.&lt;br /&gt;
&lt;br /&gt;
If you have many kinds of systems to maintain, with multiple versions of Madagascar, and users have more than one shell, you may find it easy to outsource the complex logic to the easy-to-debug Python, i.e.:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
export RSFROOT=`$M8R_SETUP/get_rsfroot.py`&lt;br /&gt;
export PYTHONPATH=`$M8R_SETUP/edit_pythonpath.py`&lt;br /&gt;
export PATH=`$M8R_SETUP/edit_path.py`&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and similarly for (t)csh. The Python scripts determine the operating system and its version, determine the machine name, and simply print to stdout the desired string.&lt;br /&gt;
&lt;br /&gt;
==Eclipse + Pydev==&lt;br /&gt;
If you use [http://eclipse.org/ Eclipse] with [http://pydev.org/ Pydev], [http://pydev.org/manual_101_interpreter.html#id2 configure the interpreter] by adding &amp;lt;tt&amp;gt;$RSFROOT/lib&amp;lt;/tt&amp;gt; to the &amp;lt;tt&amp;gt;PYTHONPATH&amp;lt;/tt&amp;gt; for your chosen interpreter.&lt;br /&gt;
&lt;br /&gt;
=Platform-specific installation advice=&lt;br /&gt;
==Supported platforms==&lt;br /&gt;
Madagascar attempts to support any [http://en.wikipedia.org/wiki/POSIX POSIX-compliant] operating system demanded by users. For systems that bundle Python (i.e. Linux distributions, BSDs), backwards compatibility will attempt to cover those systems that were bundled with the oldest non-deprecated Python version currently supported by the latest stable version of [http://scons.org/ SCons]. For example, in early 2009 the stable SCons release (1.2) supported Python 2.2 or newer. [http://distrowatch.com/table.php?distribution=redhat Python 2.2 was bundled by RHEL3], so RHEL 3 and newer are supported. &lt;br /&gt;
&lt;br /&gt;
Attempts for backward compatibility with a given operating system are also stopped if the operating system itself becomes unsupported. For example, Python 2.2 was bundled by Fedora 1 and newer, but in January 2010 only Fedora 11 and 12 are actively maintained. Thus, in January 2010 Madagascar was not attempting to support Fedora 1, even though it included Python 2.2.&lt;br /&gt;
&lt;br /&gt;
Please keep in mind that the above statements constitute only general guidelines for what will be attempted, and do not constitute in any way a warranty of support. An application of the above guidelines to some Linux distributions follows:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Support info&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Distribution&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Life Cycle&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Supported versions&lt;br /&gt;
|-&lt;br /&gt;
| RHEL/CentOS/Scientific Linux&lt;br /&gt;
| [https://www.redhat.com/security/updates/errata/ 7 years]&lt;br /&gt;
| &lt;br /&gt;
* 6 until 2017-11-30&lt;br /&gt;
* 5 until 2014-03-31&lt;br /&gt;
|-&lt;br /&gt;
| Fedora&lt;br /&gt;
| [http://fedoraproject.org/wiki/Fedora_Release_Life_Cycle Release X maintained until one month after the release of X+2]&lt;br /&gt;
| &lt;br /&gt;
* 15 until 2012-06-24&lt;br /&gt;
* 14 until 2011-12-02&lt;br /&gt;
|-&lt;br /&gt;
| Ubuntu&lt;br /&gt;
| [https://wiki.ubuntu.com/Releases Releases every 6 mo, maintained for 1.5 yrs; LTS versions every 2 yrs, maintained for 5 yrs]&lt;br /&gt;
| &lt;br /&gt;
* 15.10 until July 2016&lt;br /&gt;
* 14.04 LTS until end of April 2019&lt;br /&gt;
* 12.04.4 LTS until end of April 2017&lt;br /&gt;
|-&lt;br /&gt;
| Debian&lt;br /&gt;
| [http://wiki.debian.org/DebianLenny Usually: stable releases every 1.5-3 yrs, release X maintained 1 yr after release X+1]&lt;br /&gt;
| &lt;br /&gt;
* 6 until its TBD end of life (approx. 2014)&lt;br /&gt;
* 5 until 2012-04&lt;br /&gt;
|- &lt;br /&gt;
| openSUSE&lt;br /&gt;
| [http://en.opensuse.org/Lifetime openSUSE releases Lifetime of 1.5-2.5 years]&lt;br /&gt;
| &lt;br /&gt;
* 11.4 until 2012-09-10&lt;br /&gt;
* 11.3 until 2012-01-15&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Ubuntu==&lt;br /&gt;
In &#039;&#039;&#039;Ubuntu 18.04&#039;&#039;&#039;, you can install the essential Madagascar depenency by running&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install libxaw7-dev freeglut3-dev libnetpbm10-dev libgd-dev libplplot-dev \&lt;br /&gt;
libavcodec-dev libcairo2-dev libjpeg-dev swig python-dev python-numpy g++ gfortran \&lt;br /&gt;
libopenmpi-dev libfftw3-dev libsuitesparse-dev python-epydoc scons git&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In &#039;&#039;&#039;Ubuntu 15.10 &#039;&#039;Wily Werewolf&#039;&#039;&#039;&#039;&#039; (as well as some previous versions), you can install the essential Madagascar depenency by running&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install libxaw7-dev &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and (optionally) all of Madagascar&#039;s dependencies by running&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install libxaw7-dev freeglut3-dev libnetpbm10-dev libgd-dev libplplot-dev \&lt;br /&gt;
libavcodec-dev libcairo2-dev libjpeg-dev swig python-dev python-numpy g++ gfortran \&lt;br /&gt;
libopenmpi-dev libfftw3-dev libsuitesparse-dev python-epydoc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In Ubuntu 13.04 &#039;&#039;Raring Ringtail&#039;&#039;, you can install all of Madagascar&#039;s dependencies by running&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install freeglut3-dev g++ gfortran libgd2-xpm-dev libx11-dev libxaw7-dev \&lt;br /&gt;
libnetpbm10-dev swig python-dev python-numpy libblas-dev libcairo2-dev liblapack-dev \&lt;br /&gt;
libavcodec-dev python-epydoc scons&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In Ubuntu 12.10 &#039;&#039;Quantal Quetzal&#039;&#039;, you can install all of Madagascar&#039;s dependencies by running&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install freeglut3-dev g++ gfortran libgd2-xpm-dev libx11-dev libxaw7-dev \&lt;br /&gt;
libnetpbm10-dev swig python-dev python-numpy libblas-dev libcairo2-dev liblapack-dev \&lt;br /&gt;
libavcodec-dev python-epydoc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In Ubuntu 12.04 &#039;&#039;Precise Pangolin&#039;&#039;, you can install all of Madagascar&#039;s dependencies by running&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install scons openmpi-bin libopenmpi-dev freeglut3-dev g++ gfortran libgd2-xpm-dev \&lt;br /&gt;
libglew1.6-dev libx11-dev libxaw7-dev libnetpbm10-dev swig python-dev python-scipy python-numpy \&lt;br /&gt;
libtiff4-dev scons units libblas-dev libcairo2-dev liblapack-dev libavcodec-dev python-epydoc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In Ubuntu 10.10 &#039;&#039;Maverick Meerkat&#039;&#039;, you can install all of Madagascar&#039;s dependencies by running &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install freeglut3-dev g++ gfortran libgd2-xpm-dev libglew1.5-dev libjpeg62-dev \&lt;br /&gt;
libx11-dev libxaw7-dev libnetpbm10-dev swig python-dev python-scipy python-numpy libtiff4-dev \&lt;br /&gt;
scons units libblas-dev libcairo2-dev libavcodec-dev libplplot-dev &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In Ubuntu 9.04 &#039;&#039;Jaunty Jackalope&#039;&#039;, the corresponding command is&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install freeglut3-dev g++ gfortran libc6-dev libgd2-xpm-dev libglew1.5-dev libjpeg62-dev \&lt;br /&gt;
libx11-dev libxaw7-dev libnetpbm10-dev swig python-dev python-scipy python-numpy libtiff4-dev scons units &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Earlier versions may work with&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install mesa-libGL-devel g++ g77 libc6-dev libgd2-xpm-dev libglew-dev libjpeg62-dev \&lt;br /&gt;
libx11-dev libxaw7-dev libnetpbm10-dev swig python-dev python-scipy python-numpy libtiff4-dev scons units &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If working with the development version, you will also need &amp;lt;tt&amp;gt;git&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;subversion&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Fedora, RedHat, CentOS, Scientific Linux, openSUSE==&lt;br /&gt;
&lt;br /&gt;
Install essential Madagascar dependencies with&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo yum install gcc libXaw-devel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dependency package names, sorted by Linux distribution and Madagascar feature they provide. Packages that are not included in the standard distro repositories are hyperlinked to their providers. The tables below cover build dependencies. &lt;br /&gt;
&lt;br /&gt;
Names of packages that are runtime dependencies are &#039;&#039;&#039;highlighted&#039;&#039;&#039; in the tables below (task under construction).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note: In the future, it should be possible for the configuration scripts to output the dependency tables below, so that they are guaranteed to be in synch with a given Madagascar version&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Minimal install (&amp;quot;Core&amp;quot;), publishing and development&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Core&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | LaTeX&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Development version&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | C++ API&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | F77 API, F90 API&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Python API&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Java API&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Octave API&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Matlab API&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Fedora 15&lt;br /&gt;
| binutils, gcc, glibc-headers, python&lt;br /&gt;
| texlive-latex&lt;br /&gt;
| subversion&lt;br /&gt;
| gcc-c++&lt;br /&gt;
| gcc-gfortran&lt;br /&gt;
| numpy, swig, python-devel&lt;br /&gt;
| Java (Sun&#039;s? IcedTea?)&lt;br /&gt;
| octave, octave-devel&lt;br /&gt;
| [http://www.mathworks.com/ Matlab] with Mex&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Fedora 14&lt;br /&gt;
| binutils, gcc, glibc-headers, python&lt;br /&gt;
| texlive-latex&lt;br /&gt;
| subversion&lt;br /&gt;
| gcc-c++&lt;br /&gt;
| gcc-gfortran&lt;br /&gt;
| numpy, swig&lt;br /&gt;
| Java (Sun&#039;s? IcedTea?)&lt;br /&gt;
| octave, octave-devel&lt;br /&gt;
| [http://www.mathworks.com/ Matlab] with Mex&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Fedora 13&lt;br /&gt;
| binutils, gcc, glibc-headers, python&lt;br /&gt;
| texlive-latex&lt;br /&gt;
| subversion&lt;br /&gt;
| gcc-c++&lt;br /&gt;
| gcc-gfortran&lt;br /&gt;
| numpy, swig&lt;br /&gt;
| Java (Sun&#039;s? IcedTea?)&lt;br /&gt;
| octave, octave-devel&lt;br /&gt;
| [http://www.mathworks.com/ Matlab]&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | CentOS 5&lt;br /&gt;
| binutils, gcc, glibc-headers; python (needs [http://dag.wieers.com/rpm/FAQ.php#B2 RPMforge&#039;s RHEL5 repository])&lt;br /&gt;
| ?&lt;br /&gt;
| subversion&lt;br /&gt;
| gcc-c++&lt;br /&gt;
| gcc-gfortran&lt;br /&gt;
| numpy, swig&lt;br /&gt;
| Java (Sun&#039;s? IcedTea?), [http://inside.mines.edu/~dhale/jtk/ Mines JTK]&lt;br /&gt;
| [http://www.gnu.org/software/octave/ Octave, octave-devel]&lt;br /&gt;
| [http://www.mathworks.com/ Matlab]&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | openSUSE 11.0&lt;br /&gt;
| gcc, python&lt;br /&gt;
| texlive-latex&lt;br /&gt;
| subversion&lt;br /&gt;
| gcc-c++&lt;br /&gt;
| gcc-fortran&lt;br /&gt;
| [http://numpy.scipy.org/ NumPy], swig&lt;br /&gt;
| Java (Sun&#039;s? IcedTea?), [http://inside.mines.edu/~dhale/jtk/ Mines JTK]&lt;br /&gt;
| [http://www.gnu.org/software/octave/ Octave]&lt;br /&gt;
| [http://www.mathworks.com/ Matlab]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Graphics and visualization&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The minimum requirement is X11 graphics for running &#039;&#039;&#039;xtpen&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | X11 graphics&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | vplot2gif&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | vplot2avi&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Some sort of movies?&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | TIFF output&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | JPEG output&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | PLplot graphics&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | OpenGL graphics&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | ppm (?)&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | unknown&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Fedora 13&lt;br /&gt;
| libXaw-devel&lt;br /&gt;
| gifsicle&lt;br /&gt;
| ffmpeg (needs the [http://rpmfusion.org/ RPM Fusion] repository enabled)&lt;br /&gt;
| ffmpeg-devel (needs the [http://rpmfusion.org/ RPM Fusion] repository enabled)&lt;br /&gt;
| libtiff-devel&lt;br /&gt;
| libjpeg-devel&lt;br /&gt;
| plplot-devel&lt;br /&gt;
| mesa-libGL-devel, freeglut, freeglut-devel&lt;br /&gt;
| netpbm-devel&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | openSUSE 11.0&lt;br /&gt;
| xorg-x11-devel&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
| libtiff-devel&lt;br /&gt;
| libjpeg-devel&lt;br /&gt;
| plplot-devel&lt;br /&gt;
| mesa-libGL-devel, freeglut, freeglut-devel&lt;br /&gt;
| netpbm-devel&lt;br /&gt;
| cairo-devel, gd-devel, glew-devel&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Numerical and file manipulation utilities&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | OpenMP&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | MPI&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | BLAS/ATLAS&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Interface to the Fast Discrete Curvelet Transform&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | sfunits&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Fedora 13&lt;br /&gt;
| libgomp&lt;br /&gt;
| openmpi, openmpi-devel; openmpi-libs (?)&lt;br /&gt;
| blas, blas-devel, atlas, atlas-devel&lt;br /&gt;
| [https://wave.eos.ubc.ca/Software/Licenced/ pyct]&lt;br /&gt;
| units&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | CentOS 5&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
| [https://wave.eos.ubc.ca/Software/Licenced/ pyct]&lt;br /&gt;
| [http://www.gnu.org/software/units/units.html Gnu Units]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Other&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Inclusions from Seismic Unix&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Fedora 14, 15&lt;br /&gt;
| [http://www.cwp.mines.edu/cwpcodes/ Seismic Unix]&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | CentOS 5&lt;br /&gt;
| [http://www.cwp.mines.edu/cwpcodes/ Seismic Unix]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Command to install all dependencies present in the public repositories&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Usually package management software will not install again a package that is already installed, so it should be safe to copy and paste the command below to a command line:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Fedora 15&lt;br /&gt;
| &#039;&#039;&#039;yum -y install&#039;&#039;&#039; binutils gcc glibc-headers scons texlive-latex subversion gcc-c++ gcc-gfortran numpy python python-devel swig octave octave-devel libgomp openmpi openmpi-devel blas blas-devel atlas atlas-devel units gifsicle ffmpeg ffmpeg-devel libtiff-devel libjpeg-devel plplot-devel mesa-libGL-devel freeglut freeglut-devel libXaw-devel netpbm-devel&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | Fedora 13&lt;br /&gt;
| &#039;&#039;&#039;yum -y install&#039;&#039;&#039; binutils gcc glibc-headers scons texlive-latex subversion gcc-c++ gcc-gfortran numpy python swig octave octave-devel libgomp openmpi openmpi-devel blas blas-devel atlas atlas-devel units gifsicle ffmpeg ffmpeg-devel libtiff-devel libjpeg-devel plplot-devel mesa-libGL-devel freeglut freeglut-devel libXaw-devel netpbm-devel&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | CentOS 5&lt;br /&gt;
| &#039;&#039;&#039;yum -y install&#039;&#039;&#039; binutils freeglut freeglut-devel gcc gcc-c++ gcc-gfortran glibc-headers libjpeg-devel libXaw-devel netpbm-devel&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ffdead;&amp;quot; | openSUSE 11.0&lt;br /&gt;
| &#039;&#039;&#039;zypper install&#039;&#039;&#039; cairo-devel gcc gcc-c++ gcc-fortran gd-devel glew-devel libjpeg-devel libtiff-devel octave scons subversion texlive-latex xorg-x11-devel&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;List of runtime dependencies only&#039;&#039;&#039;&lt;br /&gt;
(needed by packagers of Madagascar in order to properly list dependencies):&lt;br /&gt;
UNDER CONSTRUCTION&lt;br /&gt;
&lt;br /&gt;
===Fedora 25===&lt;br /&gt;
The following explains how to install madagascar on Fedora 25.&lt;br /&gt;
&lt;br /&gt;
We use the following compiler: &amp;lt;code&amp;gt;gcc&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;g++&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;gfortran&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* Install some packages&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; inline style=&amp;quot;white-space:wrap&amp;quot;&amp;gt;sudo dnf install scons lapack-static lapack64-static atlas-static fftw-static gd gd-devel libtool-ltdl-devel \&lt;br /&gt;
libXaw-devel mesa-libGL-devel freeglut-devel netpbm-devel plplot-devel ffmpeg-devel swig openmpi openmpi-devel suitesparse-devel&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This installed the following packages:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
scons-2.5.1-1.fc25.noarch&lt;br /&gt;
lapack-static-3.6.1-2.fc25.x86_64&lt;br /&gt;
lapack64-static-3.6.1-2.fc25.x86_64&lt;br /&gt;
atlas-static-3.10.2-14.fc25.x86_64&lt;br /&gt;
fftw-static-3.3.5-3.fc25.x86_64&lt;br /&gt;
gd-2.2.4-1.fc25.x86_64&lt;br /&gt;
gd-devel-2.2.4-1.fc25.x86_64&lt;br /&gt;
libtool-ltdl-devel-2.4.6-13.fc25.x86_64&lt;br /&gt;
libXaw-devel-1.0.13-4.fc25.x86_64&lt;br /&gt;
mesa-libGL-devel-17.0.5-3.fc25.x86_64&lt;br /&gt;
freeglut-devel-3.0.0-3.fc24.x86_64&lt;br /&gt;
netpbm-devel-10.78.00-1.fc25.x86_64&lt;br /&gt;
plplot-devel-5.11.1-13.fc25.x86_64&lt;br /&gt;
ffmpeg-devel-3.1.9-1.fc25.x86_64&lt;br /&gt;
swig-3.0.11-1.fc25.x86_64&lt;br /&gt;
openmpi-1.10.5-1.fc25.x86_64&lt;br /&gt;
openmpi-devel-1.10.5-1.fc25.x86_64&lt;br /&gt;
suitesparse-devel-4.4.6-7.fc25.x86_64&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and many other dependencies.&lt;br /&gt;
&lt;br /&gt;
* Get the sources from the git repository&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;git clone https://github.com/ahay/src&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you run now the &amp;lt;code&amp;gt;configure&amp;lt;/code&amp;gt; script, you will get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
checking for Python ... /usr/bin/python&lt;br /&gt;
checking Python version ... 2.7.13&lt;br /&gt;
checking for RSFROOT ... /usr/local/rsf&lt;br /&gt;
checking for SCons ... /usr/bin/scons&lt;br /&gt;
checking SCons version ... v2.5.1.rel_2.5.1:3735:9dc6cee5c168[MODIFIED]&lt;br /&gt;
Running RSFROOT=/usr/local/rsf /usr/bin/scons  config ...&lt;br /&gt;
------------------------&lt;br /&gt;
scons: Reading SConscript files ...&lt;br /&gt;
checking platform ... (cached) linux [fedora]&lt;br /&gt;
checking for C compiler ... (cached) gcc&lt;br /&gt;
checking if gcc works ... yes&lt;br /&gt;
checking if gcc accepts &#039;-x c -std=gnu99 -Wall -pedantic&#039; ... yes&lt;br /&gt;
checking for ar ... (cached) ar&lt;br /&gt;
checking for libraries ... [&#039;m&#039;]&lt;br /&gt;
checking complex support ... yes&lt;br /&gt;
checking for X11 headers ... /usr/include&lt;br /&gt;
checking for X11 libraries ... /usr/lib&lt;br /&gt;
checking for OpenGL ... yes&lt;br /&gt;
checking for sfpen ... (cached) xtpen&lt;br /&gt;
checking for ppm ... yes&lt;br /&gt;
checking for tiff ... yes&lt;br /&gt;
checking for GD (PNG) ... yes&lt;br /&gt;
checking for GD (GIF) ... yes&lt;br /&gt;
checking for plplot ... no&lt;br /&gt;
&lt;br /&gt;
  Optional package: plplot-devel&lt;br /&gt;
checking for ffmpeg ... yes&lt;br /&gt;
checking for cairo (PNG) ... yes&lt;br /&gt;
checking for cairo (SVG) ... yes&lt;br /&gt;
checking for cairo (PDF) ... yes&lt;br /&gt;
checking for jpeg ... yes&lt;br /&gt;
checking for BLAS ... yes&lt;br /&gt;
checking for LAPACK ... no&lt;br /&gt;
&lt;br /&gt;
  Optional package: blas + blas-devel + atlas + atlas-devel&lt;br /&gt;
checking for SWIG ... (cached) /usr/bin/swig&lt;br /&gt;
checking for numpy ... (cached) yes&lt;br /&gt;
checking API options ... (cached) []&lt;br /&gt;
checking for C++ compiler ... (cached) g++&lt;br /&gt;
checking if g++ works ... yes&lt;br /&gt;
checking if g++ accepts &#039;-std=c++11 -U__STRICT_ANSI__ -Wall -pedantic&#039; ... yes&lt;br /&gt;
checking for MPICC ... (cached) /usr/lib64/openmpi/bin/mpicc&lt;br /&gt;
checking if /usr/lib64/openmpi/bin/mpicc works ... yes&lt;br /&gt;
checking for MPICXX ... (cached) /usr/lib64/openmpi/bin/mpicxx&lt;br /&gt;
checking if /usr/lib64/openmpi/bin/mpicxx works ... yes&lt;br /&gt;
checking for MPIRUN ... (cached) /usr/lib64/openmpi/bin/mpirun&lt;br /&gt;
checking for Posix threads ... yes&lt;br /&gt;
checking for OpenMP ... yes&lt;br /&gt;
checking for CUDA ... (cached) no&lt;br /&gt;
checking for FFTW ... yes&lt;br /&gt;
checking if FFTW supports threads ... yes&lt;br /&gt;
checking for SuiteSparse ... yes&lt;br /&gt;
checking for pfft ... no&lt;br /&gt;
scons: done reading SConscript files.&lt;br /&gt;
scons: Building targets ...&lt;br /&gt;
shell_script([&amp;quot;env.sh&amp;quot;], [])&lt;br /&gt;
shell_script([&amp;quot;env.csh&amp;quot;], [])&lt;br /&gt;
scons: done building targets.&lt;br /&gt;
------------------------&lt;br /&gt;
Done with configuration.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Libraries &amp;lt;code&amp;gt;plplot&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;lapack&amp;lt;/code&amp;gt; are not found. File &amp;lt;code&amp;gt;config.log&amp;lt;/code&amp;gt; says&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/bin/ld: cannot find -lplplotd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gcc -o .sconf_temp/sfconftest_21 .sconf_temp/conftest_21.o -L/usr/lib64/atlas -lm -lf77blas -lcblas -latlas -llapack -lcblas&lt;br /&gt;
/usr/lib64/atlas/liblapack.a(dgesv.o): In function `dgesv_&#039;:&lt;br /&gt;
(.text+0x69): undefined reference to `xerbla_&#039;&lt;br /&gt;
/usr/lib64/atlas/liblapack.a(ATL_f77wrap_dgesv.o): In function `atl_f77wrap_dgesv_&#039;:&lt;br /&gt;
(.text+0x10d): undefined reference to `ATL_xerbla&#039;&lt;br /&gt;
/usr/lib64/atlas/liblapack.a(ATL_dgetf2.o): In function `ATL_dgetf2&#039;:&lt;br /&gt;
(.text+0x184): undefined reference to `ATL_dger&#039;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So library &amp;lt;code&amp;gt;plplotd&amp;lt;/code&amp;gt; doesn&#039;t exist on Fedora 25 and the &amp;lt;code&amp;gt;configure&amp;lt;/code&amp;gt; script is looking for the wrong &amp;lt;code&amp;gt;lapack&amp;lt;/code&amp;gt; library.&lt;br /&gt;
&lt;br /&gt;
If compiling now, 2 other libraries won&#039;t be found: &amp;lt;code&amp;gt;gfortran&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;quadmath&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Regarding the &amp;lt;code&amp;gt;plplotd&amp;lt;/code&amp;gt; library, edit file &amp;lt;code&amp;gt;framework/configure.py&amp;lt;/code&amp;gt; and change the line 724:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line start=&amp;quot;724&amp;quot;&amp;gt;plplot = context.env.get(&#039;PLPLOT&#039;,&#039;plplotd&#039;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
to&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line start=&amp;quot;724&amp;quot;&amp;gt;plplot = context.env.get(&#039;PLPLOT&#039;,&#039;plplot&#039;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* As for the libraries&lt;br /&gt;
** &amp;lt;code&amp;gt;lapack&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;gfortran&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;quadmath&amp;lt;/code&amp;gt;&lt;br /&gt;
We must use the &amp;lt;code&amp;gt;lapack&amp;lt;/code&amp;gt; library installed in &amp;lt;code&amp;gt;/usr/lib64&amp;lt;/code&amp;gt;, not the one installed in &amp;lt;code&amp;gt;/usr/lib64/atlas&amp;lt;/code&amp;gt;. And libraries &amp;lt;code&amp;gt;gfortran&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;quadmath&amp;lt;/code&amp;gt; are installed in &amp;lt;code&amp;gt;/usr/lib/gcc/x86_64-redhat-linux/6.3.1/&amp;lt;/code&amp;gt;.&lt;br /&gt;
Edit file &amp;lt;code&amp;gt;framework/configure.py&amp;lt;/code&amp;gt; and add the following 4 lines:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[&#039;/usr/lib/gcc/x86_64-redhat-linux/6.3.1/&#039;,&lt;br /&gt;
 &#039;/usr/lib64/&#039;,&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LIBS.append(&#039;gfortran&#039;)&lt;br /&gt;
LIBS.append(&#039;quadmath&#039;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
so that we end up with the following &amp;lt;code&amp;gt;blas&amp;lt;/code&amp;gt; function: &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line start=&amp;quot;971&amp;quot;&amp;gt;def blas(context):&lt;br /&gt;
    context.Message(&amp;quot;checking for BLAS ... &amp;quot;)&lt;br /&gt;
    text = &#039;&#039;&#039;&lt;br /&gt;
    #ifdef __APPLE__&lt;br /&gt;
    #include &amp;lt;Accelerate/Accelerate.h&amp;gt;&lt;br /&gt;
    #else&lt;br /&gt;
    #ifdef HAVE_MKL&lt;br /&gt;
    #include &amp;lt;mkl.h&amp;gt;&lt;br /&gt;
    #else&lt;br /&gt;
    #include &amp;lt;cblas.h&amp;gt;&lt;br /&gt;
    #endif&lt;br /&gt;
    #endif&lt;br /&gt;
    int main(int argc,char* argv[]) {&lt;br /&gt;
    float d, x[]={1.,2.,3.}, y[]={3.,2.,1.};&lt;br /&gt;
    d = cblas_sdot(3,x,1,y,1);&lt;br /&gt;
    return 0;&lt;br /&gt;
    }\n&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    if plat[&#039;OS&#039;] == &#039;cygwin&#039;:&lt;br /&gt;
        context.env[&#039;ENV&#039;][&#039;PATH&#039;] = context.env[&#039;ENV&#039;][&#039;PATH&#039;] + \&lt;br /&gt;
                                         &#039;:/lib/lapack&#039;&lt;br /&gt;
&lt;br /&gt;
    res = context.TryLink(text,&#039;.c&#039;)&lt;br /&gt;
    if res: &lt;br /&gt;
        context.Result(res)&lt;br /&gt;
        context.env[&#039;BLAS&#039;] = True &lt;br /&gt;
    else:&lt;br /&gt;
        # first try blas&lt;br /&gt;
        LIBS = path_get(context,&#039;LIBS&#039;)&lt;br /&gt;
        blas = context.env.get(&#039;BLAS&#039;,&#039;blas&#039;)&lt;br /&gt;
        LIBS.append(blas)&lt;br /&gt;
        res = context.TryLink(text,&#039;.c&#039;)&lt;br /&gt;
        if res: &lt;br /&gt;
            context.Result(res)&lt;br /&gt;
            context.env[&#039;LIBS&#039;] = LIBS &lt;br /&gt;
            context.env[&#039;BLAS&#039;] = blas &lt;br /&gt;
        else:&lt;br /&gt;
            # some systems require cblas and atlas&lt;br /&gt;
            for atlas_dir in filter(os.path.isdir,&lt;br /&gt;
                                    [&#039;/usr/lib/gcc/x86_64-redhat-linux/6.3.1/&#039;,  # &amp;lt;--- add this line&lt;br /&gt;
                                     &#039;/usr/lib64/&#039;,                              # &amp;lt;--- add this line&lt;br /&gt;
                                     &#039;/usr/lib64/atlas/&#039;,&lt;br /&gt;
                                     &#039;/usr/lib/atlas/&#039;]):&lt;br /&gt;
                context.env[&#039;LIBPATH&#039;].append(atlas_dir)&lt;br /&gt;
            LIBS.pop()&lt;br /&gt;
            LIBS.append(&#039;f77blas&#039;)&lt;br /&gt;
            LIBS.append(&#039;cblas&#039;)&lt;br /&gt;
            LIBS.append(&#039;atlas&#039;)&lt;br /&gt;
            LIBS.append(&#039;gfortran&#039;)  # &amp;lt;----------------------------------------------- add this line&lt;br /&gt;
            LIBS.append(&#039;quadmath&#039;)  # &amp;lt;----------------------------------------------- add this line&lt;br /&gt;
            res = context.TryLink(text,&#039;.c&#039;)&lt;br /&gt;
            if res: &lt;br /&gt;
                context.Result(res)&lt;br /&gt;
                context.env[&#039;LIBS&#039;] = LIBS &lt;br /&gt;
                context.env[&#039;BLAS&#039;] = &#039;cblas&#039;&lt;br /&gt;
            else:&lt;br /&gt;
                context.Result(context_failure)&lt;br /&gt;
                context.env[&#039;CPPDEFINES&#039;] = \&lt;br /&gt;
                    path_get(context,&#039;CPPDEFINES&#039;,&#039;NO_BLAS&#039;)&lt;br /&gt;
                LIBS.pop()&lt;br /&gt;
                LIBS.pop()&lt;br /&gt;
                LIBS.pop()&lt;br /&gt;
                context.env[&#039;BLAS&#039;] = None &lt;br /&gt;
                need_pkg(&#039;blas&#039;, fatal=False)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* Run the &amp;lt;code&amp;gt;configure&amp;lt;/code&amp;gt; script, for example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;./configure --prefix=/usr/local/rsf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Output should give:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
checking for Python ... /usr/bin/python&lt;br /&gt;
checking Python version ... 2.7.13&lt;br /&gt;
checking for RSFROOT ... /usr/local/rsf&lt;br /&gt;
checking for SCons ... /usr/bin/scons&lt;br /&gt;
checking SCons version ... v2.5.1.rel_2.5.1:3735:9dc6cee5c168[MODIFIED]&lt;br /&gt;
Running RSFROOT=/usr/local/rsf /usr/bin/scons  config ...&lt;br /&gt;
------------------------&lt;br /&gt;
scons: Reading SConscript files ...&lt;br /&gt;
checking platform ... (cached) linux [fedora]&lt;br /&gt;
checking for C compiler ... (cached) gcc&lt;br /&gt;
checking if gcc works ... yes&lt;br /&gt;
checking if gcc accepts &#039;-x c -std=gnu99 -Wall -pedantic&#039; ... yes&lt;br /&gt;
checking for ar ... (cached) ar&lt;br /&gt;
checking for libraries ... [&#039;m&#039;]&lt;br /&gt;
checking complex support ... yes&lt;br /&gt;
checking for X11 headers ... /usr/include&lt;br /&gt;
checking for X11 libraries ... /usr/lib&lt;br /&gt;
checking for OpenGL ... yes&lt;br /&gt;
checking for sfpen ... (cached) xtpen&lt;br /&gt;
checking for ppm ... yes&lt;br /&gt;
checking for tiff ... yes&lt;br /&gt;
checking for GD (PNG) ... yes&lt;br /&gt;
checking for GD (GIF) ... yes&lt;br /&gt;
checking for plplot ... yes&lt;br /&gt;
checking for ffmpeg ... yes&lt;br /&gt;
checking for cairo (PNG) ... yes&lt;br /&gt;
checking for cairo (SVG) ... yes&lt;br /&gt;
checking for cairo (PDF) ... yes&lt;br /&gt;
checking for jpeg ... yes&lt;br /&gt;
checking for BLAS ... yes&lt;br /&gt;
checking for LAPACK ... yes&lt;br /&gt;
checking for SWIG ... (cached) /usr/bin/swig&lt;br /&gt;
checking for numpy ... (cached) yes&lt;br /&gt;
checking API options ... (cached) []&lt;br /&gt;
checking for C++ compiler ... (cached) g++&lt;br /&gt;
checking if g++ works ... yes&lt;br /&gt;
checking if g++ accepts &#039;-std=c++11 -U__STRICT_ANSI__ -Wall -pedantic&#039; ... yes&lt;br /&gt;
checking for MPICC ... (cached) /usr/lib64/openmpi/bin/mpicc&lt;br /&gt;
checking if /usr/lib64/openmpi/bin/mpicc works ... yes&lt;br /&gt;
checking for MPICXX ... (cached) /usr/lib64/openmpi/bin/mpicxx&lt;br /&gt;
checking if /usr/lib64/openmpi/bin/mpicxx works ... yes&lt;br /&gt;
checking for MPIRUN ... (cached) /usr/lib64/openmpi/bin/mpirun&lt;br /&gt;
checking for Posix threads ... yes&lt;br /&gt;
checking for OpenMP ... yes&lt;br /&gt;
checking for CUDA ... (cached) no&lt;br /&gt;
checking for FFTW ... yes&lt;br /&gt;
checking if FFTW supports threads ... yes&lt;br /&gt;
checking for SuiteSparse ... yes&lt;br /&gt;
checking for pfft ... no&lt;br /&gt;
scons: done reading SConscript files.&lt;br /&gt;
scons: Building targets ...&lt;br /&gt;
shell_script([&amp;quot;env.sh&amp;quot;], [])&lt;br /&gt;
shell_script([&amp;quot;env.csh&amp;quot;], [])&lt;br /&gt;
scons: done building targets.&lt;br /&gt;
------------------------&lt;br /&gt;
Done with configuration.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* Then run the compilation:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;make&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* and finally the installation&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;sudo make install&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Debian 5==&lt;br /&gt;
Specific dependencies:&lt;br /&gt;
* Debian 5.0 (&amp;quot;Lenny&amp;quot;): Please make sure you have the &amp;lt;tt&amp;gt;libc6-dev&amp;lt;/tt&amp;gt; package before trying to compile from source. The &amp;lt;tt&amp;gt;libXaw7-dev&amp;lt;/tt&amp;gt; package might be a dependency for &amp;lt;tt&amp;gt;xtpen&amp;lt;/tt&amp;gt; (was in Debian 4.0)&lt;br /&gt;
&lt;br /&gt;
==Yellow Dog Linux 6.1 on Sony PlayStation 3==&lt;br /&gt;
See [http://www.reproducibility.org/rsflog/uploads/Friday_Seminar_Madagascar_on_PS3.ppt Will Burnett&#039;s guide (PowerPoint)]&lt;br /&gt;
&lt;br /&gt;
==Mac OS X==&lt;br /&gt;
&lt;br /&gt;
Install necessary Mac OS X applications using:&lt;br /&gt;
* [http://www.macports.org/ MacPorts], an easy-to-use system for compiling, installing, and upgrading open-source software on Mac OS X.&lt;br /&gt;
* [http://www.finkproject.org/ Fink], a tool that brings the full world of Unix Open Source software to Mac OS X. &lt;br /&gt;
&lt;br /&gt;
Installation on Mac OS X Mountain Lion requires the following:&lt;br /&gt;
# &amp;lt;b&amp;gt;Xcode&amp;lt;/b&amp;gt;: Download and install [https://developer.apple.com/xcode/ XCode] from Apple using App Store application. In Xcode, make sure to enable and install the command-line tools in Xcode/Preferences/Downloads &lt;br /&gt;
# (Optionally) &amp;lt;b&amp;gt;X11&amp;lt;/b&amp;gt;: Install X11 libraries from [http://xquartz.macosforge.org Xquartz]. &lt;br /&gt;
# (Optionally) &amp;lt;b&amp;gt;gcc&amp;lt;/b&amp;gt;: Install the Gnu C compiler from [http://hpc.sourceforge.net HPC Mac OS X]. &lt;br /&gt;
# (Optionally) [[SEGTeX]]: To use &amp;lt;b&amp;gt;SEGTeX&amp;lt;/b&amp;gt;, you may need [http://www.tug.org/texlive/ TeX Live]. &amp;lt;b&amp;gt;MacPorts&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;Fink&amp;lt;/b&amp;gt; provide an easy way to install it with commands &amp;lt;pre&amp;gt;sudo port install texlive&amp;lt;/pre&amp;gt; or &amp;lt;pre&amp;gt;sudo fink install texlive&amp;lt;/pre&amp;gt;&lt;br /&gt;
# (Optionally) &amp;lt;b&amp;gt;FFTW&amp;lt;/b&amp;gt;: Using &amp;lt;b&amp;gt;MacPorts&amp;lt;/b&amp;gt;, run &amp;lt;pre&amp;gt;sudo port install fftw-3-single&amp;lt;/pre&amp;gt;&amp;lt;pre&amp;gt;sudo port install fftw-3 +gfortran&amp;lt;/pre&amp;gt;&lt;br /&gt;
# (Optionally) &amp;lt;b&amp;gt;MPI&amp;lt;/b&amp;gt;: Using &amp;lt;b&amp;gt;MacPorts&amp;lt;/b&amp;gt;, run &amp;lt;pre&amp;gt;sudo port install openmpi&amp;lt;/pre&amp;gt;&amp;lt;pre&amp;gt;sudo port select --set mpi openmpi-mp-fortran&amp;lt;/pre&amp;gt;&lt;br /&gt;
# (Optionally) &amp;lt;b&amp;gt;ppmpen&amp;lt;/b&amp;gt;: Using &amp;lt;b&amp;gt;MacPorts&amp;lt;/b&amp;gt;, run &amp;lt;pre&amp;gt;sudo port install libnetpbm&amp;lt;/pre&amp;gt;&lt;br /&gt;
# (Optionally) &amp;lt;b&amp;gt;Open vplots using double click&amp;lt;/b&amp;gt;: [[machacks|Instructions]].&lt;br /&gt;
Proceed with configuration and installation following the normal procedure.  You may need to use Apple&#039;s compiler (clang) instead of gcc.  Use one of these commands in the $RSFSRC directory&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure CC=clang CXX=clang++&amp;lt;/pre&amp;gt; or &amp;lt;pre&amp;gt;./configure CC=clang CXX=clang++ API=f90,matlab --prefix=/directory/where/you/want/madagascar/installed&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==OpenSolaris==&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;tt&amp;gt;pkg&amp;lt;/tt&amp;gt; to install missing components such as X11 headers.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
pfexec pkg install SUNWxorg-headers&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==MS Windows==&lt;br /&gt;
Due to its size, this topic has been assigned [[Windows | its own Wiki page]].&lt;br /&gt;
&lt;br /&gt;
==How to adapt Madagascar to a new platform==&lt;br /&gt;
The most laborious part of adapting madagascar to a new platform is finding the proper dependency names. This usually proceeds as follows: dependency X fails with a &amp;quot;missing file&amp;quot; error either as a header file in &amp;lt;tt&amp;gt;config.log&amp;lt;/tt&amp;gt;, or a missing library during the build step. Possible package names are found through an internet search for the missing file name and the distribution name or by using specific [http://rpm.pbone.net/ rpm search tools]. Packages are installed and the configure (and, if necessary) build processes are repeated until the error goes away.&lt;br /&gt;
&lt;br /&gt;
=Multi-user installs=&lt;br /&gt;
Some organizations may find it desirable to deny write access of some users to all RSFSRC/RSFROOT except their own user directory. Fortunately, this can be easily done by placing the restricted user dirs outside RSFSRC/RSFROOT, i.e. in their home dirs, say /home/joe/rsfsrc. In order to move a user&#039;s directory out of RSFSRC, you must:&lt;br /&gt;
* &amp;quot;tell&amp;quot; the SConstruct in the user&#039;s dir where to find RSFSRC so that when the user builds in his directory, it can import &amp;lt;tt&amp;gt;configure.py&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;config.py&amp;lt;/tt&amp;gt; You do that by setting the environment variable RSFSRC to the absolute path of the Madagascar source root, and by making sure that lines 2 and 3 in the users&#039; SConstruct files are&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
srcroot = os.environ.get(&#039;RSFSRC&#039;, &#039;../..&#039;)&lt;br /&gt;
sys.path.append(srcroot)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
and then replace &amp;lt;tt&amp;gt;../..&amp;lt;/tt&amp;gt; throughout the SConstruct using &amp;lt;tt&amp;gt;os.path.join&amp;lt;/tt&amp;gt; and the &amp;lt;tt&amp;gt;srcroot&amp;lt;/tt&amp;gt; variable.&lt;br /&gt;
* &amp;quot;tell&amp;quot; the build scripts about the user&#039;s dir, so that it is included in the builds launched from RSFSRC. You do that with a symbolic link:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ln -s /home/joe/rsfsrc $RSFSRC/user/joe&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&#039;&#039;When the link exists&#039;&#039;, those of Joe&#039;s programs that are mentioned in the &amp;quot;prog&amp;quot; string in SConstruct get included in the distribution, complete with self-doc. If Joe is just learning how to code and his stuff breaks the build, just remove the symbolic link. Even if build+installs are done after the link is removed, his stable programs and self-doc will continue to remain installed system-wide as long as the admin does not type &amp;lt;tt&amp;gt;scons -c install&amp;lt;/tt&amp;gt; (not likely).&lt;br /&gt;
* point the user&#039;s RSFDOC environment variable to a location where the user has write access&lt;br /&gt;
* edit the users&#039; SConstruct so that it uses the RSF library and headers already installed in $RSFROOT/lib and $RSFROOT/include , instead of building again the whole &amp;lt;tt&amp;gt;librsf&amp;lt;/tt&amp;gt; with user-specific flags in &amp;lt;tt&amp;gt;RSFSRC/filt/lib/&amp;lt;/tt&amp;gt;. To do that, replace in the user&#039;s SConstruct the env.Prepend statement with&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
rsfroot = os.environ.get(&#039;RSFROOT&#039;,&#039;/usr/local/rsf&#039;)&lt;br /&gt;
&lt;br /&gt;
env.Prepend(CPPPATH=[os.path.join(rsfroot,&#039;include&#039;)],&lt;br /&gt;
            LIBPATH=[os.path.join(rsfroot,&#039;lib&#039;)],&lt;br /&gt;
            LIBS=[&#039;rsf&#039;])&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* If the link from RSFSRC to Joe&#039;s directory was not made, add Joe&#039;s directory to his own path so that he can execute his own binaries.&lt;br /&gt;
&lt;br /&gt;
To understand how $DATAPATH disk space issues may become an issue in a multi-user environment, refer to the [[Advanced_Installation#Disk_space|Disk Space subsection]] at the beginning of this document.&lt;br /&gt;
&lt;br /&gt;
=Keeping your stuff separate=&lt;br /&gt;
A user may add his own programs and recipes to the Madagascar system. He may also create his own computational examples, data, and locked figures for testing. All of these components can be placed in their default locations, but it is not necessary to make them public. To keep these items private simply do not add them to the repository.&lt;br /&gt;
&lt;br /&gt;
However, it might be desirable to keep these components in separate places. For example, if you keep your private programs in RSFSRC/user you will have to remember to make a copy somewhere else if you ever want to delete the Madagascar installation to perform a fresh install. Yup, I deleted all my programs that way once. Good thing I had a back up! Fortunately, it is easy to keep each of these components in a separate place if desired.&lt;br /&gt;
&lt;br /&gt;
==Keeping programs separate==&lt;br /&gt;
User programs are ordinarily kept in a subdirectory of RSFSRC/user.  However, if you want to keep your programs separate all you have to do is put your subdirectory somewhere else and make a link to it in RSFSRC/user:&lt;br /&gt;
&amp;lt;bash&amp;gt;&lt;br /&gt;
ln -s path_to_my_programs $RSFSRC/user/my_programs&lt;br /&gt;
&amp;lt;/bash&amp;gt;&lt;br /&gt;
The additional instructions above for &amp;quot;multi-user installs&amp;quot; are for the case where the other users do not have write access to RSFSRC.  However, if you have full write access and only want to keep the programs in a separate place the link is the only thing you need.&lt;br /&gt;
&lt;br /&gt;
===Problems when symbolic linking and using SVN=== &lt;br /&gt;
If you decide to use a symbolic link e.g. &amp;quot;ln -s ...&amp;quot; as above, you will have difficulties checking in your code into the SVN repository.  SVN typically does not follow the symbolic link but will only the save the symbolic link.   &lt;br /&gt;
&lt;br /&gt;
See this answer from Stackoverflow (http://stackoverflow.com/questions/24850844/follow-symlinks-in-svn)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If I understand your problem, you have:&lt;br /&gt;
&lt;br /&gt;
project1/&lt;br /&gt;
project1/link1 -&amp;gt; ../../some/where/else&lt;br /&gt;
&lt;br /&gt;
If you do a simple svn add link1 it adds a symlink entry to the subversion repository, but what you&#039;re trying to accomplish is getting the stuff under somewhere else into the tree.&lt;br /&gt;
&lt;br /&gt;
If this is the case, then you&#039;re fighting in the wrong direction, you should make the real files and directories under link1, and make the target locations symlinks into the link1 directory. That would be a simple solution to the problem.&lt;br /&gt;
&lt;br /&gt;
Another solution would be to make the location ../../some/where/else an svn location in it&#039;s own right, and make link1 an externals definition to that location. When you commit in the main directory, the externals would be committed at the same time which would achieve storing the information; however to ensure that the other location was kept in sync, you would have to make sure to update it to the same version as the stored data.&lt;br /&gt;
&lt;br /&gt;
In my case, on my desktop, I have a settings directory:&lt;br /&gt;
&lt;br /&gt;
$HOME/settings&lt;br /&gt;
&lt;br /&gt;
This is a checked out copy of a directory containing .bashrc, .profile, .vimrc, .vim, etc. files and folders from an svn repo. All my profile files and directories were symlinks into this folder, so for example .profile -&amp;gt; settings/.profile, etc. When I make changes, they are reflected in the svn tree, which I can commit back to in order to ensure that I don&#039;t lose my config settings when I go to another system.&lt;br /&gt;
&lt;br /&gt;
If you really want svn to follow symlinks as hardlinks (You can&#039;t make directory hardlinks because it would be a bad thing™), then you&#039;ll have to hack the svn client source so that it did what you wanted; but this would be a maintenance nightmare.&lt;br /&gt;
&lt;br /&gt;
You could get away with making the symlink into a bind mount point directed at the target, but that has it&#039;s own issues - you would need to be root to accomplish this, and it ends up leaving funny entries in your /proc/mounts to accomplish this:&lt;br /&gt;
&lt;br /&gt;
mount --bind /absolute/path/to/some/where/else project1/link1&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Keeping recipes separate==&lt;br /&gt;
Computational recipes written in Python and imported by the SConstruct file of a workflow are normally stored in RSFSRC/book/Recipes.  The install process copies these recipes to a directory like $RSFROOT/lib/python2.5/site-packages/rsf/recipes and adds this directory to your PYTHONPATH so that Python can find them.&lt;br /&gt;
&lt;br /&gt;
However, you can put you own recipes anywhere you want.  You only have to add that place to your PYTHONPATH like this (bash):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
export PYTHONPATH=${PYTHONPATH}:path_to_my_recipes&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Or like this (csh):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
setenv PYTHONPATH ${PYTHONPATH}:path_to_my_recipes&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Keeping examples separate==&lt;br /&gt;
Madagascar&#039;s public collection of example workflows are stored in RSFSRC/book, but you can put your private workflows anywhere you want.  No special instructions are required.&lt;br /&gt;
&lt;br /&gt;
However, Madagascar assumes that the workflows are organized into a three-level book/chapter/section directory hierarchy when it creates a directory tree for the data and locked figures associated with your workflow. It is not required, but it might be easier to find the data and locked figures if you put your workflows in a three-level directory tree something like this: path_to_my_book/chapter/section/SConstruct.&lt;br /&gt;
&lt;br /&gt;
==Keeping data separate==&lt;br /&gt;
The location of the data portion of your *.rsf files is controlled by your DATAPATH environment variable.  However, you may want to keep the data for your private workflows in a different place, or several different places, than the data created by the public examples in RSFSRC/book.  The way to do that is to temporarily change the DATAPATH variable in the SConstruct &#039;&#039;before&#039;&#039; importing rsf.proj like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import os&lt;br /&gt;
os.environ[&#039;DATAPATH&#039;] = &#039;path_to_my_private_data&#039;&lt;br /&gt;
&lt;br /&gt;
from rsf.proj import *&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Keeping locked figures separate==&lt;br /&gt;
The command &amp;quot;scons lock&amp;quot; in the directory of a workflow will store a &amp;quot;locked&amp;quot; copy of your figures for regression testing.  Normally these figures are stored in the location pointed to by your RSFFIGS variable, and that is where the figures from the figures repository should be stored for testing in RSFSRC/book.&lt;br /&gt;
&lt;br /&gt;
However, you may want to keep your private figures in a different place.  The way to do that is to temporarily change the RSFFIGS variable in the SConstruct &#039;&#039;before&#039;&#039; importing rsf.proj like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import os&lt;br /&gt;
os.environ[&#039;RSFFIGS&#039;] = &#039;path_to_my_private_figures&#039;&lt;br /&gt;
&lt;br /&gt;
from rsf.proj import *&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
If you also create a RSFALTFIGS environment variable pointing to path_to_my_private_figures, then the testing script sffiglist will automatically test your figures against those in RSFALTFIGS when the sffiglist command is executed from a location outside of RSFSRC/book.&lt;br /&gt;
&lt;br /&gt;
=Capturing error and warning messages=&lt;br /&gt;
The messages during configuration are few and their importance quite high, so they should be watched &amp;quot;in person&amp;quot;. A complete log of the configuration process is recorded in RSFSRC/configure.log&lt;br /&gt;
&lt;br /&gt;
Console messages generated during the build step can be captured to a log file and observed at the same time with a command like this (tcsh):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
nice +10 nohup /usr/bin/time -p scons -k |&amp;amp; tee log_build.asc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The log file can be of course named otherwise than &amp;lt;tt&amp;gt;log_build.asc&amp;lt;/tt&amp;gt;. The file can be later grepped for error and warnings with commands such as:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
grep -c error log_build.asc&lt;br /&gt;
grep error log_build.asc | awk &#039;/error.c/ {next}; /error.h/ {next}; /error.o/ {next}; {print}&#039;&lt;br /&gt;
grep -c warning log_build.asc&lt;br /&gt;
grep warning log_build.asc | awk &#039;/imaginary constants are a GCC extension/ {next}; {print}&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Advanced troubleshooting=&lt;br /&gt;
* If you removed one of your programs or changed its name, and &amp;lt;tt&amp;gt;scons install&amp;lt;/tt&amp;gt; fails with &amp;quot;Source &amp;lt;tt&amp;gt;oldprogname&amp;lt;/tt&amp;gt; not found, needed by target install&amp;quot;, and you cleaned everything there was to clean but still get this message, remove &amp;lt;tt&amp;gt;RSFSRC/.sconsign*&amp;lt;/tt&amp;gt;&lt;br /&gt;
* If during &amp;lt;tt&amp;gt;scons install&amp;lt;/tt&amp;gt; you get a &amp;lt;tt&amp;gt;DBAccessError : (13, &#039;Permission denied&#039;)&amp;lt;/tt&amp;gt; in some reproducible papers, check permissions in your &amp;lt;tt&amp;gt;$DATAPATH&amp;lt;/tt&amp;gt; directory. This is where SCons places database &amp;quot;.sconsign&amp;quot; files for its dependencies (according to the rules in &amp;lt;tt&amp;gt;rsf.proj&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;rsf.tex&amp;lt;/tt&amp;gt;).&lt;br /&gt;
* If &amp;lt;tt&amp;gt;scons&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;scons install&amp;lt;/tt&amp;gt; fail due to an a bug introduced in a tool you are certain you will not use, a quick workaround for the problem is already built into scons: the &amp;lt;tt&amp;gt;-k&amp;lt;/tt&amp;gt; option, which means &amp;quot;keep going&amp;quot;. Thus, if you use &amp;lt;tt&amp;gt;scons -k&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;scons -k install&amp;lt;/tt&amp;gt;, SCons will not be able to build the failed component, or anything that depends on it, but it will keep going and make everything else that it can.&lt;br /&gt;
&lt;br /&gt;
=Further support=&lt;br /&gt;
Subscribe to the [https://lists.sourceforge.net/lists/listinfo/rsf-user rsf-user mailing list].&lt;/div&gt;</summary>
		<author><name>Karl</name></author>
	</entry>
	<entry>
		<id>https://ahay.org/index.php?title=WWHouston2018&amp;diff=3700</id>
		<title>WWHouston2018</title>
		<link rel="alternate" type="text/html" href="https://ahay.org/index.php?title=WWHouston2018&amp;diff=3700"/>
		<updated>2018-04-03T17:46:51Z</updated>

		<summary type="html">&lt;p&gt;Karl: Redirected page to HoustonWW 2018 i&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[HoustonWW_2018_i]]&lt;/div&gt;</summary>
		<author><name>Karl</name></author>
	</entry>
	<entry>
		<id>https://ahay.org/index.php?title=HoustonWW_2018_i&amp;diff=3699</id>
		<title>HoustonWW 2018 i</title>
		<link rel="alternate" type="text/html" href="https://ahay.org/index.php?title=HoustonWW_2018_i&amp;diff=3699"/>
		<updated>2018-04-02T22:48:25Z</updated>

		<summary type="html">&lt;p&gt;Karl: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==SEG Working Workshop - Python and Julia for Geophysics - August 8-11, 2018==&lt;br /&gt;
&lt;br /&gt;
[[Working Workshops]] as opposed to &amp;quot;talking workshops&amp;quot; are meetings where the participants work in small teams to develop new software code or to conduct computational experiments addressing a particular problem.  This workshop asks participants to create small groups to identify and address obstacles to more widespread use of Python and Julia in the geophysical community.  Results will be shared in lighting talks and code repositories.&lt;br /&gt;
&lt;br /&gt;
==Objective==&lt;br /&gt;
Python and Julia are good languages for prototyping and applying selected processing.  Lack of good examples that read geophysical data, interface to legacy processing systems, and implement common algorithms are obstacles to more widespread use of these languages in the geophysical community.  The objective of this working workshop is to identify and address these obstacles and promote more widespread use of the languages.&lt;br /&gt;
&lt;br /&gt;
Small groups of participants will form at the working workshop to address these issues.  You might work on I/O functions or a processing algorithm.  You might work on interfacing to Madagascar or Seismic Unix. You might want to produce examples of importing data into machine learning systems like tensor flow. Come to the workshop with ideas or listen to ideas presented by others. Create a small group and work on the project for three days.  Share your project at the end of the workshop in a lightning talk (a five minute presentation).  You&#039;re likely learn new skills, get some new ideas, and meet some new people that will help you in the future.  The working workshop is open to beginners and professionals.  &lt;br /&gt;
&lt;br /&gt;
Participants are expected to bring laptops with the software and data they will use during the workshop. Wifi internet access will be available.&lt;br /&gt;
&lt;br /&gt;
This working workshop hopes to provide a forum for geophysicist to learn, contribute, and network.&lt;br /&gt;
&lt;br /&gt;
==[https://docs.google.com/forms/d/e/1FAIpQLSc1W25g5phkB0HXnjiMGhBoTSfkCSctBeY_MWNN3oGK12V_uw/viewform?usp=sf_link  Registration]== &lt;br /&gt;
&lt;br /&gt;
The workshop participation is free but requires an application.  Space is limited.  The application deadline is August 1, 2018.&lt;br /&gt;
[https://docs.google.com/forms/d/e/1FAIpQLSc1W25g5phkB0HXnjiMGhBoTSfkCSctBeY_MWNN3oGK12V_uw/viewform?usp=sf_link Link to the application form]&lt;br /&gt;
&lt;br /&gt;
==Draft agenda==&lt;br /&gt;
*Wednesday afternoon August 8, 2017 3:00-6:00 PM. Optional work session to configure your computer and install open seismic software&lt;br /&gt;
**Do you want help getting your computer up to speed before the working workshop?  Come for informal, one-on-one assistance to:&lt;br /&gt;
*** Install Linux on your computer.&lt;br /&gt;
*** Configure Linux/OSX on your computer.&lt;br /&gt;
*** Install Seismic Unix on your computer&lt;br /&gt;
*** Install Madagascar on your computer.&lt;br /&gt;
*** Install Jupyter and python on your computer.  &lt;br /&gt;
*** Install a virtual Linux system on your Windows computer that will allow you to experiment with a Linux development environment. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Thursday  August 9, 2017 (working workshop starts)&lt;br /&gt;
**8:30-9:00 Coffee&lt;br /&gt;
**9:00-10:00 Introductions, project proposals, and team formations&lt;br /&gt;
**10:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
**1:00-2:00 Group discussion&lt;br /&gt;
**2:00-5:30 Breakout into work teams&lt;br /&gt;
&lt;br /&gt;
*Friday  August 10, 2016&lt;br /&gt;
**8:30-9:00 Coffee. Reform teams.&lt;br /&gt;
**9:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
**1:00-2:00 Group discussion&lt;br /&gt;
**2:00-5:30 Breakout into work teams&lt;br /&gt;
**6:00-8:00 Dinner&lt;br /&gt;
&lt;br /&gt;
*Saturday  August 11, 2016&lt;br /&gt;
**8:30-9:00 Coffee. Reform teams.&lt;br /&gt;
**9:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
** 1:00-2:00 Finalize lightning talks&lt;br /&gt;
**1:00-3:00 Lighting talks&lt;br /&gt;
&lt;br /&gt;
==Contact us==&lt;br /&gt;
If you have some ideas about working workshops, tell us about it!  Send email to [mailto:seismic.working.workshop@gmail.com seismic.working.workshop@gmail.com].&lt;br /&gt;
&lt;br /&gt;
==Location==&lt;br /&gt;
The working workshop with be in Houston.  The location has not been selected.  Possible locations are the University of Houston or UT&#039;s Houston Research Center&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Nearby hotels&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Supporting Organizations==&lt;br /&gt;
===Bureau of Economic Geology, University of Texas at Austin===&lt;br /&gt;
[[Image:Beglogo.jpg]]&lt;br /&gt;
===Society of Exploration Geophysicists===&lt;br /&gt;
[[Image:SEG Logo_Horizontal_SM.png|400px]]&lt;br /&gt;
===SEG Wavelets===&lt;br /&gt;
SEG Wavelets is the University of Houston&#039;s SEG student chapter. It is devoted to promoting education in exploration geophysics. We work with professional organizations, industry professionals, University of Houston faculty, and other student organizations to bring students educational, social, and possible future employment opportunities. More details can be found on our [http://segwavelets.uh.edu/ website].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Karl</name></author>
	</entry>
	<entry>
		<id>https://ahay.org/index.php?title=File:SEG_Logo_Horizontal_SM.png&amp;diff=3698</id>
		<title>File:SEG Logo Horizontal SM.png</title>
		<link rel="alternate" type="text/html" href="https://ahay.org/index.php?title=File:SEG_Logo_Horizontal_SM.png&amp;diff=3698"/>
		<updated>2018-04-02T22:44:25Z</updated>

		<summary type="html">&lt;p&gt;Karl: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Karl</name></author>
	</entry>
	<entry>
		<id>https://ahay.org/index.php?title=Conferences&amp;diff=3697</id>
		<title>Conferences</title>
		<link rel="alternate" type="text/html" href="https://ahay.org/index.php?title=Conferences&amp;diff=3697"/>
		<updated>2018-03-27T12:52:15Z</updated>

		<summary type="html">&lt;p&gt;Karl: /* Schools, Workshops, and Working Workshops */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:Conferences.png|right|]]&lt;br /&gt;
In reverse chronological order.&lt;br /&gt;
&lt;br /&gt;
==Schools, Workshops, and Working Workshops==&lt;br /&gt;
[[HoustonWW2018|SEG Working Workshop - Python and Julia for Geophysics, Houston August 8-11, 2018]]&lt;br /&gt;
&lt;br /&gt;
[[HoustonWW2017|SEG Working Workshop in Houston 2017]]&lt;br /&gt;
&lt;br /&gt;
[[Shanghai_2017|Madagascar School of Reproducible Computational Geophysics Shanghai 2017]]&lt;br /&gt;
&lt;br /&gt;
[[Houston_2017|Madagascar School at the University of Houston 2017]]&lt;br /&gt;
&lt;br /&gt;
[[SEG_3D_Seismic_Processing_Working_Workshop_Houston_2016-_Land_3D|SEG Land 3D Seismic Processing Working Workshop Houston 2016]]&lt;br /&gt;
&lt;br /&gt;
[[Zurich 2016|Madagascar School on Reproducible Computational Geophysics in Zürich 2016]]&lt;br /&gt;
&lt;br /&gt;
[[Vienna_2016|Workshop - Open-source Software in Applied Geosciences Vienna 2016]]&lt;br /&gt;
&lt;br /&gt;
[[Qingdao_2015|Madagascar School for Advanced Users in Qingdao 2015]]&lt;br /&gt;
&lt;br /&gt;
[[SEG 3D Seismic Processing Working Workshop Houston 2015- Land 3D|SEG 3D Land Seismic Processing Working Workshop Houston 2015]]&lt;br /&gt;
&lt;br /&gt;
[[Harbin_2015|School in Harbin 2015]]&lt;br /&gt;
&lt;br /&gt;
[[Houston_2014|Second Madagascar Working Workshop Houston 2014]]&lt;br /&gt;
&lt;br /&gt;
[[Petersburg_2014|Workshop at EAGE/St. Petersburg 2014]]&lt;br /&gt;
&lt;br /&gt;
[[Melbourne_2013|Workshop at ASEG 2013]]&lt;br /&gt;
&lt;br /&gt;
[[Austin_2013|First Madagascar Working Workshop Austin 2013]]&lt;br /&gt;
&lt;br /&gt;
[[Austin_2012|Madagascar School and Workshop on Reproducible Computational Geophysics Austin 2012]]&lt;br /&gt;
&lt;br /&gt;
[[Copenhagen_2012|Workshop - Open-source E&amp;amp;P Software - Six Years Later Copenhagen 2012]]&lt;br /&gt;
&lt;br /&gt;
[[Beijing_2011|Madagascar School of Reproducible Computational Geophysics Beijing 2011]]&lt;br /&gt;
&lt;br /&gt;
[[Houston_2011|Workshop - Open Software Tools for Reproducible Computational Geophysics Houston 2011]]&lt;br /&gt;
&lt;br /&gt;
[[Houston_2010|Madagascar School of Reproducible Computational Geophysics and Hands-On School Houston 2010]]&lt;br /&gt;
&lt;br /&gt;
[[Salvador_2009|Madagascar School on Reproducible Computational Geophysics Salvador 2009]]&lt;br /&gt;
&lt;br /&gt;
[[Delft_2009|Madagascar School on Reproducible Computational Geophysics Delft 2009]]&lt;br /&gt;
&lt;br /&gt;
[[2008_Implementation_Workshop|Towards full automation and better robustness Coding Sprint Golden 2008]] &lt;br /&gt;
&lt;br /&gt;
[[RSF_Austin_School_2007|Using and Extending RSF/Madagascar School Austin 2007]].&lt;br /&gt;
&lt;br /&gt;
[[RSF_School_and_Workshop%2C_Vancouver_2006|Reproducible Research in Computational Geophysics School and Workshop Vancouver 2006]].&lt;br /&gt;
&lt;br /&gt;
==Conference presentations==&lt;br /&gt;
&lt;br /&gt;
===Lausanne 2016 (PASC)===&lt;br /&gt;
&lt;br /&gt;
Two presentations about &amp;lt;tt&amp;gt;Madagascar&amp;lt;/tt&amp;gt; were presented in the minisymposium on &#039;&#039;&#039;Open Source Software (OSS) and High Performance Computing (HPC)&#039;&#039;&#039; at the [http://www.pasc16.org/ Platform for Advanced Scientific Computing] conference in Lausanne, Switzerland, on June 9, 2016. See presentation slides: &lt;br /&gt;
* [http://reproducibility.org/wikilocal/docs/FOMEL-PASC2016.pdf Data-Parallel Processing Using Madagascar Open-Source Software Package] &lt;br /&gt;
* [http://reproducibility.org/wikilocal/docs/POTTER-SHRAGGE-PASC2016.pdf Leveraging the Madagascar Framework for Reproducible Large-scale Cluster and Cloud Computing]&lt;br /&gt;
&lt;br /&gt;
===San Francisco 2015 (AGU)===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;Madagascar&amp;lt;/tt&amp;gt; was presented  in the session on &#039;&#039;&#039;Informatics and Intelligent Systems in Reproducible Geoscience Research&#039;&#039;&#039; at the [http://fallmeeting.agu.org/2015/ AGU Fall Meeting] in San Francisco, California, on December 17, 2015. See presentation [http://reproducibility.org/wikilocal/docs/Madagascar-AGU-2015.pdf slides] and the [https://agu.confex.com/agu/fm15/meetingapp.cgi/Session/10540 session program].&lt;br /&gt;
&lt;br /&gt;
===Stanford 2015 (SIAM Geosciences)===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;Madagascar&amp;lt;/tt&amp;gt; was presented  in the minisymposium on &#039;&#039;&#039;Advances in Software for Computational Geosciences&#039;&#039;&#039; at the [http://www.siam.org/meetings/gs15/ SIAM Conference on Mathematical &amp;amp; Computational Issues in the Geosciences] in Stanford, California, on June 30, 2015. See presentation [http://reproducibility.org/wikilocal/docs/Fomel-SIAM-Geosciences-2015.pdf slides] and the [http://meetings.siam.org/sess/dsp_programsess.cfm?SESSIONCODE=21097 minisymposium program].&lt;br /&gt;
&lt;br /&gt;
===New York 2013 (NYU Poly)===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;Madagascar&amp;lt;/tt&amp;gt; was presented at the Workshop on [http://www.reproduciblescience.org/index.php/Workshop_on_Software_Infrastructure_for_Reproducibility_in_Science_--_May_30th-31st,_2013 Software Infrastructure for Reproducibility in Science] at the Polytechnic Institute of New York University in Brooklyn, New York, on May 30, 2013. See presentation [http://reproducibility.org/wikilocal/docs/Madagascar-NYC.pdf slides]. &lt;br /&gt;
&lt;br /&gt;
The workshop was supported by the [http://www.sloan.org/ Alfred P. Sloan Foundation].  Juliana Freire provides the complete [http://vgc.poly.edu/~juliana/ReproducibleScience/SoftwareInfrastructure/agenda.pdf  workshop program].&lt;br /&gt;
&lt;br /&gt;
===Providence 2012 (ICERM)===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;Madagascar&amp;lt;/tt&amp;gt; was presented at the [http://icerm.brown.edu/tw12-5-rcem Reproducibility in Computational and Experimental Mathematics] Workshop at the Institute for Computational and Experimental Research in Mathematics (ICERM) in Providence, Rhode Island, on December 13, 2012.&lt;br /&gt;
&lt;br /&gt;
See presentation [http://reproducibility.org/wikilocal/docs/ICERM.pptx slides], the complete [http://icerm.brown.edu/tw12-5-rcem workshop program], and Victoria Stodden&#039;s [http://wiki.stodden.net/ICERM_Reproducibility_in_Computational_and_Experimental_Mathematics:_Readings_and_References wiki page].&lt;br /&gt;
&lt;br /&gt;
===Austin 2012 (SciPy)===&lt;br /&gt;
&lt;br /&gt;
The Python interface to &amp;lt;tt&amp;gt;Madagascar&amp;lt;/tt&amp;gt; was presented  at the [http://conference.scipy.org/scipy2012/ Scientific Computing with Python Conference] in Austin, Texas, on July 19, 2012. See the poster by clicking on the image below&lt;br /&gt;
.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:SciPy2012Poster.png|link=http://www.ahay.org/wikilocal/docs/SciPy2012Poster.pdf]]&lt;br /&gt;
&lt;br /&gt;
===Cary 2011 (Interface)===&lt;br /&gt;
&amp;lt;tt&amp;gt;Madagascar&amp;lt;/tt&amp;gt; was presented  in the special session on &#039;&#039;&#039;Reproducible Research&#039;&#039;&#039; at the [http://www.interfacesymposia.org/Interface2011/ 42nd Symposium on the Interface] (Statistical, Machine Learning, and Visualization Algorithms) in Cary, North Carolina, on June 1, 2011. See the [http://www.interfacesymposia.org/Interface2011/Program.pdf symposium program].&lt;br /&gt;
&lt;br /&gt;
===Long Beach 2011 (SIAM Geosciences)===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;Madagascar&amp;lt;/tt&amp;gt; was presented  in the minisymposium on &#039;&#039;&#039;Reproducible Science and Open-Source Software in the Geosciences&#039;&#039;&#039; at the [http://www.siam.org/meetings/gs11/ SIAM Conference on Mathematical &amp;amp; Computational Issues in the Geosciences] in Long Beach, California, on March 23, 2011. See presentation [http://reproducibility.org/wikilocal/docs/longbeach2011.pdf slides] and the minisymposium program: [http://meetings.siam.org/sess/dsp_programsess.cfm?SESSIONCODE=11822 Part 1] and [http://meetings.siam.org/sess/dsp_programsess.cfm?SESSIONCODE=11823 Part 2].&lt;br /&gt;
&lt;br /&gt;
===Reno 2011 (SIAM CS&amp;amp;E)===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;Madagascar&amp;lt;/tt&amp;gt; was presented  in the minisymposium on &#039;&#039;&#039;Verifiable, Reproducible Research and Computational Science&#039;&#039;&#039; at the [http://www.siam.org/meetings/cse11/ SIAM Conference on Computational Science and Engineering] in Reno, Nevada, on March 4, 2011. See presentation [http://reproducibility.org/wikilocal/docs/reno2011.pdf slides]. &lt;br /&gt;
&lt;br /&gt;
Jarrod Millman provides a complete [http://jarrodmillman.com/events/siam2011.html session program].&lt;br /&gt;
&lt;br /&gt;
===Austin 2010 (SciPy)===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;Madagascar&amp;lt;/tt&amp;gt; was presented  at the [http://conference.scipy.org/scipy2010/ Python in Scientific Computing Conference] in Austin, Texas, on July 1, 2010. See presentation [http://reproducibility.org/wikilocal/docs/scipy2010.pdf slides] and [http://conference.scipy.org/scipy2010/schedule.html complete program].&lt;br /&gt;
&lt;br /&gt;
===Salt Lake City 2010 (NSF Archive Workshop)===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;Madagascar&amp;lt;/tt&amp;gt; was presented  at the [http://users.emulab.net/trac/archive10/ NSF Workshop on Archiving Experiments to Raise Scientific Standards] in Salt Lake City on May 25, 2010. See presentation [http://reproducibility.org/wikilocal/docs/slc.pdf slides] and [http://users.emulab.net/trac/archive10/wiki/WorkshopSchedule complete program].&lt;br /&gt;
&lt;br /&gt;
===Düsseldorf 2008 (Berlin 6) ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;Madagascar&amp;lt;/tt&amp;gt; was mentioned in the special session on &#039;&#039;&#039;Open Data and Reproducible Research&#039;&#039;&#039; at the [http://www.berlin6.org/ Berlin 6 Open Access Conference] in Düsseldorf, Germany, on November 12, 2008. See presentation [http://reproducibility.org/wikilocal/docs/Berlin-6.ppt slides]. &lt;br /&gt;
&lt;br /&gt;
Mark Liberman provides a complete [http://ldc.upenn.edu/myl/Berlin6Session5/Overview.html session program].&lt;br /&gt;
&lt;br /&gt;
===Austin 2008 (Texas Python Unconference)===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;New Directions in Literate Programming with Madagascar&#039;&#039; was presented at the Second Annual Texas Python Unconference hosted by Enthought Corporation on the UT campus on October 4, 2008. See presentation [http://www.ig.utexas.edu/people/staff/tobis/MadLiter/madliter.html slides].&lt;br /&gt;
&lt;br /&gt;
===Austin 2008 (Scientific Software Days)===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;Madagascar&amp;lt;/tt&amp;gt; was presented at the Second Annual Scientific Software Days at the University of Texas at Austin on May 15, 2008. See presentation [http://reproducibility.org/wikilocal/docs/ssd2.pdf slides] and [http://www.tacc.utexas.edu/softwareday/ complete program].&lt;br /&gt;
&lt;br /&gt;
===Rio de Janeiro 2007 (SBGf)===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;Madagascar&amp;lt;/tt&amp;gt; and reproducible scientific computing were presented at the 2007  [http://www.sbgf.org.br Congress of the Brazilian Geophysical Society] in Rio de Janeiro. See presentation [http://reproducibility.org/wikilocal/docs/2007_SBGf_ReproducibleScientificComputingUsingMadagascar.pdf slides].&lt;br /&gt;
&lt;br /&gt;
===Vancouver 2007 (AIP)===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;Madagascar&amp;lt;/tt&amp;gt; was presented at a minisymposium on &#039;&#039;&#039;Software for Inverse Problems&#039;&#039;&#039; at the [http://www.pims.math.ca/science/2007/07aip/ Conference on Applied Inverse Problems] in Vancouver on June 29, 2007. See presentation [http://reproducibility.org/wikilocal/docs/Fomel-AIP.ppt slides].&lt;br /&gt;
&lt;br /&gt;
===Honolulu 2007 (ICASSP)===&lt;br /&gt;
&lt;br /&gt;
The paper [http://reproducibility.org/wikilocal/docs/scons.pdf Reproducible computational experiments using SCons] was presented in the [http://www.icassp2007.org/Papers/PublicSessionIndex3.asp?Sessionid=1168 special session] on &#039;&#039;&#039;Reproducible Signal Processing Research&#039;&#039;&#039; at the [http://www.icassp2007.org/ International Conference on Acoustics, Speech, and Signal Processing] in Honolulu on April 18, 2007 . See presentation [http://reproducibility.org/wikilocal/docs/SCons.ppt slides].&lt;br /&gt;
&lt;br /&gt;
Patrick Vandewalle provides a complete [http://lcavwww.epfl.ch/reproducible_research/ICASSP07/ session program].&lt;br /&gt;
&lt;br /&gt;
===Austin 2007 (Scientific Software Day)===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;Madagascar&amp;lt;/tt&amp;gt; was presented at the First Annual Scientific Software Day at the University of Texas at Austin on April 2, 2007. See presentation [http://reproducibility.org/wikilocal/docs/Madagascar-SSD.ppt slides].&lt;br /&gt;
&lt;br /&gt;
===New Orleans 2006 (SEG)===&lt;br /&gt;
&lt;br /&gt;
These advertising posters were prepared for the SEG Annual Meeting in New Orleans. The idea by Gilles Hennenfent, implementation by Scott Rodgers.&lt;br /&gt;
&lt;br /&gt;
[[Image:Poker_comp_BEG.png]] [[Image:Poker_comp_CSM.png]] [[Image:Poker_comp_UBC.png]]&lt;br /&gt;
&lt;br /&gt;
===Vienna 2006 (EAGE)===&lt;br /&gt;
&lt;br /&gt;
RSF/Madagascar was first presented at the EAGE Workshop [http://www.eage.org/events/index.php?evp=274&amp;amp;eventid=1&amp;amp;ActiveMenu=16&amp;amp;Opendivs=s2,s11,s13 Open Source E&amp;amp;P Software – Putting the Pieces Together] in Vienna on June 11, 2006. See presentation [http://reproducibility.org/wikilocal/docs/vienna.pdf slides].&lt;br /&gt;
&lt;br /&gt;
Joe Dellinger provides a complete [http://sepwww.stanford.edu/oldsep/joe/Vienna/ workshop program with abstracts].&lt;/div&gt;</summary>
		<author><name>Karl</name></author>
	</entry>
	<entry>
		<id>https://ahay.org/index.php?title=Main_Page&amp;diff=3696</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://ahay.org/index.php?title=Main_Page&amp;diff=3696"/>
		<updated>2018-03-27T12:50:45Z</updated>

		<summary type="html">&lt;p&gt;Karl: /* Latest News */ add 2018 working workshop&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;big&amp;gt;&#039;&#039;&#039;Madagascar&#039;&#039;&#039;&amp;lt;/big&amp;gt; is an open-source software package for multidimensional data analysis and [[Reproducibility|reproducible]] computational experiments. Its mission is to provide&lt;br /&gt;
* a convenient and powerful environment&lt;br /&gt;
* a convenient technology transfer tool&lt;br /&gt;
for researchers working with digital image and data processing in geophysics and related fields. Technology developed using the Madagascar project management system is transferred in the form of recorded processing histories, which become &amp;quot;computational recipes&amp;quot; to be verified, exchanged, and modified by users of the system.&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
[[Image:Crystal_Clear_app_katomic.png|left|30px|Modern]]&lt;br /&gt;
Madagascar is a &amp;lt;u&amp;gt;modern&amp;lt;/u&amp;gt;  package. Started in 2003 and publicly released in 2006, it was developed almost entirely from scratch. Being a relatively new package, it follows modern software engineering practices such as module encapsulation and test-driven development. A rapid development of a project of this scope (more than 1,000 main programs and more than 5,000 tests) would not be possible without standing on the shoulders of giants and learning from the 30 years of previous experience in open packages such as SEPlib and Seismic Unix. We have borrowed and reimplemented functionality and ideas from these other packages. &lt;br /&gt;
&lt;br /&gt;
[[Image:Crystal_Clear_app_vcalendar.png|left|30px|Test-driven]]&lt;br /&gt;
Madagascar is a &amp;lt;u&amp;gt;test-driven&amp;lt;/u&amp;gt;  package. Test-driven development is not only an agile software programming practice but also a way of bringing scientific foundation to geophysical research that involves numerical experiments. Bringing reproducibility and peer review, the backbone of any real science, to the field of computational geophysics is the main motivation for Madagascar development. The package consists of two levels: low-level main programs (typically developed in the C programming language and working as data filters) and high-level processing flows (described using the Python programming language) that combine main programs and completely document data processing histories for testing and reproducibility. Experience shows that high-level programming is easily mastered even by beginning students who have no previous programming experience. &lt;br /&gt;
&lt;br /&gt;
[[Image:Crystal_Clear_app_gadu.png|left|30px|Open]]&lt;br /&gt;
Madagascar is an &amp;lt;u&amp;gt;open-source&amp;lt;/u&amp;gt;  package. It is distributed under the standard GPL open-source license, which places no restriction on the usage and modification of the code. Moreover, access to modifying the source repository is not controlled by one organization but shared equally among different developers. This enables an open collaboration among different groups spread all over the world, in the true spirit of the open-source movement. &lt;br /&gt;
&lt;br /&gt;
[[Image:Crystal_Clear_filesystem_blockdevice.png|left|30px|Simple,flexible]]&lt;br /&gt;
Madagascar uses a &amp;lt;u&amp;gt;simple, flexible, and universal&amp;lt;/u&amp;gt;  data format that can handle very large datasets but is not tied specifically to seismic data or data of any other particular kind. This &amp;quot;regularly sampled&amp;quot; format is borrowed from the traditional SEPlib. A universal data format allows us to share general-purpose data processing tools with scientists from other disciplines such as petroleum engineers working on large-scale reservoir simulations.&lt;br /&gt;
&lt;br /&gt;
== Latest News ==&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;2&amp;quot; &lt;br /&gt;
| style=&amp;quot;background-color:#ffdead;font-weight:bold;font-style:italic&amp;quot; | Upcoming events: &amp;lt;br&amp;gt;&amp;lt;span style=&amp;quot;text-decoration:underline&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[HoustonWW2018|SEG Working Workshop - Python and Julia for Geophysics, Houston August 8-11, 2018]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{#widget:Feed&lt;br /&gt;
|feedurl=http://ahay.org/blog/feed/&lt;br /&gt;
|num=7&lt;br /&gt;
|desc=100&lt;br /&gt;
|date=n&lt;br /&gt;
|targ=n&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Karl</name></author>
	</entry>
	<entry>
		<id>https://ahay.org/index.php?title=Conferences&amp;diff=3695</id>
		<title>Conferences</title>
		<link rel="alternate" type="text/html" href="https://ahay.org/index.php?title=Conferences&amp;diff=3695"/>
		<updated>2018-03-27T12:44:18Z</updated>

		<summary type="html">&lt;p&gt;Karl: /* Schools, Workshops, and Working Workshops */ add working workshop houston 2018&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:Conferences.png|right|]]&lt;br /&gt;
In reverse chronological order.&lt;br /&gt;
&lt;br /&gt;
==Schools, Workshops, and Working Workshops==&lt;br /&gt;
[[HoustonWW2018|SEG Working Workshop - Python and Julia for Geophysics, Houston 2018]]&lt;br /&gt;
&lt;br /&gt;
[[HoustonWW2017|SEG Working Workshop in Houston 2017]]&lt;br /&gt;
&lt;br /&gt;
[[Shanghai_2017|Madagascar School of Reproducible Computational Geophysics Shanghai 2017]]&lt;br /&gt;
&lt;br /&gt;
[[Houston_2017|Madagascar School at the University of Houston 2017]]&lt;br /&gt;
&lt;br /&gt;
[[SEG_3D_Seismic_Processing_Working_Workshop_Houston_2016-_Land_3D|SEG Land 3D Seismic Processing Working Workshop Houston 2016]]&lt;br /&gt;
&lt;br /&gt;
[[Zurich 2016|Madagascar School on Reproducible Computational Geophysics in Zürich 2016]]&lt;br /&gt;
&lt;br /&gt;
[[Vienna_2016|Workshop - Open-source Software in Applied Geosciences Vienna 2016]]&lt;br /&gt;
&lt;br /&gt;
[[Qingdao_2015|Madagascar School for Advanced Users in Qingdao 2015]]&lt;br /&gt;
&lt;br /&gt;
[[SEG 3D Seismic Processing Working Workshop Houston 2015- Land 3D|SEG 3D Land Seismic Processing Working Workshop Houston 2015]]&lt;br /&gt;
&lt;br /&gt;
[[Harbin_2015|School in Harbin 2015]]&lt;br /&gt;
&lt;br /&gt;
[[Houston_2014|Second Madagascar Working Workshop Houston 2014]]&lt;br /&gt;
&lt;br /&gt;
[[Petersburg_2014|Workshop at EAGE/St. Petersburg 2014]]&lt;br /&gt;
&lt;br /&gt;
[[Melbourne_2013|Workshop at ASEG 2013]]&lt;br /&gt;
&lt;br /&gt;
[[Austin_2013|First Madagascar Working Workshop Austin 2013]]&lt;br /&gt;
&lt;br /&gt;
[[Austin_2012|Madagascar School and Workshop on Reproducible Computational Geophysics Austin 2012]]&lt;br /&gt;
&lt;br /&gt;
[[Copenhagen_2012|Workshop - Open-source E&amp;amp;P Software - Six Years Later Copenhagen 2012]]&lt;br /&gt;
&lt;br /&gt;
[[Beijing_2011|Madagascar School of Reproducible Computational Geophysics Beijing 2011]]&lt;br /&gt;
&lt;br /&gt;
[[Houston_2011|Workshop - Open Software Tools for Reproducible Computational Geophysics Houston 2011]]&lt;br /&gt;
&lt;br /&gt;
[[Houston_2010|Madagascar School of Reproducible Computational Geophysics and Hands-On School Houston 2010]]&lt;br /&gt;
&lt;br /&gt;
[[Salvador_2009|Madagascar School on Reproducible Computational Geophysics Salvador 2009]]&lt;br /&gt;
&lt;br /&gt;
[[Delft_2009|Madagascar School on Reproducible Computational Geophysics Delft 2009]]&lt;br /&gt;
&lt;br /&gt;
[[2008_Implementation_Workshop|Towards full automation and better robustness Coding Sprint Golden 2008]] &lt;br /&gt;
&lt;br /&gt;
[[RSF_Austin_School_2007|Using and Extending RSF/Madagascar School Austin 2007]].&lt;br /&gt;
&lt;br /&gt;
[[RSF_School_and_Workshop%2C_Vancouver_2006|Reproducible Research in Computational Geophysics School and Workshop Vancouver 2006]].&lt;br /&gt;
&lt;br /&gt;
==Conference presentations==&lt;br /&gt;
&lt;br /&gt;
===Lausanne 2016 (PASC)===&lt;br /&gt;
&lt;br /&gt;
Two presentations about &amp;lt;tt&amp;gt;Madagascar&amp;lt;/tt&amp;gt; were presented in the minisymposium on &#039;&#039;&#039;Open Source Software (OSS) and High Performance Computing (HPC)&#039;&#039;&#039; at the [http://www.pasc16.org/ Platform for Advanced Scientific Computing] conference in Lausanne, Switzerland, on June 9, 2016. See presentation slides: &lt;br /&gt;
* [http://reproducibility.org/wikilocal/docs/FOMEL-PASC2016.pdf Data-Parallel Processing Using Madagascar Open-Source Software Package] &lt;br /&gt;
* [http://reproducibility.org/wikilocal/docs/POTTER-SHRAGGE-PASC2016.pdf Leveraging the Madagascar Framework for Reproducible Large-scale Cluster and Cloud Computing]&lt;br /&gt;
&lt;br /&gt;
===San Francisco 2015 (AGU)===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;Madagascar&amp;lt;/tt&amp;gt; was presented  in the session on &#039;&#039;&#039;Informatics and Intelligent Systems in Reproducible Geoscience Research&#039;&#039;&#039; at the [http://fallmeeting.agu.org/2015/ AGU Fall Meeting] in San Francisco, California, on December 17, 2015. See presentation [http://reproducibility.org/wikilocal/docs/Madagascar-AGU-2015.pdf slides] and the [https://agu.confex.com/agu/fm15/meetingapp.cgi/Session/10540 session program].&lt;br /&gt;
&lt;br /&gt;
===Stanford 2015 (SIAM Geosciences)===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;Madagascar&amp;lt;/tt&amp;gt; was presented  in the minisymposium on &#039;&#039;&#039;Advances in Software for Computational Geosciences&#039;&#039;&#039; at the [http://www.siam.org/meetings/gs15/ SIAM Conference on Mathematical &amp;amp; Computational Issues in the Geosciences] in Stanford, California, on June 30, 2015. See presentation [http://reproducibility.org/wikilocal/docs/Fomel-SIAM-Geosciences-2015.pdf slides] and the [http://meetings.siam.org/sess/dsp_programsess.cfm?SESSIONCODE=21097 minisymposium program].&lt;br /&gt;
&lt;br /&gt;
===New York 2013 (NYU Poly)===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;Madagascar&amp;lt;/tt&amp;gt; was presented at the Workshop on [http://www.reproduciblescience.org/index.php/Workshop_on_Software_Infrastructure_for_Reproducibility_in_Science_--_May_30th-31st,_2013 Software Infrastructure for Reproducibility in Science] at the Polytechnic Institute of New York University in Brooklyn, New York, on May 30, 2013. See presentation [http://reproducibility.org/wikilocal/docs/Madagascar-NYC.pdf slides]. &lt;br /&gt;
&lt;br /&gt;
The workshop was supported by the [http://www.sloan.org/ Alfred P. Sloan Foundation].  Juliana Freire provides the complete [http://vgc.poly.edu/~juliana/ReproducibleScience/SoftwareInfrastructure/agenda.pdf  workshop program].&lt;br /&gt;
&lt;br /&gt;
===Providence 2012 (ICERM)===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;Madagascar&amp;lt;/tt&amp;gt; was presented at the [http://icerm.brown.edu/tw12-5-rcem Reproducibility in Computational and Experimental Mathematics] Workshop at the Institute for Computational and Experimental Research in Mathematics (ICERM) in Providence, Rhode Island, on December 13, 2012.&lt;br /&gt;
&lt;br /&gt;
See presentation [http://reproducibility.org/wikilocal/docs/ICERM.pptx slides], the complete [http://icerm.brown.edu/tw12-5-rcem workshop program], and Victoria Stodden&#039;s [http://wiki.stodden.net/ICERM_Reproducibility_in_Computational_and_Experimental_Mathematics:_Readings_and_References wiki page].&lt;br /&gt;
&lt;br /&gt;
===Austin 2012 (SciPy)===&lt;br /&gt;
&lt;br /&gt;
The Python interface to &amp;lt;tt&amp;gt;Madagascar&amp;lt;/tt&amp;gt; was presented  at the [http://conference.scipy.org/scipy2012/ Scientific Computing with Python Conference] in Austin, Texas, on July 19, 2012. See the poster by clicking on the image below&lt;br /&gt;
.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:SciPy2012Poster.png|link=http://www.ahay.org/wikilocal/docs/SciPy2012Poster.pdf]]&lt;br /&gt;
&lt;br /&gt;
===Cary 2011 (Interface)===&lt;br /&gt;
&amp;lt;tt&amp;gt;Madagascar&amp;lt;/tt&amp;gt; was presented  in the special session on &#039;&#039;&#039;Reproducible Research&#039;&#039;&#039; at the [http://www.interfacesymposia.org/Interface2011/ 42nd Symposium on the Interface] (Statistical, Machine Learning, and Visualization Algorithms) in Cary, North Carolina, on June 1, 2011. See the [http://www.interfacesymposia.org/Interface2011/Program.pdf symposium program].&lt;br /&gt;
&lt;br /&gt;
===Long Beach 2011 (SIAM Geosciences)===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;Madagascar&amp;lt;/tt&amp;gt; was presented  in the minisymposium on &#039;&#039;&#039;Reproducible Science and Open-Source Software in the Geosciences&#039;&#039;&#039; at the [http://www.siam.org/meetings/gs11/ SIAM Conference on Mathematical &amp;amp; Computational Issues in the Geosciences] in Long Beach, California, on March 23, 2011. See presentation [http://reproducibility.org/wikilocal/docs/longbeach2011.pdf slides] and the minisymposium program: [http://meetings.siam.org/sess/dsp_programsess.cfm?SESSIONCODE=11822 Part 1] and [http://meetings.siam.org/sess/dsp_programsess.cfm?SESSIONCODE=11823 Part 2].&lt;br /&gt;
&lt;br /&gt;
===Reno 2011 (SIAM CS&amp;amp;E)===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;Madagascar&amp;lt;/tt&amp;gt; was presented  in the minisymposium on &#039;&#039;&#039;Verifiable, Reproducible Research and Computational Science&#039;&#039;&#039; at the [http://www.siam.org/meetings/cse11/ SIAM Conference on Computational Science and Engineering] in Reno, Nevada, on March 4, 2011. See presentation [http://reproducibility.org/wikilocal/docs/reno2011.pdf slides]. &lt;br /&gt;
&lt;br /&gt;
Jarrod Millman provides a complete [http://jarrodmillman.com/events/siam2011.html session program].&lt;br /&gt;
&lt;br /&gt;
===Austin 2010 (SciPy)===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;Madagascar&amp;lt;/tt&amp;gt; was presented  at the [http://conference.scipy.org/scipy2010/ Python in Scientific Computing Conference] in Austin, Texas, on July 1, 2010. See presentation [http://reproducibility.org/wikilocal/docs/scipy2010.pdf slides] and [http://conference.scipy.org/scipy2010/schedule.html complete program].&lt;br /&gt;
&lt;br /&gt;
===Salt Lake City 2010 (NSF Archive Workshop)===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;Madagascar&amp;lt;/tt&amp;gt; was presented  at the [http://users.emulab.net/trac/archive10/ NSF Workshop on Archiving Experiments to Raise Scientific Standards] in Salt Lake City on May 25, 2010. See presentation [http://reproducibility.org/wikilocal/docs/slc.pdf slides] and [http://users.emulab.net/trac/archive10/wiki/WorkshopSchedule complete program].&lt;br /&gt;
&lt;br /&gt;
===Düsseldorf 2008 (Berlin 6) ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;Madagascar&amp;lt;/tt&amp;gt; was mentioned in the special session on &#039;&#039;&#039;Open Data and Reproducible Research&#039;&#039;&#039; at the [http://www.berlin6.org/ Berlin 6 Open Access Conference] in Düsseldorf, Germany, on November 12, 2008. See presentation [http://reproducibility.org/wikilocal/docs/Berlin-6.ppt slides]. &lt;br /&gt;
&lt;br /&gt;
Mark Liberman provides a complete [http://ldc.upenn.edu/myl/Berlin6Session5/Overview.html session program].&lt;br /&gt;
&lt;br /&gt;
===Austin 2008 (Texas Python Unconference)===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;New Directions in Literate Programming with Madagascar&#039;&#039; was presented at the Second Annual Texas Python Unconference hosted by Enthought Corporation on the UT campus on October 4, 2008. See presentation [http://www.ig.utexas.edu/people/staff/tobis/MadLiter/madliter.html slides].&lt;br /&gt;
&lt;br /&gt;
===Austin 2008 (Scientific Software Days)===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;Madagascar&amp;lt;/tt&amp;gt; was presented at the Second Annual Scientific Software Days at the University of Texas at Austin on May 15, 2008. See presentation [http://reproducibility.org/wikilocal/docs/ssd2.pdf slides] and [http://www.tacc.utexas.edu/softwareday/ complete program].&lt;br /&gt;
&lt;br /&gt;
===Rio de Janeiro 2007 (SBGf)===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;Madagascar&amp;lt;/tt&amp;gt; and reproducible scientific computing were presented at the 2007  [http://www.sbgf.org.br Congress of the Brazilian Geophysical Society] in Rio de Janeiro. See presentation [http://reproducibility.org/wikilocal/docs/2007_SBGf_ReproducibleScientificComputingUsingMadagascar.pdf slides].&lt;br /&gt;
&lt;br /&gt;
===Vancouver 2007 (AIP)===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;Madagascar&amp;lt;/tt&amp;gt; was presented at a minisymposium on &#039;&#039;&#039;Software for Inverse Problems&#039;&#039;&#039; at the [http://www.pims.math.ca/science/2007/07aip/ Conference on Applied Inverse Problems] in Vancouver on June 29, 2007. See presentation [http://reproducibility.org/wikilocal/docs/Fomel-AIP.ppt slides].&lt;br /&gt;
&lt;br /&gt;
===Honolulu 2007 (ICASSP)===&lt;br /&gt;
&lt;br /&gt;
The paper [http://reproducibility.org/wikilocal/docs/scons.pdf Reproducible computational experiments using SCons] was presented in the [http://www.icassp2007.org/Papers/PublicSessionIndex3.asp?Sessionid=1168 special session] on &#039;&#039;&#039;Reproducible Signal Processing Research&#039;&#039;&#039; at the [http://www.icassp2007.org/ International Conference on Acoustics, Speech, and Signal Processing] in Honolulu on April 18, 2007 . See presentation [http://reproducibility.org/wikilocal/docs/SCons.ppt slides].&lt;br /&gt;
&lt;br /&gt;
Patrick Vandewalle provides a complete [http://lcavwww.epfl.ch/reproducible_research/ICASSP07/ session program].&lt;br /&gt;
&lt;br /&gt;
===Austin 2007 (Scientific Software Day)===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;Madagascar&amp;lt;/tt&amp;gt; was presented at the First Annual Scientific Software Day at the University of Texas at Austin on April 2, 2007. See presentation [http://reproducibility.org/wikilocal/docs/Madagascar-SSD.ppt slides].&lt;br /&gt;
&lt;br /&gt;
===New Orleans 2006 (SEG)===&lt;br /&gt;
&lt;br /&gt;
These advertising posters were prepared for the SEG Annual Meeting in New Orleans. The idea by Gilles Hennenfent, implementation by Scott Rodgers.&lt;br /&gt;
&lt;br /&gt;
[[Image:Poker_comp_BEG.png]] [[Image:Poker_comp_CSM.png]] [[Image:Poker_comp_UBC.png]]&lt;br /&gt;
&lt;br /&gt;
===Vienna 2006 (EAGE)===&lt;br /&gt;
&lt;br /&gt;
RSF/Madagascar was first presented at the EAGE Workshop [http://www.eage.org/events/index.php?evp=274&amp;amp;eventid=1&amp;amp;ActiveMenu=16&amp;amp;Opendivs=s2,s11,s13 Open Source E&amp;amp;P Software – Putting the Pieces Together] in Vienna on June 11, 2006. See presentation [http://reproducibility.org/wikilocal/docs/vienna.pdf slides].&lt;br /&gt;
&lt;br /&gt;
Joe Dellinger provides a complete [http://sepwww.stanford.edu/oldsep/joe/Vienna/ workshop program with abstracts].&lt;/div&gt;</summary>
		<author><name>Karl</name></author>
	</entry>
	<entry>
		<id>https://ahay.org/index.php?title=Conferences&amp;diff=3694</id>
		<title>Conferences</title>
		<link rel="alternate" type="text/html" href="https://ahay.org/index.php?title=Conferences&amp;diff=3694"/>
		<updated>2018-03-27T12:42:54Z</updated>

		<summary type="html">&lt;p&gt;Karl: /* Schools, Workshops, and Working Workshops */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:Conferences.png|right|]]&lt;br /&gt;
In reverse chronological order.&lt;br /&gt;
&lt;br /&gt;
==Schools, Workshops, and Working Workshops==&lt;br /&gt;
[[HoustonWW2018|SEG Working Workshop in Houston 2018]]&lt;br /&gt;
&lt;br /&gt;
[[HoustonWW2017|SEG Working Workshop in Houston 2017]]&lt;br /&gt;
&lt;br /&gt;
[[Shanghai_2017|Madagascar School of Reproducible Computational Geophysics Shanghai 2017]]&lt;br /&gt;
&lt;br /&gt;
[[Houston_2017|Madagascar School at the University of Houston 2017]]&lt;br /&gt;
&lt;br /&gt;
[[SEG_3D_Seismic_Processing_Working_Workshop_Houston_2016-_Land_3D|SEG Land 3D Seismic Processing Working Workshop Houston 2016]]&lt;br /&gt;
&lt;br /&gt;
[[Zurich 2016|Madagascar School on Reproducible Computational Geophysics in Zürich 2016]]&lt;br /&gt;
&lt;br /&gt;
[[Vienna_2016|Workshop - Open-source Software in Applied Geosciences Vienna 2016]]&lt;br /&gt;
&lt;br /&gt;
[[Qingdao_2015|Madagascar School for Advanced Users in Qingdao 2015]]&lt;br /&gt;
&lt;br /&gt;
[[SEG 3D Seismic Processing Working Workshop Houston 2015- Land 3D|SEG 3D Land Seismic Processing Working Workshop Houston 2015]]&lt;br /&gt;
&lt;br /&gt;
[[Harbin_2015|School in Harbin 2015]]&lt;br /&gt;
&lt;br /&gt;
[[Houston_2014|Second Madagascar Working Workshop Houston 2014]]&lt;br /&gt;
&lt;br /&gt;
[[Petersburg_2014|Workshop at EAGE/St. Petersburg 2014]]&lt;br /&gt;
&lt;br /&gt;
[[Melbourne_2013|Workshop at ASEG 2013]]&lt;br /&gt;
&lt;br /&gt;
[[Austin_2013|First Madagascar Working Workshop Austin 2013]]&lt;br /&gt;
&lt;br /&gt;
[[Austin_2012|Madagascar School and Workshop on Reproducible Computational Geophysics Austin 2012]]&lt;br /&gt;
&lt;br /&gt;
[[Copenhagen_2012|Workshop - Open-source E&amp;amp;P Software - Six Years Later Copenhagen 2012]]&lt;br /&gt;
&lt;br /&gt;
[[Beijing_2011|Madagascar School of Reproducible Computational Geophysics Beijing 2011]]&lt;br /&gt;
&lt;br /&gt;
[[Houston_2011|Workshop - Open Software Tools for Reproducible Computational Geophysics Houston 2011]]&lt;br /&gt;
&lt;br /&gt;
[[Houston_2010|Madagascar School of Reproducible Computational Geophysics and Hands-On School Houston 2010]]&lt;br /&gt;
&lt;br /&gt;
[[Salvador_2009|Madagascar School on Reproducible Computational Geophysics Salvador 2009]]&lt;br /&gt;
&lt;br /&gt;
[[Delft_2009|Madagascar School on Reproducible Computational Geophysics Delft 2009]]&lt;br /&gt;
&lt;br /&gt;
[[2008_Implementation_Workshop|Towards full automation and better robustness Coding Sprint Golden 2008]] &lt;br /&gt;
&lt;br /&gt;
[[RSF_Austin_School_2007|Using and Extending RSF/Madagascar School Austin 2007]].&lt;br /&gt;
&lt;br /&gt;
[[RSF_School_and_Workshop%2C_Vancouver_2006|Reproducible Research in Computational Geophysics School and Workshop Vancouver 2006]].&lt;br /&gt;
&lt;br /&gt;
==Conference presentations==&lt;br /&gt;
&lt;br /&gt;
===Lausanne 2016 (PASC)===&lt;br /&gt;
&lt;br /&gt;
Two presentations about &amp;lt;tt&amp;gt;Madagascar&amp;lt;/tt&amp;gt; were presented in the minisymposium on &#039;&#039;&#039;Open Source Software (OSS) and High Performance Computing (HPC)&#039;&#039;&#039; at the [http://www.pasc16.org/ Platform for Advanced Scientific Computing] conference in Lausanne, Switzerland, on June 9, 2016. See presentation slides: &lt;br /&gt;
* [http://reproducibility.org/wikilocal/docs/FOMEL-PASC2016.pdf Data-Parallel Processing Using Madagascar Open-Source Software Package] &lt;br /&gt;
* [http://reproducibility.org/wikilocal/docs/POTTER-SHRAGGE-PASC2016.pdf Leveraging the Madagascar Framework for Reproducible Large-scale Cluster and Cloud Computing]&lt;br /&gt;
&lt;br /&gt;
===San Francisco 2015 (AGU)===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;Madagascar&amp;lt;/tt&amp;gt; was presented  in the session on &#039;&#039;&#039;Informatics and Intelligent Systems in Reproducible Geoscience Research&#039;&#039;&#039; at the [http://fallmeeting.agu.org/2015/ AGU Fall Meeting] in San Francisco, California, on December 17, 2015. See presentation [http://reproducibility.org/wikilocal/docs/Madagascar-AGU-2015.pdf slides] and the [https://agu.confex.com/agu/fm15/meetingapp.cgi/Session/10540 session program].&lt;br /&gt;
&lt;br /&gt;
===Stanford 2015 (SIAM Geosciences)===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;Madagascar&amp;lt;/tt&amp;gt; was presented  in the minisymposium on &#039;&#039;&#039;Advances in Software for Computational Geosciences&#039;&#039;&#039; at the [http://www.siam.org/meetings/gs15/ SIAM Conference on Mathematical &amp;amp; Computational Issues in the Geosciences] in Stanford, California, on June 30, 2015. See presentation [http://reproducibility.org/wikilocal/docs/Fomel-SIAM-Geosciences-2015.pdf slides] and the [http://meetings.siam.org/sess/dsp_programsess.cfm?SESSIONCODE=21097 minisymposium program].&lt;br /&gt;
&lt;br /&gt;
===New York 2013 (NYU Poly)===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;Madagascar&amp;lt;/tt&amp;gt; was presented at the Workshop on [http://www.reproduciblescience.org/index.php/Workshop_on_Software_Infrastructure_for_Reproducibility_in_Science_--_May_30th-31st,_2013 Software Infrastructure for Reproducibility in Science] at the Polytechnic Institute of New York University in Brooklyn, New York, on May 30, 2013. See presentation [http://reproducibility.org/wikilocal/docs/Madagascar-NYC.pdf slides]. &lt;br /&gt;
&lt;br /&gt;
The workshop was supported by the [http://www.sloan.org/ Alfred P. Sloan Foundation].  Juliana Freire provides the complete [http://vgc.poly.edu/~juliana/ReproducibleScience/SoftwareInfrastructure/agenda.pdf  workshop program].&lt;br /&gt;
&lt;br /&gt;
===Providence 2012 (ICERM)===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;Madagascar&amp;lt;/tt&amp;gt; was presented at the [http://icerm.brown.edu/tw12-5-rcem Reproducibility in Computational and Experimental Mathematics] Workshop at the Institute for Computational and Experimental Research in Mathematics (ICERM) in Providence, Rhode Island, on December 13, 2012.&lt;br /&gt;
&lt;br /&gt;
See presentation [http://reproducibility.org/wikilocal/docs/ICERM.pptx slides], the complete [http://icerm.brown.edu/tw12-5-rcem workshop program], and Victoria Stodden&#039;s [http://wiki.stodden.net/ICERM_Reproducibility_in_Computational_and_Experimental_Mathematics:_Readings_and_References wiki page].&lt;br /&gt;
&lt;br /&gt;
===Austin 2012 (SciPy)===&lt;br /&gt;
&lt;br /&gt;
The Python interface to &amp;lt;tt&amp;gt;Madagascar&amp;lt;/tt&amp;gt; was presented  at the [http://conference.scipy.org/scipy2012/ Scientific Computing with Python Conference] in Austin, Texas, on July 19, 2012. See the poster by clicking on the image below&lt;br /&gt;
.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:SciPy2012Poster.png|link=http://www.ahay.org/wikilocal/docs/SciPy2012Poster.pdf]]&lt;br /&gt;
&lt;br /&gt;
===Cary 2011 (Interface)===&lt;br /&gt;
&amp;lt;tt&amp;gt;Madagascar&amp;lt;/tt&amp;gt; was presented  in the special session on &#039;&#039;&#039;Reproducible Research&#039;&#039;&#039; at the [http://www.interfacesymposia.org/Interface2011/ 42nd Symposium on the Interface] (Statistical, Machine Learning, and Visualization Algorithms) in Cary, North Carolina, on June 1, 2011. See the [http://www.interfacesymposia.org/Interface2011/Program.pdf symposium program].&lt;br /&gt;
&lt;br /&gt;
===Long Beach 2011 (SIAM Geosciences)===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;Madagascar&amp;lt;/tt&amp;gt; was presented  in the minisymposium on &#039;&#039;&#039;Reproducible Science and Open-Source Software in the Geosciences&#039;&#039;&#039; at the [http://www.siam.org/meetings/gs11/ SIAM Conference on Mathematical &amp;amp; Computational Issues in the Geosciences] in Long Beach, California, on March 23, 2011. See presentation [http://reproducibility.org/wikilocal/docs/longbeach2011.pdf slides] and the minisymposium program: [http://meetings.siam.org/sess/dsp_programsess.cfm?SESSIONCODE=11822 Part 1] and [http://meetings.siam.org/sess/dsp_programsess.cfm?SESSIONCODE=11823 Part 2].&lt;br /&gt;
&lt;br /&gt;
===Reno 2011 (SIAM CS&amp;amp;E)===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;Madagascar&amp;lt;/tt&amp;gt; was presented  in the minisymposium on &#039;&#039;&#039;Verifiable, Reproducible Research and Computational Science&#039;&#039;&#039; at the [http://www.siam.org/meetings/cse11/ SIAM Conference on Computational Science and Engineering] in Reno, Nevada, on March 4, 2011. See presentation [http://reproducibility.org/wikilocal/docs/reno2011.pdf slides]. &lt;br /&gt;
&lt;br /&gt;
Jarrod Millman provides a complete [http://jarrodmillman.com/events/siam2011.html session program].&lt;br /&gt;
&lt;br /&gt;
===Austin 2010 (SciPy)===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;Madagascar&amp;lt;/tt&amp;gt; was presented  at the [http://conference.scipy.org/scipy2010/ Python in Scientific Computing Conference] in Austin, Texas, on July 1, 2010. See presentation [http://reproducibility.org/wikilocal/docs/scipy2010.pdf slides] and [http://conference.scipy.org/scipy2010/schedule.html complete program].&lt;br /&gt;
&lt;br /&gt;
===Salt Lake City 2010 (NSF Archive Workshop)===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;Madagascar&amp;lt;/tt&amp;gt; was presented  at the [http://users.emulab.net/trac/archive10/ NSF Workshop on Archiving Experiments to Raise Scientific Standards] in Salt Lake City on May 25, 2010. See presentation [http://reproducibility.org/wikilocal/docs/slc.pdf slides] and [http://users.emulab.net/trac/archive10/wiki/WorkshopSchedule complete program].&lt;br /&gt;
&lt;br /&gt;
===Düsseldorf 2008 (Berlin 6) ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;Madagascar&amp;lt;/tt&amp;gt; was mentioned in the special session on &#039;&#039;&#039;Open Data and Reproducible Research&#039;&#039;&#039; at the [http://www.berlin6.org/ Berlin 6 Open Access Conference] in Düsseldorf, Germany, on November 12, 2008. See presentation [http://reproducibility.org/wikilocal/docs/Berlin-6.ppt slides]. &lt;br /&gt;
&lt;br /&gt;
Mark Liberman provides a complete [http://ldc.upenn.edu/myl/Berlin6Session5/Overview.html session program].&lt;br /&gt;
&lt;br /&gt;
===Austin 2008 (Texas Python Unconference)===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;New Directions in Literate Programming with Madagascar&#039;&#039; was presented at the Second Annual Texas Python Unconference hosted by Enthought Corporation on the UT campus on October 4, 2008. See presentation [http://www.ig.utexas.edu/people/staff/tobis/MadLiter/madliter.html slides].&lt;br /&gt;
&lt;br /&gt;
===Austin 2008 (Scientific Software Days)===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;Madagascar&amp;lt;/tt&amp;gt; was presented at the Second Annual Scientific Software Days at the University of Texas at Austin on May 15, 2008. See presentation [http://reproducibility.org/wikilocal/docs/ssd2.pdf slides] and [http://www.tacc.utexas.edu/softwareday/ complete program].&lt;br /&gt;
&lt;br /&gt;
===Rio de Janeiro 2007 (SBGf)===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;Madagascar&amp;lt;/tt&amp;gt; and reproducible scientific computing were presented at the 2007  [http://www.sbgf.org.br Congress of the Brazilian Geophysical Society] in Rio de Janeiro. See presentation [http://reproducibility.org/wikilocal/docs/2007_SBGf_ReproducibleScientificComputingUsingMadagascar.pdf slides].&lt;br /&gt;
&lt;br /&gt;
===Vancouver 2007 (AIP)===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;Madagascar&amp;lt;/tt&amp;gt; was presented at a minisymposium on &#039;&#039;&#039;Software for Inverse Problems&#039;&#039;&#039; at the [http://www.pims.math.ca/science/2007/07aip/ Conference on Applied Inverse Problems] in Vancouver on June 29, 2007. See presentation [http://reproducibility.org/wikilocal/docs/Fomel-AIP.ppt slides].&lt;br /&gt;
&lt;br /&gt;
===Honolulu 2007 (ICASSP)===&lt;br /&gt;
&lt;br /&gt;
The paper [http://reproducibility.org/wikilocal/docs/scons.pdf Reproducible computational experiments using SCons] was presented in the [http://www.icassp2007.org/Papers/PublicSessionIndex3.asp?Sessionid=1168 special session] on &#039;&#039;&#039;Reproducible Signal Processing Research&#039;&#039;&#039; at the [http://www.icassp2007.org/ International Conference on Acoustics, Speech, and Signal Processing] in Honolulu on April 18, 2007 . See presentation [http://reproducibility.org/wikilocal/docs/SCons.ppt slides].&lt;br /&gt;
&lt;br /&gt;
Patrick Vandewalle provides a complete [http://lcavwww.epfl.ch/reproducible_research/ICASSP07/ session program].&lt;br /&gt;
&lt;br /&gt;
===Austin 2007 (Scientific Software Day)===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;Madagascar&amp;lt;/tt&amp;gt; was presented at the First Annual Scientific Software Day at the University of Texas at Austin on April 2, 2007. See presentation [http://reproducibility.org/wikilocal/docs/Madagascar-SSD.ppt slides].&lt;br /&gt;
&lt;br /&gt;
===New Orleans 2006 (SEG)===&lt;br /&gt;
&lt;br /&gt;
These advertising posters were prepared for the SEG Annual Meeting in New Orleans. The idea by Gilles Hennenfent, implementation by Scott Rodgers.&lt;br /&gt;
&lt;br /&gt;
[[Image:Poker_comp_BEG.png]] [[Image:Poker_comp_CSM.png]] [[Image:Poker_comp_UBC.png]]&lt;br /&gt;
&lt;br /&gt;
===Vienna 2006 (EAGE)===&lt;br /&gt;
&lt;br /&gt;
RSF/Madagascar was first presented at the EAGE Workshop [http://www.eage.org/events/index.php?evp=274&amp;amp;eventid=1&amp;amp;ActiveMenu=16&amp;amp;Opendivs=s2,s11,s13 Open Source E&amp;amp;P Software – Putting the Pieces Together] in Vienna on June 11, 2006. See presentation [http://reproducibility.org/wikilocal/docs/vienna.pdf slides].&lt;br /&gt;
&lt;br /&gt;
Joe Dellinger provides a complete [http://sepwww.stanford.edu/oldsep/joe/Vienna/ workshop program with abstracts].&lt;/div&gt;</summary>
		<author><name>Karl</name></author>
	</entry>
	<entry>
		<id>https://ahay.org/index.php?title=HoustonWW_2018_i&amp;diff=3693</id>
		<title>HoustonWW 2018 i</title>
		<link rel="alternate" type="text/html" href="https://ahay.org/index.php?title=HoustonWW_2018_i&amp;diff=3693"/>
		<updated>2018-03-22T21:15:03Z</updated>

		<summary type="html">&lt;p&gt;Karl: /* Objective */ Minor grammer changes&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==SEG Working Workshop - Python and Julia for Geophysics - August 8-11, 2018==&lt;br /&gt;
&lt;br /&gt;
[[Working Workshops]] as opposed to &amp;quot;talking workshops&amp;quot; are meetings where the participants work in small teams to develop new software code or to conduct computational experiments addressing a particular problem.  This workshop asks participants to create small groups to identify and address obstacles to more widespread use of Python and Julia in the geophysical community.  Results will be shared in lighting talks and code repositories.&lt;br /&gt;
&lt;br /&gt;
==Objective==&lt;br /&gt;
Python and Julia are good languages for prototyping and applying selected processing.  Lack of good examples that read geophysical data, interface to legacy processing systems, and implement common algorithms are obstacles to more widespread use of these languages in the geophysical community.  The objective of this working workshop is to identify and address these obstacles and promote more widespread use of the languages.&lt;br /&gt;
&lt;br /&gt;
Small groups of participants will form at the working workshop to address these issues.  You might work on I/O functions or a processing algorithm.  You might work on interfacing to Madagascar or Seismic Unix. You might want to produce examples of importing data into machine learning systems like tensor flow. Come to the workshop with ideas or listen to ideas presented by others. Create a small group and work on the project for three days.  Share your project at the end of the workshop in a lightning talk (a five minute presentation).  You&#039;re likely learn new skills, get some new ideas, and meet some new people that will help you in the future.  The working workshop is open to beginners and professionals.  &lt;br /&gt;
&lt;br /&gt;
Participants are expected to bring laptops with the software and data they will use during the workshop. Wifi internet access will be available.&lt;br /&gt;
&lt;br /&gt;
This working workshop hopes to provide a forum for geophysicist to learn, contribute, and network.&lt;br /&gt;
&lt;br /&gt;
==[https://docs.google.com/forms/d/e/1FAIpQLSc1W25g5phkB0HXnjiMGhBoTSfkCSctBeY_MWNN3oGK12V_uw/viewform?usp=sf_link  Registration]== &lt;br /&gt;
&lt;br /&gt;
The workshop participation is free but requires an application.  Space is limited.  The application deadline is August 1, 2018.&lt;br /&gt;
[https://docs.google.com/forms/d/e/1FAIpQLSc1W25g5phkB0HXnjiMGhBoTSfkCSctBeY_MWNN3oGK12V_uw/viewform?usp=sf_link Link to the application form]&lt;br /&gt;
&lt;br /&gt;
==Draft agenda==&lt;br /&gt;
*Wednesday afternoon August 8, 2017 3:00-6:00 PM. Optional work session to configure your computer and install open seismic software&lt;br /&gt;
**Do you want help getting your computer up to speed before the working workshop?  Come for informal, one-on-one assistance to:&lt;br /&gt;
*** Install Linux on your computer.&lt;br /&gt;
*** Configure Linux/OSX on your computer.&lt;br /&gt;
*** Install Seismic Unix on your computer&lt;br /&gt;
*** Install Madagascar on your computer.&lt;br /&gt;
*** Install Jupyter and python on your computer.  &lt;br /&gt;
*** Install a virtual Linux system on your Windows computer that will allow you to experiment with a Linux development environment. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Thursday  August 9, 2017 (working workshop starts)&lt;br /&gt;
**8:30-9:00 Coffee&lt;br /&gt;
**9:00-10:00 Introductions, project proposals, and team formations&lt;br /&gt;
**10:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
**1:00-2:00 Group discussion&lt;br /&gt;
**2:00-5:30 Breakout into work teams&lt;br /&gt;
&lt;br /&gt;
*Friday  August 10, 2016&lt;br /&gt;
**8:30-9:00 Coffee. Reform teams.&lt;br /&gt;
**9:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
**1:00-2:00 Group discussion&lt;br /&gt;
**2:00-5:30 Breakout into work teams&lt;br /&gt;
**6:00-8:00 Dinner&lt;br /&gt;
&lt;br /&gt;
*Saturday  August 11, 2016&lt;br /&gt;
**8:30-9:00 Coffee. Reform teams.&lt;br /&gt;
**9:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
** 1:00-2:00 Finalize lightning talks&lt;br /&gt;
**1:00-3:00 Lighting talks&lt;br /&gt;
&lt;br /&gt;
==Contact us==&lt;br /&gt;
If you have some ideas about working workshops, tell us about it!  Send email to [mailto:seismic.working.workshop@gmail.com seismic.working.workshop@gmail.com].&lt;br /&gt;
&lt;br /&gt;
==Location==&lt;br /&gt;
The working workshop with be in Houston.  The location has not been selected.  Possible locations are the University of Houston or UT&#039;s Houston Research Center&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Nearby hotels&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Supporting Organizations==&lt;br /&gt;
===Bureau of Economic Geology, University of Texas at Austin===&lt;br /&gt;
[[Image:Beglogo.jpg]]&lt;br /&gt;
===Society of Exploration Geophysicists===&lt;br /&gt;
[[Image:Seglogo.png]]&lt;br /&gt;
&lt;br /&gt;
===SEG Wavelets===&lt;br /&gt;
SEG Wavelets is the University of Houston&#039;s SEG student chapter. It is devoted to promoting education in exploration geophysics. We work with professional organizations, industry professionals, University of Houston faculty, and other student organizations to bring students educational, social, and possible future employment opportunities. More details can be found on our [http://segwavelets.uh.edu/ website].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Karl</name></author>
	</entry>
	<entry>
		<id>https://ahay.org/index.php?title=HoustonWW_2018_i&amp;diff=3692</id>
		<title>HoustonWW 2018 i</title>
		<link rel="alternate" type="text/html" href="https://ahay.org/index.php?title=HoustonWW_2018_i&amp;diff=3692"/>
		<updated>2018-03-22T21:07:04Z</updated>

		<summary type="html">&lt;p&gt;Karl: /* Supporting Organizations */ minor formatting&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==SEG Working Workshop - Python and Julia for Geophysics - August 8-11, 2018==&lt;br /&gt;
&lt;br /&gt;
[[Working Workshops]] as opposed to &amp;quot;talking workshops&amp;quot; are meetings where the participants work in small teams to develop new software code or to conduct computational experiments addressing a particular problem.  This workshop asks participants to create small groups to identify and address obstacles to more widespread use of Python and Julia in the geophysical community.  Results will be shared in lighting talks and code repositories.&lt;br /&gt;
&lt;br /&gt;
==Objective==&lt;br /&gt;
Python and Julia are good languages for prototyping and applying selected processing.  Lack of good examples that read geophysical data, interface to legacy processing systems, and implement common algorithms are obstacles to more widespread use of these languages in the geophysical community.  The objective of this working workshop is to identify and address these obstacles and promote more widespread use of the languages.&lt;br /&gt;
&lt;br /&gt;
Small groups of participants will form at the working workshop to address these issues.  You might work on I/O functions or a processing algorithm.  You might work on interfacing to Madagascar or Seismic Unix.  You might want to produce examples of importing data into machine learning systems like tensor flow.  Come to the workshop with an ideas or listen to ideas presented by others.  Create a small group and work on the project for three days.  Share your project at the end of the workshop in a lightning talk (a five minute presentation).  You&#039;re likely learn new skills, get some new ideas, and meet some new people that will help you in the future.  The working workshop is open to beginners and professionals.  &lt;br /&gt;
&lt;br /&gt;
Participants are expected to bring laptops with the software and data they will use during the workshop. Wifi internet access will be available.&lt;br /&gt;
&lt;br /&gt;
This working workshop hopes to provide a forum for geophysicist to learn, contribute, and network.&lt;br /&gt;
&lt;br /&gt;
==[https://docs.google.com/forms/d/e/1FAIpQLSc1W25g5phkB0HXnjiMGhBoTSfkCSctBeY_MWNN3oGK12V_uw/viewform?usp=sf_link  Registration]== &lt;br /&gt;
&lt;br /&gt;
The workshop participation is free but requires an application.  Space is limited.  The application deadline is August 1, 2018.&lt;br /&gt;
[https://docs.google.com/forms/d/e/1FAIpQLSc1W25g5phkB0HXnjiMGhBoTSfkCSctBeY_MWNN3oGK12V_uw/viewform?usp=sf_link Link to the application form]&lt;br /&gt;
&lt;br /&gt;
==Draft agenda==&lt;br /&gt;
*Wednesday afternoon August 8, 2017 3:00-6:00 PM. Optional work session to configure your computer and install open seismic software&lt;br /&gt;
**Do you want help getting your computer up to speed before the working workshop?  Come for informal, one-on-one assistance to:&lt;br /&gt;
*** Install Linux on your computer.&lt;br /&gt;
*** Configure Linux/OSX on your computer.&lt;br /&gt;
*** Install Seismic Unix on your computer&lt;br /&gt;
*** Install Madagascar on your computer.&lt;br /&gt;
*** Install Jupyter and python on your computer.  &lt;br /&gt;
*** Install a virtual Linux system on your Windows computer that will allow you to experiment with a Linux development environment. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Thursday  August 9, 2017 (working workshop starts)&lt;br /&gt;
**8:30-9:00 Coffee&lt;br /&gt;
**9:00-10:00 Introductions, project proposals, and team formations&lt;br /&gt;
**10:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
**1:00-2:00 Group discussion&lt;br /&gt;
**2:00-5:30 Breakout into work teams&lt;br /&gt;
&lt;br /&gt;
*Friday  August 10, 2016&lt;br /&gt;
**8:30-9:00 Coffee. Reform teams.&lt;br /&gt;
**9:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
**1:00-2:00 Group discussion&lt;br /&gt;
**2:00-5:30 Breakout into work teams&lt;br /&gt;
**6:00-8:00 Dinner&lt;br /&gt;
&lt;br /&gt;
*Saturday  August 11, 2016&lt;br /&gt;
**8:30-9:00 Coffee. Reform teams.&lt;br /&gt;
**9:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
** 1:00-2:00 Finalize lightning talks&lt;br /&gt;
**1:00-3:00 Lighting talks&lt;br /&gt;
&lt;br /&gt;
==Contact us==&lt;br /&gt;
If you have some ideas about working workshops, tell us about it!  Send email to [mailto:seismic.working.workshop@gmail.com seismic.working.workshop@gmail.com].&lt;br /&gt;
&lt;br /&gt;
==Location==&lt;br /&gt;
The working workshop with be in Houston.  The location has not been selected.  Possible locations are the University of Houston or UT&#039;s Houston Research Center&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Nearby hotels&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Supporting Organizations==&lt;br /&gt;
===Bureau of Economic Geology, University of Texas at Austin===&lt;br /&gt;
[[Image:Beglogo.jpg]]&lt;br /&gt;
===Society of Exploration Geophysicists===&lt;br /&gt;
[[Image:Seglogo.png]]&lt;br /&gt;
&lt;br /&gt;
===SEG Wavelets===&lt;br /&gt;
SEG Wavelets is the University of Houston&#039;s SEG student chapter. It is devoted to promoting education in exploration geophysics. We work with professional organizations, industry professionals, University of Houston faculty, and other student organizations to bring students educational, social, and possible future employment opportunities. More details can be found on our [http://segwavelets.uh.edu/ website].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Karl</name></author>
	</entry>
	<entry>
		<id>https://ahay.org/index.php?title=HoustonWW_2018_i&amp;diff=3691</id>
		<title>HoustonWW 2018 i</title>
		<link rel="alternate" type="text/html" href="https://ahay.org/index.php?title=HoustonWW_2018_i&amp;diff=3691"/>
		<updated>2018-03-01T18:16:34Z</updated>

		<summary type="html">&lt;p&gt;Karl: /* Supporting Organizations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==SEG Working Workshop - Python and Julia for Geophysics - August 8-11, 2018==&lt;br /&gt;
&lt;br /&gt;
[[Working Workshops]] as opposed to &amp;quot;talking workshops&amp;quot; are meetings where the participants work in small teams to develop new software code or to conduct computational experiments addressing a particular problem.  This workshop asks participants to create small groups to identify and address obstacles to more widespread use of Python and Julia in the geophysical community.  Results will be shared in lighting talks and code repositories.&lt;br /&gt;
&lt;br /&gt;
==Objective==&lt;br /&gt;
Python and Julia are good languages for prototyping and applying selected processing.  Lack of good examples that read geophysical data, interface to legacy processing systems, and implement common algorithms are obstacles to more widespread use of these languages in the geophysical community.  The objective of this working workshop is to identify and address these obstacles and promote more widespread use of the languages.&lt;br /&gt;
&lt;br /&gt;
Small groups of participants will form at the working workshop to address these issues.  You might work on I/O functions or a processing algorithm.  You might work on interfacing to Madagascar or Seismic Unix.  You might want to produce examples of importing data into machine learning systems like tensor flow.  Come to the workshop with an ideas or listen to ideas presented by others.  Create a small group and work on the project for three days.  Share your project at the end of the workshop in a lightning talk (a five minute presentation).  You&#039;re likely learn new skills, get some new ideas, and meet some new people that will help you in the future.  The working workshop is open to beginners and professionals.  &lt;br /&gt;
&lt;br /&gt;
Participants are expected to bring laptops with the software and data they will use during the workshop. Wifi internet access will be available.&lt;br /&gt;
&lt;br /&gt;
This working workshop hopes to provide a forum for geophysicist to learn, contribute, and network.&lt;br /&gt;
&lt;br /&gt;
==[https://docs.google.com/forms/d/e/1FAIpQLSc1W25g5phkB0HXnjiMGhBoTSfkCSctBeY_MWNN3oGK12V_uw/viewform?usp=sf_link  Registration]== &lt;br /&gt;
&lt;br /&gt;
The workshop participation is free but requires an application.  Space is limited.  The application deadline is August 1, 2018.&lt;br /&gt;
[https://docs.google.com/forms/d/e/1FAIpQLSc1W25g5phkB0HXnjiMGhBoTSfkCSctBeY_MWNN3oGK12V_uw/viewform?usp=sf_link Link to the application form]&lt;br /&gt;
&lt;br /&gt;
==Draft agenda==&lt;br /&gt;
*Wednesday afternoon August 8, 2017 3:00-6:00 PM. Optional work session to configure your computer and install open seismic software&lt;br /&gt;
**Do you want help getting your computer up to speed before the working workshop?  Come for informal, one-on-one assistance to:&lt;br /&gt;
*** Install Linux on your computer.&lt;br /&gt;
*** Configure Linux/OSX on your computer.&lt;br /&gt;
*** Install Seismic Unix on your computer&lt;br /&gt;
*** Install Madagascar on your computer.&lt;br /&gt;
*** Install Jupyter and python on your computer.  &lt;br /&gt;
*** Install a virtual Linux system on your Windows computer that will allow you to experiment with a Linux development environment. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Thursday  August 9, 2017 (working workshop starts)&lt;br /&gt;
**8:30-9:00 Coffee&lt;br /&gt;
**9:00-10:00 Introductions, project proposals, and team formations&lt;br /&gt;
**10:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
**1:00-2:00 Group discussion&lt;br /&gt;
**2:00-5:30 Breakout into work teams&lt;br /&gt;
&lt;br /&gt;
*Friday  August 10, 2016&lt;br /&gt;
**8:30-9:00 Coffee. Reform teams.&lt;br /&gt;
**9:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
**1:00-2:00 Group discussion&lt;br /&gt;
**2:00-5:30 Breakout into work teams&lt;br /&gt;
**6:00-8:00 Dinner&lt;br /&gt;
&lt;br /&gt;
*Saturday  August 11, 2016&lt;br /&gt;
**8:30-9:00 Coffee. Reform teams.&lt;br /&gt;
**9:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
** 1:00-2:00 Finalize lightning talks&lt;br /&gt;
**1:00-3:00 Lighting talks&lt;br /&gt;
&lt;br /&gt;
==Contact us==&lt;br /&gt;
If you have some ideas about working workshops, tell us about it!  Send email to [mailto:seismic.working.workshop@gmail.com seismic.working.workshop@gmail.com].&lt;br /&gt;
&lt;br /&gt;
==Location==&lt;br /&gt;
The working workshop with be in Houston.  The location has not been selected.  Possible locations are the University of Houston or UT&#039;s Houston Research Center&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Nearby hotels&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Supporting Organizations==&lt;br /&gt;
&lt;br /&gt;
[[Image:Beglogo.jpg]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Seglogo.png]]&lt;br /&gt;
&lt;br /&gt;
===SEG Wavelets===&lt;br /&gt;
SEG Wavelets is the University of Houston&#039;s SEG student chapter. It is devoted to promoting education in exploration geophysics. We work with professional organizations, industry professionals, University of Houston faculty, and other student organizations to bring students educational, social, and possible future employment opportunities. More details can be found on our [http://segwavelets.uh.edu/ website].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Karl</name></author>
	</entry>
	<entry>
		<id>https://ahay.org/index.php?title=HoustonWW_2018_i&amp;diff=3690</id>
		<title>HoustonWW 2018 i</title>
		<link rel="alternate" type="text/html" href="https://ahay.org/index.php?title=HoustonWW_2018_i&amp;diff=3690"/>
		<updated>2018-03-01T18:14:09Z</updated>

		<summary type="html">&lt;p&gt;Karl: /* Objective */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==SEG Working Workshop - Python and Julia for Geophysics - August 8-11, 2018==&lt;br /&gt;
&lt;br /&gt;
[[Working Workshops]] as opposed to &amp;quot;talking workshops&amp;quot; are meetings where the participants work in small teams to develop new software code or to conduct computational experiments addressing a particular problem.  This workshop asks participants to create small groups to identify and address obstacles to more widespread use of Python and Julia in the geophysical community.  Results will be shared in lighting talks and code repositories.&lt;br /&gt;
&lt;br /&gt;
==Objective==&lt;br /&gt;
Python and Julia are good languages for prototyping and applying selected processing.  Lack of good examples that read geophysical data, interface to legacy processing systems, and implement common algorithms are obstacles to more widespread use of these languages in the geophysical community.  The objective of this working workshop is to identify and address these obstacles and promote more widespread use of the languages.&lt;br /&gt;
&lt;br /&gt;
Small groups of participants will form at the working workshop to address these issues.  You might work on I/O functions or a processing algorithm.  You might work on interfacing to Madagascar or Seismic Unix.  You might want to produce examples of importing data into machine learning systems like tensor flow.  Come to the workshop with an ideas or listen to ideas presented by others.  Create a small group and work on the project for three days.  Share your project at the end of the workshop in a lightning talk (a five minute presentation).  You&#039;re likely learn new skills, get some new ideas, and meet some new people that will help you in the future.  The working workshop is open to beginners and professionals.  &lt;br /&gt;
&lt;br /&gt;
Participants are expected to bring laptops with the software and data they will use during the workshop. Wifi internet access will be available.&lt;br /&gt;
&lt;br /&gt;
This working workshop hopes to provide a forum for geophysicist to learn, contribute, and network.&lt;br /&gt;
&lt;br /&gt;
==[https://docs.google.com/forms/d/e/1FAIpQLSc1W25g5phkB0HXnjiMGhBoTSfkCSctBeY_MWNN3oGK12V_uw/viewform?usp=sf_link  Registration]== &lt;br /&gt;
&lt;br /&gt;
The workshop participation is free but requires an application.  Space is limited.  The application deadline is August 1, 2018.&lt;br /&gt;
[https://docs.google.com/forms/d/e/1FAIpQLSc1W25g5phkB0HXnjiMGhBoTSfkCSctBeY_MWNN3oGK12V_uw/viewform?usp=sf_link Link to the application form]&lt;br /&gt;
&lt;br /&gt;
==Draft agenda==&lt;br /&gt;
*Wednesday afternoon August 8, 2017 3:00-6:00 PM. Optional work session to configure your computer and install open seismic software&lt;br /&gt;
**Do you want help getting your computer up to speed before the working workshop?  Come for informal, one-on-one assistance to:&lt;br /&gt;
*** Install Linux on your computer.&lt;br /&gt;
*** Configure Linux/OSX on your computer.&lt;br /&gt;
*** Install Seismic Unix on your computer&lt;br /&gt;
*** Install Madagascar on your computer.&lt;br /&gt;
*** Install Jupyter and python on your computer.  &lt;br /&gt;
*** Install a virtual Linux system on your Windows computer that will allow you to experiment with a Linux development environment. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Thursday  August 9, 2017 (working workshop starts)&lt;br /&gt;
**8:30-9:00 Coffee&lt;br /&gt;
**9:00-10:00 Introductions, project proposals, and team formations&lt;br /&gt;
**10:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
**1:00-2:00 Group discussion&lt;br /&gt;
**2:00-5:30 Breakout into work teams&lt;br /&gt;
&lt;br /&gt;
*Friday  August 10, 2016&lt;br /&gt;
**8:30-9:00 Coffee. Reform teams.&lt;br /&gt;
**9:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
**1:00-2:00 Group discussion&lt;br /&gt;
**2:00-5:30 Breakout into work teams&lt;br /&gt;
**6:00-8:00 Dinner&lt;br /&gt;
&lt;br /&gt;
*Saturday  August 11, 2016&lt;br /&gt;
**8:30-9:00 Coffee. Reform teams.&lt;br /&gt;
**9:00-12:00 Breakout into work teams&lt;br /&gt;
**12:00-1:00 Lunch (provided)&lt;br /&gt;
** 1:00-2:00 Finalize lightning talks&lt;br /&gt;
**1:00-3:00 Lighting talks&lt;br /&gt;
&lt;br /&gt;
==Contact us==&lt;br /&gt;
If you have some ideas about working workshops, tell us about it!  Send email to [mailto:seismic.working.workshop@gmail.com seismic.working.workshop@gmail.com].&lt;br /&gt;
&lt;br /&gt;
==Location==&lt;br /&gt;
The working workshop with be in Houston.  The location has not been selected.  Possible locations are the University of Houston or UT&#039;s Houston Research Center&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Nearby hotels&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Supporting Organizations==&lt;br /&gt;
&lt;br /&gt;
[[Image:Beglogo.jpg]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Seglogo.png]]&lt;br /&gt;
&lt;br /&gt;
===SEG Wavelets===&lt;br /&gt;
SEG Wavelets is the University of Houston&#039;s SEG student chapter. It is devoted to promoting education in exploration geophysics. We work with professional organizations, industry professionals, University of Houston faculty, and other student organizations to bring students educational, social, and possible future employment opportunities. More details can be found on our [http://segwavelets.uh.edu/ website].&lt;br /&gt;
&lt;br /&gt;
[[Image:Ricelogo.jpg|left]] [[Image:TRIP.png]] [http://www.trip.caam.rice.edu/ The Rice Inversion Project]&amp;lt;br&amp;gt;&lt;br /&gt;
Department of Computational and Applied Mathematics&amp;lt;br&amp;gt;&lt;br /&gt;
Rice University&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Karl</name></author>
	</entry>
</feed>