Many Lisp implementations include a copy of ASDF.
You can usually load this copy using Common Lisp's require
function:
(require :asdf)
As of the writing of this manual, the following implementations provide ASDF 2 this way: abcl allegro ccl clisp cmucl ecl sbcl xcl. The following implementations don't provide it yet but might in a future release: lispworks scl. The following implementations are obsolete and most probably will never bundle it: cormancl gcl genera mcl.
If the implementation you are using doesn't provide ASDF 2, see see Loading an otherwise installed ASDF below. If that implementation is still actively maintained, you may also send a bug report to your Lisp vendor and complain about their failing to provide ASDF.
To check whether ASDF is properly loaded in your current Lisp image, you can run this form:
(asdf:asdf-version)
If it returns a string, that is the version of ASDF that is currently installed.
If it raises an error, then either ASDF is not loaded, or you are using an old version of ASDF.
You can check whether an old version is loaded by checking if the ASDF package is present. The form below will allow you to programmatically determine whether a recent version is loaded, an old version is loaded, or none at all:
(or #+asdf2 (asdf:asdf-version) #+asdf :old)
If it returns a version number, that's the version of ASDF installed.
If it returns the keyword :OLD
,
then you're using an old version of ASDF (from before 1.635).
If it returns NIL
then ASDF is not installed.
If you are experiencing problems with ASDF, please try upgrading to the latest released version, using the method below, before you contact us and raise an issue.
If your implementation does provide ASDF 2 or later, and you want to upgrade to a more recent version, just install ASDF like any other package (see see Loading an otherwise installed ASDF below), configure ASDF as usual (see see Configuring ASDF below), and upgrade with:
(require :asdf) (asdf:load-system :asdf)
If on the other hand, your implementation only provides an old ASDF, you will require a special configuration step and an old-style loading:
(require :asdf) (push #p"/path/to/new/asdf/" asdf:*central-registry*) (asdf:oos 'asdf:load-op :asdf)
Don't forget the trailing /
at the end of your pathname.
Also, note that older versions of ASDF won't redirect their output, or at least won't do it according to your usual ASDF 2 configuration. You therefore need write access on the directory where you install the new ASDF, and make sure you're not using it for multiple mutually incompatible implementations. At worst, you may have to have multiple copies of the new ASDF, e.g. one per implementation installation, to avoid clashes. Note that to our knowledge all implementations that provide ASDF provide ASDF 2 in their latest release, so you may want to upgrade your implementation rather than go through that hoop.
Finally, note that there are some limitations to upgrading ASDF:
:depends-on (:asdf)
, or :depends-on ((:version :asdf "2.010"))
,
but instead that they check that a recent enough ASDF is installed,
with such code as:
(unless (or #+asdf2 (asdf:version-satisfies (asdf:asdf-version) *required-asdf-version*)) (error "FOO requires ASDF ~A or later." *required-asdf-version*))
If your implementation doesn't include ASDF, if for some reason the upgrade somehow fails, does not or cannot apply to your case, you will have to install the file asdf.lisp somewhere and load it with:
(load "/path/to/your/installed/asdf.lisp")
The single file asdf.lisp is all you normally need to use ASDF.
You can extract this file from latest release tarball on the ASDF website. If you are daring and willing to report bugs, you can get the latest and greatest version of ASDF from its git repository. See Getting the latest version.
For maximum convenience you might want to have ASDF loaded whenever you start your Lisp implementation, for example by loading it from the startup script or dumping a custom core — check your Lisp implementation's manual for details.