I’m quick jotting some notes about my recent installation of SBCL and OCICL on
macOS. Once again I got tired of Roswell: It crashed and I to reinstall
everything on two occasions recently, I barely use the shebang-based scripting
facilities and I find it cumbersome to have to create an external command sbcl
to ros exec the main executable.
So I decided I would go with SBCL alone, and I thought it was a good opportunity to install OCICL along the way. This would also allow me to use another great project, icl.
If everything goes okay for you, you should end up with something like:
~
» alias sbcl
sbcl='sbcl --userinit ~/.config/sbcl/init.lisp'
~
» sbcl --eval '(format t "~&Registries: ~A~%" (remove-if-not (lambda (x) (member x '\''(:quicklisp :ocicl))) *features*))' --eval '(quit)'
This is SBCL 2.6.10, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>.
SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses. See the CREDITS and COPYING files in the
distribution for more information.
Registries: (OCICL QUICKLISP)
Note the alias, defined in my Zsh config directory. I was unable to inform SBCL to use XDG-compliant directory, I’m probably dumb.
First step is to install SBCL and OCICL with Homebrew, as well as optional packages for icl, then Quicklisp:
brew install sbcl ocicl mpfr libfixposix
curl -O https://beta.quicklisp.org/quicklisp.lisp
You may want to installrlwrap but we can be fine with linedit too. I’ll
show you later. Create a config file in your $HOME/.config, or use default
location for SNCL init file:
mkdir ~/.config/sbcl
vim ~/.config/sbcl/init.lisp
Here’s the init.lisp in all its glory:
(require :asdf)
#-quicklisp
(let ((quicklisp-init (merge-pathnames ".local/share/quicklisp/setup.lisp"
(user-homedir-pathname))))
(when (probe-file quicklisp-init)
(load quicklisp-init)))
#-ocicl
(let ((ocicl-init (merge-pathnames ".local/share/ocicl/ocicl-runtime.lisp"
(user-homedir-pathname))))
(when (probe-file ocicl-init)
(load ocicl-init)))
(asdf:initialize-source-registry
(list :source-registry
(list :directory (uiop:getcwd))
:inherit-configuration))
#+(and sbcl (not swank) (not slynk))
(when (and (interactive-stream-p *standard-input*)
(not (member (uiop:getenv "TERM") '("dumb" nil) :test #'equal))
(find-package :ql))
(ignore-errors
(ql:quickload :linedit :silent t)
(uiop:symbol-call :linedit :install-repl :wrap-current t :eof-quits t)))
Some words of caution here: I decided to install Quicklisp and OCICL in
~/.local/share/. If one or the other is not installed, this init file will
just ignore it. Installation of linedit is as easy as running:
sbcl --userinit ~/.config/sbcl/init.lisp --eval '(ql:quickload :linedit)' --eval '(quit)'
Then proceed with icl, using the instructions provided on GitHub: clone the repo
wherever you want (I use ~/.local/lib/icl), and run ocicl install && make.
You can then symlink the executable in ~/.local/bin or whichever directory
fits you best.
If everything went well, you might want to check the OCICL tree:
~ 1m25s
» ocicl --global tree
/Users/chl/.local/share/ocicl/ocicl.csv
├─ alexandria
├─ babel
├─ babel-streams
├─ babel-tests
├─ cffi
├─ cffi-examples
├─ cffi-grovel
├─ cffi-libffi
├─ cffi-tests
├─ cffi-toolchain
├─ cffi-uffi-compat
├─ linedit
├─ osicat
├─ terminfo
├─ trivial-features
├─ trivial-features-tests
└─ uffi
If any item appears in red or suffixed with a !, then it either means that
your installation tree is not correct or that a more recent version of the
package do exist.
You can disable icl colors by invoking it as NO_COLOR=1 icl, or by setting
(setf icl:*colors-enabled* nil) in ~/.config/icl/config.lisp . Maybe a
DUMB terminal would do the trick as well. As for OCICL, ocicl --color never
will do the trick.
♪ Ladytron • Until The Fire