Wednesday, May 03, 2006

Setting up ASDF for CLISP+Win32

It took me quite a while to figure this out so I assume that others are having troubles with it as well. It all makes sense and is quite easy once you know how but then so's almost everything!

  1. Download CLISP and install it.
  2. Download ASDF (Thanks Cliki for the ASDF link) and save it somewhere. I saved it in the root of the CLISP install directory.
  3. Choose a location for your ASDF Registry. I created an asdfs directory within the CLISP directory. Just keep these locations in mind when you next upgrade CLISP.
  4. For each ASDF capable library you have downloaded, create a shortcut to it's .asd file or files and put the shortcut in the ASDF registry directory.
  5. Make sure all the shortcuts have the same filename as the .asd they point to i.e. remove the "Shortcut to"
  6. Run Clisp.
  7. Find out where CLISP expects to find its initialization files:
    It is probably your Documents and Settings\\Username directory but it doesn't hurt to check.
  8. Create a file called .clisprc.lisp in the directory discovered in the previous step.
  9. Put the following in the .clisprc.lisp file:
    (load "path-to-asdf.lisp")
    (push "path-to-asdf-registry" asdf:*central-registry*)

  10. You should now be able to run clisp and do:
    (asdf:oos 'asdf:load-op 'Whatever-you-want)

Pretty easy, huh? Let me know where the mistakes are and if you think there are any resources that could benefit from this, let me know or just cut and paste it!


Chui said...

I have been blogging my struggles with ASDF+CLISP+Windows.

Thanks. Will check it out.

osl said...

the package lw-addons has another solution:

(defun update-asdf-central-registry ()
"Loops through *ASDF-DIRS* and adds all directories containing
system definitions to ASDF's central registry."
(dolist (asdf-dir *asdf-dirs*)
(dolist (dir-candidate (directory (make-pathname :name :wild
:type :wild
:defaults asdf-dir)))
(when (lw:file-directory-p dir-candidate)
(let ((asd-candidate (merge-pathnames "*.asd" dir-candidate)))
(when (directory asd-candidate)
(pushnew dir-candidate asdf:*central-registry*
:test #'equal)))))))


should be doable for clisp also. One just has to make shure, that a directory tree doesnt contain .asds with the same name and maybe a different version.

Btw: Windows has real (hard)links now, but you have to get a tool first, i think the sdk has one

Anonymous said...

Shortcuts DO NOT WORK!

For solution see this URL: