NOTE: as of OpenMCL release 0.6, it's necessary to obtain and install the interface database before compiling OpenMCL sources.
The default OpenMCL heap image is built by invoking the lisp kernel , specifying
the name of a bootstrapping image (typically "ppc-boot" for
LinuxPPC, "ppc-boot.image" for DarwinPPC) in the ccl
directory.
The bootstrapping image is built by invoking a special utility
inside a running OpenMCL heap image to compile sources contained
in the ccl/level-0
directory. (This process is
called "cross-dumping".) The bootstrapping image loads several
dozen FASL files; after it's done so, saving a heap image (via
"SAVE-APPLICATION") should produce something that's functionally
equivalent to the PPCCL
(Darwin:
dppccl.image
) heap image contained in binary
distributions.
A few points worth noting:
There's a circular dependency between the full heap image
(PPCCL
or dppcl.image
) and the
bootstrapping image (ppc-boot
or
ppc-boot.image
), in that each is used to build
the other.
There are some minor implementation differences, but the environment in effect after the bootstrapping image has loaded its FASL files is essentially equivalent to the environment provided by the full heap image; the latter loads a lot faster and is easier to distribute, of course.
If the full heap image doesn't work (because of an OS compatibilty problem or other bug), it's very likely that the bootstrapping image will suffer the same problems.
Given a bootstrapping image and a set of up-to-date FASL
files, the development cycle usually involves editing lisp sources
(or updating those sources via cvs update
),
recompiling modified files, and using the bootstrapping image to
produce a new heap image.
Given a source distribution and a lisp kernel/heap image (ppccl / dppccl, PPCCL / dppccl.image), one can produce a bootstapping image (ppc-boot) by:
1) invoking OpenMCL from the shell % openmcl Welcome to OpenMCL .... ! ? 2) calling 'CCL::XLOAD-LEVEL-0' at the lisp prompt ? (ccl::xload-level-0)
This will compile the lisp sources in the
ccl/level-0
directory if they're newer than the
corresponding FASL files and will then "load" the resulting FASL
filess into a simulated lisp heap (contained inside data
structures inside the running lisp.) That "simulated heap image"
is then written to disk as "ccl:ppc-boot" under LinuxPPC or as
"ccl:ppc-boot.image" under DarwinPPC.
XLOAD-LEVEL-0 should be called whenever "ccl:ppc-boot" (Darwin: "ccl:ppc-boot.image") is out-of-date with respect to the source files in "ccl:level-0;". :
? (ccl::xload-level-0 :force)
will force recompilation of the level-0 sources.
Calling:
? (ccl::compile-ccl)
at the lisp prompt will compile any FASL files that are
out-of-date with respect to the corresponding lisp sources;
(CCL::COMPILE-CCL t) will force recompilation. CCL::COMPILE-CCL
will reload newly-compiled versions of some files;
CCL::XCOMPILE-CCL is analogous, but skips this reloading step.
Unless there are bootstrapping considerations involved, it usually
doesn't matter whether these files (the members of
CCL::*ENV-MODULES*
) are reloaded after they're
recompiled.
Calling [X]COMPILE-CCL in an environment where FASL files don't yet exist may produce warnings to that effect whenever files are REQUIREd during compilation; those warnings can be safely ignored. Depending on the maturity of the OpenMCL release, calling [X]COMPILE-CCL may also produce several warnings about undefined functions, etc. They should be cleaned up at some point.
At the shell prompt, cd to your ccl
directory and
invoke the OpenMCL kernel with the bootstrapping image.
For LinuxPPC, this would be:
% ./ppccl ppc-boot
For DarwinPPC:
% ./dppccl ppc-boot.image
That should load a few dozen FASL files (printing a message to file descriptor 2 as each file is loaded.) If all of these files successfully load, the lisp will print a prompt. You should be able to do essentially everything in that environment that you can in the environment provided by a "real" heap image (memory constraints and memory layout are a little different, so a few things - like enabling the EGC - don't work.) If you're confident that things loaded OK, you can save that image.
For LinuxPPC:
? (ccl::save-application "PPCCL") ; Overwiting the existing PPCCL
For DarwinPPC:
? (ccl::save-application "dppccl.image")
If things go wrong in the early stages of the loading sequence, errors are often difficult to debug; until a fair amount of code (CLOS, the CL condition system, streams, the reader, the read-eval-print loop) is loaded, it's generally not possible for the lisp to report an error. Errors that occur during these early stages ("the cold load") sometimes cause the lisp kernel debugger to be invoked; it's primitive, but can sometimes help one to get oriented.