## -*- mode: Text -*-

These are abbreviated instructions for installing the Flux Knit Tools using the
binary distribution and the source distribution , and for building a special
version of `gcc' for use with the ``flattening'' optimization.

Longer, more detailed instructions are included in the Knit User's Manual (the
file `doc/user/manual.ps').


Installing the binary distribution
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Just run the following (feel free to change the installation directory from
`$HOME/local'):

	./configure --prefix=$HOME/local
	make -C bin install

Preformatted documentation is included in the distribution:

	doc/user/manual.{dvi,ps}	--- Knit User's Manual and Tutorial
	doc/report/report.{dvi,ps}	--- Knit Language Report

If you need to re-make the documentation for some reason, do the following:

	make -C doc


Installing the source distribution
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

One of the support tools needed to build Knit currently contains a bug.  The
workaround for this bug is complicated and time-consuming, so, in this file, we
only give instructions on how to install the binary release.  (Note that the
``binary release'' includes full source code.)

If you really want to build Knit from source, read the instructions in the Knit
User's Manual (`doc/user/manual.ps').


Using the ``flattening'' optimization
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

If you want to use flattening, you may also need a patched copy of `gcc'.  The
effect of the patch is to disable some type errors.  This sounds really dodgy
but we're assuming you've already built your system without flattening using a
normal C compiler and it didn't report any type errors.  If so, then building
it again with flattening and the hacked compiler should work just fine.

The resulting compiler should not be installed on your normal path to reduce
the chance of accidentally using the patched version as your production
compiler.  The instructions below are for installing things in
`$HOME/local/hacked-gcc/{bin,lib,...}'.

	# We assume gcc-2.95.2 but the patch will probably work with most
	# versions of gcc since it patches code that seems to change slowly.
	bunzip -c gcc-core-2.95.2.tar.bz | tar zvf -
	patch knit/unsupported/gcc.patch
	cd gcc-2.95.2
	./configure --prefix=$HOME/local/hacked-gcc
	make install

Now when building your programs, run Knit with the `-f' flag and then use:

	make CC=$HOME/local/hacked-gcc/bin/gcc

## End of file.

