Previous Section Next Section Table of Contents Glossary Index

Chapter 2. Obtaining, Installing, and Running Clozure CL

2.3. Command Line Set Up

Sometimes it's convenient to use Clozure CL from a Unix shell command line. This is especially true when using Clozure CL as a way to run Common Lisp utilities.

2.3.1. The ccl Shell Script

Clozure CL needs to be able to find the ccl directory in order to support features such as require and provide, access to foreign interface information (see The Interface Database) and the Lisp build process (see Building Clozure CL from its Source Code). Specifically, it needs to set up logical pathname translations for the "ccl:" logical host. If this logical host isn't defined (or isn't defined correctly), some things might work, some things might not, and it'll generally be hard to invoke and use Clozure CL productively.

Clozure CL uses the value of the environment variable CCL_DEFAULT_DIRECTORY to determine the filesystem location of the ccl directory; the ccl shell script is intended to provide a way to invoke Clozure CL with that environment variable set correctly.

There are two versions of the shell script: "ccl/scripts/ccl" is used to invoke 32-bit implementations of Clozure CL and "ccl/scripts/ccl64" is used to invoke 64-bit implementations. Install one script or the other or both as needed.

To use the script:

  1. Copy the script to a directory that is on your PATH. This is often /usr/local/bin or ~/bin. It is better to do this than to add ccl/scripts to your PATH, because the script needs to be edited, and editing it in-place means that Subversion sees the script as modified..

  2. Edit the definition of CCL_DEFAULT_DIRECTORY near the beginning of the shell script so that it refers to your ccl directory. Alternately, set the value of the CCL_DEFAULT_DIRECTORY environment variable wherever you usually set per-user environment variables, in your .cshrc, .tcshrc, .bashrc, .bash_profile, or .MacOSX/environment.plist script, or system-wide in /etc/profile or /etc/bashrc. When the ccl script runs, if the process environment contains a definition of CCL_DEFAULT_DIRECTORY, the ccl script will not override it.

  3. Ensure that the shell script is executable, for example:

    $ chmod +x ~/ccl/ccl/scripts/ccl64

    This command grants execute permission to the named script. If you are using a 32-bit platform, substitute "ccl" in place of "ccl64".


    The above command won't work if you are not the owner of the installed copy of Clozure CL. In that case, you can use the "sudo" command like this:

    $ sudo chmod +x ~/ccl/ccl/scripts/ccl64

    Give your password when prompted.

    If the "sudo" command doesn't work, then you are not an administrator on the system you're using, and you don't have the appropriate "sudo" permissions. In that case you'll need to get help from the system's administrator.

Note that most people won't need both ccl and ccl64 scripts. You only need both if you sometimes run 32-bit Clozure CL and sometimes run 64-bit Clozure CL. You can rename the script that you use to whatever you want. For example, if you are on a 64-bit system, and you only use Clozure CL in 64-bit mode, then you can rename ccl64 to ccl so that you only need to type "ccl" to run it.

Once this is done, it should be possible to invoke Clozure CL by typing ccl or ccl64 at a shell prompt:

shell> ccl
Welcome to Clozure Common Lisp Version 1.7  (DarwinX8632)!

The ccl shell script passes all of its arguments to the Clozure CL kernel. See Section 2.3.2, “Invocation” for more information about command-line arguments.

Assuming the shell script is configured and invoked properly, Clozure CL should be able to initialize the "ccl:" logical host so that its translations refer to the "ccl" directory. To test this, you can call probe-file in Clozure CL's read-eval-print loop:

? (probe-file "ccl:level-1;level-1.lisp")  ;returns the physical pathname of the file

2.3.2. Invocation

Assuming that the shell script is properly installed, it can be used to invoke Clozure CL from a shell prompt:

shell> ccl [args ...]

By convention ccl runs a 32-bit session; ccl64 runs a 64-bit session. However, the name of the installed script(s) and the implementation that is invoked are customizable, as described in Section 2.3.1, “The ccl Shell Script”.

For details about command-line options see Section 2.5, “Command Line Options”.

Previous Section Next Section Table of Contents Glossary Index