HOME Try Sather Post Messages

2. Installing Sather


1. Introduction

I will explain how to install Sather from the source code on Linux. (Binary packages are available for RedHad and Debian.) You cannot install Sather on Win32 even if you use cygwin, which means that you need a Linux machine to play with Sather.

2. Hardware and Linux distribution that I use

Followings are my hardware and Linux distribution. If you have i386+Linux environment, you should be able to install Sather in a similar way.

3. Preparation

3.1. Required header files and library

Followings are required to install Sather.

note

3.2. Installing gc and tcl/tk

  1. getting the source
    The tar balls are at the following sites.
  2. extracting the tar balls
    you can extract *.tar.bz2 and *.tar.gz using following commands
    tar xjvf *.tar.bz2
    tar xzvf *.tar.gz
    
  3. installing
    All of then can be installed by
    ./configure → make → sudo make install
    like as follows:
    cd (directory produced by extracting the tar ball)
    ./configure 
    make
    sudo make install
    
  4. making a soft link
    If libraries without version number are not created under /usr/local/lib, you need to make a soft link (see
    here).
  5. updating the library cache
    Check if /usr/local/lib is registered in /etc/ld.so.conf (if not add by yourself), then execute ldconfig.
    # ldconfig    (you need to be the root.)
    
Now you are ready to install Sather.

4. Installing Sather

4.0. Getting the tar ball

You can download the tar ball of Sather stable version from http://www.gnu.org/software/sather/. Then extract it in the way as shown previously.

4.1. make

Installing Sather is somehow unusual. You can not install Sather in an ordinary way (configure → make → make install).

Following shows how to install the compiler, the viewer, and others.

 su                                                                 be the root
 cp sather-1.2.2.tar.bz2 /usr/local/src                             copy the tar ball to /usr/local/src)
 cd /usr/local/src                                                  (go to /usr/local/src)
 tar xjvf sather-1.2.2.tar.bz2                                      (extract the tar ball)
 cd sather-1.2.2                                                    (go to sather-1.2.2)
 SATHER_HOME=/usr/local/src/sather-1.2.2;export SATHER_HOME         (set SATHER_HOME (bash))
 make compiler                                                      (make sacomp (sather compiler))
 make browser                                                       (make sabrowse (sather source and class viewer))
 make info                                                          (make info¡Ë
 cp Emacs/*.info /usr/local/info                                    (copy the info file to the directory which info refers)
 cat Emacs/dir >> /usr/local/info/dir                               (add the entry to Sather in /usr/local/info/dir)
 ln -s /usr/local/src/sather-1.2.2/Bin/sacomp /usr/local/bin        (make the soft link of sacomp in /usr/local/bin)
 ln -s /usr/local/src/sather-1.2.2/Bin/sabrowse /usr/local/bin      (make the soft link of sabrowse in /usr/local/bin)

4.2. Test

You can test it in the following way. Testing takes ca. 10 minutes. Everything OK if the test program say Everything okey at the end.
 cd /usr/local/src/sather-1.2.2/Test
 make test-full

...........
wait 10 min
...........

TEST DONE

Everything okey

4.3. Editing your .bashrc

Add following line in the ~/.bashrc.
SATHER_HOME=/usr/local/src/sather-1.2.2;export SATHER_HOME

5. Configuring Emacs

As sather.el is available, it is convenient to use emacs to edit Sather source codes.
  1. copy sather.el and sather-lib.el to the load path of emacs such as /usr/local/share/emacs/site-lisp.
    su
    cp /usr/local/src/sather-1.2.2/Emacs/*.el /usr/local/share/emacs/site-lisp
    
  2. byte-compile these files. You can ignore warnings.
    cd /usr/local/share/emacs/site-lisp
    emacs -batch -f batch-byte-compile sather*.el
    
  3. add following three lines to the ~/.emacs.
    (add-to-list 'auto-mode-alist '("\\.sa$" . sather-mode))
    (add-to-list 'auto-mode-alist '("\\.psa$" . sather-mode))
    (autoload 'sather-mode "sather" "Major mode for Sather  programs" t)
    

Test

  1. Open a Sather source code and see if it is highlighted.
    For instance
    emacs /usr/local/src/sather-1.2.2/Test/test-all.sa 
    
  2. See if you can see the info of Sather by pressing (Ctrl-h i). (Or type info Sather in the command line.)

6. Have you got it?

As it is almost an ordinary procedure even complicated somehow, you can do it with little problems, I hope, if you have enough experience to compile from the source.

If you could not, send a message to the guest book. I may be able to advice.