next up previous contents
Next: Traceable/Redefinable Code Generation Up: Compilation Previous: Creating LISP with Compiler

Compiling a LISP Code

When you have developed a LISP package, usually it is desirable to get it compiled. This has advantages commonly known.

What follows is the prescription if you are at this stage. (i.e. you are happy, your program works, and its time to finalize the job)

  1. Execute the LISP that has the compiler present. How to create such a LISP was the topic of the previous section. We suggest that you run it at least with the following parameters:
    LISP -P20000 -S10000

    Actually, you can do this job interpretatively, by loading the LISP code for the compiler (that is also present in the software supplied). But this will be painfully slow, therefore it is not very logical, except one case: Due to some reason you cannot perform the compilation explained in the previous section ``Creating LISP with Compiler''

  2. Type-in and evaluate the following LISP expression in order to start the compilation.
    (compilefile "lispfile" 'genname)
    Here lispfile is the name of the file that contains your LISP program (or the starting part of it). genname is a generic atom which will serve in naming of the output files. All outcome files of this compilation will have names starting with genname.

    So the ``genname'' for the files that you have used in the creation of the compiler (in the previous section) was comp . The output files are:

    gennameU :
    This file contains all the constants of the LISP program you have compiled.
    gennameE :
    This file contains all the non compilable, LISP s-expressions of your program. Later on cri will attack this file and generate the ``initialization file''.
    gennameNn :
    Here the last n is an integer. All these files contain the procedure names of the LISP program that was compiled.
    gennameCn :
    Here the last n is an integer. These files contain the C source of the compiled LISP procedures.
    gennameXn :
    Here the last n is an integer. These files contain the names of externally called procedures. So, normally, the union set of the contents of gennameXn shall be a subset of the union set of the contents of gennameNn files. That means no procedure shall be used without having it defined somewhere. But, this compiler is cleaver to accept those undefined procedures by just giving a warning and generating such a code that this procedure is definable at run-time, cute eh?. Best to understand this feature is to test it.

  3. For the successive inputing of other LISP source files just give their names as strings (included in double quotes) or as quoted atoms (if they have no extensions of course). To declare the end of the compilation enter end to finish the compilation (as any bright man will immediately recognize, it is therefore only possible to get a lisp source that lives in a file named end compiled, if one surrounds the end\ with (double quotes)).
  4. Perform all the steps of the previous section starting with the 2. step, with one change: Executions of cr1 crc cri shall have command line arguments if the genname you used is different then comp You have to supply this genname as command line argument to the mentioned cr programs. An example:

    If your genname was rlisp for example, call crc as

    crc rlisp

    Furthermore if you want that cri names the initialization file that it is creating other than LISP-INI then supply this name as the second command line argument.

    cri rlisp MY-LISP-INI
    If you have forgotten to do this and cri has created the initialization file with the default name LISP-INI just you can rename it as you like.

next up previous contents
Next: Traceable/Redefinable Code Generation Up: Compilation Previous: Creating LISP with Compiler

Gokturk UCOLUK
Fri Nov 1 21:52:13 EET 1996