Prev |  | Next

## 2. Installing Larceny

### 2.1. Varieties of Larceny

There are two main varieties of Larceny.

Native Larceny is the fastest and most convenient variety of Larceny. It compiles directly to native machine code for Intel x86 or ARMv7 microprocessors running Linux and for x86 machines running Apple's MacOS X or Microsoft Windows.

Petit Larceny compiles to C instead of machine code. It can be made to run on most Unix machines.

### 2.2. System requirements

Binary distributions of native Larceny are available for just about any Intel x86-compatible microprocessor running a Linux, Apple OS X, or Windows operating system, and for ARMv7 microprocessors running Linux. Although Larceny still uses 32-bit pointers, it will run on 64-bit machines provided the appropriate 32-bit libraries have been installed.

Binary distributions of Petit Larceny are available for x86 machines running Linux. Petit Larceny requires the `gcc` compiler as well as the appropriate 32-bit libraries.

Unless you intend to modify Larceny yourself, you do not need its source code, which is available at Larceny's GitHub site.

For more details, see `doc/HOWTO-INSTALL`. If you want to build Larceny or Petit Larceny from source code, see `doc/HOWTO-BUILD`.

### 2.3. Downloading

The current versions of Larceny are available for download at Larceny's main web page.

Larceny is distributed in two forms: as a precompiled binary, or as source code that can be used to reconstruct any of the precompiled binary distributions. Unless you intend to modify Larceny yourself, you do not need to download the source code.

### 2.4. Installing the programs

Unpack the distribution files with an appropriate command such as one of the following, substituting the version number (such as 0.98) for "X.Y":

    tar -xzf larceny-X.Y-bin-native-ia32-linux86.tar.gz
    tar -xzf larceny-X.Y-bin-native-ia32-macosx.tar.gz
    tar -xzf larceny-X.Y-bin-native-ia32-win32.tar.gz
    tar -xzf larceny-X.Y-bin-petit-stdc-linux86.tar.gz
    tar -xzf larceny-X.Y-src.tar.gz

That will create a directory with a similar name (but without the `.tar.gz` suffix) in your current working directory. That is the Larceny root directory, which you may rename to something shorter, such as `larceny`; the rest of this section will refer to it by that name.

Assuming you have unpacked a binary distribution for Linux or OS X, the `larceny` directory will contain the following files:

    larceny.bin         Run-time system
    larceny.heap        Heap image with preloaded libraries and compiler
    larceny             Shell script that runs the two files listed above
    scheme-script       Shell script that runs Scheme scripts
    compile-stale       Scheme script that compiles R7RS/R6RS libraries
    startup.sch         Pathnames for the autoload and require features

If you unpacked a binary distribution, then you should be able to run it immediately by making the `larceny` directory your current working directory and invoking `./larceny`. (If that does not work, you may need to install some 32-bit libraries on your machine. See `doc/HOWTO-INSTALL`.)

Binary distributions for Windows will include a `larceny.bat` file in addition to the files listed above, so you can run Larceny by invoking `larceny`. (If that does not work, you may need to tell the DEP feature to let Larceny opt out.)

If you unpacked the source code there will be many other files and directories, but `larceny.bin` and `larceny.heap` will not be present.

### Tip

You can reconstruct the `larceny.bin` and `larceny.heap` files from their source code, but that process requires a working version of Larceny. Unless you're porting Larceny or Petit Larceny to a brand new target architecture, it's easier to obtain those files from a binary distribution of Larceny.

You may add the `larceny` directory to your standard path, or you may install Larceny into a directory that is already part of your standard path.

Suppose, for example, that you want to install Larceny in `/usr/local/bin` and `/usr/local/lib/larceny`. Copy the `larceny` and `scheme-script` files to `/usr/local/bin` and edit the definition of `LARCENY_ROOT` at the head of each file to point to the correct directory:

    LARCENY_ROOT=/usr/local/lib/larceny

Then move the entire `larceny` directory to `/usr/local/lib/larceny`.

You should now be able to run Larceny from any directory by typing "`larceny`" at a prompt.

### 2.5. Compiling the R7RS/R6RS standard libraries

If you are installing Petit Larceny, then you will have to compile the R7RS/R6RS runtime and standard libraries before you can run Larceny in R7RS or R6RS modes.

This step is also required if you are building any variety of Larceny from source code. With the prebuilt native varieties of Larceny, however, this step should not be necessary unless you change one of the files in `lib/R7RS`, `lib/R6RS`, or `lib/SRFI`.

### Tip

If the `lib/R7RS`, `lib/R6RS`, and `lib/SRFI` directories are read-only, you will be less likely to touch, modify, or compile the standard libraries by accident.

Compiling the R7RS/R6RS runtime and standard libraries is accomplished as follows:

        $ ./larceny
        Larceny v0.98 "General Ripper" (...)
        > (require 'r7rsmode)
        > (larceny:compile-r7rs-runtime)
        > (exit)

### Warning

Compiling the R7RS/R6RS runtime as shown above causes all previously compiled R7RS/R6RS libraries and top-level programs to become stale. That means those previously compiled files will need to be recompiled or removed.

Prev |  | Next
| Home |