Here are my steps for setting up SBCL (Steel Bank Common Lisp) and Slime (Emacs Lisp mode) to work under Windows Vista.
It’s mostly straightforward, except for dealing with spaces in path names. It turns out that slime.el uses the (split-string) function to pull apart the Lisp command line, which won’t work with the default “c:\program files\…” location. Here’s how to fix that, using symbolic links (yes, Windows supports them too!).
The following was tested on a Vista box, SBCL 1.0.13, and Slime 2.0 on Emacs 22.2.1.
Installing SBCL:
- Download and install SBCL. By default, it will install to c:\Program Files\Steel Bank Common Lisp\1.0.13
- Run cmd.exe as Administrator (required for symbolic links)
- Set up a link from SBCL install directory, to some location without spaces. Note that the syntax is an inverse of the Unix ‘ln’ command.
C:\Users\Rob\Documents>ver
Microsoft Windows [Version 6.0.6000]C:\Users\Rob\Documents>mklink /d SBCL “c:\Program Files\Steel Bank Common Lisp\1.0.13″
symbolic link created for SBCL <<===>> c:\Program Files\Steel Bank Common Lisp\1.0.13C:\Users\Rob\Documents>dir sbcl*
…
04/09/2008 09:07 PM <SYMLINKD> SBCL [c:\Program Files\Steel Bank Common Lisp\1.0.13]
Installing Emacs and Slime:
- Download Emacs, unzip it to any location (eg. c:\Program Files\emacs). If desired, run the emacs\bin\addpm.exe program to add a link to the start menu.
- Download Slime, and unzip it under your emacs/site-lisp directory.
- Add the following to your ~/.emacs file:
(setq inferior-lisp-program “c:/users/rob/documents/sbcl/sbcl.exe –core c:/users/rob/documents/sbcl/sbcl.core”)
(require ’slime)
(slime-setup) - Restart Emacs, and then run M-x run-lisp to test whether Lisp starts up.
- Start slime with M-x slime. Happy hacking!
robert | 11-Apr-08 at 7:53 pm | Permalink
Also, here are some notes for getting ASDF-install to work with SBCL and Windows. They weren’t worth their own blog posting, really.
It’s tricky to get asdf-install to work in a Windows SBCL installation, due to a combination of reliance on Unix tools for archive processing, and some problems with inter-process communication on the Windows port of SBCL.
This produces errors such as the following, when trying to run asdf-install:
Here’s a method to get this up and running. The following was done using SBCL 1.0.13 and a recent version of ASDF-Install, all running on a Windows Vista machine.
I. The tools
First, get a copy of ASDF-Install from the “asdf-install-unstable” repository:
http://common-lisp.net/project/asdf-install/asdf-install_latest.tar.gzSBCL comes with its own, older version - I just installed this new one right on top of the old one, in the sbcl/asdf-install directory.
Second, you’ll need Cygwin, for the bash and tar programs from Unix. Plus, it’s a very cool toolset.
http://www.cygwin.comII. The kluges
Now time for some diffs.
First of all, in asdf-install/variables.lisp, customize the paths to match your Cygwin install. In particular, the following: (changed lines in boldface)
Second, in asdf-install/installer.lisp, in the function tar-arguments, we get rid of extra backslashes and double quotes:
Finally, a change in asdf-install/port.lisp: the function return-output-from-program has got to lose its output redirection, because it confuses Win32 SBCL. (In effect, it will no longer return any output from program, but be that as it may.
) The new version looks like:
3. The results.
Now everything should be ready to run.
A few additional notes:
1. At the “Install where?” prompt, it’s easiest to install to the local directory. System-wide install will fail because of Vista user-access control, unless you’re running your Lisp session as root.
2. GPG verification isn’t supported on Win32 SBCL, and would require more kluging.
3. ASDF by itself expects all definition files to be linked manually to the repository directory. For a quick script to automate that, see this page:
http://www.cliki.net/asdf- under the Alternative Sysdef Search functionality heading.Neil Haven | 16-May-08 at 10:04 am | Permalink
Thanks Robert!
Posts like these are a real service to the lisp community. (It is good to know there are other people working in SBCL under Vista.)
Your recipe above works equally well for XEmacs ver 21.4.21 except that under XEmacs your init file will be ~/.xemacs/init.el instead of ~/.emacs.
Also, I solved the problem of spaces in file names by reverting to the old-style MS-DOS 8.3 pathnames that are available by doing a dir /X at a command prompt instead of by using links. Once I have convinced myself that windows links aren’t going to get all microsoft-cranky on me, I’ll probably switch to your method.
Best of luck.
Running SBCL on Windows « Brainrack Aborning - Developing a Search Engine | 29-May-08 at 11:15 am | Permalink
[...] http://robert.zubek.net/blog/2008/04/09/sbcl-emacs-windows-vista/ http://sbcl-internals.cliki.net/Build%20on%20Windows http://www.sbcl.org/ [...]
Installing SBCL, Emacs, and SLIME on Windows XP » What’s In Peter’s Head | 30-May-08 at 11:04 am | Permalink
[...] Zubek wrote a post about 2 months ago about how to setup SBCL/Emacs/SLIME on Vista, but it doesn’t work exactly right on Windows XP. If you use the .emacs settings from his [...]
Peter Christensen | 30-May-08 at 11:52 am | Permalink
It’s a little bit different on Windows xP: it requires a reboot to move the environment variables from user to system, but after the reboot it works fine. Also, since the PATH and SBCL_HOME variables are populated, all you need in the .emacs file is:
(setq inferior-lisp-program “sbcl”)
…
I wrote a complete setup guide for Windows XP here:
http://www.pchristensen.com/blog/articles/installing-sbcl-emacs-and-slime-on-windows-xp/
Praki Prakash | 11-Jun-08 at 6:57 am | Permalink
Hi Robert,
After having struggled with asdf and asdf-install on WinXP, I can tell you that this subject deserves its own book! Anyway, I have been debugging the issue in using asdf-install with SBCL and WinXP. Your post proved to be a great aid. However, the version of asdf-install that I can find online doesn’t have a tar-arguments function but there is a tar-argument function. The return-output-from-program returns nothing causing a read-line error.
Can you tell me where you found the asdf-install package that you were able to hack an work?
Thanks,
robert | 11-Jun-08 at 7:45 am | Permalink
Praki - I used the version of asdf-install linked above. But I have not experimented with it since then - it’s possible that it has changed further.