I’ve been using Slime recently, configured to use SBCL via (setq inferior-lisp-program "/usr/bin/sbcl")
in ~/.emacs.
Of my two Gentoo machines, slime on the x86 box was working fine, provided I masked >dev-lisp/sbcl-1.0.19 to prevent a “ASDF 2 is not compatible with ASDF-BINARY-LOCATIONS” error when starting slime. Note that this is no longer possible because at the time of writing Portage only contains SBCL 1.0.55-r1 (there is a solution to this - see later).
So, on my x86 box the following combo worked together just fine:
slap steph # equery list slime sbcl asdf asdf-binary-locations gentoo-init
* Searching for slime ...
[IP-] [ ] app-emacs/slime-2.0_p20080731:0
* Searching for sbcl ...
[I--] [??] dev-lisp/sbcl-1.0.19:0
* Searching for asdf ...
[IP-] [ ] dev-lisp/asdf-1.89:0
* Searching for asdf-binary-locations ...
[IP-] [ ] dev-lisp/asdf-binary-locations-20061018:0
* Searching for gentoo-init ...
[IP-] [ ] dev-lisp/gentoo-init-0.1:0
However, I had more problem on my amd64 machine with the following package versions:
bpc ~ # equery list slime sbcl asdf asdf-binary-locations gentoo-init
* Searching for slime ...
[IP-] [ ] app-emacs/slime-2.0_p20080731:0
* Searching for sbcl ...
[IP-] [ ] dev-lisp/sbcl-1.0.55-r1:0
* Searching for asdf ...
[IP-] [ ] dev-lisp/asdf-1.86-r1:0
* Searching for asdf-binary-locations ...
[IP-] [ ] dev-lisp/asdf-binary-locations-20061018:0
* Searching for gentoo-init ...
[IP-] [ ] dev-lisp/gentoo-init-0.1:0
And /etc/gentoo-init.lisp (as provided by the gentoo-init package):
(in-package #:cl-user)
#+(or sbcl ecl) (require :asdf)
#-(or sbcl ecl) (load #p"/usr/share/common-lisp/source/asdf/asdf.lisp")
(push #p"/usr/share/common-lisp/systems/" asdf:*central-registry*)
(asdf:oos 'asdf:load-op :asdf-binary-locations)
(setf asdf:*centralize-lisp-binaries* t)
(setf asdf:*source-to-target-mappings* '((#p"/usr/lib/sbcl/" nil) (#p"/usr/lib64/sbcl/" nil)))
When starting slime I received an error immediately:
debugger invoked on a SIMPLE-ERROR in thread
#<THREAD "initial thread" RUNNING {1002998D13}>:
ASDF 2 is not compatible with ASDF-BINARY-LOCATIONS, which you are using.
ASDF 2 now achieves the same purpose with its builtin ASDF-OUTPUT-TRANSLATIONS,
which should be easier to configure. Please stop using ASDF-BINARY-LOCATIONS,
and instead use ASDF-OUTPUT-TRANSLATIONS. See the ASDF manual for details.
In case you insist on preserving your previous A-B-L configuration, but
do not know how to achieve the same effect with A-O-T, you may use function
ASDF:ENABLE-ASDF-BINARY-LOCATIONS-COMPATIBILITY as documented in the manual;
call that function where you would otherwise have loaded and configured A-B-L.
Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL.
restarts (invokable by number or by possibly-abbreviated name):
0: [RETRY ] Retry EVAL of current toplevel form.
1: [CONTINUE] Ignore error and continue loading file "/usr/share/emacs/site-lisp/slime/swank-loader.lisp".
2: [ABORT ] Abort loading file "/usr/share/emacs/site-lisp/slime/swank-loader.lisp".
3: Exit debugger, returning to top level.
((SB-PCL::FAST-METHOD ASDF:OPERATE :BEFORE (T T))
#<unused argument>
#<unused argument>
#<unused argument>
#<unused argument>)
0]
To get around this I used ASDF 2’s compatibility command enable-asdf-binary-locations-compatibility
and changed config in /etc/gentoo-init.lisp to the following (for those unfamiliar with Lisp, the semi-colons are comments):
(in-package #:cl-user)
#+(or sbcl ecl) (require :asdf)
#-(or sbcl ecl) (load #p"/usr/share/common-lisp/source/asdf/asdf.lisp")
(push #p"/usr/share/common-lisp/systems/" asdf:*central-registry*)
;(asdf:oos 'asdf:load-op :asdf-binary-locations)
;(setf asdf:*centralize-lisp-binaries* t)
;(setf asdf:*source-to-target-mappings* '((#p"/usr/lib/sbcl/" nil) (#p"/usr/lib64/sbcl/" nil)))
(asdf:enable-asdf-binary-locations-compatibility :centralize-lisp-binaries t :source-to-target-mappings '((#p"/usr/lib/sbcl/" nil) (#p"/usr/lib64/sbcl/" nil)))
This got rid of the error about asdf-binary-locations, but when starting slime it compiled a load of stuff then produced this error instead:
debugger invoked on a ASDF:COMPILE-ERROR in thread
#<THREAD "initial thread" RUNNING {1002998D13}>:
Error while invoking #<COMPILE-OP NIL {1004310B03}> on
#<CL-SOURCE-FILE "swank" "swank-sbcl">
Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL.
restarts (invokable by number or by possibly-abbreviated name):
0: [RETRY ] Retry compiling #<CL-SOURCE-FILE "swank" "swank-sbcl">.
1: [ACCEPT ] Continue, treating
compiling #<CL-SOURCE-FILE "swank" "swank-sbcl"> as having been
successful.
2: [RETRY ] Retry EVAL of current toplevel form.
3: [CONTINUE] Ignore error and continue loading file "/usr/share/emacs/site-lisp/slime/swank-loader.lisp".
4: [ABORT ] Abort loading file "/usr/share/emacs/site-lisp/slime/swank-loader.lisp".
5: Exit debugger, returning to top level.
((SB-PCL::FAST-METHOD ASDF:PERFORM (ASDF:COMPILE-OP ASDF:CL-SOURCE-FILE))
#<unavailable argument>
#<unavailable argument>
#<ASDF:COMPILE-OP NIL {1004310B03}>
#<ASDF:CL-SOURCE-FILE "swank" "swank-sbcl">)
0]
The solution was to unmask the latest slime via /etc/portage/package.keywords:
# Latest version of slime required for ASDF 2 support.
=app-emacs/slime-2.0_p20101103
Then upgrade it. Now slime starts properly into SBCL :-)