# GLAM2 Installation

## Requirements

The only requirement is a C compiler. If you have some kind of Unix or Linux system, you almost certainly have one already. If you have Mac OS X, you may need to install a developer toolkit, which should come for free with Mac OS X. If you have Windows, you can get a C compiler from various places, such as MinGW or Cygwin.

## Usual procedure

This procedure should be suitable in most cases.

1. You presumably obtained GLAM2 as a zipped package, called something like glam2-9999.zip. The first step is to unzip it, creating a new directory glam2-9999.
2. Using the command line, move into the src subdirectory and type 'make'. This should compile the glam2 programs.
3. To compile purge, move into the purge subdirectory and type 'make'.
4. After successful compilation, the programs are ready to use. Run them just by typing their names (possibly with leading ./ depending on the settings for your command line environment). If you like, you can put the programs in standard 'bin' directories, or add their location to your system's PATH.

## Alternatives

There is a Debian package.

The Makefile in the src subdirectory holds the commands for compiling the glam2 programs. (Likewise for the purge subdirectory.) The commands are customized for the widely-used gcc compiler. To use a different compiler, you may have to modify the Makefile. The Makefile is very simple and commented, so this should be doable even if you know nothing about makefiles. However, you will obviously need to know what commands are suitable for your compiler. Use compiler options that make the resulting programs as fast as possible.

The programs can also be compiled directly, without 'make'. For instance, to compile glam2mask, move into the src subdirectory and type:

    cc -Wall -O3 -o glam2mask glam2mask.c alignment.c fasta.c util.c -lm

Modify as appropriate for your compiler. Look in the Makefile for commands to compile the other programs.