[ Home ] The pages on this CLiki-driven site can be edited by anybody at any time. No warranty of any kind can therefore be made; any implied warranties of merchantability or fitness for a particular purpose are expressly disclaimed
[ Home ] [ Recent Changes ] [ About CLiki ] [ Text Formatting ]

Getting Started with McCLIM


This page presents a complete McCLIM installation walk-through for manual download of each component.

While this installation method is highly instructional for anyone interested in learning about McCLIM's dependencies, it is not the easiest way to install it.

See Getting started using clbuild for an easier installation method, which uses clbuild to download everything automatically.

Needed Components

(NOTE: The author of this page uses Gentoo and sbcl. Other lisps may work depending on McCLIM itself at any given release. Any supported system that can run sbcl and the graphics should work in basically the same way as below - specific backends are sometimes limited to a single platform.)

Preparing the Lisp System

First, we need to get the relevant files, and put them somewhere of use. One way to do this which might appeal to many is asdf-install, but this author prefers to be a little more hands on. This is simply a way which works, and is by no means the only way. The assumption made here is a reasonably modern sbcl installation is already present.

If you have other arrangements for where you like to store lisp goodies, the following steps can be skipped and the files placed as you prefer.

First, make a directory in which to place your lisp packages. I use $HOME/lisptoplevel/systems/

