This chapter explains how to install Caml Light on your machine.
zcat cl7unix.tar.Z | tar xBf -This extracts the source files in the current directory. The file INSTALL contains complete instructions on how to configure, compile and install Caml Light. Read it and follow the instructions.
To test the installation, double-click on the application Caml Light. The ``Caml Light output'' window should display something like
> Caml Light version 0.7 #In the ``Caml Light input'' window, enter 1+2;; and press the Return key. The ``Caml Light output'' window should display:
> Caml Light version 0.7 #1+2;; - : int = 3 #Select ``Quit'' from the ``File'' menu to return to the Finder.
If you have MPW, you can install the batch compilation tools as follows. The tools and scripts from the tools folder must reside in a place where MPW will find them as commands. There are two ways to achieve this result: either copy the files in the tools folder to the Tools or the Scripts folder in your MPW folder; or keep the files in the tools folder and add the following line to your UserStartup file (assuming Caml Light resides in folder Caml Light on the disk named My HD):
Set Commands "{Commands},My HD:Caml Light:tools:"In either case, you now have to edit the camlc script, and replace the string
Macintosh HD:Caml Light:lib:(in the first line) with the actual pathname of the lib folder. For example, if you put Caml Light in folder Caml Light on the disk named My HD, the first line of camlc should read:
Set stdlib "My HD:Caml Light:lib:"
Here is one commonly encountered problem.
Create a directory on the hard disk where Caml Light will reside. In the following, we assume that this directory is named C:\caml. If you choose a different directory, replace C:\caml in the following by the appropriate absolute path name. Then, execute the following commands:
cd C:\caml A:pkunzip -d A:cl7pc(Be careful not to omit the -d option to pkunzip.) This extracts all files in the C:\caml directory.
Select or create a directory where Caml Light will put its temporary files. Many machines already have a C:\tmp directory for that purpose. If it does not exist, create it.
For the remainder of the configuration process, you will have to determine two things:
SET PATH=C:\dos;...into
SET PATH=C:\dos;...;C:\caml\bin
SET CAMLLIB=C:\caml\lib SET GO32TMP=C:\tmp
SET GO32=driver C:\caml\dev\graph.grd gw 640 gh 480where graph.grd stands for the name of the graphics driver for your SuperVGA card, as determined above. The 640 and 480 specify the default graphics resolution to use; you can put 800 and 600, or 1024 and 768 instead, depending on your taste and the capabilities of your card.
If you were unable to determine the correct graphics driver, do not insert anything, leaving the GO32 variable undefined.
SET GO32=emu C:\caml\dev\emu387 driver C:\caml\dev\graph.grd gw 640 gh 480where graph.grd stands for the name of the graphics driver for your SuperVGA card, as determined above. As explained in the previous item, you can choose another default graphics resolution instead of 640 and 480.
If you were unable to determine the correct graphics driver, insert the following line instead:
SET GO32=emu C:\caml\dev\emu387
camlc -vThe camlc command should print something like:
The Caml Light system for the 80386 PC, version 0.7 (standard library from C:\caml\lib) The Caml Light runtime system, version 0.7 The Caml Light compiler, version 0.7 The Caml Light linker, version 0.7Then, execute:
camlThe caml command should print something like:
> Caml Light version 0.7 #In response to the # prompt, type:
quit();;This should get you back to the DOS command interpreter.
On the other hand, the 80386 PC version knows how to cohabit with DPMI-compliant or VCPI-compliant environments and memory managers. These include Windows 3, Desqview, and the EMM386, QEMM386 and 386MAX memory managers. In the case of EMM386.EXE from the MS-DOS distribution, EMS must be enabled (do not give it the NOEMS option). If you run the 80386 PC under a VCPI-compliant memory manager, configure the memory manager so that it allocates at least 1M of EMS, and preferably 2M or more.