Project

General

Profile

Install » History » Version 86

Version 85 (Rogers, Chris, 28 June 2011 16:41) → Version 86/204 (Tunnell, Christopher, 04 August 2011 18:15)

{{toc}}

*_For installation commands without explanation, ie. to cheat which is not recommended, please [[InstallQuick|click here]]_*

h1. Introduction

This page will take you through getting the prerequisites of installing MAUS and ensuring that it's working. This will come in five phases:

* Prerequisites - ensuring you have the basic tools required to compile code
* Getting code - getting MAUS code (MAUS will attempt to handle dependencies)
* Dependencies - installing third party dependencies that are required by MAUS
* Building MAUS - ensuring everything compiles
* Testing MAUS - running tests to ensure that you have a working copy of MAUS

*DO NOT HAVE WHITESPACE IN DIRECTORY NAME: various third_party packages will break. This is beyond the scope of MAUS. See issue #306.*

*RAL-ONLY NOTE: please run +export http_proxy=wwwcache.rl.ac.uk:8080+ (or equivalent) to setup the RAL proxy*

h1. Prerequisites

_If you already have development tools and libraries installed like GCC, you can skip this section and continue to the [[Install#Dependencies|next section]]... if you are unsure, continue._

To check if you have a compiler (which generally indicates that you have the rest) run at the command line the command *gcc*. You should see something like the following:

<pre>
gcc: no input files
</pre>

which means you can continue to the [[Install#Dependencies|next section]]. If you see something like the following:

<pre>
bash: gcc: command not found
</pre>

then continue with this section.

To be able to compile MAUS, you will of course need a compiler. This should come with your machine and will require the person who runs the machine to install this. The following sections will deal with installing these prerequisites on various types of Linux.

h3. Scientific Linux/Redhat/Fedora

To install the tools required to build software on Scientific Linux, you must run the following commands:

<pre>
sudo yum groupinstall "Development Tools"
sudo yum groupinstall "Development Libraries"
sudo yum install wget libX11-devel libXft-devel libXext-devel libXpm-devel libX11-devel
</pre>

where the *sudo* command means that this is run as the root superuser. If you do not have this access, you must ask your system manager.

> *Scientific Linux 4.8 only*. Please also run:
>
> <pre>sudo yum install xorg-x11-devel</pre>

Please return to the beginning of this section and repeat the test.

h3. Debian or Ubuntu

To install the tools required to build software on Debian-based systems, you must run the following commands:

<pre>
sudo apt-get install build-essential xorg-dev automake autoconf libtool scons zlibc
</pre>

where the *sudo* command means that this is run as the root superuser. If you do not have this access, you must ask your system manager.

> _*RAL ONLY*. For RAL people, you need to create a file called /etc/apt/apt.conf and fill it with:_
>
> <pre>
ACQUIRE
{
http::proxy "http://wwwcache.rl.ac.uk:8080/";
}
</pre>

When it installed then please return to the beginning of this section and repeat the test.

h3. OpenSUSE

To install the required tools, you must run the following command:

<pre>
sudo zypper install -t pattern devel_C_C++
</pre>

where the *sudo* command means that this is run as the root superuser. If you do not have this access, you must ask your system manager. Please return to the beginning of this section and repeat the test.

h3. Other distribution

Please try using "google":http://www.google.com to find out how to do it for your specific architecture. If you succeed, then please post those instruction here and continue with these instructions. If you fail, please email the user mailing list (maus-user@jiscmail.ac.uk).

h2. Getting the code

If you are a user, it is recommended that you use a release since the repository is meant to be unstable since people are developing on it. If you are a developer, you should user the 'Bazaar' method. Regardless: there are three options for obtaining code.

h3. Using a release (recommended for users)

This is stable code since it is not under development. Please click on the "Files":http://micewww.pp.rl.ac.uk/projects/maus/files tab above and download the file _maus-latest-release.tar.gz_. Or you could choose to download a later release if you choose. Upon downloading the file (I'm going to assume you're using the latest, but just change the filename if you aren't), then run:

<pre>
tar xvfz maus-latest-release.tar.gz
</pre>

to extract the code. You should now have a directory called 'maus-latest-release'.

h3. Bazaar repository (recommended for developers)

*Unstable code, this is, since it's under development*. The following command checks out the current source tree for MAUS that is under development. This code branch is meant to be unstable since it's being developed on. Please think before using this version.

Bazaar (bzr) is the program we use to maintain the repository. There is a MAUS-specific tutorial of using bzr [[Bzr_usage|here]]. Please "branch":http://en.wikipedia.org/wiki/Branching_%28software%29 MAUS. The code is hosted on "launchpad":http://launchpad.net under the "MAUS project":https://code.launchpad.net/maus. To get the code, you must then run:

<pre>
bzr branch lp:maus
</pre>

and you should now have a directory called 'maus'. If you get a 'command not found', you must [[InstallingBzr|install bazaar]]. If you run into connectivity issues, you can check the bazaar server status "here":http://identi.ca/launchpadstatus.

*If you want to publish results based on MAUS, please use a release version of the code*.

h2. Dependencies

MAUS will try to help you by installing all of its dependencies for you. This is recommended that you allow rather than installing it on your own due to issues with the compiler flags of ROOT/Geant4 in most distributions (the issues is with not having the -fPIC argument to GCC for "PIC":http://en.wikipedia.org/wiki/Position-independent_code).

h3. Setup Environment

Please enter the MAUS directory that you just created in the previous section:

<pre>
cd maus
</pre>

You can now run must first setup an environment within MAUS by running and ignoring complaints against python version:

&lt;pre&gt;
./configure
&lt;/pre&gt;

which should return at
the following command end:

&lt;pre&gt;
SUCCESS: Whenever you want
to build all use MAUS, you must &#39;source&#39;
SUCCESS: the environmental variables file. For Bourne-
SUCCESS: compatible shells like &#39;bash&#39;, run:
SUCCESS:
SUCCESS: source env.sh
SUCCESS:
SUCCESS: which can be added to
your dependencies, build MAUS, respective shell&#39;s
SUCCESS: startup scripts. Example: ~/.bashrc for &#39;bash&#39;.
&lt;/pre&gt;

then obey the above &quot;SUCCESS&quot; instructions
and run the tests &lt;pre&gt; source env.sh&lt;/pre&gt;. Please note that MAUS does not support c-shell or variants at present. If

&lt;pre&gt;
echo The shell is $SHELL
&lt;/pre&gt;

contains any references to _*csh_ then you will need to switch to,
for you. example, bash, by typing

&lt;pre&gt;
bash
&lt;/pre&gt;


Then do

<pre>
./tests/integration/install_then_build_then_test.bash
source env.sh
</pre>

which should then say:

&lt;pre&gt;
SUCCESS: MAUS setup
&lt;/pre&gt;

You have now setup the MAUS environment. This will help MAUS know
where it should install local copies of various dependencies. You can check that the 5 output of the following two commands it executes are ("repository version":http://micewww.pp.rl.ac.uk/projects/maus/repository/entry/tests/integration/install_then_build_then_test.bash): the same:

<pre>
./configure # configure environment echo $MAUS_ROOT_DIR
source env.sh # load environment pwd
./third_party/build_all.bash # get/build &lt;/pre&gt;

Now it&#39;s time to build the
dependencies of MAUS (ROOT, Geant4, etc.)
source env.sh # load environment again (it now finds ROOT)
geant4, etc.). To let you know where are you in the process, it may be worthwhile running the following command:

&lt;pre&gt;
scons
&lt;/pre&gt;

which should produce the following output:

&lt;pre&gt;
scons: Reading SConscript files ...
**** Compiling in release mode...
Configuring...
Checking whether the C++ compiler worksyes
Checking for C++ library json... no
!! Can&#39;t find jsoncpp which is needed.
You may install it by running:
MAUS_ROOT_DIR=~/MAUS/maus-latest-release ./third_party/bash/52jsoncpp.bash
&lt;/pre&gt;

where the
build # script couldn&#39;t find the &#39;jsoncpp&#39; package, which is required to run MAUS.

It is now time to
build the dependencies of MAUS since we don't use Makefiles (ROOT, Geant4, JsonCpp, etc.). Please run the following command from your MAUS_ROOT_DIR directory:

&lt;pre&gt;

./run_tests.bash # test the setup
bash ${MAUS_ROOT_DIR}/third_party/build_all.bash
</pre>

This has worked on ("live display":http://test.mice.rl.ac.uk/job/MAUS_VMs_nightly/): which will take an hour or two.

* Scientific Linux 4.8 64-bit and 32-bit h3. Building MAUS

You should now be able to run:

&lt;pre&gt;

* Scientific Linux 5.5 64-bit and 32-bit scons build
* Fedora 14 64-bit and 32-bit
* OpenSUSE 11.3 64-bit and 32-bit
* Ubuntu 10.10 64-bit and 32-bit
&lt;/pre&gt;

If you do which should not see return any errors, then everything was successful. errors. If you MAUS is now setup.

h3. Testing MAUS

To test that MAUS works, please
run into issues, please send the output of: unit tests that are included.

<pre>
scons build
bash run_tests.bash
</pre>

to us through an issue by clicking 'New Issue' above. which should not return any errors.

You are now ready to run MAUS!

h3. Troubleshooting

* *I get an error about Python versions when I run ./configure*: this is normal - you need to install third party libraries (including python 2.7) by doing <pre>bash ${MAUS_ROOT_DIR}/third_party/build_all.bash</pre>