next up previous contents
Next: The CTK Design Up: Contents Previous: Introduction   Contents

Subsections


CTK Installation

Unix users

  1. Download the gzip compressed CTK tar file. This is available from:

      http://www.dcs.shef.ac.uk/research/groups/spandh/projects/respite/ctk/
    

  2. Unpack the archive if you have not done so already:

      cd /usr/local
      gunzip CTKv1.1.0.tar.gz   # uncompress the archive
      tar xf CTKv1.1.0.tar      # unpack it
    

    This creates the directory /usr/local/CTK containing the files from the main archive.

    If you have downloaded the data tar file then unpack this now aswell. First copy it to /usr/local (or whereever you wish to place CTK) and then:

      cd /usr/local
      gunzip CTK.data.gz   # uncompress the archive
      tar xf CTK.data.tar      # unpack it
    

    The rest of these instructions assume that CTK is installed in /usr/local/CTK.

  3. Set some CTK environment variables in the file .profile (or .login, depending on your shell) in your home directory. (Create the file if it is not there already.)

    This is done like this:

    In .profile (if your shell is bash, ksh, zsh or sh), add the following lines:

      CTKROOT=/usr/local/CTK
      CTKLOCAL=/usr/local/CTK/local
      PATH=$CTKLOCAL/bin:$PATH
      if [ $MANPATH ]
      then
        MANPATH=$CTKROOT/man:$MANPATH
      else
        MANPATH=$CTKROOT/man
      fi
    
      export CTKROOT CTKLOCAL PATH MANPATH
    

    In .login (in case your shell is csh or tcsh), add the following lines:

      if ( ! $?CTKROOT ) then
        setenv CTKROOT /usr/local/CTK
      endif
      if ( ! $?CTKLOCAL ) then
        setenv CTKLOCAL $CTKROOT/local
      endif
      if ( $?PATH ) then
        setenv PATH $CTKLOCAL/bin:$PATH
      else
        setenv PATH $CTKLOCAL/bin
      endif
      if ( $?MANPATH ) then
        setenv MANPATH $CTKROOT/man:$MANPATH
      else
        setenv MANPATH $CTKROOT/man
      endif
    

    After you have done this, you will need to login again, or re-source the profile before continuing, so that at least $CTKROOT and $CTKLOCAL are set. The installation will give an error message and not proceed otherwise.

  4. Make sure Qt is properly installed

    The Qt widget library is needed if you want to run the CTK GUI. It should be installed on your system and the following environment variables should be set:

    If you're using GNU g++, you may also want to set these:

    This is done like this:

    In .profile (if your shell is bash, ksh, zsh or sh), add the following lines:

            QTDIR=/usr/local/qt
            PATH=$QTDIR/bin:$PATH
            if [ $LD_LIBRARY_PATH ]
            then
                    LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
            else
                    LD_LIBRARY_PATH=$QTDIR/lib
            fi
            LIBRARY_PATH=$LD_LIBRARY_PATH
            if [ $CPLUS_INCLUDE_PATH ]
            then
                    CPLUS_INCLUDE_PATH=$QTDIR/include:$CPLUS_INCLUDE_PATH
            else
                    CPLUS_INCLUDE_PATH=$QTDIR/include
            fi
    
            export QTDIR PATH MANPATH LD_LIBRARY_PATH LIBRARY_PATH
            export CPLUS_INCLUDE_PATH
    

    In .login (in case your shell is csh or tcsh), add the following lines:

        
            if ( ! $?QTDIR ) then
                setenv QTDIR /usr/local/qt
            endif
            if ( $?PATH ) then
                setenv PATH $QTDIR/bin:$PATH
            else
                setenv PATH $QTDIR/bin
            endif
            if ( $?MANPATH ) then
                setenv MANPATH $QTDIR/man:$MANPATH
            else
                setenv MANPATH $QTDIR/man
            endif
            if ( $?LD_LIBRARY_PATH ) then
                setenv LD_LIBRARY_PATH $QTDIR/lib:$LD_LIBRARY_PATH
            else
                setenv LD_LIBRARY_PATH $QTDIR/lib
            endif
            if ( ! $?LIBRARY_PATH ) then
                setenv LIBRARY_PATH $LD_LIBRARY_PATH
            endif
            if ( $?CPLUS_INCLUDE_PATH ) then
                setenv CPLUS_INCLUDE_PATH $QTDIR/include:$CPLUS_INCLUDE_PATH
            else
                setenv CPLUS_INCLUDE_PATH $QTDIR/include
            endif
    

    After you have done this, you will need to login again, or re-source the profile before continuing, so that at least $QTDIR is set. The installation will give an error message and not proceed otherwise.

  5. Compile the CTK binaries

    You may find that pre-compiled binaries are available for download directly from the CTK web site. In this case simply copy the tar file to $CTKROOT/.. and unpack it. If you can't find binaries for your system, then you will have to compile your own.

    The $CTKROOT/src directory contains a makefile which compiles the CTK binaries. The basic system - with no MATLAB or Qt support - can be built by typing:

           cd $CTKROOT/src
           make
    

    If this fails or if you want to install the MATLAB interface or the Qt-based GUI you will have to edit $CTKROOT/src/Makefile. First read the INSTALL file found in $CTKROOT/src.

  6. Setting up with MATLAB support

    If you have compiled with MATLAB support you will also need to set your LD_LIBRARY_PATH to locate the MATLAB libraries.

    This is done like this:

    In .profile (if your shell is bash, ksh, zsh or sh), add the following lines:

            if [ $LD_LIBRARY_PATH ]
            then
                    LD_LIBRARY_PATH=/usr/local/matlab/extern/lib/sol2:$LD_LIBRARY_PATH
            else
                    LD_LIBRARY_PATH=/usr/local/matlab/extern/lib/sol2
    

    In .login (in case your shell is csh or tcsh), add the following lines:

            if ( $?LD_LIBRARY_PATH ) then
                setenv LD_LIBRARY_PATH /usr/local/matlab/extern/lib/sol2:$LD_LIBRARY_PATH
            else
                setenv LD_LIBRARY_PATH /usr/local/matlab/extern/lib/sol2
            endif
    

    The exact path may vary on your system, but it should point to the location of the files libmat.so and libeng.so.

  7. Preparing the CTK script files

    The example CTK script files need to be editted so that the first line of each script references the CTKScript script interpreter binary. This can be done automatically by using the `fix_scripts' script. Simply type:

    fix_scripts
    

  8. Setting up your editor (emacs only)

    When viewing CTK script files emacs should be put into sh-mode. To make this happen automatically add the following lines to your .emacs file:

      (setq auto-mode-alist
        (append '(("\\.ctk$"  . sh-mode))
           auto-mode-alist))
    


next up previous contents
Next: The CTK Design Up: Contents Previous: Introduction   Contents
Jon Barker 2001-02-15