Sbcl-installation
Installing Steel Bank Common Lisp (SBCL)
SBCL is available from https://www.sbcl.org. You can of course
go to that website to find download and installation instructions for SBCL,
but here is a concise summary that includes build options appropriate for
ACL2.
- Download an SBCL binary from
https://www.sbcl.org/platform-table.html.
That page contains a table
with combinations of operating systems and hardware architectures,
from which you have to pick the one that applies to you.
Note that you need an SBCL binary
in order to compile from source (see below).
The file downloaded from the table will have a name like
sbcl-2.1.2-arm64-darwin-binary.tar.bz2,
where the arm64-darwin part depends on
the chosen combination of operating system and hardware architecture.
- Untar the file in a directory of your choice,
which will create a subdirectory with a name like
sbcl-2.1.2-arm64-darwin,
consistently with the name of the downloaded file.
- Change to that subdirectory and run
@{(sh run-sbcl.sh)}
to make sure that the binary works.
On macOS, you may get a pop-up saying that
Apple cannot check it for malware and that it needs to be updated.
In that case, open the macOS settings,
go under `Privacy and Security'
(or `Security and Privacy', depending on macOS version),
and you should see something about the (SBCL) executable
whose execution was stopped:
click the button to allow it, and retry running it.
Eventually it should work.
- In the same directory where you just ran SBCL, run the SBCL installer.
This is done via
@{(INSTALL_ROOT=... sh install.sh)},
where ... is optional: if omitted, it defaults to /usr/local.
If you pick something different from this default,
note that the installer will create three directories there,
namely bin, lib, and share.
Thus, for examples, if you want to install SBCL in your home,
you may want to create a directory in your home (e.g. sbcl, or apps),
and pass that as INSTALL_ROOT,
instead of passing your home directory.
- Add that bin directory to your path, so that SBCL can be found.
Try running @{(sbcl)} to make sure that the installed binary works.
This time macOS should not block its execution.
- Download the SBCL source from
https://www.sbcl.org/platform-table.html,
the same page with the table of binaries.
There should be one link to the sources, above the table of binaries.
The downloaded file will have a name like sbcl-2.3.9-source.tar.bz2.
- Untar the file in a directory of your choice,
which will create a subdirectory with a name like sbcl-2.3.9.
- Change to that subdirectory, and compile SBCL via
@{(sh make.sh --without-immobile-space --without-immobile-code --without-compact-instance-header)}.
These options prevents certain possible errors.
The compilation process prints a lot of stuff on the screen,
and should succeed.
- The final part of the screen output will suggest
to run the tests, via
@{(cd ./tests && sh ./run-tests.sh)}.
They will take a while, but should eventually succeed.
- The final part of the screen output will also suggest
to build the documentation, via @{(cd ./doc/manual && make)},
which may fail, but that does not seem to matter.
- Finally, install the just compiled SBCL
in the same way as the downloaded binary above, via
@{(INSTALL_ROOT=... sh install.sh)}.
If you use the same ... as above (or use the default if you did before),
the new installation will replace the old one,
and invoking SBCL (which will still be on the path)
will run the newly compiled version.
- If a new version of the SBCL sources becomes available,
you can repeat the procedure above to compile and install it,
using the previously installed binary.
- As an alternative to installing the binary compiled from the sources,
you could create a script, in your executable path, containing
@{(
#!/bin/sh
<dir>/run-sbcl.sh --dynamic-space-size 2000 "$@"
)}
where <dir> is the untarred directory described above,
and where the dynamic space size option is just an example
of how one can pass options to the running SBCL,
but it is not necessarily needed.
If you need to pass options like this,
you can also do that if you follow the installation instructions:
in that case, the script should contain just sbcl
instead of <dir>/run-sbcl.sh.