V
V
Voidzero2014-08-09 08:21:40
Lisp
Voidzero, 2014-08-09 08:21:40

How to compile Lisp file to exe?

How do I compile a Common Lisp file into an exe or .deb package? What development environment should I use for this? I have Allegro CL and newLisp installed now, so far I can't figure it out, I'm just starting to learn Lisp.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey P, 2016-02-19
@ruddy22

I think that the above list of commands will help you
https://www.cs.utexas.edu/users/qr/algy/allegro-co...

C
capuccio, 2020-01-02
@capuccio

Live Compilation Example: An example of using a log system is a short program that loads a log package and prints out a few log messages.
1. We are talking about SBCL and Linux.
2. There are different ways to compile, this one was the first one that worked for me.
3. The compiled program is made in the form of a package with something like this asd file

#+sb-core-compression
(defmethod asdf:perform ((o asdf:image-op) (c asdf:system))
  (uiop:dump-image (asdf:output-file o c) :executable t :compression t))
(defsystem "simple-log/example"
:class :package-inferred-system
:depends-on (....); usual dependences
:build-operation  "program-op"
:build-pathname "example.bin"
:entry-point "simple-log/example:main"
:description "a compilable example for simple-log"
:version 0.1
:components ((:file "example")))

4. The :entry-point option points to a package function (like "main" in C) that will be run at startup.
5. If you want the binary to be 15 MB (for a simple program) instead of 50-60 MB, it is recommended to compile SBCL with --with-sb-core-compression:
sh make.sh --with-sb-core-compression
6. See Makefile : to compile the package, we first install it as local to the quicklisp directory
(~/quicklisp/local-projects/simple-log in my case); after that run
~/local/bin/sbcl --quit --eval "(asdf:make :simple-log/example)"

where ~/local/bin/sbcl is my own (for the sake of --with-sb-core-compression) compiled SBCL.
7. The compilation result will be written to the same directory where the package is located; in my case it's
~/quicklisp/local-projects/simple-log/example.bin
8. Yes, it's hard the first time, but I'm used to it.
Well, as for the DEB-package, this is a separate story. But it is possible to make a deb out of binaries, although this is not our way, in Brazilian debian style.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question