Install instructions for CMU Common Lisp
----------------------------------------

McCLIM has been tested with CMUCL 18e.

1. Make sure you have a Lisp core file that includes 

   - CLX
   - Gray streams
   - mk:defsystem or ASDF

   If you don't, check the section "How to create a Lisp core file". 

   *Note*: If you get mk:defsystem from CLOCC and load it using
   CLOCC's facilities, you need to restore PCL's default behavior for
   defining classes, methods and functions.  Make sure that the
   variables pcl::*defclass-times*, pcl::*defmethod-times*, and
   pcl::*defgeneric-times* have the value '(load eval).

   *Note*: Either ASDF or mk:defsystem may be used. If both are present,
   McCLIM will default to defining the system within ASDF.       

2. Start Lisp

3. Load the system definition file:

   (load "system.lisp")

4. Compile and load the system:
  
     Using mk:defsystem:       
       (operate-on-system :clim :compile)          ;; Build CLIM
       (operate-on-system :clim-clx :compile)      ;; Build a backend
       (operate-on-system :clim-examples :compile) ;; Build examples

     Using ASDF:
       (asdf:oos 'asdf:compile-op :clim)
       (asdf:oos 'asdf:compile-op :clim-clx)
       (asdf:oos 'asdf:compile-op :clim-examples)

The first two steps can be done in one step with the :clim-clx-user target:

    mk:defsystem  (operate-on-system :clim-clx-user :compile)
    ASDF          (asdf:oos 'asdf:compile-op :clim-clx-user)

5. At a later date, after everything is compiled, load the compiled system:

     Using mk:defsystem:
       (operate-on-system :clim-clx-user :load)
       (operate-on-system :clim-examples :load)

     Using ASDF:
       (asdf:oos 'asdf:load-op :clim-clx-user)
       (asdf:oos 'asdf:load-op :clim-examples)

     Note that when using ASDF, compiling the systems in stage 4 can be
     omitted, as 'asdf:load-op will compile the systems automatically
     if necessary.


Running the demos
-----------------

1. Run the calculator demo

   (clim-demo::calculator)

   This demo is self-explanatory.
	
2. Run the menu demo

   (menutest::menutest)

   This demo is self-explanatory.
	
3. Run the slider demo

   (clim-demo::colorslider)

   You should see three sliders on the left and a color area on the right. 
   Use the three sliders to adjust RGB values to obtain a color.

4. Some of the demos should be run using the function clim-demo::run-test:
   (clim-demo::run-test 'clim-demo::address-book)
   (clim-demo::run-test 'goatee::goatee-test)
   [N.B.: This advice is mostly obsolete. The usual way to start a
   CLIM application is with e.g.,
   (run-frame-top-level (make-application-frame 'clim-demo::address-book)
   Any problems that result should be reported as bugs.]

5. Instructions for loading the McCLIM Listener are contained in 
   McCLIM/Apps/Listener/README.

6. You will get much better performance after executing this form:
   (setf mp::*idle-process* mp::*initial-process*)

How to create a Lisp core file
------------------------------

In order to run McCLIM on CMU CL, it is convenient to create a Lisp
core file that contains:

   - CLX, the Common Lisp interface to the X Window System
   - mk:defsystem, the portable, free defsystem facility
   - The extended streams facility suggested by David Gray (Gray
     streams) 

1. Get the file "clx-library.x86f" from an appropriate site
   (Debian, or cons.org, according to the system you are running). In
   recent distributions you should be able to type:

   (load "library:subsystems/gray-streams-library")
   or
   (require :gray-streams)
   Otherwise, folow the directions below.

2. Get the mk:defsystem from (say) sourceforge.net (the file is called
   defsystem.lisp

3. Compile the file defsystem.lisp

4. Get the two files gray-streams-class.lisp and gray-streams.lisp
   from some source repository of CMU CL

5. Compile and load the gray-streams files in that order

6. Run a fresh Lisp

7. Load the files clx-library.x86f, defsystem.x86f,
   gray-streams-class.x86f, and gray-streams.x86f

8. Save Lisp to a new core file, for instance:

   (save-lisp "lisp+clx+defsystem+gray.core")

9. If you want to make this new core file the one used by default,
   change the symbolic link, usually in /usr/lib/cmucl, called
   lisp.core to point to the new core file.
