Giter VIP home page Giter VIP logo

kroc's Introduction

KRoC

The Kent Retargetable occam Compiler (KRoC) is an occam/occam-pi language platform, comprised of an occam compiler, native-code translator and supporting run-time system.

Prerequisites

To compile and use KRoC, you will need to have the following already installed on your machine:

  • the bash shell
  • the GNU toolchain -- i.e. GCC 2.95.2 or later, binutils 2.0 or later, GNU awk, GNU make
  • pkg-config
  • the C development headers
  • Python 2.4 or later
  • xsltproc

Some occam-pi modules can optionally make use of other native libraries if available:

  • libpng
  • SDL and SDL_Sound
  • OpenGL
  • MySQL
  • Player

To check out and update KRoC from the Git repository, you will also need:

  • Git
  • automake 1.8 or later, autoconf 2.52 or later (but not autoconf 2.64, which is buggy)

On Debian-based systems, we suggest installing the following packages:

apt-get install bash gcc binutils gawk make automake autoconf pkg-config \
libc6-dev libsdl1.2-dev libsdl-sound1.2-dev libgl1-mesa-dev \
libmysqlclient15-dev libpng12-dev libxmu-dev libxi-dev \
libplayercore2-dev libplayerc2-dev libltdl3-dev \
perl python xsltproc git

On x86-64 Debian systems, you will also need the packages that allow 32-bit binaries to be compiled:

apt-get install libc6-dev-i386 lib32gcc1 gcc-multilib

Installation

For installation instructions, please see:

http://projects.cs.kent.ac.uk/projects/kroc/trac/wiki/Installation

Configuration

Before using KRoC, remember to source the relevant setup file:

  • ". PREFIX/bin/kroc-setup.sh" for Bourne-style shells such as bash

  • "source PREFIX/bin/kroc-setup.csh" for C-style shells such as csh/tcsh

It may be convenient to include this command in your shell's startup file (e.g. "/.bash_profile", "/.cshrc", or "/etc/profile").

Directories

demos/

Some standalone demo programs written in occam-pi.

doc/

Various items of documentation. The "essentially-kroc.txt" file is a
good place to start.

install/

This is the default installation directory for KRoC.

modules/

Reusable modules that can be used in occam-pi programs. Each module
contains a "libsrc" directory with the module's source code, and an
"examples" directory with demonstration and test programs.

The "modules/course" directory will probably be of particular
interest, since it contains the examples and exercises used to teach
occam-pi at the University of Kent.

runtime/

Low-level runtime support code for the occam-pi environment.

tests/

Functional test programs for occam-pi systems.

tools/

Tools for compiling, debugging, packaging and documenting occam-pi
programs.

licenses/

Copies of relevant software licenses (see Licensing below).

Note: most directories contain further README files.

Licensing

KRoC is free software. In general, tools are made available under the GNU General Public License (v2 or later), and libraries are made available under the GNU Lesser General Public License (v2 or later). Information about the GNU licenses can be found at:

http://www.fsf.org/licensing/

Reporting problems

Known bugs are given in the top-level BUGS file. If KRoC fails to compile or work correctly on your system, please mail our bug tracking system at [email protected], including a brief description of the problem and a copy of the "typescript" file generated by "build".

kroc's People

Contributors

atsampson avatar bringfire avatar clj avatar egelmex avatar exo avatar gilmorenator avatar jadudm avatar nuked avatar perlfu avatar peter-welch avatar prettysg avatar rdcrng avatar snim2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kroc's Issues

32bit is deprecated on newer Mac OS versions?

Attempting to build on:

System Version:	macOS 10.15.3 (19D49f)
Kernel Version:	Darwin 19.3.0

leads to this error:
ld: warning: The i386 architecture is deprecated for macOS (remove from the Xcode build setting: ARCHS)

which is I believe due to deprecation of 32bit builds on newer Mac OS (Xcode?) versions.

I'd be willing to try some fixes (I will play with ARCHS setting of Xcode), but I suspect the problem will be a lot deeper and beyond my knowledge. But if you have any pointers for things I could try, please comment them here, I'm an old Occam fan and would love to see it running on my Mac and try my hand at writing some again, after a 35y break since I tried it at University. :-)

Compiled programs segfault on Ubuntu 18.04

I haven't investigated that hard, but compiled programs (and indeed the test suite) segfault on execution when KRoC is built on Ubuntu 18.04 (and, presumably, but untested, also on the equivalent Debian version - buster?). Stack trace was corrupt.

Not a very useful bug report, but figured it worth noting in case anybody else spots it too. If I get more time I'll try and debug it a little better.

cdx.o: No such file or directory

During compilation via ./build make -k clean runs which deletes a variety object files.
In the makefiles we only aim at generating .tce files so the object files associated with the compilation of the .tce files did not get regenerated if the .tce files weren't deleted

This only seems to be a problem with the compilation of cdx.tce

Performing make clean destroyed all the .o files but not the .tce files so that complete compilation could start again.

Steps to reproduce:
Running on kroc-1.6

  1. ./build --prefix=...
  2. ./build --prefix=...
  3. Compilation fails

Unused options in build process

