The C[] Compiler Installation Guide



Unpacking

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

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


Building The C[] Compiler from Sources

Building the C[] compiler consists of two steps: firstly edit makefile. Secondly compile all the programs.

Editing Makefile

Open Makefile in the root C[] compiler distribution directory ( cbc-2.0.1 ) 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 the Executable

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).