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?
Right now, if I start SBCL (with just QUICKLISP pre-loaded) and save the image:
(save-lisp-and-die "core")
And then try to start SBCL again with this image
sbcl --core core
And then try to do:
(ql:quickload :cl-yaclyaml)
I get the following:
To load "cl-yaclyaml":
Load 1 ASDF system:
cl-yaclyaml
; Loading "cl-yaclyaml"
.......
debugger invoked on a SB-INT:EXTENSION-FAILURE in thread
#<THREAD "main thread" RUNNING {100322C613}>:
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 #<REQUIRE-SYSTEM "sb-sprof">.
1: [ACCEPT ] Continue, treating completing load for #<REQUIRE-SYSTEM "sb-sprof"> 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]
Alternatively, if I try:
(require 'sb-sprof)
when sbcl is started with saved core, I get the same error. If sbcl is started just as sbcl
there is no error reported.
In fact, pre-loading QUICKLISP is not a problem: the same problem happens if sbcl is called initially with sbcl --no-userinit --no-sysinit
.
Am I doing it wrong?
PS. If I use roswell, ros -L sbcl-bin -m core run
somehow doesn't pick up the image (tested by declaring variable *A*
before saving and not seeing it once restarted).
PS2. So far what it looks like is that sbcl does not provide extension modules (SB-SPROF
, SB-POSIX
, etc.) unless they are explicitly required prior saving the image.
SAVE-APPLICATION
works as expected. Does SBCL do some tree-shaking when saving the image? – Awakening/usr/local/bin/
, it is not the one provided by the distribution. I think it was a binary from SBCL website. – Awakeningcontrib
directory with extra modules (includingSB-SPROF
,SB-POSIX
etc.) in the same directory where the core is. And if they are not pre-loaded at the time of saving the image, SBCL doesn't put them into the image. I wonder if this is the behaviour of a particular SBCL version or all of them? – AwakeningSBCL_HOME
environment variable set? – Pinduscontrib
inSBCL_HOME
or where the image resides. Thanks! – Awakening