KROC(1)

NAME
kroc - KRoC occam system main driver program

SYNOPSIS
kroc [-C CONFIG-FILE] [OPTION]... [FILE]...

DESCRIPTION

Compiles occam source FILEs and optionally links with other object FILEs to produce an executable. For example, to compile the source file foo.occ into an executable, you would issue the command:

    kroc foo.occ

If successful, this will leave behind an executable called foo.

To seperately compile bits1.occ and bits2.occ, then compile main.occ linking in the bits and the course library, something like the following would be used:

    kroc -c bits1.occ
    kroc -c bits2.occ
    kroc main.occ bits1.o bits2.o -lcourse

A path to a specific KRoC configuration file can be specified using the -C option.

DEBUGGING

When an occam program crashes out with either "deadlock" or "range error", debugging can be used to find out what went wrong. To enable, simply compile with the "-d" flag:

    kroc -d foo.occ

when the program crashes now, it will report the filename and line-number where the error occured. For deadlock, the state of processes blocked on communication is reported, again with filename and line-number.

OPTIONS

-b, --brief
    give brief occ21 error messages. default behaviour is to print the offending code along with a few lines either way. can sometimes get a bit much though.

-c, --compile
    compile source FILE to object, do not link.

-s, --strict
    strict usage checking. this causes the compiler to go into strict usage checking mode. undefined warnings become errors and channel direction specifiers must be used on all references to channel names (except real channel declarations, which are transparently both).

-S  compile in STOP error mode. instead of aborting on run-time error, a program compiled in stop error-mode are simply descheduled (with error reporting if post-mortem debugging is enabled). This flag is only honoured when compiling a main code unit (i.e., without -c) and affects all processes within the program.

-d  enable debugging (post-mortem). this will capture and report all run-time errors and attempt to locate deadlocked processes when the whole system deadlocks.

-e, --enable-udc
    enable external channel checking. this is used to turn on the external-channel checks in the translator and enables PLACE'd channels and the mobile-size-field in the occam compiler.

-h, --help
    show usage summary and exit.

-Ipath
    search path for occam libraries and includes. may be used multiple times.

-Lpath
    search path for native code libraries. may be used multiple times.

-lname
    link with native code library libname.so.

-k, --keep-temp
    keep temporary files created during compilation, extended transputer code (.tce) files.

-V, --version
    print version and exit.

-l, --library
    generated .so shared library. this is used to create process libraries for the dynamic loadable processes extension.

-n, --dry-run
    do not run any commands, just print them.

--oc-opts=opts
    pass these options to the occam compiler (occ21).

--octran-opts=opts
    pass these options to the translator (tranx86).

--cc-opts=opts
    pass these options to the C compiler (gcc).

-nw, --no-warn
    no warnings from occ21.

-nd, --no-dynmem
    disable dynamic memory support.

-o file
    output to FILE.

-p, --pre-compile
    pre-compile occam source files to extended transputer code (.tce) files.

-P, --pause
    enable event/schedule check and possible reschedule at loop-ends and on backward jumps.

-io, --inline-io
    inline various input/output kernel calls.

-is, --inline-sched
    inline various scheduler kernel calls.

-it, --inline-ldtimer
    inline load-timer kernel call.

-v, --verbose
    show commands run during compilation and additional information from the translator.

-w, --warn
    show additional warnings from occ21.

-X6 enable extended input for unhandled CASE inputs (and other experimental features).

-X7 enable mobile processes (experimental).

--nfw
    do not wait for globally forked processes when terminating.

--new
    do not wait for unfinished blocking system-calls when terminating.

ADDITIONAL OPTIONS

-di enable insert debugging (post-mortem). this is used to track the execution of code for very precise debugging. use this when attempting to track errors in external C code.

-dm enable run-time memory access debugging. this is used as a compiler debugging aid and requires the run-time system to have been built with the necessary support (disabled by default).

-t2, -t4, -t8, -t9
    set occ21 processor compilation class (only t8 (extended), default, is fully supported).

--rmox
    compile for RMoX (experimental).

--nocc
    use the new occam-pi compiler (experimental).

--nocc-opts=opts
    pass these options to the new occam-pi compiler (experimental).

--force-tlp
    force top-level PROC interface to be `(CHAN BYTE kyb?, scr!, err!)', regardless of whether it actually is or not.

--no-revalt
    disable reversed ALT disabling sequences (enabled by default).

--use-revalt
    enable reversed ALT disabling sequences (default).

--no-zen
    disable enhanced ALT enabling (enabled by default).

--use-zen
    enable enhanced ALT enabling (default).

--no-zep
    disable ALT pre-enabling (enabled by default).

--use-zep
    enable ALT pre-enabling (default).

--ncl
    do not link in default compiler libraries.

--xml
    generate XML tree-dump from the compiler.

-H, --halterror
    use HALT error-mode (default). This option is only effective on the top-level process (i.e., one compiled without -c).

--cc
    print compiler for use with external C code.

--cflags
    print compiler flags to be used when compiling external C code (e.g. CIF processes).

--tran
    print the path to the translator for .tce/.etc files.

--tranflags
    print the flags given to the translator.

--libpath
    print path to occam libraries.

--incpath
    print path to occam includes.

--cclibpath
    print path to host libraries in -L.. form.

--ccincpath
    print path to host includes in -I.. form.

--linkcc=prog
    use the given program for final linking (gcc).

AUTHOR
See the file AUTHORS in the distribution for the list of contributors to KRoC. This manual page is maintained by Fred Barnes <F.R.M.Barnes@kent.ac.uk>

SEE ALSO
kmakef(1)

REPORTING BUGS
Please report bugs to <kroc-bugs@kent.ac.uk>

COPYRIGHT
Copyright © 1996-2005 KRoC AUTHORS

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.