Installation
Prev | Chapter 1. Introduction | Next

## Installation

### Ensure ASDF is loaded

Simply load the file `asdf.lisp`.

    (load "asdf.lisp")

### Build C helper libraries

CLSQL uses functions that require 64-bit integer parameters and return values. The FFI in most CLSQL implementations do not support 64-bit integers. Thus, C helper libraries are required to break these 64-bit integers into two compatible 32-bit integers. The helper libraries reside in the directories `uffi` and `db-mysql`.

#### Microsoft Windows

Files named `Makefile.msvc` are supplied for building the libraries under Microsoft Windows. Since Microsoft Windows does not come with that compiler, compiled DLL and LIB library files are supplied with CLSQL.

#### UNIX

Files named `Makefile` are supplied for building the libraries under UNIX. Loading the `.asd` files automatically invokes make when necessary. So, manual building of the helper libraries is not necessary on most UNIX systems. However, the location of the MySQL library files and include files may need to adjusted in `db-mysql/Makefile` on non-Debian systems.

### Add UFFI path

Unzip or untar the UFFI distribution which creates a directory for the UFFI files. Add that directory to ASDF's `asdf:*central-registry*`. You can do that by pushing the pathname of the directory onto this variable. The following example code assumes the UFFI files reside in the `/usr/share/lisp/uffi/` directory.

    (push #P"/usr/share/lisp/uffi/" asdf:*central-registry*)

### Add MD5 path

If you plan to use the clsql-postgresql-socket interface, you must load the md5 module. Unzip or untar the cl-md5 distribution, which creates a directory for the cl-md5 files. Add that directory to ASDF's `asdf:*central-registry*`. You can do that by pushing the pathname of the directory onto this variable. The following example code assumes the cl-md5 files reside in the `/usr/share/lisp/cl-md5/` directory.

    (push #P"/usr/share/lisp/cl-md5/" asdf:*central-registry*)

### Add CLSQL path and load module

Unzip or untar the CLSQL distribution which creates a directory for the CLSQL files. Add that directory to ASDF's `asdf:*central-registry*`. You can do that by pushing the pathname of the directory onto this variable. The following example code assumes the CLSQL files reside in the `/usr/share/lisp/clsql/` directory. You need to load the clsql system.

    (push #P"/usr/share/lisp/clsql/" asdf:*central-registry*)
    (asdf:operate 'asdf:load-op 'clsql)                   ; main CLSQL package

### Run test suite (optional)

The test suite can be executed using the ASDF test-op operator. If CLSQL has not been loaded with asdf:load-op, the asdf:test-op operator will automatically load CLSQL. A configuration file named `.clsql-test.config` must be created in your home directory. There are instructures on the format of that file in the `tests/README`. After creating `.clsql-test.config`, you can run the test suite with ASDF:

    	  (asdf:operate 'asdf:test-op 'clsql)

Prev | Up | Next
Prerequisites | Home | Chapter 2. CommonSQL Tutorial