Previous Section Next Section Table of Contents Glossary Index

Chapter 2. Obtaining, Installing, and Running Clozure CL

2.2. Obtaining Clozure CL

There are three ways to obtain Clozure CL. For Mac OS X, there are disk images that can be used to install Clozure CL in the usual Macintosh way. For other OSes, Subversion is the best way to obtain Clozure CL. Mac OS X users can also use Subversion if they prefer. Tarballs are available for those who prefer them, but if you have Subversion installed, it is simpler and more flexible to use Subversion than tarballs.

There are three popular ways to use Clozure CL: as a stand-alone double-clickable application (Mac OS X only), as a command-line application, or with Emacs and SLIME.

The following sections describe these options.

2.2.1. The Mac Way

If you are using Mac OS X then you can install and use Clozure CL in the usual Macintosh way. Download and mount a disk image, then drag the ccl folder to the Applications folder or wherever you wish. After that you can double-click the Clozure CL application found inside the ccl directory. The disk images for version 1.7 are available at ftp://clozure.com/pub/release/1.7/

So that Clozure CL can locate its source code, and for other reasons explained in Section 4.6.2, “Predefined Logical Hosts”, you keep the Clozure CL application in the ccl directory. If you use a shell, you can set the value of the CCL_DEFAULT_DIRECTORY environment variable to explicitly indicate the location of the ccl directory. If you choose to do that, then the ccl directory and the Clozure CL application can each be in any location you find convenient.

2.2.2. Tarballs

Tarball distributions of Clozure CL release version 1.7 are available at ftp://clozure.com/pub/release/1.7/. Download and extract one on your local disk. Then edit the Clozure CL shell script to set the value of CCL_DEFAULT_DIRECTORY and start up the appropriate Clozure CL kernel. See Section 2.3.1, “The ccl Shell Script” for more information about the Clozure CL shell scripts.

2.2.3. Getting Clozure CL with Subversion

It is very easy to download and configure Clozure CL to obtain sources from the Subversion repository. This is the preferred way to get either the latest, or a specific version of Clozure CL, unless you prefer the Mac Way. Subversion is a source code control system that is in wide use. Many OSes come with Subversion pre-installed. A complete, buildable and runnable set of Clozure CL sources and binaries can be retrieved with a single Subversion command.

Note

Unless stated otherwise, examples in this chapter are given for Mac OS X in particular or Unix-based host environments in general.

For Windows, special care must be taken to install a working development environment. For more information see the Clozure CL Wiki at URL: http://trac.clozure.com/ccl/wiki/WindowsNotes

2.2.3.1. Checking Subversion Installation

Make sure that Subversion is installed on your system. Bring up a command line shell and type:

shell> svn
        

If Subversion is installed, you will see something like:

Type 'svn help' for usage
        

If Subversion is not installed, you will see something like:

-bash: svn: command not found
        

If Subversion is not installed, you'll need to figure out how to install it on your OS. You can find information about obtaining and installing Subversion at the Subversion web page.

2.2.3.2. Downloading Clozure CL Using Subversion

Before you download Clozure CL you should consider: Do you want to run the most recent source code, or the current stable release version? If you don't know how to answer this question, then you probably want the release version.

2.2.3.2.1. Downloading the Trunk

Day-to-day development of Clozure CL takes place in an area of the Subversion repository known as "the trunk". At most times, the trunk is perfectly usable, but occasionally it can be unstable or totally broken. If you wish to live on the bleeding edge, download sources from the trunk.

For example, the following command will fetch a copy of the trunk for Mac OS X (Darwin) with x86 processors (both 32- and 64-bit versions):

svn co http://svn.clozure.com/publicsvn/openmcl/trunk/darwinx86/ccl
         

To get a trunk Clozure CL for another platform, replace "darwinx86" with one of the following names (all versions include both 32- and 64-bit binaries):

  • darwinx86

  • linuxx86

  • freebsdx86

  • solarisx86

  • windows

  • linuxppc

  • darwinppc

2.2.3.2.2. Downloading a Release Version

Release versions of Clozure CL are intended to be stable. While bugs will be fixed in the release branches, enhancements and new features will go into the trunk. If you wish to run the stable release, the following command will fetch a copy of the release version 1.7 for Mac OS X (Darwin) with x86 processors (both 32- and 64-bit versions):

svn co http://svn.clozure.com/publicsvn/openmcl/release/1.7/darwinx86/ccl
          

To get the release version of Clozure CL for another platform, replace "darwinx86" with one of the following names:

  • darwinx86

  • linuxx86

  • freebsdx86

  • solarisx86

  • windows

  • linuxppc

  • darwinppc

These distributions contain complete sources and binaries. They use Subversion's "externals" features to share common sources; the majority of source code is the same across all versions.

2.2.4. Rebuilding Clozure CL From Sources

This section explains how to peform a "full rebuild" of Clozure CL from a source distribution.

After downloading Clozure CL sources, you should rebuild Clozure CL as described here. At the start of a full rebuild, object files in the ccl directory are deleted, which causes the build script to recompile the runtime kernel (C code) and high-level sources (Lisp), then save a new heap image. Doing a full rebuild helps to ensure that your local installation will run properly for your host OS environment.

In an interactive shell, a command sequence like the following will rebuild Clozure CL in place:

