Previous Section Next Section Table of Contents Glossary Index

Chapter 3. Building Clozure CL from its Source Code

3.4. Building the kernel

The Lisp kernel is the executable that you run to use Lisp. It doesn't actually contain the entire Lisp implementation; rather, it loads a heap image which contains the specifics—the "library", as it might be called if this was a C program. The kernel also provides runtime support to the heap image, such as garbage collection, memory allocation, exception handling, and the OS interface.

The Lisp kernel file has different names on different platforms. See Table 3.1, “Platform-specific filename conventions”. On all platforms the lisp kernel sources reside in ccl/lisp-kernel.

This section gives directions on how to rebuild the Lisp kernel from its source code. Most Clozure CL users will rarely have to do this. You probably will only need to do it if you are attempting to port Clozure CL to a new architecture or extend or enhance its kernel in some way. As mentioned above, this step happens automatically when you do

? (rebuild-ccl :full t)
      

3.4.1. Kernel build prerequisites

The Clozure CL kernel can be bult with the following widely available tools:

  • cc or gcc- the GNU C compiler

  • ld - the GNU linker

  • m4 or gm4- the GNU m4 macro processor

  • as - the GNU assembler (version 2.10.1 or later)

  • make - either GNU make or, on FreeBSD, the default BSD make program

In general, the more recent the versions of those tools, the better; some versions of gcc 3.x on Linux have difficulty compiling some of the kernel source code correctly (so gcc 4.0 should be used, if possible.) On OSX, the versions of the tools distributed with XCode should work fine; on Linux, the versions of the tools installed with the OS (or available through its package management system) should work fine if they're "recent enough". On FreeBSD, the installed version of the m4 program doesn't support some features that the kernel build process depends on; the GNU version of the m4 macroprocessor (called gm4 on FreeBSD) should be installed.

3.4.2. Using "make" to build the lisp kernel

With those tools in place, do:

shell> cd ccl/lisp-kernel/PLATFORM
shell> make
	    

That'll assemble several assembly language source files, compile several C source files, and link ../../the kernel.


Previous Section Next Section Table of Contents Glossary Index