Skip to content

how to install slippery chicken 'by hand'

Ruben Philipp edited this page Mar 28, 2024 · 21 revisions

how to install slippery chicken 'by hand'

Warning

Installing slippery chicken via all.lsp, as described in this document, is deprecated as of version 1.1.0. If you want to keep using the old version of slippery chicken, please use this tagged commit: https://github.com/mdedwards/slippery-chicken/releases/tag/pre-asdf.

The installation process for version 1.1.0 is described here.


Try the script first

If you've not worked with Lisp before and you don't have a working Lisp implementation on your computer, the first thing to try is the script-based installation of slippery-chicken and related components. This should work on Macs and Debian/Ubuntu Linux systems. Just start your terminal application, copy/paste the following line at the prompt, and hit return. Note that this will create a lisp directory in your home directory, or in your terminal's current working directory, so make sure you don't already have a lisp directory there (though the script will warn you, if that is the case).

curl https://michael-edwards.org/sc/sc-install -o sc-install; chmod u+x sc-install; ./sc-install

If that works properly, then you can start Lisp by simply typing sbcl in the terminal, or you can start the emacs text editor (type emacs at the terminal prompt) and run Lisp via the slime package.

However you start Lisp, it should compile various packages the first time it runs. This might take a while, so please be patient. The next time you start it, the Lisp prompt should be available in a snap. In any case, once you see a funny chicken ascii-art logo and a prompt (perhaps merely a *), you're in the slippery chicken package and ready to go.

If for some reason the above doesn't work, and/or you'd prefer to take things one step at a time, then proceed as described below.

Introduction

The following describes how to install slippery chicken and related packages for use with Emacs and the SLIME Emacs<->Lisp interface. It is focused on installation on a Mac but will also work with slight modifications on Linux. Slippery chicken will also work on Windows but configuring the C Compiler to work with CLM might not be easy; this will only be an issue if you want to generate sound files though. For score and MIDI output Windows installation should be trivial.

Lisp

Any lisp implementation should work but these days most of us use SBCL: http://www.sbcl.org/

On Macs this should be very simple to install. Just open your terminal app and issue the following command:

brew install sbcl

If you don't have brew on your OSX system, then you can get it from https://brew.sh/

Linux has its own application managers similar to brew, e.g. yum or apt.

C Compiler

If you intend to use CLM (for sound file generation) you'll need a C compiler. On most UNIX systems (including Apple's OSX) you'll already have the GNU C compiler. You can check whether yours is ready to go by typing the following command in your terminal:

gcc -v

You should get some version details starting with something like this:

Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1

If you don't have gcc, on OSX 10.9 and above you can install command line tools without the full installation of XCode. Type the following in the terminal application:

xcode-select --install

This seems to be broken on Catalina (10.15) so if it doesn't work for you, then get the package directly from https://developer.apple.com/download/more/

Emacs

Grab your preferred version of the text editor Emacs: Aquamacs on OSX or Emacs for all systems.

SLIME

This is the interface between Emacs and Lisp running as a subprocess within Emacs. Grab the latest source from https://github.com/slime/slime/releases and unpack it wherever you like. Read all about it at https://common-lisp.net/project/slime/

Lilypond

If you want to generate beautiful scores from within slippery chicken, install Lilypond from http://lilypond.org/

Lisp software

CLM

If you intend to write sound files using slippery chicken you'll need to install Common Lisp Music (CLM).

Grab the latest CLM source code from https://ccrma.stanford.edu/software/clm/

CMN

If you want to write scores quickly using Common Music Notation, grab the latest CMN from https://ccrma.stanford.edu/software/cmn/

slippery chicken

Get the latest source code from http://michael-edwards.org/sc/source.html or https://github.com/mdedwards/slippery-chicken

If downloading from github.com create an empty 'bin' directory at the same level as the directory containing all the slippery chicken .lsp files. For more details on git see using github

Initialisation files

In order for all the software to work together we'll need two initialisation ('dot') files in your home directory (abbreviated to ~/ on UNIX systems). You can write these with your favourite text editor (Emacs, no doubt) but beware that some operating systems don't like you writing 'dot' files so you'll have to persuade them somehow. If you use Aquamacs on Mac OSX, the recommended init file is found here at "/Library/Preferences/Aquamacs Emacs/Preferences.el".

~/.emacs

;;; Make sure slime source can be found so that the emacs<->lisp interface works
(add-to-list 'load-path "/Applications/slime-2.26/") ; <-- change path?
(require 'slime)

;;; DJR Tue 2 Jun 2020 13:24:00 BST
;;; Updated this to use a wildcard so that your install will work no matter what
;;; version of SBCL you are using.
(let ((sbcl-local (car (file-expand-wildcards
			"/usr/local/Cellar/sbcl/*/lib/sbcl/sbcl.core"))))
  (setq slime-lisp-implementations
	`((sbcl ("/usr/local/bin/sbcl"
		 "--core"
		 ,sbcl-local
		 "--dynamic-space-size" "2147")))))

~/.swank.lisp

;;; replace these paths with the correct locations of clm, cmn, and slippery 
;;; chicken.
(load "~/lisp/clm-5/all.lisp") ; <-- if you're going to use it
(load "~/lisp/cmn/cmn-all.lisp") ; <-- if you're going to use it
(load "~/sc/src/all.lsp")

Starting Lisp in Emacs

Once you've fired up emacs you need to start Lisp by issuing the command 'slime'. You do this by typing Alt x (or Escape x) then slime. The 'alt' key is 'option' on Macs. (Alt x creates the prompt in the mini-buffer at the bottom of the Emacs window; you then type your command there and hit return.)

Once Lisp has started you should see a prompt. To get into the slippery chicken package type either (sc) or (in-package :sc)

In order to quit Lisp you do ALT x slime-quit-lisp, or in Emacs parlance: M-x slime-quit-lisp

Clone this wiki locally