In $HOME/.sbclrc (the sbcl initialization file in one's home directory), include the following:

  (require 'asdf)
  (push 
    (truename "/home/user/lisptoplevel/systems/")
    asdf:*central-registry*)

Adjust the path in truename according to your local situation (if you need the full path cd into the target directory and type pwd to get it).

Now, we will proceed to download the required components. With McCLIM it is usually better to work with cvs or darcs (development) versions when possible - we will do so here. The assumption here is that the user has cvs and darcs clients available - if not, obtaining them is fairly straightforward. If cvs and darcs versions are not possible, tarball distributions can also be used.

If not already in your version of lisptoplevel/systems, cd to that directory.

First, we will get McCLIM itself:

  cvs -z3 -d:pserver:anonymous:anonymous@common-lisp.net:/project/mcclim/cvsroot co mcclim

This puts mcclim into its own directory, and that is where it should stay. In order to allow sbcl to see it, we link the mcclim.asd file to the systems directory (which should be the one you are in now)

  ln -s mcclim/mcclim.asd .

At the current time (Nov. 2006) you will need clx regardless of which backend you ultimately use. Since sbcl can use the newest telent clx, we will download that version using darcs:

  darcs get http://common-lisp.net/~crhodes/clx

Again, symlink the clx.asd file to the systems directory:

  ln -s clx/clx.asd .

We also need spacial-trees. Unlike the others, this one is available as a tarball. I used wget to download it, but there is no requirement to do so - any web browser or download client will suffice.

  wget http://ftp.linux.org.uk/pub/lisp/cclan/spatial-trees.tar.gz

Because this is a tarball, we need to decompress it before we do the symlink.

  tar -xvzf spatial-trees.tar.gz
  ln -s spatial-trees-0.2/spatial-trees.asd .

If build fails to compile you may need flexichains

wget http://www.common-lisp.net/project/flexichain/download/flexichain_latest.tgz tar -xvzf flexichain_latest.tgz ln -s flexichain/flexichain.asd .

Note: this is also covered below for optional components.

Building the System

Normally an McCLIM build does not build everything at once. Nor do any support libraries need to be built by hand - if everything is in place, the following command should produce a loaded and working McCLIM:

  (asdf:oos 'asdf:load-op :mcclim)

Testing

The typical way to check if McCLIM is running as expected is to build the examples included with McCLIM. To do this, once the previous command is complete, we simply run:

  (asdf:oos 'asdf:load-op :clim-examples)

Once this is complete, simply run the following command to start up the demo system:

  (clim-demo::run-test 'clim-demo::demodemo)

If that succeeds, you now have a working McCLIM installation.

McCLIM + gtkairo

gtkairo is a new backend for McCLIM using the GTK and Cairo graphics libraries. It will produce a somewhat more modern look than the default CLX backend (which uses only the default X Windows system itself) but is not (as of Nov. 2006) as complete or stable.

First, the Common Foreign Function Interface (cffi) needs to be installed. This is the library that allows sbcl to interface with GTK and Cairo, neither of which are written in Lisp. For recent versions of gtkairo, the cffi-newtypes branch is required. (Note: Gtkairo will work as described on Linux/x86 using SBCL. On other platforms, notably Darwin, make sure your SBCL supports callbacks. Although I haven't checked it, I believe at the time of this writing it doesn't.)

  darcs get http://common-lisp.net/~loliveira/darcs/cffi-newtypes/
  ln -s cffi-newtypes/cffi.asd .

To both build and use the gtkairo backend, simply issue this command:

  (asdf:oos 'asdf:load-op :clim-gtkairo)

This will build both cffi and the backend itself, thanks to asdf. (Alternatively, you can do (push :gtkairo *features*) before building mcclim. Then clim-gtkairo is automatically built as part of the mcclim system.) Now, as before, run the McCLIM demos:

  (clim-demo::run-test 'clim-demo::demodemo)

This time you should see a different appearance due to the new backend being used.

See Gtkairo Configuration for a list of configuration variables that can be used to tweak gtkairo behaviour.

DREI

Extensive new work is being done on a new editing component for McCLIM. It is activated by default. If you want to enable the old Goatee component:

   (setf climi::*use-goatee* t)

DREI provides Emacs-like editing throughout McCLIM.

Switching Backends

Once multiple backends are loaded, you may find a situation where you want to switch back and forth between one and the other. This is done by setting the *default-server-path* variable in clim-internals.

To switch to gtkairo:

  (setq clim:*default-server-path* '(:gtkairo))

To switch to clx:

  (setq clim:*default-server-path* '(:clx))

Gsharp

Gsharp isn't part of McCLIM proper but is one of the best maintained and most sophisticated applications using it. To download it and required supporting libraries:

  cvs -z3 -d :pserver:anonymous:anonymous@common-lisp.net:/project/gsharp/cvsroot co gsharp
  ln -s gsharp/gsharp.asd .
  wget http://www.common-lisp.net/project/flexichain/download/flexichain_latest.tgz
  tar -xvzf flexichain_latest.tgz
  ln -s flexichain/flexichain.asd .
  cvs -d :pserver:anonymous:anonymous@common-lisp.net:/project/climacs/cvsroot co esa
  ln -s esa/esa.asd .

To build Gsharp and its requirements, type

  (asdf:oos 'asdf:load-op :gsharp)

To run it, enter

  (gsharp:gsharp)

Climacs

Climacs, much like Gsharp, isn't part of McClim proper, but contributions to this project have been merged to McClim as DREI (mentioned above). The goal of the project is to create a "fully free Common Lisp-based editor that has good integration with other CLIM-based applications". More information about Climacs can be found here or at your local library.

To install the package, first install flexichain as described above in the Gsharp section. Swank is also a good thing to have, so follow the instructions on installing swank's parent package, slime, found here.

Once these prerequisites have been filled and McClim installed as described above, we can install climacs.

   cvs -z3 -d :pserver:anonymous:anonymous@common-lisp.net:/project/climacs/cvsroot co climacs
   ln -s climacs/climacs.asd .

To build climacs, then lunch it, type the following:

  (asdf:oos 'asdf:load-op 'climacs)
  (climacs:climacs)

For an old (but still somewhat valid) compairson of Climacs' commands with other emacsen, look here. More current key command definitions are in the code itself usually under the file named something like "foo-commands.lisp".

TODO - add other applications (BeIRC, Closure, etc)

This page is presently Documentation


This page is linked from: Documentation   index   Using the McCLIM gtkairo backend on sbcl 0.9.13  

CLiki pages can be edited by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively