Installing CATS
CATS (Create and Analyse Time Series) is a program written by Simon Williams at the Proudman Oceanographic Laboratory in Liverpool, UK.
The source can be downloaded by filling in the form here.
The installation instructions below work for me on any system provided that the BLAS and LAPACK libraries, with a C interface, are installed correctly. Requirements are as follows for systems that I use and have tested on:
Linux
An optimized binary can be built on Linux (Ubuntu Lucid in my case) using the BLAS and LAPACK distributions available through the Ubuntu Software Center (under "Applications"). If the BLAS and LAPACK shared and/or static libraries are installed, there should be no further problems following the installation instructions below.
Mac OS X
A binary can be built for Mac using Apple's optimized versions of the BLAS and LAPACK libraries, which are contained in the "vecLib" sub-framework, part of the "Accelerate" framework, as follows. This set of instructions assumes that this and a gcc compiler are installed, for instance from the Command Line Tools for Xcode package (from February 2012 and Xcode 4.3 onwards) or the complete Xcode package.
Installation
These instructions are based on the files found in the version 3.1.2 source code.
- Edit the following environment variables in the top-level make include
file, e.g. make.inc.gcc:
BINDIR = /usr/local/bin
(this is where the executable file will be installed, so choose the directory based on your preferences)
LAPACKLIB = -llapack
BLASLIB = -lblas
(these are the relevant BLAS and LAPACK libraries that will be used)
CLAPACK, F77LIB and I77LIB are unnecessary and may be left as they are, blank or commented out.
To force a 64-bit executable to be compiled, add -m64 (or -arch x86_64 for Mac OS X) to CFLAGS.
- Both the Ubuntu and Apple implementations of the BLAS and LAPACK
libraries appear to support a C interface directly for all routines used
by CATS. This being the case, there should be no need for an
additional "wrapper library" as described under "Optimisation and the
clapack/blas libraries" on Simon Williams' CATS web page. Edit
lib/timeseries.h to remove the lines
#include "f2c.h"
#include "blaswrap.h"
- Change to the time/ directory and, if necessary, edit the Makefile to
ensure that the correct make include file will be read, e.g.
include ../make.inc.gcc
Then run
make cleaner
make
make clean
- Change to the lib/ directory and, if necessary, edit the Makefile to
ensure that the correct make include file will be read, e.g.
include ../make.inc.gcc
Also, the CLAPACK variable is superfluous and undefined here, so comment the first and uncomment the second line defining INCLUDEDIRS and LIBDIRS, e.g.
#INCLUDEDIRS = -I$(CLAPACK)/F2CLIBS -I$(CLAPACK) -I../time -I. -I../lib
INCLUDEDIRS = -I../time -I. -I../lib
#LIBDIRS = -L$(CLAPACK)/F2CLIBS -L$(CLAPACK) -L. -L../lib -L../time
LIBDIRS = -L. -L../lib -L../time
Then run
make cleaner
make
make clean
- Change to the analysis/ directory and, if necessary, edit the Makefile
to ensure that the correct make include file will be read, e.g.
include ../make.inc.gcc
Again, CLAPACK and, here, ATLAS are superfluous and undefined, so comment the first and uncomment the second line defining INCLUDEDIRS and LIBDIRS, e.g.
#INCLUDEDIRS = -I$(ATLAS)/inc -I$(CLAPACK) -I$(CLAPACK)/F2CLIBS -I. -I../lib -I../time
INCLUDEDIRS = -I. -I../lib -I../time
#LIBDIRS = -L$(ATLAS)/lib -L$(CLAPACK) -L$(CLAPACK)/F2CLIBS -L. -L../lib -L../time
LIBDIRS = -L. -L../lib -L../time
Then run
make cleaner
make
sudo make install
make clean
Speed tests
Running CATS on the time series in the example/ directory, estimating annual and semi-annual cycle terms in addition to a trend in the presence of a variable white noise plus unspecified power-law noise model, produced the following results for comparison:
CATS options: --model=vw: --model=pl: --sinusoid=1y1
| Operating system | Processor | PENC | VYAS |
| Linux (pre-compiled binary) | 2.40 GHz Intel Core 2 Duo | 3870 | 310 |
| Linux (Ubuntu Lucid, 64-bit) | 2.40 GHz Intel Core 2 Duo | 2800 | 205 |
| Linux (pre-compiled binary) | 2.93 GHz Intel Xeon | 2750 | 220 |
| Linux (Ubuntu Jaunty, 64-bit) | 2.93 GHz Intel Xeon | 3050 | 255 |
| Linux (pre-compiled binary) | 2.67 GHz Intel Xeon | 135 | |
| Linux (Fedora 15, 64-bit) | 2.67 GHz Intel Xeon | 1595 | 135 |
| Mac OS X (Snow Leopard, 64-bit) | 2.53 GHz Intel Core 2 Duo | 2700 | 300 |
| Mac OS X (Snow Leopard, 64-bit) | 2.66 GHz Intel Xeon Quad-Core | 3000 | 250 |
| Mac OS X (Lion, 64-bit) | 2.3 GHz Intel Core i5 | 1420 | 125 |
| Mac OS X (Mountain Lion, 64-bit) | 2.3 GHz Intel Core i5 | 1100 | 90 |