kent logo

CO538 Anonymous Questions and Answers Keyword Index

This page provides a keyword index to questions and answers. Clicking on a keyword will take you to a page containing all questions and answers for that keyword, grouped by year.

To submit a question, use the anonymous questions page. You may find the keyword index and/or top-level index useful for locating past questions and answers.

Keyword reference for linux


Question 115 (2004):

When I try to run my q7 answer on my Linux box (Mandrake 10.1) I get this error:

    KRoC: unable to find clock file (.kroc_clock or /etc/kroc_clock)

What does it mean and what can i do to fix it ?

Answer 115:

It's because you're missing the KRoC clock file. When you installed the software it prints out a message saying that you must copy "~/.kroc_clock" to the current-directory or to "/etc/". This file just contains your CPU speed in MHz (as read from "/proc/cpuinfo"). Newer versions of KRoC/Linux (1.3.4-pre4 and above I think) will automatically read the speed out of "/proc/cpuinfo" if a clock file isn't found.

Keywords: q7 , linux

Question 69 (2004):

I am having trouble installing the vim extensions on my linux machine at home. My version does not highlight keywords or auto-indent etc. :( Do I just copy the vim-extensions folder into my vim directory as suggested on the vim website, or are there other things I need to do ? (the info on their website is very brief). I wasn't sure if vim would automatically detect and use the new folder/extensions.

Answer 69:

The kent vim extensions by default will replace your "~/.vimrc" file. This is where Vim looks for things when it starts up. You don't actually need the kent Vim extensions, however, since occam syntax highlighting is now included in the Vim distribution (as shipped for Linux distributions). You do need to turn syntax highlighting on, however (and this is generally a good idea for any editing in Vim, assuming you have a colour-capable terminal). My own "~/.vimrc" file contains, amongst other things:

    syntax enable
    set foldmethod=marker
    map <F2> zc
    map <S-F2> zC
    map <F3> zo
    map <S-F3> zO
    map <F4> zM
    map <F5> zR

The first command turns on syntax highlighting. The second tells Vim to use folding, based on the "marker" method (the fold markers are, by default, "{{{" and "}}}"). The remaining commands map my mostly unused function-keys to fold-operations. E.g. F2 and F3 close and open folds respectively. F4 and F5 open all and close all folds respectively.

The "~/.vimrc" file that the kent-vim-extensions should install is on raptor in "/usr/local/courses/co516/kent-vim-ext/-kent-vim-ext-vimrc". If you look at this file you'll see it sets up some things before loading other .vim initialisation files.

Keywords: linux , vim

Question 26 (2004):


I've successfully installed KRoC on my Linux machine. But when I try to run the "kroc q1.occ -lcourse" command, for example, it tells me that it doesn't know the "kroc" command. Someone's told me that to overcome this I have to first type the command:

    source <path-to-where-I-installed-kroc>/bin/setup.sh

and that works.

But how do I set things up so that that command is automatically done whenever I open a new shell window? It's very tedious to type manually each time! I'm using the bash shell. Thanks.

Answer 26:

You need to arrange for the shell to execute this each time it starts up. The most effective method is just to add that command (`source /path/to/kroc/bin/setup.sh') to your `~/.bash_profile'. This may not start working immediately (some GUI environments start bash shells in non-login mode), but will do if you log out of X and back in again.

Alternatively, you can make it system-wide by putting the same command in `/etc/profile'.

Keywords: linux


Question 99 (2003):

Hi. I have just installed Mandrake 9.2 and downloaded `kroc' & `gvim'. Is there a detailed readme suited to a non-unix person giving clear instructions on how to get an `.occ' file compiling using KRoC ? Thanks.

Answer 99:

When you install KRoC on Linux (running the `./build' script), it outputs a message directing you to some initial documentation:


Compiling from the command-line is relatively simple. After you've source'd the KRoC setup file (that modifies your `PATH' environment variable):

    source /path/to/kroc/bin/setup.sh

(use `setup.csh' if you use csh or tcsh, although I'd stronly recommend bash -- that is probably the default).

To compile an occam file:

    kroc q7.occ -lcourse

As for gvim, install the Kent Vim Extensions following the instructions on:


Keywords: gvim , linux

Question 37 (2003):

I've tried to install KRoC onto my computer at home running Mandrake Linux. I ran the `build' script, so it should be installed according to the installation instructions. But yet it still doesn't recognise the 'kroc' command. Sorry I'm new to linux, what have I done wrong (or more likely not done)?

Answer 37:

You suggest correctly that it's something which you've not done. Before you can use kroc, you need to source the setup file. More than likely, this will be something like:

    mandrake$ source /path/to/kroc/bin/setup.sh

replace `/path/to/kroc/' with the directory where you installed KRoC to -- which will be the source tree if you just hit return at the first question it asks you (about where to install).

Once that file has been sourced, the `kroc' command should work.

Keywords: mandrake-linux , linux


Question 16 (2001):

I'm trying to install Kroc on my newly installed Linux system at home. I've unzipped and tarred it, run the script called 'build', but get the error message Script 'build' line29: unknown command unset.

In the read-me file, there is also the sentence: You will need the standard linux kernel headers in order to compile the sources. As a newby, I do not understand a word of this! Is there any chance of an 'idiots' installation guide?

Answer 16:

The shell should really understand unset. What Linux distribution are you using? It sounds like you have something old or non-bash ...

More information is needed to diagnose your problem properly. Please mail Fred Barnes, frmb2@ukc.ac.uk, the typescript file generated during the 'build' operation. This (anonymous) medium is not the place to sort this out.

Keywords: linux

Question 9 (2001):

I am attempting to install KRoC on my own Linux machine. I have downloaded it and installed it as per the instructions on the Kroc webpage, but I get these errors when compiling the demo.occ you supplied in the examples directory:

  [aejm1@localhost examples]$ kroc demo.occ
  Warning-oc-demo.occ(20)- Parameter error is not used
  Warning-oc-demo.occ(20)- Parameter in is not used
  demo.o: In function `_occam_start':
  demo.o(.text+0x50): undefined reference to `O_fibonacci'
  demo.o(.text+0x5c): undefined reference to `O_squares'
  ...  etc.

What am I doing wrong?

Answer 9:

You have missed one other instruction. To pick up the course library that these examples use, the compile command on the Linux KRoC must be:

  kroc demo.occ -lcourse

On raptor, we have specially modified the kroc command to find the course library automatically. For general release KRoC, where applications need not use our special course library, it would be wrong to make that automatic provision - so you have to use the general mechanism provided by kroc for accessing pre-compiled libraries. This mechanism is the same as that used by the standard gcc compiler and is explained in the essentially-kroc documentation provided in the release (and which the KRoC build script strongly encourages users to read).

Keywords: linux


Question 84 (2000):

Not really an anonymous question, more an anonymous suggestion!!

I downloaded the answers directory last night to run the example animations at home. Its only after I rebooted to Linux and tried to run it that I realised that the compiled versions are in SPARC format!! My solution - reboot to Windows telnet in, run the animations, make notes, reboot to Linux and do my assignment!

Would it be possible to put up Linux versions of the compiled code when you aren't providing the original source (in the case of assignments before the deadline)?

I know it won't help anyone in our year anymore, but it might help students in the future.

Answer 84:

The fun ones are there! Once you have built the KRoC/Linux release, look in:


and you will find Linux/PC executables q7-nick and q7-fred. What we didn't include, sadly, was a Linux/PC executable for the minimal solution - i.e. the equivalent to a7 on raptor. Yes, we will do that in future. Apologies.

Keywords: demos , model-answers , linux

Valid CSS!

Valid XHTML 1.0!

This work is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License.
Last modified Mon May 20 13:50:27 2013
This document is maintained by Fred Barnes, to whom any comments and corrections should be addressed.