Prerequisites
A C++ compiler.
- Linux users automatically have access to the GNU C++ compiler, g++.
- For Mac users, a C++ compiler is included in the Command Line Tools package. The recommended way to install Command Line Tools is to type the following from a Terminal window:
xcode-select --install
If this installation method does not work for you, this thread on Stackexchange may be helpful for providing a work-around.
The GNU Scientific Library (GSL).
The program is dependent on the gsl (gnu scientific library) being installed. This library is used by other programs, so it may already be installed. Check in /usr/include or usr/local/include for a directory called gsl. This is the most likely place to find gsl. If not already installed, download the latest release from the gsl website and follow the installation instructions in the README and INSTALL files. You will need root access to put the files in /usr/include. If this is not possible, then the directions to install it in a different directory, such as the home directory are given below.
- Move the directory that was created by unpacking the tar file. It will be called gsl-X where X is the version number.
- At prompt, run configure with the prefix option as shown below. The path specified should be the path where you would like gsl installed, e.g.:
./configure --prefix=/home/kellyb/GSL - At prompts run the following three commands in turn
make
make check
make install - To ensure it has installed, move to the directory you specified in prefix. There should subdirectory named include/. In include/gsl/ there should be a number of .h files.
Compiling sampletrees
- Unpack the gzipped tar file (tar xzvf sampletrees_<version>.tar.gz) and change to the sampletrees/src/ directory. In the sampletrees/src directory there should be a makefile.
- Run the makefile from the src/ directory by typing "make" at the prompt. Provided the gsl library can be found there should be no issues compiling the program. The name of the executable is sampletrees.
- Note: if you installed gsl somewhere other than /usr/include, you will have to pass the path to gsl to the makefile. Directions for how to pass the path to the makefile are in the comments in the makefile.