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
If you already have development tools and libraries installed like GCC, you can skip this section and continue to the 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:
gcc: no input files
which means you can continue to the next section. If you see something like the following:
bash: gcc: command not found
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.
To install the tools required to build software on Scientific Linux, you must run the following commands:
sudo yum groupinstall "Development Tools" sudo yum groupinstall "Development Libraries"
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. If you are running Scientific Linux 4.8, then please also run:
sudo yum install xorg-x11-devel
Please return to the beginning of this section and repeat the test.
Debian or Ubuntu¶
To install the tools required to build software on Debian-based systems, you must run the following commands:
sudo apt-get install build-essentials
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.
Please try using google 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 (firstname.lastname@example.org).
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.
Using a release (recommended for users)¶
Please click on the 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:
tar xvfz maus-latest-release.tar.gz
to extract the code. You should now have a directory called 'maus'.
Using a nightly release¶
Nightlies are packed nightly. This is not meant to be stable but is a way of obtaining the latest code without requiring the installation of Bazaar. Please run the following two commands if you want the nightly (if you are behind a firewall, download the this file and ignore the 'wget' step).
wget http://micewww.pp.rl.ac.uk/static_files/maus_nightly.tar.gz tar xvfz maus_nightly.tar.gz
and you should now have a directory called 'maus'.
Bazaar repository (recommended for developers)¶
Bazaar is the program we use to maintain the repository. Please branch MAUS by running the following command.
bzr branch lp:maus
and you should now have a directory called 'maus'. If you get a 'command not found', you must install bazaar.
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).
Please enter the MAUS directory that you just created in the previous section:
You must first setup an environment within MAUS by running and ignoring complaints against python version:
which should return at the end:
SUCCESS: Whenever you want to use MAUS, you must 'source' SUCCESS: the environmental variables file. For Bourne- SUCCESS: compatible shells like 'bash', run: SUCCESS: SUCCESS: source env.sh SUCCESS: SUCCESS: and for C-compatible shells, run: SUCCESS: SUCCESS: source env.csh SUCCESS: SUCCESS: which can be added to your respective shell's SUCCESS: startup scripts. Example: ~/.bashrc for 'bash'.
which should then say:
SUCCESS: MAUS setup
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 output of the following two commands are the same:
echo $MAUS_ROOT_DIR pwd
Now it's time to build the dependencies of MAUS (ROOT, geant4, etc.). To let you know where are you in the process, it may be worthwhile running the following command:
which should produce the following output:
scons: Reading SConscript files ... **** Compiling in release mode... Configuring... Checking whether the C++ compiler worksyes Checking for C++ library json... no can't find jsoncpp which is needed You may install it by running: MAUS_ROOT_DIR=/mnt/home/maus ./third_party/bash/11jsoncpp.bash
where the build script couldn't find the 'jsoncpp' package, which is required to run MAUS.
It is now time to build the essential components of MAUS which are:
- Python - the version that ships with Scientific Linux is hideously out of date so it has been included here. Specifically, this is CPython.
- SWIG - SWIG is used to 'connect' C++ code and Python code. This allows people to write code in both languages for MAUS components
- JsonCpp - JsonCpp is used with C++ to allow C++ to read and write "JSON"http://www.json.org/ files. These files make up the internal datastructure for MAUS since they are a widely used, easy to read and write, and well supported data format that doesn't require ROOT to run in, for instance, the control room.
To build these please run the command:
which will download and build these three packages. This will take approximately 3 minutes.
Once you have built the essential components, you can test that 'scons' now finds 'JsonCpp' by rerunning the scons command. The output should indicate success but with some errors about not finding ROOT and Geant4. There should now be files in your 'build' directory.
The setup you have at the moment is intended for the control room. If you require, for example, ROOT (plotting) or Geant4 (physics models and tracking) which most people do, then please continue with this section. If you don't require these, please go to the next section.
We will now build ROOT and Geant4 with their own list of dependencies ('gsl' for ROOT and CLHEP for Geant4). Please run the command from your MAUS ROOT directory:
which will take an hour or two.
You should now be able to run:
REQUIREALL=1 scons all
which should not return any errors (set REQUIREALL to 0 for the control room). MAUS is now setup.
To test that MAUS works, please run the unit tests that are included.
scons && python -m unittest discover -b -v build
which should not return any errors.
You are now ready to run MAUS! Please now consult the examples section