[ Home ]
SBCL Internals

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 ]

SBCL can be built on Windows using either MinGW/MSYS or Cygwin. In either case the resulting binary is a non-Cygwin binary (ie. does not depend on cygwin.dll, and does not understand Cygwin pathnames).

As of 0.9.10.7 the MinGW/MSYS build is slightly nicer: on Cygwin you need to

If you have both MinGW/MSYS and Cygwin installed you need to specify GNUMAKE=make for make-target-contrib.sh to work. (Cygwin provides "gmake" which will be used instead if you don't and this will lead to no end of pathname woes. Somehow this does not seem to mess up the main build, though.)


MinGW/MSYS build

These installation instructions document what I (Brian Mastenbrook) did to build SBCL/Win32 on a Windows system which did not have either MinGW or Cygwin installed. [Notes in square brackets were added by Neil Haven based on his experiences on 26-29 May 2008.]

Prerequisites

To build SBCL on Win32, you'll need to have MinGW and MSYS installed. Don't get them from the MinGW download page: despite what the text on this page says, the links there are not up to date with the releases on the SourceForge project page (as of 2007/01/28). Do download them from the SourceForge file releases page, under the "Current" package. The SourceForge file release system is somewhat nonobvious; to see all the "Current" releases, click on "Current", not the package name listed next to it.

What you'll need to download is:

Install MinGW, but when prompted for which packages to install, do not select the included version of "make". MSYS will install its own. [You are given a choice amongst components to install. I chose the basic MinGW tool set and the g++ compiler options.]

Then install MSYS. When prompted, provide the path where you installed MinGW. The installer will congratulate you for not installing MinGW's version of make. [There is a post-install script that will ask you a series of questions. It will want to know where you installed MinGW. Mine was installed in the default location which is c:\MinGW.]

To build installer packages, you'll need WiX. Download the 2.0 release, not 3.0. Unzip the download somewhere. If you put it in C:\Program Files\WiX\ you won't need to set WIX_PATH later. [I chose not to install WiX.]

Cross-compiler

Download and install a SBCL Windows binary. [The latest release of SBCL with Windows binaries is 1.0.13 as of 26 May 2008.] The installer will put SBCL into your PATH and set SBCL_HOME appropriately.

Build

You'll run the build from an MSYS shell. If your Windows system is anything like mine, your user name contains a space, and the build scripts aren't entirely happy with directories containing spaces like your home directory. Make sure the directory you're building in does not contain spaces. [The installation process should have created a desktop icon for launching MSYS -- launch MSYS. At the prompt use cd to change to the directory where you've put your SBCL source. Mine is in c:\users\gneilhaven\lisp\sbcl-1.0.17, so I can type cd /c/users/gneilhaven/lisp/sbcl-1.0.17 and then simply build with the command make.sh sbcl inside MSYS.]

Build with sh make.sh sbcl. The default cross-compiler command refers to the device NUL, which as of 2007/01/28 causes problems. You can redirect output as you would on a normal *nix system.

Once the build completes, you will see two build failures (as of 2007/01/28) [as of 29 May 2008 I see just one failure, the sb-simple-streams module fails]. The SB-MD5 build fails due to the NUL device issue; if you feel like cheating, you can touch contrib/sb-md5/test-passed to fix this. The SB-SIMPLE-STREAMS build fails due to more substantial issues.

Building from a SourceForge Checkout

If you are simply compiling SBCL from a normal release the following discussion does not apply to you. If, however, you are downloading from CVS (and you know who you are) then you should be aware that the hoary incompatibility between DOS and UNIX line-endings can cause you trouble.

Using TortoiseCVS (a popular and easy Windows CVS interface), you need to set the Use UNIX Line Endings checkbox in the options tab before doing your checkout

If you don't, you will very likely see errors halt your compilation process. In version 1.0.17 et seq. those errors mentioned 'genesis' and 'Makefile.features'. Be forewarned!

Running SBCL

In order to run the lisp, you will need to track down sbcl.exe and sbcl.core. The default build process places the .exe file at src/runtime/sbcl.exe; the .core file is at output/sbcl.core. Execute \path\to\sbcl.exe --core "\path\to\sbcl.core". For simplicity's sake, I copied both files to the contrib directory.

Remember to change the PATH and SBCL_HOME environment variables to reflect the new locations for SBCL. Also, if you use (x)emacs, you might need to change some paths in your init file to point to the new version of SBCL. Beware! If you start (x)emacs before changing all your paths appropriately, you might find you have a broken Swank connection. If that happens, delete all the .fasl files from compiling swank (for XEmacs they should be located under .slime/fasl/...) and restart (x)emacs so that swank gets recompiled.

Making an Installer

If you didn't follow the recommendation above for the installation location of WiX, set WIX_PATH to the location you did install it in. Then sh make-windows-installer.sh. If all goes well, this should produce sbcl-VERSION.msi in output/. If you're going to upload this to SourceForge, rename it to sbcl-VERSION-x86-windows-binary.msi before the upload.


This page is linked from: Build   Win32  

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