Installing LIGOTOOLS binaries

 

LIGOTOOLS - INTRODUCTION TO BINARY INSTALLS

LIGOTOOLS is a good place to start because it is maintained as a set of binaries. A binary is jargon for a package that, when placed on your computer, can immediately be executed. Word is released as a binary. The advantage of this method of releasing software is simplicity - other than downloading the code, little else is required of the user. The disadvantage is lack of portability. Because there are many different operating systems and even differences in the architecture of different computers running the same operating system, many different binaries may have to be maintained in order to ensure that the software can be run on a sufficient number of platforms to be useful to the team.

INSTALLATION OF LIGOTOOLS

This package is maintained by Peter Shawhan at the University of Maryland. The home page for the distribution is http://www.ldas-sw.ligo.caltech.edu/ligotools/setup_info.html. This homepage

has full instructions for the download and the build. Follow these instructions and see how far you get. I suggest using /home/<user>/ligotools as the base directory for the distribution. Incidentally, some ligotools will build on a mac, so you may wish to try this in addition to linux.

One issue to raise here is that of shells. Notice that in part 2 of the instructions, the fourth bullet says ‘if your shell is csh or tcsh, type rehash’. You can think of a shell as a text based, interpreted interface between the user and the operating system running the computer. There isn’t really a good shell on windows machines, although you can still open up an MSDOS window and this is occasionally useful. By contrast, in unix there several shells, and on any given system you will find users for more than one of them. It is nice to have freedom to choose, and very nice that the number of shells is not zero, but the large number of possible shells is often a source of confusion. Here, two shells are mentioned, named csh and tcsh. These two shells are from the same ‘family’, meaning that they have similar command sets, philosophies and structure, but are not exactly the same, so that not every text interpretable by the csh shell will be interpretable, or interpreted in the same way, in the tcsh shell. The family having csh and tcsh as members is generically referred to as ‘C-shells’, because the syntax often loosely resembles the C programming language, particularly for conditionals.


To avoid confusion, let us all resolve to use (religously) the bash shell for everything. The bash shell is a member of the family of ‘Bourne shells’. The original Bourne shell was sh. The bash shell has added much functionality to the bourne shell, but it is not true that bash is a superset of bourne; you can have text that is interpretable in sh, but not in bash. The bash shell is the default in linux and for the last few years has also been the default shell on a mac. In case you didn’t know it, macs running OsX are in fact running a variety of unix known as BSD.


Much of the time, the text interpreted by a shell is written on the command line. When you hit return, the text is interpreted and the commands carried out, or an error is returned if the command you type makes no sense. However you can also write shell scripts, in which the instructions are contained in a text file. We will come back to shell scripts later. For now, we just need to be able to check which shell we are in on the command line. One way to do this is to

type

SHELLS

$ echo $SHELL

On my linux box, this returns

/bin/bash

I will pull this apart. The first $ in my command represents the PROMPT and should not be typed in. Indeed, the prompt on your unix box may be something different. The command echo is a user command universal to all unix shells. Echo means write something to the standard output, which in this case is directed to the terminal window. Try echo hello. However, in this case the thing to type out is $SHELL, and the first character being a $ means that bash interprets the entire string $SHELL as an environment variable. Environment variables are sequences of characters, which may not include white space, that are defined to be some string of ascii text, and that string may include white space. Some environment variables are defined by agreement between unix developers, and $SHELL is one of them - it simply gives the full path in the filesystem to the executable that implements the shell interpreter. So if you look in the directory /bin by typing ls /bin, you will see a whole load of files, one of which will have the name bash, and this is in fact a program that implements the bash shell interpretation of ascii text on your system.


You can also define your own environment variables and overwrite existing ones. Be very careful doing the latter as you may render the terminal unuseable. As an example we could

define an environment variable in the bash shell as follows:


$ export MYNAME=ed

And then when you type echo $MYNAME, you will get the obvious answer. WARNING - all shells have difficulties, and the difficulty with the bash shell is that it DOES care where you put spaces. In particular, there must be no whitespace immediately between the “=” sign and

MYNAME or ed. Try retyping with space inserted and see what happens.

ENVIRONMENT VARIABLES

CONTROLLING THE ENVIRONMENT IN NEW SHELLS

You should read this section before going through part 3 of the ligotools installation. Associated with each shell is a file in your home directory which is executed by the shell interpreter, bash in our case, every time a new shell is opened. The most common way of opening a new shell is simply opening a terminal window, but many programs, and the operating system of the computer itself, may start new shells specially for running processes and programs. In the bash shell, the automatically executed file is called .bashrc . If you go to your home directory using the cd command, cd /home/<username> and type ls, you will see

all the files and folders there - and NOT the file .bashrc. This is because, by convention in

unix, files whose names start with a ‘.’ are hidden. You can see hidden files by instead running ls -a in your home directory, which may well reveal .bashrc as well as lots of other hidden files and folders associated with programs, your account, or the operating system. There are also some special files, one called ‘.’, which is just the current directory, and one called ‘..’ which is the directory one level above your current directory.


You will need to edit, or perhaps create, a .bashrc file in your home directory to get ligotools to work by default in a new shell. The instructions in part C therefore boil down to putting a single line of text in .bashrc.

CHECKING THAT IT WORKS

LIGOTOOLS contains a lot of packages, some of which our outdated and useless, but some of which are quite nice to have. One nice one is guild. Try typing guild & at the command prompt. What SHOULD happen is that a nice window should appear that looks something like this:

As part of the build instructions, you will be asked if you want to install a large number of packages. Say yes to them all EXCEPT root or anything to do with dmt, dtt, or gds. We will build our own copies of these things from the source code.

Now click on utilities and select time converter. If you type Now in the box at the top, you will get the time now in UTC and GPS second format. GPS seconds started at zero at midnight on January 6th 1980. The GPS second is the standard time reference used for data in LIGO, so having this handy little tool on your desktop is quite useful for our research. You can also type any GPS time or any UTC time string into this window and the time converter will convert to the other format.