Next: , Previous: , Up: Top   [Contents][Index]


14 Static Linking

On recent enough versions of supported implementations (currently, GNU CLISP 2.49, CMUCL 2015-11, and SBCL 1.2.17), and with a recent enough ASDF (3.1.2 or later), you can create a statically linked Lisp executable image that includes all the C extensions (wrappers and any other objects output by compile-op) as well as your Lisp code — or a standalone application executable. This makes it easier to deliver your code as a single file.

To dump a statically linked executable image, use:

  (asdf:load-system :cffi-grovel)
  (asdf:operate :static-image-op :example-software)

To dump a statically linked executable standalone application, use:

  (asdf:load-system :cffi-grovel)
  (asdf:operate :static-program-op :example-software)

See the ASDF manual for documentation about image-op and program-op which are the parent operation classes that behave similarly except they don’t statically link C code.

Implementor’s note: There is also an operation :static-runtime-op to create the statically linked runtime alone, but it’s admittedly not very useful except as an intermediate step dependency towards building :static-image-op or :static-program-op.