From trac reported by @jadudm:
We pass configuration options down through the build process that are unrecognized in some parts of the tree. This causes warnings during the build process that confuse new developers.

Build generates warnings with newer Autotools

There are several warnings of the type:

configure.ac:2: warning: The macro `AC_CANONICAL_SYSTEM' is obsolete.
configure.ac:2: You should run autoupdate.

as just one example. Documentation on how to fix these can be found here.

Build failure: gcc: multiple definition of 'oc_help_info'

Failure occurred under GCC 11:

/usr/bin/ld: harness.o:/home/virt/projects/occam/kroc/tools/occ21/misc/harness.c:567: multiple definition of 'oc_help_info'; version.o:/home/virt/projects/occam/kroc/tools/occ21/version.c:39: first defined here

Adding extern to harness.c fixes the problem.

Unhelpful message in ./build

If ./build fails on make step it reports installation failed.

This could probably be updated to print something like.

* Build failed, KRoC was not installed*
and
* Installation failed, KRoC not installed*

to make it clearer at a glance.

configure tests link against the wrong libraries on AMD64

When building on an AMD64 machine, KRoC cross-builds for IA32 -- i.e. it passes -m32 to GCC and winds up linking against 32-bit libraries. However, the configure tests that check for libraries don't ever find out about the extra linker flags, so they check for the AMD64 libraries. As a result, you can wind up getting modules enabled that can't possibly build.

The problem is that occbuild and occbuild.m4 only exposes CFLAGS for native code, not linker flags. This could be fixed by adding a --libs flag to occbuild, and have occbuild.m4 export the result as OCCBUILD_LIBS (both names by analogy with pkg-config), which could then be used when doing configure tests for native libraries.

udc needs either fixing or removing

From trac:
The udc (user-defined channels) module is broken in the MP branch; I don't think we really have much of a use for it any more, so it can probably safely be removed.

AMD64 build doesn't pass -fPIC when building library modules

/usr/bin/ld: cfile.o: relocation R_X86_64_PC32 against undefined symbol `select@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
occbuild: Command failed: gcc -L/home/me92/src/kroc-git/kroc-git/modules/inmoslibs/libsrc/forall -L/home/me92/src/kroc-git/kroc-git/tvm/posix -shared -o liboccam_tvm_file.so cfile.o

dynproc needs either fixing or removing

From trac:
dynproc is broken in the MP branch. We've got at least one application (the occam webserver) that uses it, so we might want to consider fixing it.

Segfault on simple program (skip.occ)

Given this program:

PROC main (CHAN BYTE kyb, scr, err)
  SKIP

the TVM segfaults. (I don't know if kroc would segfault, because I'm just trying to get a TVM build going.)

building as follows:

CFLAGS=-DDEBUG_INTERPRETER ./build --prefix=/home/jadudm/local/kroc --with-toolchain=tvm --with-wrapper=posix

and compiling the program with occbuild --program skip.occ, I get a TCE and TBC file.

I get the following debug output from running tvm skip.tbc:

jadudm@lego:~/git/kroc/mcj$ tvm skip.tbc
0x565557768814 55    LDNLP 00000005 00000000 00000000 00000000
0x565557768815 56    LDNLP 00000006 00000014 00000000 00000000
0x565557768816 00        J 00000000 0000002c 00000000 00000000
0x565557768817 00        J 00000000 0000002c 00000000 00000000
0x565557768818 60     NFIX 00000000 0000002c 00000000 00000000
0x565557768819 4e      LDC fffffffe 0000002c 00000000 00000000
0x56555776881a 22     PFIX 00000002 fffffffe 0000002c 00000000
0x56555776881b f5  FFICALL 00000025 fffffffe 0000002c 00000000

Dumping the TCE file:

jadudm@lego:~/git/kroc/mcj$ tce-dump.pl skip.tce
.JUMPENTRY	main
.ALIGN	3

.L0:
.GLOBAL	main
.SETWS	4
.SETVS	0
.MS_USAGE	0
.FILENAME	skip.occ
.LINE	1
.PROC	main
	.LINE	2
	RET
.GLOBALEND	main
.ALIGN	3

I'm not sure what is going on. The LDNLP (load non-local pointer) instructions... could be loading the top-level channels (KYB, SCR, ERR)... but... Hm.

The entire program compiles down to a RET instruction. However, the actual run looks different... which I think is because the TVM wrapper/runtime for POSIX has to do some additional work (that is, making FFI calls in order to check the external channels, etc.).

I think the segfault has to do with the external channel linkages, but that's a hunch, not something supported by evidence.

This is a start, anyway.

tvm for a 32 bit Tensilica Xtensa LX6

This site seems dead, and many occam-pi and kroc sites seem stale. However, I am still thinking about a port to the ESP 32 and it's 32 bit Tensilica Xtensa LX6.

The Xtensa LX6 chipsets have more memory than the arduino and run up to 240MHz so would be a powerful occam iot platform.

However, promises of putting together instructions for porting to something more than bare metal have fallen through. The starting position, that is, does not appear to be the arduino port example.

To facilitate this a brief on the method to port to a minimal OS needs work.

I was toying with an update of Plumb to support as well. That, in itself, should be straightforward.

Would there be excitement enough to get something like this going?

Cheers,
A

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.