KiCS Installation

24 July 2011

For a long time, I have been curious about logical programming. Being fond of functional programming languages, I thought that Curry sounded like a good first step in learning more about logical programming. However, it turned out to be a bit of a tedious task figuring out the installation of the implementation of choice, the Kiel Curry System (KiCS). The reason I chose KiCS was that I may be using Curry in a project, where one of the requirements is the possibility to interface with native C++ code. Haskell supports this, and KiCS is Curry that runs on Haskell. This post will cover setting up KiCS.

The fact of the matter is that KiCS relies on the cabal package curry-frontend, which did not install out-of-the-box on my machine, due to package dependency version incompatibilities. I  also encountered som locale issues. This post will hopefully help others prevent some of these pit-falls.

Prerequisites
I made KiCS work using ghc-6.12.1-12/cabal-install-0.8.0-1 from Ubuntu 10.04’s repository. It will not work for versions of GHC ≥ 7 (at least when I tried, it did not).

I made KiCS v 0.81893 from the tar-ball from the official page.

These instructions should work on any *nix based system with Haskell (i.e. also Mac OS X).

Steps

  1. Install the curry-frontend version 0.2.9 package:
    $ cabal install curry-frontend-0.2.9

    Note: Make sure to include the cabal bin directory in your path, as described on the official KiCS page:

    $ export PATH=~/.cabal/bin:$PATH
  2. Install happy:
    $ cabal install happy
  3. Install haskell-src:
    $ cabal install haskell-src
  4. Theoretically, you should now be able to install KiCS as described on the official page, i.e.:
    $ tar xf kics_src.tar
    $ cd kics
    $ make 

    In practice, however, a well-known locale bug prevented this for me. For each file that make complained about, I did the following (exemplified by IO.curry):

    $ <src/lib/IO.curry iconv -f ISO-8859-1 -t UTF-8>IO.curry && \
       mv IO.curry src/lib/.

    Eventually, the make should succeed.

  5. Run KiCS:
    $ ./bin/kicsi
             _               _           _            _
            /\_\            /\ \       /\ \          / /\
           / / /  _         \ \ \     /  \ \        / /  \
          / / /  /\_\       /\ \_\   / /\ \ \      / / /\ \__
         / / /__/ / /      / /\/_/  / / /\ \ \    / / /\ \___\
        / /\_____/ /      / / /    / / /  \ \_\   \ \ \ \/___/
       / /\_______/      / / /    / / /    \/_/    \ \ \
      / / /\ \ \        / / /    / / /         _    \ \ \  The
     / / /  \ \ \   ___/ / /__  / / /________ /_/\__/ / /  Kiel
    / / /    \ \ \ /\__\/_/___\/ / /_________\\ \/___/ /  Curry
    \/_/      \_\_\\/_________/\/____________/ \_____\/  System
    
    Version 0.81893
    
    no readline support. Consider cabal install readline
    Prelude> 3+4
    7
    More?
    
    No more Solutions
    Prelude>
    

No comments

Hello world!

24 July 2011

This is my blog. I will use it as an outlet for my explorations and projects.

3 comments