chaoshu的个人博客分享 http://blog.sciencenet.cn/u/chaoshu

博文

Ubuntu下安装CATS(Create and Analyse Time Series)

已有 5026 次阅读 2014-4-15 10:15 |个人分类:时间序列|系统分类:科研笔记| ubuntu, CATS, Installing

Installing CATS

CATS (Create and Analyse Time Series) is a program writtenby SimonWilliams atthe National OceanographyCentre in Liverpool, UK.

The installation instructions below work for me on any system provided that the BLAS and LAPACK libraries, with a Cinterface, are installed correctly. Requirements are as follows for systems that I use and have tested on:

安装编译器及相关库文件:sudo apt-get install gfortran
                                           sudo apt-get install libblas-dev

                                           sudo apt-get install liblapack-dev        

注意:如果是root身份登入,都去掉sudo,下面类似。                      

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 shouldbe no further problems following the installation instructions below.

Mac OS X

A binary can be built for Mac using Apple's optimized versions ofthe BLAS and LAPACK libraries, which are contained in the "vecLib"sub-framework, part of the "Accelerate" framework, as follows. Thisset of instructions assumes that this and a C compiler areinstalled, for instance from the CommandLine Tools for Xcode package (from February 2012and Xcode 4.3 onwards) or thecomplete Xcode package.


Installation

These instructions are based on the files found in the version3.1.2 source code.

  1. Edit the following environment variables in the top-level makeinclude file, e.g. make.inc.gcc:

    BINDIR= /usr/local/bin
    (this is where the executable file will be installed, so choose thedirectory based on your preferences)

    LAPACKLIB =-llapack
    BLASLIB =-lblas
    (these are the relevant BLAS and LAPACK libraries that will beused)

    CLAPACK, F77LIB and I77LIB areunnecessary and may be left as they are, blank or commentedout.

    To force a 64-bit executable to be compiled,add
    -m64 (or -archx86_64 forMac OS X) to CFLAGS.

  2. Both the Ubuntu and Apple implementations of the BLAS andLAPACK libraries appear to support a C interface directly for allroutines used by CATS. This being the case, thereshould be no need for an additional "wrapper library" as describedunder "Optimisation and the clapack/blas libraries" on SimonWilliams' CATS web page. Edit lib/timeseries.h to remove thelines

    #include"f2c.h" 
    #include "blaswrap.h"


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

    include../make.inc.gcc

    Then run

    makecleaner 
    make
    make clean


  4. Change to the lib/ directory and, if necessary, edit theMakefile to ensure that the correct make include file will be read,e.g.

    include../make.inc.gcc

    Also, the CLAPACK variableis superfluous and undefined here, so comment the first anduncomment the second linedefining 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

    makecleaner 
    make
    make clean


  5. Change to the analysis/ directory and, if necessary, edit theMakefile to ensure that the correct make include file will be read,e.g.

    include../make.inc.gcc

    Again, CLAPACK and,here, ATLAS aresuperfluous and undefined, so comment the first and uncomment thesecond linedefining 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

    makecleaner
    make
    sudo make install
    make clean

安装完成,检测一下自己是否安装成功。切换到examples目录下,在终端中输入以下命令:

cats vyas.neu -A 1y1 -V -C4 -Ovyas_all.mle

如果成功生成了vyas_all.mle文件那就成功了。

Cats Version : 3.1.2
Cats command : cats -A 1y1 -V -C4 -Ovyas_all.mlevyas.neu
Data from file : vyas.neu
cats : running on ubuntu
Linux release 3.5.0-17-generic (version#28-Ubuntu SMP Tue Oct 9 19:32:08 UTC 2012) on i686
userid : root

Sampling frequency 1.17366e-05 (Hz), 0.99days
Number of samples 1 period apart = 565 of587
Number of points in full series = 612
Number of series to process : 1
Start Time : Thu Apr  3 11:28:192014

general_inner_simplex : starting simplex
general_inner_simplex : n_vert = 0

Stopping criteria met.
Stopping criteria :(0 <= 1e-06||   0 <= 0.0001)&&   (0 <=2e-05)
Time taken to create cholesky of covariancematrix : 0.000000 seconds
a = -inf  sig = 1.118838 P =736.057109 mle = inf
Time taken to do final mle part : 0.000000seconds
+NORT MLE   :            inf
+NORT  INTER :     -33.7459+-     0.2048
+NORT  SLOPE :      16.8047+-     0.1667
+NORT SIN   :      -0.2552+-     0.0689
+NORT COS   :      -0.0387+-     0.0855
+NORT SIN   :      -0.0124+-     0.0661
+NORT COS   :      -0.2565+-     0.0674
+NORT  OFFSET:       2.9200+-     0.1999
End Time : Thu Apr  3 11:28:192014

Total Time : 0


参考资料:

http://blog.sina.com.cn/s/blog_6562367a010168ld.html

http://web.mit.edu/mfloyd/www/computing/cats/




https://blog.sciencenet.cn/blog-858128-785066.html


下一篇:Ubuntu系统安装GMT
收藏 IP: 59.173.138.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-11-24 19:16

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部