title: How to properly save Common Lisp image using SBCL?
body: <p>If I want to create a Lisp-image of my program, how do I do it properly? Are there any prerequisites? And doesn't it play nicely with QUICKLISP?</p>
  
  <p>Right now, if I start SBCL (with just QUICKLISP pre-loaded) and save the image:</p>
  
  <pre><code>(save-lisp-and-die "core")
  </code></pre>
  
  <p>And then try to start SBCL again with this image</p>
  
  <pre><code>sbcl --core core
  </code></pre>
  
  <p>And then try to do:</p>
  
  <pre><code>(ql:quickload :cl-yaclyaml)
  </code></pre>
  
  <p>I get the following:</p>
  
  <pre><code>To load "cl-yaclyaml":
    Load 1 ASDF system:
      cl-yaclyaml
  ; Loading "cl-yaclyaml"
  .......
  debugger invoked on a SB-INT:EXTENSION-FAILURE in thread
  #&lt;THREAD "main thread" RUNNING {100322C613}&gt;:
    Don't know how to REQUIRE sb-sprof.
  See also:
    The SBCL Manual, Variable *MODULE-PROVIDER-FUNCTIONS*
    The SBCL Manual, Function REQUIRE
  
  Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.
  
  restarts (invokable by number or by possibly-abbreviated name):
    0: [RETRY                        ] Retry completing load for #&lt;REQUIRE-SYSTEM "sb-sprof"&gt;.
    1: [ACCEPT                       ] Continue, treating completing load for #&lt;REQUIRE-SYSTEM "sb-sprof"&gt; as having been successful.
    2:                                 Retry ASDF operation.
    3: [CLEAR-CONFIGURATION-AND-RETRY] Retry ASDF operation after resetting the configuration.
    4: [ABORT                        ] Give up on "cl-yaclyaml"
    5:                                 Exit debugger, returning to top level.
  
  (SB-IMPL::REQUIRE-ERROR "Don't know how to ~S ~A." REQUIRE "sb-sprof")
  0] 
  </code></pre>
  
  <p>Alternatively, if I try:</p>
  
  <pre><code>(require 'sb-sprof)
  </code></pre>
  
  <p>when sbcl is started with saved core, I get the same error. If sbcl is started just as <code>sbcl</code> there is no error reported.</p>
  
  <p>In fact, pre-loading QUICKLISP is not a problem: the same problem happens if sbcl is called initially with <code>sbcl --no-userinit --no-sysinit</code>.</p>
  
  <p>Am I doing it wrong?</p>
  
  <p>PS. If I use roswell, <code>ros -L sbcl-bin -m core run</code> somehow doesn't pick up the image (tested by declaring variable <code>*A*</code> before saving and not seeing it once restarted).</p>
  
  <p>PS2. So far what it looks like is that sbcl does not provide extension modules (<code>SB-SPROF</code>, <code>SB-POSIX</code>, etc.) unless they are explicitly required prior saving the image.</p>