It intends to solve the same basic class of problems as mk-defsystem, but internally it takes advantage of modern CL features like pathname support, etc, and it uses CLOS for extensibility.
Documentation on how to use ASDF can be found on its home page on common-lisp.net. For more details, see the online ASDF Manual and builder.
In a hurry, have a look at: FirstStepsWithAsdfAndAsdfInstall
A short howto is also available. And here is a page which explains how to use ASDF with Corman Lisp.
hello-lisp provides an example of how to lay out the file structure of a Lisp program / library to use asdf and make it asdf-install friendly.
ASDF is bundled with (at least) the following Lisps: SBCL, CCL, ECL, ACL and ABCL. Thus, you need only (require 'asdf) to use it. (Note that the bundled version may lag behind the version available on-line) If you have Debian or Gentoo and the Common Lisp Controller installed, you also already have it. Otherwise you can find it in the common-lisp.net git repository.
From http://www.sbcl.org/manual/Automatic-Recompilation-of-Stale-Fasls.html
If you update your Lisp to a version that uses a different fasl-format you get a diskfull of stale fasls that ASDF will try to load in good faith, with predictable and unpleasant results.
The ugly brute force solution looks is to find and delete all the fasls (f.e. find -name *.fasl -type f -print | xargs /bin/rm -f) -- but there are better ways. Add the following around-method to your .lisp-init, .sbclrc, or equivalent:
;;; If the fasl was stale, try to recompile and load (once). Since only SBCL
;;; has a separate condition for bogus fasls we retry on any old error
;;; on other lisps. Actually, Allegro has a similar condition, but it's
;;; unexported. Works nicely for the ACL7 upgrade, though.
;;; CMUCL has an invalid-fasl condition as of 19c.
(defmethod asdf:perform :around ((o asdf:load-op) (c asdf:cl-source-file))
(handler-case (call-next-method o c)
(#+sbcl sb-ext:invalid-fasl
#+allegro excl::file-incompatible-fasl-error
#+lispworks conditions:fasl-error
#+cmu ext:invalid-fasl
#-(or sbcl allegro lispworks cmu) error ()
(asdf:perform (make-instance 'asdf:compile-op) c)
(call-next-method))))
From #lisp circa 2004-08-05:
Q: Why isn't there a shortcut for (asdf:operate 'asdf:load-op :foo)? Something like (asdf:load :foo)
A: ASDF is designed to be an extensible system - you can create new ASDF operations by subclassing 'ASDF:OPERATION and specializing ASDF:OPERATE.
In addition, some lisp implementations (SBCL, CCL, ECL, and CMUCL after 19a patch 000) provide a hook for ASDF into REQUIRE. SLIME also provides a way of loading ASDF systems. But see below on how to enable this for CMUCL.
As of June 2009, this question is more or less obsolete, as shortcuts have been added, see the "getting started" guide.
A: Because that's the wrong place to make that decision. The system file `belongs to' the system creator, but the choice of where to put fasls is for the site admin or end-user to make. See http://ww.telent.net/diary/2004/11/#8.82988 for more information.
See asdf binary locations for an ASDF-extension that shows how to support this requirement in ASDF.
A: There's some information below on this page, only partially specific to clisp. Also, Bill Clementson has a post on the topic.
A: Right here: asdf-install.
A: See here: http://weitz.de/asdf-install/#*proxy-user*. (And, actually, this question doesn't quite belong here...)
(Actually, this item doesn't belong here, either; it's really more appropriate for the page on ASDF-INSTALL.)
The cclan version of asdf apparently doesn't have the necessary code to hook REQUIRE into CMUCL. So here is a small bit of code to make it so. You need at least cmucl 19a with patch 0 for this to work.
;; Simple support for ASDF and CMUCL(in-package #:asdf)
(eval-when (:compile-toplevel :load-toplevel :execute) (when (find-symbol "*MODULE-PROVIDER-FUNCTIONS*" "EXT") (pushnew :cmu-hooks-require *features*)))
#+cmu-hooks-require (progn (defun module-provide-asdf (name) (handler-bind ((style-warning #'muffle-warning)) (let* ((*verbose-out* (make-broadcast-stream)) (name (string-downcase name)) (system (asdf:find-system name nil))) (when system (asdf:operate 'asdf:load-op name) t)))) (pushnew 'module-provide-asdf ext:*module-provider-functions*) ;; Add whatever use you need, like adding paths to asdf:*central-registry* )
Getting Clisp on Windows to load asdf and getting asdf to look where you need it to is not the easiest process to figure out. Here's how I managed to do it.
(user-homedir-pathname)It is probably your Documents and Settings\\Username directory but it doesn't hurt to check.
(load "path-to-asdf.lisp") (push "path-to-asdf-registry" asdf:*central-registry*); Example: ; (load #P"C:\\Programs\\asdf.lisp") ; (push #P"C:\\Programs\\asdf-registry\\" asdf:*central-registry*)
(asdf:oos 'asdf:load-op 'Whatever-you-want)
;; An alternative to the standard sysdef search can be defined. This
;; code below can be dropped into your Lisp init files and customized.
;; It will search for all ASDF systems in subdirectories of the
;; specified directories. That lets you simply "drop-in" new packages
;; into one of the specified directories, and it will be available for
;; loading without any further steps.
(in-package #:asdf)
(defvar *subdir-search-registry* '(#p"/my/lisp/libraries/")
"List of directories to search subdirectories within.")
(defvar *subdir-search-wildcard* :wild
"Value of :wild means search only one level of subdirectories; value of :wild-inferiors means search all levels of subdirectories (I don't advise using this in big directories!)")
(defun sysdef-subdir-search (system)
(let ((latter-path (make-pathname :name (coerce-name system)
:directory (list :relative
*subdir-search-wildcard*)
:type "asd"
:version :newest
:case :local)))
(dolist (d *subdir-search-registry*)
(let* ((wild-path (merge-pathnames latter-path d))
(files (directory wild-path)))
(when files
(return (first files)))))))
(pushnew 'sysdef-subdir-search *system-definition-search-functions*)
In the system definition of Iterate, Jörg Höhle censures the practice of cluttering the package space with dozens of tiny definition packages and even more so the typically empty ASDFNNNN packages
. His remark went largely unnoticed (certainly, no one reads .asd files); which does not make it any less justified, in my opinion. To be sure, the current revision of ASDF (1.104) deletes ASDFNNNN packages as soon as they are not needed, so that the latter problem has been dealt with; but the former problem persists. Maybe something should be done about it at last? The difficulty is not so much technical as social: persuading everyone to establish a conventional use of this facility. Even now there are writers that do not follow the current manual's recommended usage (to define one's system XYZ while in the XYZ-SYSTEM package).
Pages in this topic: asdf-dependency-grovel asdf-packaging-tools common-lisp-controller FirstStepsWithAsdfAndAsdfInstall poiu
Also linked from: ASDF System asdf-addons ASDF-Binary-Locations ASDF-Extension ASDlite aserve ch-asdf cirCLe cl-cbr cl-curl cl-jointgen cl-menusystem cl-reversi CL-S3 cl-syntax-sugar cl-syslog cl-xml Closer to MOP Current recommended libraries Daniel Lowe hello-lisp Leonardo Varuzza Lint ltd Marko Kocic MKCL ODCL ParenscriptWithApachePHP SLIME-PPCRE system-menu TemplateForASDF WAAF-CFFI XCVB Zebu
CLiki pages can be edited by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively