Saclib2.1 on Linux


Where it works

This version of Saclib2.1 for linux has been successfully used on the SuSE linux distribution. There have been problems compiling it on Debian linux, though. These problems have to do with the ucontext.h system header's for exception handling. As I get more information on different linux's, I'll post it.

Downloading and installing

First download saclib2.1.tar.gz and unzip and untar it. Compiling the system requires that an environment variable saclib be set to the root directory of the saclib system, e.g. /home/brown/saclib2.1. Then simply type $saclib/bin/mklib all, and hope for the best. If there are any problems send me an e-mail.

Documentation

Saclib2.1 is sparsely documented. To get documentation (old and outdated, I'm afraid), cd to $saclib/doc/guide and type make. This will produce the file $saclib/doc/saclib.dvi, which is most of the available documentation. For any saclib function, such as IPROD, you may also use sman: For example:
>$saclib/bin/sman IPROD
/*===========================================================================
                              C <- IPROD(A,B)

Integer product.

Inputs
  A,B : in Z.

Outputs
  C   : A * B.
===========================================================================*/

Using

Here is a trivial example of a saclib program, along with instructions for compiling the program:
/* Compile with:
   gcc -I$saclib/include test.c $saclib/lib/saclibo.a
*/
#include "saclib.h"

int sacMain()
{
  Word A, B, C;
  A = IREAD();
  B = IREAD();
  C = IPROD(A,B);
  SWRITE("A*B = ");
  IWRITE(C);
  SWRITE("\n");  
}
    
What results is a program that reads in two arbitray length integers and prints out their product. For example:
valiant[113] [~/temp/]> gcc -I$saclib/include test.c $saclib/lib/saclibo.a
valiant[114] [~/temp/]> a.out
6723893537669
6328735289323
A*B = 42553742313496668714008087
    

Chris Brown
Last modified: Fri Mar 31 16:11:18 EST 2000