
			 Installation Notes
			 ==================

This area is nearly self-contained and can be given to students to
work on.  However, there is a library that is used by all the example
programs and that will need to be compiled and installed somewhere
that KROC knows about.

Building the course library
===========================

Once kroc has been installed, go to the 'libsrc' directory and build
and install the course library:

    unix% make install
    kroc -c utils.occ
    kroc -c string.occ
    kroc -c demo_cycles.occ
    kroc -c demo_nets.occ
    kroc -c file_in.occ
    kroc -c float_io.occ
    kroc -c random.occ
    rm -f ../lib/libcourse.a
    ar rc ../lib/libcourse.a utils.o string.o demo_cycles.o demo_nets.o file_in.o float_io.o random.o
    ranlib ../lib/libcourse.a
   echo utils.tco string.tco demo_cycles.tco demo_nets.tco file_in.tco float_io.tco random.tco | tr ' ' '\012' > course.lbb
    ilibr -f course.lbb -o ../lib/course.lib

[or something similar]
If your system does not need ranlib, it should give an error but the
resulting library will be correct.

The library files used are now in the 'lib' directory -
    libcourse.a	       (UNIX library containing object code)
    course.lib	       (occam library containing PROC/FUNCTION headers)
    consts.inc	       constants used in library


Compiling the Examples
======================

You can now compile the examples and exercise programs.  To do the
former, just enter the examples directory and type 'make'.

    unix% make
    kroc demo.occ -L../lib -lcourse
    kroc echoing.occ -L../lib -lcourse
    kroc hello_raw_world.occ -L../lib -lcourse
    kroc hello_seq_world.occ -L../lib -lcourse
    kroc hello_world.occ -L../lib -lcourse
    kroc sort_inside.occ -L../lib -lcourse
    kroc sort_pump.occ -L../lib -lcourse
    kroc test_utils.occ -L../lib -lcourse

[or something similar]

and you can run them.


Compiling the Exercises
=======================

The exercises are compiled as follows, and must be done with the
explicit arguments:

    unix% kroc q1.occ -L../lib -lcourse

etc.

Now this is a little clumsy for students, so you may want to fix the
installation so that the extra arguments to 'kroc' are not needed.
To do this, you have two choices:

1. You can either copy the three needed files (libcourse.a, course.lib
and consts.inc) from the course lib directory into the default kroc
search directory ($KROC/lib).

If you want to do this, then type:

    unix% cp lib/course.a lib/course.lib lib/consts.inc $KROC/lib

    [where $KROC is wherever you installed kroc]


2.  You can edit the 'kroc' driver program to find the course files
in the current place

If you want to do the latter, then edit $KROC/bin/kroc in a text
editor and change the line (~29):
       ocllibs="-loccam8 -loccamutl -lm"
to read:
       ocllibs="-loccam8 -loccamutl -lm -lcourse"
and change the line (~42):
    ocspath="$ocrtsdir ./"
to read:
    ocspath="$KROC/course/lib/ $ocrtsdir ./"
if $KROC/course/lib is the location of the course lib directory


If you do either of the above, then you, or any of the students can
now compile the exercises simply:

     unix% kroc q1.occ

and the programs will compile without need for the extra arguments.
