ASDF: optimization settings and other enhancements
- From: Klaus Weidner <kweidner@xxxxxxxxx>
- Date: Tue, 30 Aug 2005 18:18:42 GMT
Hello,
is there an easy way to recompile a set of Lisp files with specific
optimization settings? For example, let's say I hit a bug in an ASDF packaged
library and don't get a useful backtrace since it's been compiled with minimal
debugging, so I'd like to recompile it with other optimization switches without
touching the source.
What I'd like to be able to do is something similar to the following:
(asdf:oos 'asdf:recompile-op :cl-foo-library
:optimize-speed 0 :optimize-debug 3)
which would recompile everything using (declare (optimize (speed 0) (debug 3))).
Currently the only way I know to change it requires putting a declaim line at
the top of each source file, which is messy. Since this sounds like a fairly
typical scenario I'm sure somebody has an elegant solution for this, but a bit
of googling didn't help me find it... I'll have a shot at hacking it into asdf
myself if there's no existing solution.
As a side note, isn't anyone else annoyed by the overly verbose syntax
for loading packages using asdf? I'm using the following macro:
(defmacro asdf::use (&rest pkgs)
`(eval-when (:compile-toplevel :load-toplevel :execute)
,@(loop for pkg in pkgs
collect `(asdf:oos 'asdf:load-op ,pkg))))
This way, (asdf::use :cl-ppcre :xmls) works interactively to load multiple
packages.
Or put this line at the top of a lisp file to make loading it "just work"
instead of needing special incantations, which is really nice for "#!"
executable Lisp files. (Yes, this was inspired by the Perl module facility...)
For example:
#!/usr/bin/clisp -C
(asdf:use :port)
(port:run-prog "/bin/ls")
This would require the following using plain ASDF:
#!/usr/bin/clisp -C
(eval-when (:compile-toplevel :load-toplevel :execute)
(asdf:oos 'asdf:load-op :port))
(port:run-prog "/bin/ls")
I'm sure this verbosity may be a factor why Lisp is less than popular as a
quick scripting solution...
-Klaus
.
- Follow-Ups:
- Prev by Date: Re: Help me come up with a few and simple programming challenges
- Next by Date: Re: (Prolog + LISP + Erlang) with integration issues versus C++
- Previous by thread: Re: Cost of starting a software business (was: Resume questions, how convey? (was: How much should I charge fo...))
- Next by thread: Re: ASDF: optimization settings and other enhancements
- Index(es):
Relevant Pages
|