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.
Chris Hagan | 11-Jul-08 at 2:01 am | Permalink
Thanks for publishing this tutorial. I wonder if anybody else has gotten to the stage of installing SLIME and had this error generated on M-x run-lisp? I’d hate to give up on Vista or SBCL.
VirtualAlloc: 0×1e7.
ensure_space: failed to validate 536870912 bytes at 0×09000000
(hint: Try “ulimit -a”; maybe you should increase memory limits.)
Process inferior-lisp exited abnormally with code 1
Chris | 07-Aug-08 at 10:23 pm | Permalink
Chris, I’ve seen that problem before. IIRC, it was something to do with Xemacs. Try Emacs.
Sean | 11-Sep-08 at 2:40 pm | Permalink
I followed this exactly using the versions given but I get an error in the _emacs file while loading emacs. It sasy “Symbol’s value as variable is void: \223c:/sbcl/sbcl.exe”
Note that I mklink’d the SBCL directory to one just under C:.
Can anybody help? I’ve tried emacs 21 and 22 and also tried SBCL 1.0.13 and 1.0.19.
Recent Links Tagged With "sbcl" - JabberTags | 17-Dec-08 at 11:34 am | Permalink
[...] >> sbcl SBCL v1.0i-TPS ετοιμο σεταρισμενο Saved by j2n4me on Thu 04-12-2008 SBCL + Emacs + Windows Vista Saved by viriromero on Tue 02-12-2008 Sbcl on dreambox Saved by Mitchelmussoissohot on Thu [...]
found .emacs, but doesnt work running lisp | keyongtech | 18-Jan-09 at 8:29 am | Permalink
[...] .emacs, but doesnt work running lisp http://robert.zubek.net/blog/2008/04…windows-vista/ followed every step exactly but when i try to run it: # Restart Emacs, and then run M-x run-lisp [...]
Christph Amort | 18-Jan-09 at 2:19 pm | Permalink
the guide is great! some stumble upons (that newbees like me fall in):
- extract the slime directly into the emacs/site-lisp folder (no subdirectory needed!)
- copying the dirs from your webpage made
(setq inferior-lisp-program “c:/u… …re”)
instead of ” <- can you see the difference!
(require ’slime) and also here ‘<- emacs complains about that strage quote on my vista!
I think post 10 Sean is asking for it!!
On my Vista version HOME was on C:\Users\hp02\AppData\Roaming
chris
Emacs + Slime + SBCL on Windows Vista :: nklein software | 27-May-09 at 2:14 pm | Permalink
[...] the most part, I followed Robert Zubek’s gameplan. However, I quickly ran into a problem with swank’s temporary files not being in a writable [...]
John Connors | 02-Jul-09 at 12:18 am | Permalink
Thank you for this, I needed it to get SBCL running on a Vista box, coming back to it after a long break. Building it will be a whole other experience, but there you go..
Sasha Shipka | 04-Nov-09 at 10:50 am | Permalink
Hello, I’m a newcomer to Lisp and I would like to make asdf-install work on windows also. I followed your instructions, return-output-from-program was changed this way already. However when I try to invoke (asdf-install:install
error jumps out right away:
The value ECHO is not of type LIST.
[Condition of type TYPE-ERROR]
Backtrace:
ROPAGATE NIL :WHERE NIL)
0: (COPY-LIST ASDF-INSTALL:ECHO)[:EXTERNAL]
1: (ASDF-INSTALL:INSTALL :CLOSER-MOP
…
I tried to find (copy-list echo) anywhere in asdf-install code and failed (perhaps it has something with that :external).