Re: calling native compiler?
Hannah Schroeter <hannah <at> schlund.de>
2002-08-14 14:02:45 GMT
On Mon, Aug 12, 2002 at 09:14:08AM -0400, Sandro Magi wrote:
>Maybe I'm just an idiot, but I haven't been able to find a way to invoke the
>native code compiler to generate stand-alone native executables. There is no
>reference anywhere in the mailing lists, the manual, the documentation, the
>website or CLiki.
>How do you invoke the native code compiler? Thanks.
You must differentiate two things: native code and standalone code.
SBCL always compiles to native code, newer versions even implicitly
(i.e. when you #'load a .lisp source w/o file compiling it before,
or when typing in forms in the REPL). However, there's no way
to generate standalone code (i.e. a self-contained program where
you don't need the sbcl runtime binary to run).
However, "standalone"-ness isn't really a black or white property
anyway. Usually, C programs need other files to run too (things like
ld.so and the shared C standard library). So the difference is
more gradual: the sbcl runtime is installed on less machines, and
it uses a different mechanism to start up (i.e. you must do more
things manually or in a wrapper script).
The best thing to do is to use #'sb-ext:save-lisp-and-die (use
#'describe to view its documentation) to dump a core with your
application code inside, using :toplevel to specify your main
function to run. Then build a small wrapper shell script of the