Installation: Difference between revisions

From Madagascar
Jump to navigation Jump to search
Fomels (talk | contribs)
 
(56 intermediate revisions by 6 users not shown)
Line 1: Line 1:
[[Image:Fotolia_4727725_XS.jpg|right|]]
[[Image:Fotolia_4727725_XS.jpg|right|]]
Madagascar has been installed and is periodically tested on
Madagascar has been installed and is periodically tested on different platforms
 
*Linux distributions (Fedora, RedHat, Ubuntu, etc.)  
*Different Linux distributions (Fedora, RedHat, SuSE, Debian, Ubuntu, Oracle, Mandriva)  
*FreeBSD
*Solaris
*HP-UX
*SGI Irix
*MacOS X  
*MacOS X  
*Windows under the [http://www.cygwin.com/ Cygwin] environment and  under Microsoft's [http://www.microsoft.com/technet/interopmigration/unix/sfu/default.mspx Services for UNIX] environment.  
*Windows under the [http://www.cygwin.com/ Cygwin] environment.


<font size="-1">''This page was created from the LaTeX source in [http://rsf.svn.sourceforge.net/viewvc/rsf/trunk/book/rsf/rsf/install.tex?view=markup book/rsf/rsf/install.tex] using [[latex2wiki]]''</font>


==Precompiled binary packages==
==Precompiled binary packages==


A precompiled binary package of the latest Madagascar stable release exists for Mac OS X.  See the [[Download|Madagascar download page]] for details.
See the [[Download|Madagascar download page]] for the availability of binary packages.


==Installation from source==
==Installation from source==
===Platform-specific instructions===
[[Windows|Specific instructions are provided]] for '''Windows''' users.
Please consult the [[Advanced Installation#Platform-specific_installation_advice|Advanced Installation]] guide for other platform-specific instructions.


===Prerequisites===
===Prerequisites===
    
    
#C compiler. Any ANSI-compliant compiler such as [http://gcc.gnu.org/ GCC] should work. GCC usually comes pre-installed on Linux machines.  
#C compiler. Any ANSI-compliant compiler such as [http://gcc.gnu.org/ GCC] should work. GCC usually comes pre-installed on Linux machines.  
#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. Madagascar currently attempts to support Python versions 2.2 through 2.6.  Versions before 2.2 are probably not common, but if you experience problems and you have an earlier version you should probably upgrade.
#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. Madagascar supports Python 3.
 
Each API option has [[Advanced Installation#Dependencies|its own prerequisites]].


SCons is also required, but it is included with Madagascar and the configure scripts will attempt to install it for you if you don't have it already. For more information see the [[Advanced Installation#Prerequisites|Advanced Installation]] guide.
Prerequisites for optional add-on functionality are [[Advanced Installation#Platform specific installation advice|platform-specific]].  


Each API option has [[Advanced Installation#Dependencies|its own prerequisites]].
[[Windows|Building under cygwin on Windows]] requires several preparatory steps.


Note that building under cygwin on [[Windows]] requires several preparatory steps.
===General instructions===


===Environmental variables===
# '''Configuration:''' Open a terminal window, change to the top Madagascar source directory, and run <syntaxhighlight lang="bash">./configure --prefix=/directory/where/you/want/madagascar/installed</syntaxhighlight> You can examine the <tt>config.py</tt> file that this command generates. Additional options are available. You can obtain a full list of customizable variables by running <tt>scons -h</tt>. For example, to install Fortran-90 API bindings in addition to the basic package, run <syntaxhighlight lang="bash">./configure API=f90 --prefix=/directory/where/you/want/madagascar/installed</syntaxhighlight> After running <tt>./configure</tt> you may see a list of dependencies that your system does not have installed (the items that have "no" next to them). Most of them are optional. If you decide to install additional packages for your platform, rerun the <tt>./configure</tt> command.
# Set the <tt>RSFROOT</tt> environmental variable to the directory where you want to install Madagascar.  
# '''Building and installing the package:''' Run <syntaxhighlight lang="bash">make install</syntaxhighlight> If you need "root" privileges for installing under <tt>&#36;RSFROOT</tt>, you may need to run <syntaxhighlight lang="bash">make; su; make install</syntaxhighlight> or <syntaxhighlight lang="bash">make; sudo make install</syntaxhighlight> If <tt>make</tt> does not exist on your system, an alternative procedure can be found in the [[#Troubleshooting|Troubleshooting]] section.  
# Set the <tt>PYTHONPATH</tt> environmental variable to include <tt>$RSFROOT/lib</tt>.
# '''User setup:''' If your shell is <tt>sh</tt> or <tt>bash</tt>, add to your <tt>$HOME/.bashrc</tt> and <tt>$HOME/.profile</tt> files the line <syntaxhighlight lang="bash">source ~/RSFSRC/share/madagascar/etc/env.sh</syntaxhighlight> (if used something different in the <tt>--prefix</tt> option to <tt>./configure</tt>, use that instead of ~/RSFSRC). If your shell is <tt>(t)csh</tt>, add to your <tt>$HOME/.cshrc</tt> file the line <syntaxhighlight lang="bash">source ~/RSFSRC/share/madagascar/etc/env.csh</syntaxhighlight> (if used something different in the <tt>--prefix</tt> option to <tt>./configure</tt>, 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 <tt>DATAPATH</tt> 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 <syntaxhighlight lang="bash">export DATAPATH=~/RSFDATA/ </syntaxhighlight> to ~/.bashrc and ~/.profile .
# Add <tt>$RSFROOT/bin</tt> to your <tt>PATH</tt> environmental variable
# Set <tt>DATAPATH</tt> to the directory for temporary data files.  


Example configuration for <tt>csh</tt> and <tt>tcsh</tt>:
==Uninstall==
<pre>
To clean all intermediate files and all installed files, run <pre>scons -c install</pre> or <pre>make distclean</pre> in the source code directory.
setenv RSFROOT /usr/local/rsf
if ($?PYTHONPATH) then
setenv PYTHONPATH ${PYTHONPATH}:$RSFROOT/lib
else
setenv PYTHONPATH $RSFROOT/lib
endif
set path = ($path $RSFROOT/bin)
setenv DATAPATH /var/tmp/
</pre>
Example configuration for <tt>bash</tt>:
<bash>
export RSFROOT=/usr/local/rsf
if [ -n "$PYTHONPATH" ]; then
export PYTHONPATH=${PYTHONPATH}:$RSFROOT/lib
else
export PYTHONPATH=$RSFROOT/lib
fi
export PATH=$PATH:$RSFROOT/bin
export DATAPATH=/var/tmp/
</bash>
Notice the slash at the end of the <tt>DATAPATH</tt> variable.


===Software construction===
==Troubleshooting==
 
===Alternative build/install procedure===
#Configuration. Change to the top source directory and run <pre>./configure</pre> You can examine the <tt>config.py</tt> file that this command generates.  Additional options are available. You can obtain a full list of customizable variables by running <tt>scons -h</tt>. For example, to install C++ and Fortran-90 API bindings in addition to the basic package, run <pre>./configure API=c++,fortran-90</pre>  
# '''Set the environment variables:''' If your shell is <tt>sh</tt> or <tt>bash</tt>, type <syntaxhighlight lang="bash">source env.sh</syntaxhighlight> Else, if your shell is <tt>csh</tt> or <tt>tcsh</tt>, type <syntaxhighlight lang="bash">source env.csh</syntaxhighlight>
#Building and installing the package. Run <tt>scons install</tt> or the following two commands in succession:  <pre>make; make install</pre> or <pre>scons; scons install</pre> If you need "root" privileges for installing under <tt>&#36;RSFROOT</tt>, you may need to run <pre>su; scons install </pre> or <pre>sudo scons install</pre>
# '''Build:''' Type <tt>scons</tt>
#Cleaning. To clean all intermediate files generated by SCons, run <pre>make clean</pre> or <pre>scons -c</pre> To clean all intermediate files and all installed files, run <pre>make distclean</pre> or <pre>scons -c install</pre>
# '''Install:''' Run <tt>scons install</tt> . If you need "root" privileges for installing under <tt>&#36;RSFROOT</tt>, you may need to run <syntaxhighlight lang="bash">su; scons install </syntaxhighlight> or <syntaxhighlight lang="bash">sudo scons install</syntaxhighlight>


===Troubleshooting===
===Other issues===
Note that <tt>scons</tt> does not inherit your environmental variables including <tt>PATH</tt>.  
Note that <tt>scons</tt> does not inherit your environmental variables including <tt>PATH</tt>.  
If the configuration part ends with the message like
If the configuration part ends with the message like
Line 71: Line 50:
checking if cc works ... failed
checking if cc works ... failed
</pre>
</pre>
the problem may be that your compiler is in unusual place. Try
the problem may be that your compiler is in an unusual place. Try
<pre>
<pre>
./configure CC=/full/path/to/cc
./configure CC=/full/path/to/cc
Line 84: Line 63:
</pre>
</pre>


For more information, please consult the [[Advanced Installation]] guide.
Please consult the [[Advanced Installation]] guide for more information.


==Testing and quick start==
==Testing and quick start==


Here are a few simple tests and and a brief introduction to Madagascar:
Here are a few simple tests and a brief introduction to Madagascar:


Typing any Madagascar command in a terminal window without parameters should generate a brief documentation on that command. Try one of the following:
Typing any Madagascar command in a terminal window without parameters should generate brief documentation. Try one of the following:


<pre>
<pre>
Line 100: Line 79:
</pre>
</pre>


If you get an error like "Command not found", you may not have your <tt>&#36;PATH</tt> environment variable set correctly, or you may need to issue the <tt>rehash</tt> command.
If you get an error like "Command not found," you may not have your <tt>&#36;PATH</tt> environment variable set correctly, or you may need to issue the <tt>rehash</tt> command.


Now try making a simple Madagascar data file:
Now try making a simple Madagascar data file:
Line 107: Line 86:
</pre>
</pre>


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
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
<pre>
<pre>
Cannot write to data file /path/spike.rsf@: Bad file descriptor
Cannot write to data file /path/spike.rsf@: Bad file descriptor
Line 113: Line 92:
you may need to create the directory pointed to by your <tt>&#36;DATAPATH</tt> environment variable.
you may need to create the directory pointed to by your <tt>&#36;DATAPATH</tt> environment variable.


The file <tt>spike.rsf</tt> is a text header. The actual data are stored in the binary file pointed to by the <tt>in=</tt> parameter in the header.  You can look at the header file directly with <tt>more</tt>, or better, examine the file properties with
The file <tt>spike.rsf</tt> is a text header. The actual data are stored in the binary file pointed to by the <tt>in=</tt> parameter in the header.  You can look at the header file directly with <tt>more</tt>, or better, examine the file properties with
<pre>
<pre>
sfin spike.rsf
sfin spike.rsf
Line 125: Line 104:
The following command applies a bandpass filter to <tt>spike.rsf</tt> and puts the result in <tt>filter.rsf</tt>:
The following command applies a bandpass filter to <tt>spike.rsf</tt> and puts the result in <tt>filter.rsf</tt>:
<pre>
<pre>
sfbandpass fhi=2 phase=1 < spike.rsf > filter.rsf
sfbandpass fhi=2 phase=y < spike.rsf > filter.rsf
</pre>
</pre>


Line 136: Line 115:


<pre>
<pre>
xtpen < filter.vpl
sfpen < filter.vpl
</pre>
</pre>


Line 142: Line 121:


<pre>
<pre>
sfspike n1=1000 k1=300 | sfbandpass fhi=2 phase=1 | \
sfspike n1=1000 k1=300 | sfbandpass fhi=2 phase=y | \
sfwiggle clip=0.02 title="Welcome to Madagascar" | xtpen
sfwiggle clip=0.02 title="Welcome to Madagascar" | sfpen
</pre>
</pre>


If you have SCons installed, you can use it to automate Madagascar processing. Here is a simple <tt>SConstruct</tt> file to make <tt>filter.rsf</tt> and <tt>filter.vpl</tt>:
If you have SCons installed, you can use it to automate Madagascar processing. Here is a simple <tt>SConstruct</tt> file to make <tt>filter.rsf</tt> and <tt>filter.vpl</tt>:


<python>
<syntaxhighlight lang="python">
#
#
# Setting up
# Setting up
#
#
from rsfproj import *
from rsf.proj import *


#
#
# Make filter.rsf
# Make filter.rsf
#
#
Flow('filter',None,
Flow('filter',None,'spike n1=1000 k1=300 | bandpass fhi=2 phase=y')
    'spike n1=1000 k1=300 | bandpass fhi=2 phase=1')


#
#
# Make filter.vpl
# Make filter.vpl
#
#
Result('filter',
Result('filter','wiggle clip=0.02 title="Welcome to Madagascar"')
      'wiggle clip=0.02 title="Welcome to Madagascar"')


End()
End()
</python>
</syntaxhighlight>


Put the file in an empty directory, give it the name <tt>SConstruct</tt>, <tt>cd</tt> to that directory, and issue the command:
Put the file in an empty directory, give it the name <tt>SConstruct</tt>, <tt>cd</tt> to that directory, and issue the command:
Line 175: Line 152:
</pre>
</pre>


The graphics file is now stored in the <tt>Fig</tt> subdirectory. You can view it manually with:
The graphics file is now stored in the <tt>Fig</tt> subdirectory. You can view it manually with:


<pre>
<pre>
xtpen Fig/filter.vpl
sfpen Fig/filter.vpl
</pre>
</pre>


Line 187: Line 164:
</pre>
</pre>


When an SConstruct file makes more than one graphics file, the  <tt>scons view</tt> command will display all of them in sequence.  
When a SConstruct file makes more than one graphics file, the  <tt>scons view</tt> command will display all of them in sequence.  
[[Image:filter.png|frame|center|Welcome to Madagascar.]]
[[Image:filter.png|frame|center|Welcome to Madagascar.]]
Now edit the <tt>SConstruct</tt> file: change the title string on the <tt>Result</tt> line to "Hello World!", save the file, and rerun the scons command. You will see that scons has figured out that the file <tt>filter.rsf</tt> does not need to be rebuilt because nothing that affects it has changed. Only the file <tt>filter.vpl</tt> is rebuilt.
Now edit the <tt>SConstruct</tt> file: change the title string on the <tt>Result</tt> line to "Hello World!", save the file, and rerun the scons command. You will see that scons has figured out that the file <tt>filter.rsf</tt> does not need to be rebuilt because nothing that affects it has changed. Only the file <tt>filter.vpl</tt> is rebuilt.

Latest revision as of 21:58, 15 October 2024

Madagascar has been installed and is periodically tested on different platforms

  • Linux distributions (Fedora, RedHat, Ubuntu, etc.)
  • MacOS X
  • Windows under the Cygwin environment.


Precompiled binary packages[edit]

See the Madagascar download page for the availability of binary packages.

Installation from source[edit]

Platform-specific instructions[edit]

Specific instructions are provided for Windows users.

Please consult the Advanced Installation guide for other platform-specific instructions.

Prerequisites[edit]

  1. C compiler. Any ANSI-compliant compiler such as GCC should work. GCC usually comes pre-installed on Linux machines.
  2. Python interpreter. Python is an interpretable programming language. It is used in Madagascar installation scripts and project management scripts. Python comes pre-installed on some platforms. Madagascar supports Python 3.

Each API option has its own prerequisites.

Prerequisites for optional add-on functionality are platform-specific.

Building under cygwin on Windows requires several preparatory steps.

General instructions[edit]

  1. Configuration: Open a terminal window, change to the top Madagascar source directory, and run
    ./configure --prefix=/directory/where/you/want/madagascar/installed
    You can examine the config.py file that this command generates. Additional options are available. You can obtain a full list of customizable variables by running scons -h. For example, to install Fortran-90 API bindings in addition to the basic package, run
    ./configure API=f90 --prefix=/directory/where/you/want/madagascar/installed
    After running ./configure you may see a list of dependencies that your system does not have installed (the items that have "no" next to them). Most of them are optional. If you decide to install additional packages for your platform, rerun the ./configure command.
  2. Building and installing the package: Run
    make install
    If you need "root" privileges for installing under $RSFROOT, you may need to run
    make; su; make install
    or
    make; sudo make install
    If make does not exist on your system, an alternative procedure can be found in the Troubleshooting section.
  3. User setup: If your shell is sh or bash, add to your $HOME/.bashrc and $HOME/.profile files the line
    source ~/RSFSRC/share/madagascar/etc/env.sh
    (if used something different in the --prefix option to ./configure, use that instead of ~/RSFSRC). If your shell is (t)csh, add to your $HOME/.cshrc file the line
    source ~/RSFSRC/share/madagascar/etc/env.csh
    (if used something different in the --prefix option to ./configure, 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 DATAPATH 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
    export DATAPATH=~/RSFDATA/
    to ~/.bashrc and ~/.profile .

Uninstall[edit]

To clean all intermediate files and all installed files, run

scons -c install

or

make distclean

in the source code directory.

Troubleshooting[edit]

Alternative build/install procedure[edit]

  1. Set the environment variables: If your shell is sh or bash, type
    source env.sh
    Else, if your shell is csh or tcsh, type
    source env.csh
  2. Build: Type scons
  3. Install: Run scons install . If you need "root" privileges for installing under $RSFROOT, you may need to run
    su; scons install
    or
    sudo scons install

Other issues[edit]

Note that scons does not inherit your environmental variables including PATH. If the configuration part ends with the message like

checking if cc works ... failed

the problem may be that your compiler is in an unusual place. Try

./configure CC=/full/path/to/cc

or

./configure CC=`which cc`

On Windows under SFU, use the gcc compiler

./configure CC=/opt/gcc.3.3/bin/gcc

Please consult the Advanced Installation guide for more information.

Testing and quick start[edit]

Here are a few simple tests and a brief introduction to Madagascar:

Typing any Madagascar command in a terminal window without parameters should generate brief documentation. Try one of the following:

sfin
sfattr
sfspike
sfbandpass
sfwiggle

If you get an error like "Command not found," you may not have your $PATH environment variable set correctly, or you may need to issue the rehash command.

Now try making a simple Madagascar data file:

sfspike n1=1000 k1=300 > spike.rsf

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

Cannot write to data file /path/spike.rsf@: Bad file descriptor

you may need to create the directory pointed to by your $DATAPATH environment variable.

The file spike.rsf is a text header. The actual data are stored in the binary file pointed to by the in= parameter in the header. You can look at the header file directly with more, or better, examine the file properties with

sfin spike.rsf

You can learn more about the contents of spike.rsf with

sfattr < spike.rsf

The following command applies a bandpass filter to spike.rsf and puts the result in filter.rsf:

sfbandpass fhi=2 phase=y < spike.rsf > filter.rsf

The following command makes a graphics file from filter.rsf:

sfwiggle clip=0.02 title="Welcome to Madagascar" < filter.rsf > filter.vpl

If you have an X11 display program running, and your $DISPLAY environment variable is set correctly, you can display the graphics file with:

sfpen < filter.vpl

You can pipe Madagascar commands together and do the whole thing at once like this:

sfspike n1=1000 k1=300 | sfbandpass fhi=2 phase=y | \
sfwiggle clip=0.02 title="Welcome to Madagascar" | sfpen

If you have SCons installed, you can use it to automate Madagascar processing. Here is a simple SConstruct file to make filter.rsf and filter.vpl:

#
# Setting up
#
from rsf.proj import *

#
# Make filter.rsf
#
Flow('filter',None,'spike n1=1000 k1=300 | bandpass fhi=2 phase=y')

#
# Make filter.vpl
#
Result('filter','wiggle clip=0.02 title="Welcome to Madagascar"')

End()

Put the file in an empty directory, give it the name SConstruct, cd to that directory, and issue the command:

scons

The graphics file is now stored in the Fig subdirectory. You can view it manually with:

sfpen Fig/filter.vpl

... or you can use:

scons view

When a SConstruct file makes more than one graphics file, the scons view command will display all of them in sequence.

Welcome to Madagascar.

Now edit the SConstruct file: change the title string on the Result line to "Hello World!", save the file, and rerun the scons command. You will see that scons has figured out that the file filter.rsf does not need to be rebuilt because nothing that affects it has changed. Only the file filter.vpl is rebuilt.