Le 10/02/2023 à 00:20, Brandon Hale a écrit :
Hello all,
I apologize if this is either the wrong place to get help with ecl, or
if this is asked all of the time. I've written a small replacement for
i3status with common lisp and want to use ecl to make a binary so when
i3wm loads, it just loads the cl-i3status binary. I've looked at the ecl
documentation online and it suggests doing something like this:
(ql:quickload :cl-i3)
(asdf:make-build :cl-i3
:type :program
:move-here #P"/home/brandon/Programming/lisp/cl-i3/"
:prologue-code '(require 'asdf))
So, I run this and the binary appears. However, when I try to run it, I
get this output:
;;; Loading #P"/usr/lib/ecl-21.2.1/asdf.fas"
;;; Computing Hangul syllable names
Condition of type: MISSING-COMPONENT
Component "str" not found
Available restarts:
1. (RETRY) Retry ASDF operation.
2. (CLEAR-CONFIGURATION-AND-RETRY) Retry ASDF operation after resetting the
configuration.
Top level in: #<process TOP-LEVEL 0x557ade1c2f80>.
I imagine it is just because of my use of quicklisp packages, but how do
I compile the packages into the binary?
Thank you very much for any help you can offer,
ecl produces elf binaries. You will want to compile, and link all your
code into this executable file. So you don't need to load asdf or
anything else at run-time (in the prologue-code). Instead, you load
asdf, quicklisp, and your code, when you generate the executable with
make-build.
Have a look at the hello-world project
https://gitlab.com/informatimago/hw/
to see how to produce executables.
In particular, in the case of ecl:
https://gitlab.com/informatimago/hw/-/blob/master/generate.lisp#L216
--
__Pascal Bourguignon__