All Manuals > Release Notes and Installation Guide > 8 Configuration on macOS

8.4 Saving and testing the configured image

It is not usually necessary to save an image merely to preload patches and your configuration, because these load very quickly on modern machines.

However, if you want to save an image to reduce startup time for a complex configuration (such as large application code) or to save a non-windowing image, then proceed as described in this section.

8.4.1 Create a configuration file

Make a copy of config/configure.lisp called /tmp/my-configuration.lisp. When you have made the desired changes in my-configuration.lisp you can save a new LispWorks image as described in 8.4.2 Create and use a save-image script.

8.4.2 Create and use a save-image script

  1. Create a configuration and saving script /tmp/save-config.lisp containing:
    (in-package "CL-USER")
    (load-all-patches)
    (load "/tmp/my-configuration.lisp") 
    #+:cocoa 
    (save-image-with-bundle "/Applications/My LispWorks/LW")
    #-:cocoa 
    (save-image "my-lispworks-gtk")
    
  2. Change directory to the directory containing the LispWorks image to configure. For the native macOS/Cocoa LispWorks image:
    % cd "/Applications/LispWorks 8.0 (64-bit)/LispWorks (64-bit).app/Contents/MacOS"
    

    or for the X11/GTK+ LispWorks image:

    % cd "/Applications/LispWorks 8.0 (64-bit)"
    
  3. Start the supplied image passing the configuration script the build file. For example enter one of the following commands (on one line of input):
    % ./lispworks-8-0-0-macos64-universal -build /tmp/save-config.lisp
    

    or:

    % ./lispworks-8-0-0-macos64-universal-gtk -build /tmp/save-config.lisp
    

    If the image will not run at this stage, it is probably not finding a valid key.

    Saving the image takes some time.

You can now use the new My LispWorks/LW.app application bundle or the my-lispworks-gtk image by starting it just as you did the supplied LispWorks. The supplied LispWorks is not required after the configuration process has been successfully completed.

Do not try to save a new image over an image that is currently running. Instead, save an image under a unique name, and then, if necessary, replace the new image with the old one after the call to save-image has returned.

8.4.3 What to do if no image is saved

If no new image is saved, then there is some error while loading the build script. To see the error message, run the command with output redirected to a file, for example:

% ./lispworks-8-0-0-macos64-universal -build /tmp/save-config.lisp > /tmp/output.txt

Look in the file /tmp/output.txt.

8.4.4 Testing the newly saved image

You should now test the new LispWorks image. To test a configured LispWorks, do the following:

  1. If you are using an X11/GTK+ image, change directory to /tmp.
  2. When using X11, verify that your DISPLAY environment variable is correctly set and that your machine has permission to connect to the display.
  3. Start up the new image, by entering the path of the X11/GTK+ executable or by double-clicking on the LispWorks icon in the macOS Finder.

    The window-based environment should now initialize—during initialization a window displaying a copyright notice will appear on the screen.

    You may wish to work through some of the examples in the LispWorks® User Guide and Reference Manual, to further check that the configured image has been successfully built.

  4. Test the load-on-demand system. In the Listener, type:
    CL-USER 1 > (inspect 1)
    

    Before information about the fixnum 1 is printed, the system should load the inspector from the load-on-demand Library directory.

    You can quit the inspector by typing :q.

8.4.5 Saving a non-windowing image

For some purposes such as scripting it is convenient to have a LispWorks image that does not start the graphical programming environment.

To save an image which does not automatically start the GUI, use a script as described in 8.4.2 Create and use a save-image script but pass the :environment argument to save-image. For example:

(save-image "my-tty-lispworks" :environment nil)

Release Notes and Installation Guide - 01 Dec 2021 19:38:48