this post was submitted on 30 Nov 2023
1 points (100.0% liked)

Lisp

55 readers
3 users here now

founded 1 year ago
MODERATORS
 

I have seen that sb-ext:save-lisp-and-die is used to make executables from sourc code, but how do you make the executable for specific systems? e.g. Linux, Windows, Apple.

top 3 comments
sorted by: hot top controversial new old

`save-lisp-and-die` just saves a core images which has the same global state as the current image, the saved image is executable when the `:EXECUTABLE` is `true`. However, you can only save the image for the underlying OS, eg, if you run `sbcl` in Linux, `save-lisp-and-die` will only save a Linux version.

The typical usages of `save-lisp-and-die` are, when you want to run this lisp image as a standalone exe, or when you load a lot of libs or large data set, you can save it to another image and run that image afterwards, that will save you a lot of loading time.

[–] dzecniv@alien.top 1 points 1 year ago

Hi, you have to compile them on their respective platform, with possible help of a CI system. Or compile a Windows version on Wine: I read that the Kandria game's version is built like this.

Example Github actions: https://github.com/melusina-org/make-common-lisp-program

Example software that ships for all three platforms (in addition of an AppImage): https://github.com/VitoVan/calm

[–] Shinmera@alien.top 1 points 1 year ago

Common Lisp is not a batch compiled language, it relies on having a running program in order to compile your code. As such you must be running on the target platform to deploy for to produce executables.