%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Copyright (c) 2003-2018 by The University of Queensland
% http://www.uq.edu.au
%
% Primary Business: Queensland, Australia
% Licensed under the Apache License, version 2.0
% http://www.apache.org/licenses/LICENSE-2.0
%
% Development until 2012 by Earth Systems Science Computational Center (ESSCC)
% Development 2012-2013 by School of Earth Sciences
% Development from 2014 by Centre for Geoscience Computing (GeoComp)
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\section{Linux binary installation}
\label{sec:binlinux}

\esfinley can be installed as a stand-alone bundle, containing all the required dependencies.
Alternatively, if we have a package for your distribution you can use the standard tools to install.


For more information on using the \file{run-escript} command please see the User's Guide.

If you are using Debian~6.0(``Squeeze''), Ubuntu~10.4(``Lucid Lynx'') or greater, then see Section~\ref{sec:debian}.
For other linux distributions refer to Section~\ref{sec:standalonelinux}.

\subsection{Debian and Ubuntu}\label{sec:debian}

We produce \texttt{.deb}s for the i386 and amd64 architectures for Debian stable(``squeeze'') and the 
following Ubuntu releases:
\begin{itemize}
 \item $11.10$ --- \emph{Oneiric} Ocelot
 \item $12.04$ --- \emph{Precise} Pangolin (LTS)
 \item $12.10$ --- \emph{Quantal} Queztal 
\end{itemize}

The package file will be named \file{escript-X-D_A.deb} where \texttt{X} is the version, \texttt{D} 
is the distribution codename (eg ``\texttt{squeeze}'' or ``\texttt{oneric}'') and \texttt{A} is the architecture.
For example, \file{escript-3.4-1-squeeze_amd64.deb} would be the file for squeeze for 64bit processors.
To install \esfinley download the appropriate \file{.deb} file and execute the following 
commands as root (you need to be in the directory containing the file):

\begin{verse}
\textbf{(For Ubuntu users)}\\
You will need to either install \texttt{aptitude}\footnote{Unless you are short on disk space \texttt{aptitude} is recommended} or substitute \texttt{apt-get} where this guide uses \texttt{aptitude}.
\begin{shellCode}
sudo apt-get install aptitude
\end{shellCode}
\end{verse}

\begin{shellCode}
dpkg --unpack escript*.deb
aptitude install escript
\end{shellCode}

Installing escript should not remove any packages from your system.
If aptitude suggests removing escript, then choose 'N'.
It should then suggest installing some dependencies choose 'Y' here.
If it suggests removing \texttt{escript-noalias} then agree.

If you use sudo (for example on Ubuntu) enter the following instead:
\begin{shellCode}
sudo dpkg --unpack escript*.deb
sudo aptitude install escript
\end{shellCode}

This should install \esfinley and its dependencies on your system.
Please notify the development team if something goes wrong.

\subsection{Stand-alone bundle}\label{sec:standalonelinux}

If there is no package available for your distribution, you may be able to use one of our stand alone bundles.
You will need three pieces:
\begin{enumerate}
 \item escript itself (\file{escript_3.4_i386.tar.bz2})\footnotemark\ from launchpad.net.\addtocounter{footnote}{-1}
 \item the support bundle (\file{escript-support_3.0_i386.tar.bz2})\footnote{For $64$-bit Intel and Amd processors substitute \texttt{amd64} for \texttt{i386}.} from launchpad.net.  
 [This is the same support bundle as in previous releases. So you can reuse it if you have it already.]
 \item sympy from \url{http://sympy.org} --- This is a new dependency and is not in the support bundle.
\end{enumerate}

Change directory to where you would like to install escript (We assume the three files are in this directory).

\begin{shellCode}
tar -xjf escript-support_3.0_i386.tar.bz2
tar -xjf escript_3.4_i386.tar.bz2

\end{shellCode}
This will produce a directory called \file{stand} which contains a stand-alone version of \esfinley and its dependencies.

\noindent To install SymPy(replace 0.7.1 with the version of sympy you have) enter the following:
\begin{shellCode}
eval `stand/escript.d/bin/run-escript -e`
tar -xzf sympy-0.7.1.tar.gz 
cd sympy-0.7.1
python setup.py install --prefix ../stand/pkg/
\end{shellCode}

You can test your installation by running:
\begin{shellCode}
stand/escript.d/bin/run-escript
\end{shellCode}
This should give you a normal python shell.
If you wish to save on typing you can add \file{x/stand/escript.d/bin}\footnote{or whatever you renamed \texttt{stand} to.} to your \texttt{PATH} variable (where x is the absolute path to your install).

You may now remove the tar files and the sympy directory from your starting directory.
