Abstract
These are instruction on how to make ASDF work with Corman Common Lisp (CCL) 2.5 (or rather vice versa). CCL has several problems with respect to ANSI compatibility and thus ASDF can't be used out of the box. As a consequence, CCL users don't have convenient access to many open source libraries (check out CLiki or common-lisp.net) out there. They either have to find another way to load these libraries, or, if they're new to Lisp, they'll probably end up not using these libraries at all.If you're a registered CCL user you should probably ask your vendor to support the full ANSI standard but until then you can try the workarounds described here if you want to deploy ASDF. Note that these workarounds are intended for people who want to load third-party libraries via ASDF. As we currently have to disable file compilation it is not recommended to use ASDF in conjunction with CCL for the development of your own libraries.
I've tested these workarounds successfully with a couple of libraries. Let me know if you run into problems - maybe I can help. (But note, however, that this is about loading the library with ASDF. I probably can't help if the library itself doesn't work with CCL.)
Note: In the meantime, Corman Lisp 3.0 has been released and most likely you won't need this anymore. ASDF is expected to work out of the box with Corman Lisp now.
CormanLisp.img which lives inside the CCL folder.
asdf.lisp from the CCLAN CVS repository. (Note that you don't have to use CVS to get the file. Because it's only one file you can easily get it via ViewCVS.)
patch.lisp (available from http://weitz.de/corman-asdf/patch.lisp).
asdf.lisp.
asdf-addons.lisp (available from http://weitz.de/corman-asdf/asdf-addons.lisp).
(pushnew 'asdf-util:source-dir-search
asdf:*system-definition-search-functions*)
SAVE-IMAGE (see CCL documentation) to save your Lisp image.
CormanLisp.img and move it into the CCL directory (thus replacing the original file of the same name).
You are now ready to use ASDF - see the following section.
PUSH
these directories onto the list ASDF-UTIL:*SOURCE-DIRS*
(preferable in the file init.lisp in the CCL
directory). This list is used by ASDF to find the system definitions
(the files ending in .asd) of the libraries you want to
load.
Here's a step-by-step example:
C:\Lisp
and C:\Lisp\libs on your hard disk.
(pushnew #p"C:/Lisp/libs/" asdf-util:*source-dirs* :test #'equal)to the end of your
init.lisp file.
C:\Lisp\libs (such that the
file cl-ppcre.asd is located at C:\Lisp\libs\cl-ppcre-x.y.z\cl-ppcre.asd).
(asdf:oos 'asdf:load-op :cl-ppcre)
(cl-ppcre:split "-+" "a-bc--de-f")which is expected to return the list
("a" "bc" "de" "f")
patch.lisp modifies
Corman Lisp to overcome some of its shortcomings with respect to
ASDF. The file asdf-addons.lisp adds a new search facility for ASDF. Here are the details:
DEFINE-MODIFY-MACRO in CCL doesn't take into account &OPTIONAL and &REST lambda list keywords but they are needed for ASDF.
The patch includes a corrected version of this macro.
The patch fixes this for MAKE-PATHNAME.
*CENTRAL-REGISTRY* is a list
which contains only the value *DEFAULT-PATHNAME-DEFAULTS*.
This implies that, if all else fails, ASDF tries to find a system
definition like foo.asd by merging
with *DEFAULT-PATHNAME-DEFAULTS* which in most other
implementations will usually result in looking up the file in the
'current working directory.'
This is not the case in CCL so the patch
modifies (SETF CURRENT-DIRECTORY) (see Corman Lisp docs) to alway set *DEFAULT-PATHNAME-DEFAULTS* to its argument. (This is not strictly necessary for ASDF to work so you can remove this definition from patch.lisp if you don't like the new behaviour.)
(in-package "CL-USER") (defpackage "FOO" (:use "CL") (:export "BAR"))and compile it, then execute the resulting FASL file via the "Lisp" menu. See?
As a workaround we push the symbol :BROKEN-FASL-LOADER on *FEATURES*. ASDF (1.84 or higher) will recognize this and simply refrain from compiling files at all. In other words, ASDF's COMPILE-OP is useless with this workaround while LOAD-OP will only LOAD code. (Note that this is not as bad as it might seem because CCL, like SBCL or MCL, compiles everything on the fly.)
Update: Roger Corman has uploaded a patch but I still see problems with the FASL loader. My current recommendation is to keep FASL loading disabled.
This doesn't work with MS Windows because it doesn't have usable symlinks so we define (in asdf-addons.lisp) the function ASDF-UTIL:SOURCE-DIR-SEARCH and the special variable ASDF-UTIL:*SOURCE-DIRS*. SOURCE-DIR-SEARCH will scan all directories which are exactly one level below one of the directories mentioned in *SOURCE-DIRS* for system definitions (i.e. for .asd files).
ASDF-UTIL:SOURCE-DIR-SEARCH uses CCL's CL::DIRECTORY-SUBDIRS to get a list of all subdirectories of a directory. This function doesn't work correctly with subdirectories which have a dot in their name.
The patch fixes this by re-defining SUBDIRECTORY-PATHNAME.
IN-PACKAGE is not ANSI-compliant in that it silently creates packages if they are not found.
The patch fixes this be re-defining IN-PACKAGE. This is not strictly necessary for ASDF to work but while we're at it... :)
patch.lisp to replace the corresponding definitions in the CCL sys directory and re-build the compiler as described in the Corman Lisp docs. However, this will not work with IN-PACKAGE because the code to build the compiler currently relies on the wrong, old behaviour of IN-PACKAGE.
ASDF:OOS with the keyword argument :VERBOSE set to NIL. This'll use a broadcast stream which CCL currently doesn't have.
ASDF-UTIL:SOURCE-DIR-SEARCH might grab the wrong one. It will check the directories in ASDF-UTIL:*SOURCE-DIRS* in order but if the two library versions reside in the same directory the order depends on the behaviour of CCL's DIRECTORY function.
COMPILE-OP is effectively
disabled. This implies that currently (while CCL's FASL loader is
broken) you probably shouldn't use ASDF for development purposes.
patch.lisp redefines symbols from the COMMON-LISP package. This works (at the moment) with Corman Lisp but isn't portable according to section 11.1.2.1.2 of the standard.
patch.lisp to Roger Corman. You should check the Changelog and compare the date when it was last updated with the dates in Corman Technologies' patches directory. Maybe some or all of my patches are no longer needed when you read this.
| 2006-10-12 | Note about Corman Lisp 3.0 | |
| 2004-05-14 | Update about broken FASL loader | |
| 2004-05-06 | Initial version | |
$Header: /usr/local/cvsrep/weitz.de/corman-asdf/index.html,v 1.3 2006/10/12 10:33:23 edi Exp $