joe> cd /path/to/installed/ccl
joe:ccl> ./kernel-filename --no-init
Welcome to Clozure Common Lisp Version [...]
? (rebuild-ccl :full t)
<...lots of compilation output...>
? (quit)
joe:ccl>
    

Replace /path/to/installed/ccl with the path of the ccl directory that you downloaded.

Replace kernel-filename with the filename of the Lisp kernel program. To find the filename of a Lisp kernel image for your particular platform, see Section 3.1.1, “Platform-specific filename conventions”.

Specifying the --no-init option ensures that personal initializations do not interfere with rebuilding Clozure CL.

The rest of this section covers the following topics in brief:

Note

This section does not provide comprehensive documentation on the build process. Please refer to Chapter 3, Building Clozure CL from its Source Code for more information. Those more detailed instructions are used mainly by developers who maintain, customize, and/or port Clozure CL. If you are customizing Clozure CL, or if you run into some exceptional situation, you may need to perform the individual build steps.

2.2.4.1. Software Requirements for Building Clozure CL

In order to build Clozure CL you must have a working system and development environment. There are different requirements and setup procedures for each platform, but the main requirement is to have a C compiler and a few other utilities: GNU gcc or cc with ld and as; make; and m4. Please refer to Chapter 3, Building Clozure CL from its Source Code for details.

Note

If you don't have the prerequisite C compiler toolchain installed, rebuild-ccl will not work. See Section 3.3, “Kernel Build Prerequisites” for additional details.

Most distributions of Linux have all or most of the required development tools either pre-installed or readily available. On Debian-based Linux you can download and install the essential build tools using the package manager. For example:

apt-get install build-essential

(You may need to install C header files separately.)

For Mac OS X, Xcode 4 is available from the App Store.

For Windows, install Cygwin and the MinGW toolchain for the 32- or 64-bit OS. More information about installing Clozure CL on Windows is available in the Clozure CL Wiki at URL: http://trac.clozure.com/ccl/wiki/WindowsNotes

2.2.4.2. When to Rebuild Clozure CL From Sources

The most common scenario that requires a full rebuild is the standard installation after downloading the source tree. Users and application developers (who otherwise have no special build requirements) will generally need to run the full rebuild process just once for any given installation on a particular host system.

Another common scenario is installing a patch update: You can use Subversion (svn update) to download a more recent set of source files. (Be sure to download sources from the same path and branch in the source repository.) Then run a full rebuild to create new kernel and heap images. If you are running Clozure CL from the trunk, you may need to update sources and run the full rebuild more often.

Another reason to do a full rebuild is to ensure that Clozure CL will run properly in the host OS environment. This may be necessary, for example, when the target OS version is not identical to the one where the pre-built kernel was generated. The Lisp kernel uses some functionality defined in standard platform-provided libraries. On some platforms, applications (such as the Lisp kernel) are built in such a way as to depend on the specific versions of these libraries that were present at build time, and may not run on systems that have older or newer versions of these libraries. If you're affected by this, the simplest workaround is to build the Lisp kernel on the machine(s) that you intend to run it on and use that locally-built kernel instead of one distributed via Subversion.

2.2.4.3. Rebuilding Clozure CL Using REBUILD-CCL

Once the checkout is complete, and provided that you have a working development setup, you can build Clozure CL by running the Lisp kernel (an OS-native executable program) and running REBUILD-CCL in Lisp.

For example, to build a 64-bit Clozure CL on Mac OS X:

joe:ccl> ./dx86cl64 --no-init
Welcome to Clozure Common Lisp Version 1.7  (DarwinX8664)!
? (rebuild-ccl :full t)
Rebuilding Clozure Common Lisp using Version 1.7  (DarwinX8664)
;Building lisp-kernel ...
;Kernel built successfully.
;Compiling <...>
;Loading <...>

<...lots of compilation output...>

;Wrote bootstrapping image: #P"/Users/joe/ccl/x86-boot64.image"
;Wrote heap image: #P"/Users/joe/ccl/dx86cl64.image"
NIL
? (quit)
joe:ccl>
    

If the build fails for any reason, the kernel and/or heap image files may be missing or corrupted. To recover, delete the image files and update the source directory from Subversion. For example:

joe:ccl> rm dx86cl*
joe:ccl> svn update
<... lots of Subversion output...>
joe:ccl> ./dx86cl64 --no-init
Welcome to Clozure Common Lisp Version 1.7  (DarwinX8664)!
? (rebuild-ccl :full t)
<... lots of compilation output...>
? (quit)
joe:ccl> 

    

Once the full rebuild is completed, you can run the new Lisp kernel from the command shell. However, running the OS- and processor-specific executable directly is not recommended for day-to-day use. Clozure CL includes the ccl and ccl64 command shell scripts. For details on configuring a shell script for your environment, see Section 2.3.1, “The ccl Shell Script”.

2.2.4.4. Summary of the Build Process Steps

Should the build fail, your first concern should be to confirm that all requirements are in place: the C compiler, utilities, and OS header files; source files for the trunk or release branch you want to build; and the Lisp kernel and heap image files. For assistance with trouble-shooting, here is an outline of the full build process, with links to the more detailed instructions in Chapter 3, Building Clozure CL from its Source Code.


Previous Section Next Section Table of Contents Glossary Index