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.
- My own PC(CPU: AMD Sempron 2800+), Memory 1024 MB, HDD 80 GB, DVD multi drive)
- OpenSuSE 10.0 for i386
3. Preparation
3.1. Required header files and library
Followings are required to install Sather.
- header files of gc: gc.h,
gc_config_macros.h,
gc_local_alloc.h,
gc_pthread_redirects.h,
gc_typed.h
- header files of tcl:
tcl.h,
tclDecls.h,
tclExtend.h,
tclPlatDecls.h,
tcldbg.h
- header files of tk:
tk.h,
tkDecls.h,
tkPlatDecls.h
- libraries of gc: libgc.so, libgc.la
- a library of tcl: libtcl.so
- a library of tk: libtk.so
note
3.2. Installing gc and tcl/tk
- getting the source
The tar balls are at the following sites.
- extracting the tar balls
you can extract *.tar.bz2 and *.tar.gz using following commands
tar xjvf *.tar.bz2
tar xzvf *.tar.gz
- 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
- 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).
- 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
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
cp sather-1.2.2.tar.bz2 /usr/local/src
cd /usr/local/src
tar xjvf sather-1.2.2.tar.bz2
cd sather-1.2.2
SATHER_HOME=/usr/local/src/sather-1.2.2;export SATHER_HOME
make compiler
make browser
make info
cp Emacs/*.info /usr/local/info
cat Emacs/dir >> /usr/local/info/dir
ln -s /usr/local/src/sather-1.2.2/Bin/sacomp /usr/local/bin
ln -s /usr/local/src/sather-1.2.2/Bin/sabrowse /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
...........
...........
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.
- 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
- byte-compile these files. You can ignore warnings.
cd /usr/local/share/emacs/site-lisp
emacs -batch -f batch-byte-compile sather*.el
- 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
- Open a Sather source code and see if it is highlighted.
emacs /usr/local/src/sather-1.2.2/Test/test-all.sa
- 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.