ASDF-Binary-Locations (ABL) is an ASDF-Extension that makes it easy to specify where your Common Lisp binaries (FASL files) should go.
Each Common Lisp implementation has its own format for compiled files (fasls for short). If you use multiple implementations (or even just multiple versions of the same implementation), you'll soon find your source directories littered with various DFSLs, FASLs, CFSLs and so on. This is ugly and makes finding what you want more difficult. Worse yet, some implementations share the same file extension or change formats from version to version. This means that you'll have to recompile binaries as you switch from one implementation to the next. That's downright inefficient.
ASDF-Binary-Locations prevents this nightmare by:
ABL's default binary location for each Lisp implementation is a subdirectory of each source directory. To account for different Lisps, Operating Systems, Implementation versions, and so on, ABL borrows code from SLIME to create reasonable custom directory names. Here are some examples:
It may be more convenient to keep FASL files out of sources entirely and have ABL put all compiled files into subdirectories of a single central location (see *centralize-lisp-binaries* below).
Here is a summary of the variables that control ABL's source to binary mappings:
*centralize-lisp-binaries* - If true, compiled lisp files without an explicit mapping (see *source-to-target-mappings*) will be placed in subdirectories of *default-toplevel-directory*. If false, then compiled lisp files without an explicitly mapping will be placed in subdirectories of their sources.
*default-toplevel-directory* - If *centralize-lisp-binaries* is true, then compiled lisp files without an explicit mapping (see *source-to-target-mappings*) will be placed in subdirectories of *default-toplevel-directory*.
*include-per-user-information* - specifies whether or not to include user information in the directory. Only used when *centralize-lisp-binaries* is true.
*map-all-source-files* - If true, then all source files will be mapped by ABL. If
nil (the default), then only Common Lisp Source Files (i.e., instances of cl-source-file or its subclasses) will be.
*source-to-target-mappings* - This specifies mappings from source to target. If the target is nil, then it means to not map the source to anything. I.e., to leave it as is. This has the effect of turning off ASDF-Binary-Locations for the given source directory.
These variables are used by
output-files-for-system-and-operation to determine where to place a source file's binary. You can further customize ABL by writing additional methods on the generic function
The *source-to-target-mappings* variable specifies mappings from source to target. If the target is nil, then it means to not map the source to anything. I.e., to leave it as is. This has the effect of turning off ASDF-Binary-Locations for the given source directory. Examples:
;; compile everything in .../src and below into .../cmucl '(("/nfs/home/compbio/d95-bli/share/common-lisp/src/" "/nfs/home/compbio/d95-bli/lib/common-lisp/cmucl/")) ;; leave SBCL innards alone (SBCL specific) (list (list (princ-to-string (sb-ext:posix-getenv "SBCL_HOME")) nil))
nilso that the FASLs are not relocated.