开发者

How can ecl include asdf dependencies in an executable? (take 2)

This question was asked and answered by ayrnieu at

How can ECL include ASDF dependencies in an executable?

But the example code he linked to does not actually involve any dependencies. I've tried copying the model in the stumpwm code he refers to but I can't get it to work. He are my files.

---- ecl-test.asd ----

(defsystem "ecl-test"
  :description "test of asdf:make-build"
  :depends-on (:mydefs)
  :components ((:file "package")
  (:file "ecl-test" :depends-on ("package"))
  (:file "main" :depends-on ("package" "ecl-test"))
        )
)

---- ecl-test.lisp ----

    (in-package :ecl-test)

    (defun test ()
      (format t "testing...~%")

;; Note that with the next line commented out,
;; the program never uses the package "mydefs".
;;    (format t (write-to-string (mydefs:number-sequence :from 2 :to 7)))

      (format t "...done~%"))

---- package.lisp ----

(defpackage :ecl-test
  (:use :cl 
 :mydefs
 )
  (:export :test))

---- main.lisp ----

(ecl-test:test)
(ext:quit)

This compiles successfully (in slime):

CL-USER> (asdf:make-build 'ecl-test :type :program :monolithic t :epilogue-code '(ext:quit 0))

; loading system definition from /home/dabrowsa/lisp/ecl-test/ecl-test.asd into
; #<ASDF0 package>
;;; Loading "/home/dabrowsa/lisp/ecl-test/ecl-test.asd"
;;; Compiling /home/dabrowsa/lisp/ecl-test/package.lisp.
;;; OPTIMIZE levels: Safety=2, Space=0, Speed=3, Debug=3
;;; End of Pass 1.
;;; Note: Creating tag: "_eclitxZgyvjVscp1_KzxnJ9z" for #P"/home/dabrowsa/lisp/ecl-test/package.o"
;;; Note: Invoking external command:
;;;   gcc "-I/usr/include/"  -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -fPIC  -Dlinux -O -w -c "/home/dabrowsa/lisp/ecl-test/package.c" -o "/home/dabrowsa/lisp/ecl-test/package.o"
;;; Finished compiling /home/dabrowsa/lisp/ecl-test/package.lisp.
;;; Note: Scanning #P"/home/dabrowsa/lisp/ecl-test/package.o"
;;; Note: Found tag: "_eclitxZgyvjVscp1_KzxnJ9z" for /home/dabrowsa/lisp/ecl-test/package.o
;;; Note: Invoking external command:
;;;   gcc "-I/usr/include/"  -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -fPIC  -Dlinux -O -w -c "/tmp/ECLINITMs8gOO.c" -o "/tmp/ECLINITMs8gOO.o"
;;; Note: Invoking external command:
;;;   gcc -o "/home/dabrowsa/lisp/ecl-test/package.fas" -L"/usr/lib/" "/tmp/ECLINITMs8gOO.o" "/home/dabrowsa/lisp/ecl-test/package.o"   -shared    -lecl  -lgmp -lgc -ldl  -lm 
;;; Loading "/home/dabrowsa/lisp/ecl-test/package.fas"
;;; Compiling /home/dabrowsa/lisp/ecl-test/ecl-test.lisp.
;;; OPTIMIZE levels: Safety=2, Space=0, Speed=3, Debug=3
;;; Compiling (DEFUN TEST ...).
;;; End of Pass 1.
;;; Note: Creating tag: "_eclclGsJgWGIqMw1_y1ynJ9z" for #P"/home/dabrowsa/lisp/ecl-test/ecl-test.o"
;;; Emitting code for TEST.
;;; Note: Invoking external command:
;;;   gcc "-I/usr/include/"  -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -fPIC  -Dlinux -O -w -c "/home/dabrowsa/lisp/ecl-test/ecl-test.c" -o "/home/dabrowsa/lisp/ecl-test/ecl-test.o"
;;; Finished compiling /home/dabrowsa/lisp/ecl-test/ecl-test.lisp.
;;; Note: Scanning #P"/home/dabrowsa/lisp/ecl-test/ecl-test.o"
;;; Note: Found tag: "_eclclGsJgWGIqMw1_y1ynJ9z" for /home/dabrowsa/lisp/ecl-test/ecl-test.o
;;; Note: Invoking external command:
;;;   gcc "-I/usr/include/"  -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -fPIC  -Dlinux -O -w -c "/tmp/ECLINITg28qfo.c" -o "/tmp/ECLINITg28qfo.o"
;;; Note: Invoking external command:
;;;   gcc -o "/home/dabrowsa/lisp/ecl-test/ecl-test.fas" -L"/usr/lib/" "/tmp/ECLINITg28qfo.o" "/home/dabrowsa/lisp/ecl-test/ecl-test.o"   -shared    -lecl  -lgmp -lgc -ldl  -lm 
;;; Loading "/home/dabrowsa/lisp/ecl-test/ecl-test.fas"
;;; Compiling /home/dabrowsa/lisp/ecl-test/main.lisp.
;;; OPTIMIZE levels: Safety=2, Space=0, Speed=3, Debug=3
;;; End of Pass 1.
;;; Note: Creating tag: "_eclJi0DFzaXyAEw1_4LynJ9z" for #P"/home/dabrowsa/lisp/ecl-test/main.o"
;;; Note: Invoking external command:
;;;   gcc "-I/usr/include/"  -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -fPIC  -Dlinux -O -w -c "/home/dabrowsa/lisp/ecl-test/main.c" -o "/home/dabrowsa/lisp/ecl-test/main.o"
;;; Finished compiling /home/dabrowsa/lisp/ecl-test/main.lisp.
;;; Note: Scanning #P"/home/dabrowsa/lisp/ecl-test/main.o"
;;; Note: Found tag: "_eclJi0DFzaXyAEw1_4LynJ9z" for /home/dabrowsa/lisp/ecl-test/main.o
;;; Note: Invoking external command:
;;;   gcc "-I/usr/include/"  -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -fPIC  -Dlinux -O -w -c "/tmp/ECLINITeop9MY.c" -o "/tmp/ECLINITeop9MY.o"
;;; Note: Invoking external command:
;;;   gcc -o "/home/dabrowsa/lisp/ecl-test/main.fas" -L"/usr/lib/" "/tmp/ECLINITeop9MY.o" "/home/dabrowsa/lisp/ecl-test/main.o"   -shared    -lecl  -lgmp -lgc -ldl  -lm 
;;; Note: Scanning #P"/home/dabrowsa/lisp/ecl-test/main.o"
;;; Note: Found tag: "_eclJi0DFzaXyAEw1_4LynJ9z" for /home/dabrowsa/lisp/ecl-test/main.o
;;; Note: Scanning #P"/home/dabrowsa/lisp/ecl-test/ecl-test.o"
;;; Note: Found tag: "_eclclGsJgWGIqMw1_y1ynJ9z" for /home/dabrowsa/lisp/ecl-test/ecl-test.o
;;; Note: Scanning #P"/home/dabrowsa/lisp/ecl-test/package.o"
;;; Note: Found tag: "_eclitxZgyvjVscp1_KzxnJ9z" for /home/dabrowsa/lisp/ecl-test/package.o
;;; Note: Invoking external command:
;;;   gcc "-I/usr/include/"  -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -fPIC  -Dlinux -O -w -c "/tmp/ECLINITsLgWth.c" -o "/tmp/ECLINITsLgWth.o"
;;; Note: Invoking external command:
;;;   ar cr /home/dabrowsa/lisp/ecl-test/libecl-test.a /tmp/ECLINITsLgWth.o /home/dabrowsa/lisp/ecl-test/package.o /home/dabrowsa/lisp/ecl-test/ecl-test.o /home/dabrowsa/lisp/ecl-test/main.o 
;;; Note: Invoking external command:
;;;   ranlib /home/dabrowsa/lisp/ecl-test/libecl-test.a
;;; Note: Invoking external command:
;;;   gcc "-I/usr/include/"  -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -fPIC  -Dlinux -O -w -c "/tmp/ECLINITTF1dqA.c" -o "/tmp/ECLINITTF1dqA.o"
;;; Note: Invoking external command:
;;;   gcc -o "/home/dabrowsa/lisp/ecl-test/ecl-test-mono" -L"/usr/lib/" "/tmp/ECLINITTF1dqA.o" "/home/dabrowsa/lisp/ecl-test/libecl-test.a"     -lecl  -lgmp -lgc -ldl  -lm #<ASDF::PROGRAM-OP NIL 38147728>

But executing ecl-test-开发者_如何学Pythonmono produces an error.

~/lisp/ecl-test$ ./ecl-test-mono

The function ASDF::SYSTEM-REGISTERED-P is undefined.
No restarts available.

Broken at NIL.
ECL-TEST>>

SYSTEM-REGISTERED-P seems to be an unexported function in ASDF, I have no idea why that's popping up here, but then, I'm a newbie so what do I know.


You're better off asking this on ecls-list.

Or try this in your call to MAKE-BUILD:

:prologue-code '(require :asdf)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