Install ALPM from a checkout of its repository:
make install # default PREFIX=/opt/local make install PREFIX=/usr/local
This generates a single self-contained ‘alpm.lsp’ (ALPM concatenated by itself) and installs it as ‘$PREFIX/share/autolisp/alpm.lsp’, the documentation (org + PDF) under ‘$PREFIX/share/doc/alpm/’, and this manual as an Info file ‘$PREFIX/share/info/alpm.info’ (read it with ‘info alpm’). ‘sudo make install’ works; packagers can use ‘DESTDIR’. Then one form, once per session (or from your ‘acaddoc.lsp’ / ‘on_start.lsp’ / clautolisp init), does everything:
(load "/opt/local/share/autolisp/alpm.lsp")
Loading it defines ALPM and initializes the site registry — the file is self-locating (it registers the directory it is loaded from, so it works under any prefix or relocated), performing the equivalent of:
(alpm-register-directory "/opt/local/share/autolisp/" T) (alpm-register-support-path) (alpm-trust-registry)
‘$PREFIX/share/autolisp/’ is the site directory: install each system there as a subdirectory ‘<name>/’ containing ‘<name>.alpm’ and its sources — then ‘(alpm-load-system "foo" nil)’ finds ‘/opt/local/share/autolisp/foo/foo.alpm’ and loads foo’s sources from ‘/opt/local/share/autolisp/foo/’.
For systems living elsewhere (development trees), extend the registry yourself:
(alpm-register-directory "/home/pjb/lisp/systems" nil) (alpm-register-directory "d:/work/lisp" T) ; T = also scan subdirectories
(When working on ALPM itself, ‘(load ".../alpm/sources/alpm.lsp")’ loads the uninstalled implementation without any site initialization.)
Use ‘/’ as the path separator on every platform. The recursive form registers a whole tree of projects at once (symlink loops are detected and skipped). ‘alpm-register-support-path’ adds the directories of AutoCAD’s / BricsCAD’s own search path — they are configured in the GUI, and ALPM does not consult them unless you ask. ‘alpm-trust-registry’ keeps ‘SECURELOAD’ from blocking loads out of registered directories that are not already trusted.
To find out where systems live in a tree before registering anything, use ‘alpm-find-systems-in-tree’ — same recursive, symlink-safe traversal as ‘alpm-register-directory’’s recursive form, but read-only:
(alpm-find-systems-in-tree "/home/pjb/lisp")
;; => ("/home/pjb/lisp/geometry" "/home/pjb/lisp/vectors" ...)
It returns the directories that directly contain a ‘.alpm’ file, without touching ‘*alpm-registry*’.