Installing CATS

CATS (Create and Analyse Time Series) is a program written by Simon Williams at the National Oceanography Centre in Liverpool, UK.

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 C compiler are installed, for instance from the Command Line Tools 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.

  1. Edit the following environment variables in the top-level include-file for make, 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 must be 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.

  2. 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"


  3. Change to the time/ directory and, if necessary, edit the Makefile to ensure that the correct include-file for make will be read, e.g.

    include ../make.inc.gcc

    Then run

    make cleaner
    make
    make clean


  4. Change to the lib/ directory and, if necessary, edit the Makefile to ensure that the correct include-file for make 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


  5. Change to the analysis/ directory and, if necessary, edit the Makefile to ensure that the correct include-file for make 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

Comparison of CATS computing speed
Operating system Processor PENC VYAS
Linux (pre-compiled binary) 2.40 GHz Intel Core 2 Duo 3870 s 310 s
Linux (Ubuntu Lucid, 64-bit) 2.40 GHz Intel Core 2 Duo 2800 s 205 s
Linux (pre-compiled binary) 2.93 GHz Intel Xeon 2750 s 220 s
Linux (Ubuntu Jaunty, 64-bit) 2.93 GHz Intel Xeon 3050 s 255 s
Linux (pre-compiled binary) 2.67 GHz Intel Xeon 135 s
Linux (Fedora 15, 64-bit) 2.67 GHz Intel Xeon 1595 s 135 s
Mac OS X 10.6 (Snow Leopard, 64-bit) 2.53 GHz Intel Core 2 Duo 2700 s 300 s
Mac OS X 10.6 (Snow Leopard, 64-bit) 2.66 GHz Intel Xeon Quad-Core 3000 s 250 s
Mac OS X 10.7 (Lion, 64-bit) 2.3 GHz Intel Core i5 1420 s 125 s
Mac OS X 10.8 (Mountain Lion, 64-bit) 2.3 GHz Intel Core i5 1100 s 90 s
Mac OS X 10.9 (Mavericks, 64-bit) 2.3 GHz Intel Core i5 900 s 80 s
Mac OS X 10.10 (Yosemite, 64-bit) 2.8 GHz Intel Core i5 675 s 50 s
Mac OS X 10.11 (El Capitan, 64-bit) 2.8 GHz Intel Core i5 570 s 45 s
macOS 10.12 (Sierra, 64-bit) 2.8 GHz Intel Core i5 555 s 45 s
Mac OS X * 2.6 GHz 56 s
Scientific Linux (64-bit) † 3.2 GHz Intel Xeon 1575 s 151 s

* Courtesy of Reed Burgette (New Mexico State University)
† Courtesy of Julie Elliott (Purdue University)