🔮 SBCL Setup with MSYS2 on Windows
1. Download and Install MSYS2
- Visit the official MSYS2 website at https://www.msys2.org/ and download the latest installer.
- Run the downloaded installer and follow the on-screen instructions to install MSYS2. The default installation path (C:\msys64) is recommended.
- After installation, open MSYS2 using the shortcut created in the Start Menu.
- Update the package database and base packages by running the following
commands in the terminal:
pacman -Syu
- Close the terminal if prompted, then reopen it and complete the update
process with:
pacman -Su
2. Install Build Essentials for UCRT64
- In the MSYS2 terminal, install the build essentials for the UCRT64
environment by executing:
pacman -S --needed base-devel mingw-w64-ucrt-x86_64-toolchain
- This command installs the necessary compilers and tools to build software using the UCRT64 environment.
3. Download and Install SBCL
- Go to the SBCL website at http://www.sbcl.org/ and download the latest Windows binary available.
- Run the installer and follow the prompts to install SBCL. Note the installation directory (e.g., C:\Program Files\Steel Bank Common Lisp).
4. Clone the SBCL Git Repository
- Open the MSYS2 terminal and clone the SBCL repository to the ~/sbcl
directory with:
git clone git://git.code.sf.net/p/sbcl/sbcl ~/sbcl
5. Checkout the Latest SBCL Version
- Open the UCRT64 MSYS2 terminal as administrator. You can do this by right-clicking the UCRT64 shortcut and selecting “Run as administrator.”
- Change the directory to the cloned SBCL source with:
cd ~/sbcl
- Checkout the latest tagged version (e.g., 2.4.1) with:
git checkout sbcl-2.4.1
6. Build SBCL
- Add the Windows SBCL binary to your PATH by executing:export PATH=$PATH:’c/Program Files/Steel Bank Common Lisp’
- In the UCRT64 terminal (still as administrator), navigate to the
~/sbcl directory and start the build process with:
sh make.sh --fancy
- This process may take some time, depending on your system’s capabilities.
7. Install the Built SBCL Version
- After the build completes successfully, install SBCL by running:
sh install.sh
- Follow any on-screen prompts to complete the installation.
8. Install libzstd.dll Dependency
- SBCL depends on
libzstd.dll
to run. Download the DLL from the latest release at https://github.com/facebook/zstd/releases. - After downloading, place
libzstd.dll
in a directory that is part of your PATH environment variable, or add the directory where you placedlibzstd.dll
to your PATH. This can be done by:- Searching for “Environment Variables” in Windows search, opening the dialog.
- In the “System Properties” window, click on “Environment Variables”.
- In the “System Variables” section, find the
Path
variable and select “Edit”. - Add the path to the directory containing
libzstd.dll
. - Click “OK” to close each dialog and apply the changes.