The C[] Compiler v2.0.3 Installation Guide



Table of Contents
  1. Unpacking
  2. Building The C[] Compiler from Sources
  3. Installing The C[] Compiler
  4. Tuning Up for a Particular Platform
Unpacking

To unpack C[] compiler sources, type the following shell commands:

     gunzip cbc-2.0.3.tar.gz
     tar -xvf cbc-2.0.3.tar
The above commands create the directory cbc-2.0.3 and unpack sources to it. Now type from a command prompt:
     cd cbc-2.0.3


Building The C[] Compiler from Sources

Building the C[] compiler consists of two mandatory steps: editing makefile and compiling all programs.

Editing Makefile

Open Makefile in the root C[] compiler distribution directory ( cbc-2.0.3 ) with any text editor. Now properly set up the folowing Makefile variables:

CC   - a C compiler to compile all the programs, gcc is recomended on all platforms other then HP. On HP c89 should be used.
 
OPT   - optimizing options to pass to the C compiler.
 
SF   - platform-dependent C compiler options. Platfroms and corresponding SF values are listed in the Makefile.
 
CPPDIR   - directory containing C preprocessor. GNU cpp is strongly recomended. For example on one of our computers the variable CPPDIR is set to /export/home/local/lib/gcc-lib/sparc-sun-solaris2.4/2.7.2.f.1. It is very important to avoid extra spaces at the end of the string value of this variable.
 
CBCHOME   - C[] compiler root installation directory, the directory to install compiler binaries and headers . It is very important to avoid extra spaces at the end of the string value of this variable.
Compile All Programs

Type

  make
from a command prompt. The cbc command line compiler and cbcc compiler driver will be automatically built.


Installing The C[] Compiler

To install C[] compiler type from a command prompt:

  make install

The installation procedure creates the C[] compiler root installation directory according to the value of CBCHOME Makefile variable. Then bin, man and h subdirectories of the root install directory are created and all necessary files are copied to these directories. The bin contains the cbc command line compiler and the cbcc compiler driver. The h directory contains headers which are always included into output C files (see The C[] Compiler User's Guide for details).


Tuning Up for a Particular Platform

cbc compiler version 2.0.3 and higher produce parameterized code containing machine-specific parameters which are defined in file $(CBCHOME)/machdef.h. By default, the file describing SPARCStation-5 with MicroSPARC chip and 8K primary cache is installed. In order to better meet requirements of your system you may generate machdef.h file yourself. To do this type


    make tune

from the compiler distribution root directory. The process will take about one hour.