Installation » History » Version 11

Jeremy Gow, 2012-10-24 01:03 PM

1 7 Jeremy Gow
h1. Installing IDyOM
2 1 Marcus Pearce
3 1 Marcus Pearce
h2. Prerequisites
4 1 Marcus Pearce
5 2 Marcus Pearce
* "Steel Bank Common Lisp [SBCL]":http://www.sbcl.org/platform-table.html
6 7 Jeremy Gow
* "Quicklisp":http://www.quicklisp.org/beta/ is a library manager for Common Lisp.  Just download "<code>quicklisp.lisp</code>":http://beta.quicklisp.org/quicklisp.lisp
7 7 Jeremy Gow
* An SQL database.  I would recommend  "SQLite":http://www.sqlite.org/ 
8 1 Marcus Pearce
9 7 Jeremy Gow
Many people find "Emacs":http://www.gnu.org/software/emacs/ with "Slime":http://common-lisp.net/project/slime/ useful for Common Lisp development.  Package management systems can simplify the installation of these prerequisites, e.g. "Fink":http://www.finkproject.org/ or "Macports":http://www.macports.org/ for OS X.
10 2 Marcus Pearce
11 7 Jeremy Gow
See the "CLSQL Manual":http://clsql.b9.com/manual/ for information on other database systems you can use and how to access them from Common Lisp.  If you prefer not to use Quicklisp, you will need to install the following Lisp libraries: "UFFI":http://uffi.bi.com, "CLSQL":http://clsql.b9.com, "CL-PPCRE":http://www.weitz.de/cl-ppcre/, "PS-Graph":http://www.cliki.net/psgraph, "Midi":http://www.cliki.net/midi
12 1 Marcus Pearce
13 7 Jeremy Gow
h2. Install Quicklisp
14 1 Marcus Pearce
15 7 Jeremy Gow
To install Quicklisp to a directory <code>DIR</code>, you need to load "<code>quicklisp.lisp</code>":http://beta.quicklisp.org/quicklisp.lisp in Lisp:
16 1 Marcus Pearce
17 1 Marcus Pearce
<pre>
18 7 Jeremy Gow
(load "quicklisp.lisp")
19 7 Jeremy Gow
(quicklisp-quickstart:install :path "DIR/quicklisp/")
20 7 Jeremy Gow
(ql:add-to-init-file)
21 1 Marcus Pearce
</pre>
22 1 Marcus Pearce
23 7 Jeremy Gow
h2. Download IDyOM
24 1 Marcus Pearce
25 9 Jeremy Gow
Download the following Lisp libraries, and unzip them into <code>DIR/quicklisp/local-projects/</code>
26 2 Marcus Pearce
* "MIPS":https://code.soundsoftware.ac.uk/hg/mips/archive/tip.zip
27 1 Marcus Pearce
* "AMuSE":https://code.soundsoftware.ac.uk/hg/amuse/archive/tip.zip
28 2 Marcus Pearce
* "amuse-viewpoints":https://code.soundsoftware.ac.uk/hg/amuse-viewpoints/archive/tip.zip
29 1 Marcus Pearce
* "mtp-admin":https://code.soundsoftware.ac.uk/hg/mtp-admin/archive/tip.zip
30 1 Marcus Pearce
* "ppm-star":https://code.soundsoftware.ac.uk/hg/ppm-star/archive/tip.zip
31 1 Marcus Pearce
* "idyom":https://code.soundsoftware.ac.uk/hg/idyom/archive/tip.zip
32 1 Marcus Pearce
33 9 Jeremy Gow
The <code>local-projects</code> directory should now contain six subdirectories, one for each library.
34 9 Jeremy Gow
35 10 Jeremy Gow
h2. Set <code>*root-dir*</code>
36 10 Jeremy Gow
37 11 Jeremy Gow
Next you need to set the global variable <code>*root-dir*</code> in <code>idyom/apps/apps.lisp</code> to a directory in your local filesystem.  IDyOM will use
38 11 Jeremy Gow
this directory to cache data and write log files.
39 10 Jeremy Gow
40 1 Marcus Pearce
h2. Install IDyOM
41 7 Jeremy Gow
42 9 Jeremy Gow
You can now use Quicklisp to install IDyOM:
43 5 Marcus Pearce
<pre>
44 7 Jeremy Gow
(ql:quickload "idyom")
45 5 Marcus Pearce
</pre>
46 9 Jeremy Gow
This will also install the third-party Lisp libraries IDyOM depends on.  The first time it loads, you may get an error which brings up the debugger.  Press 2 [ACCEPT] and the installation should complete.
47 1 Marcus Pearce
48 7 Jeremy Gow
h2. Create a database
49 1 Marcus Pearce
50 7 Jeremy Gow
IDyOM is now installed, but you will need a database in order to use it.  To create an SQLite database in directory <code>DIR</code>:
51 5 Marcus Pearce
52 1 Marcus Pearce
<pre>
53 1 Marcus Pearce
(clsql:connect '("DIR/example.db") :if-exists :old :database-type :sqlite3)
54 8 Jeremy Gow
</pre>
55 8 Jeremy Gow
Alternatively, to connect to an existing local MySQL database:
56 8 Jeremy Gow
<pre>
57 8 Jeremy Gow
(clsql:connect '("localhost" "example-database" "username" "password") :if-exists :old :database-type :mysql)
58 8 Jeremy Gow
</pre>
59 8 Jeremy Gow
See the "CLSQL documentation":http://clsql.b9.com/manual/ for more on "connect":http://clsql.b9.com/manual/connect.html and "supported databases":http://clsql.b9.com/manual/prerequisites.html#idp8251808.
60 8 Jeremy Gow
61 8 Jeremy Gow
Finally, for a new database: 
62 8 Jeremy Gow
<pre>
63 7 Jeremy Gow
(mtp-admin:initialise-database)
64 7 Jeremy Gow
</pre>
65 1 Marcus Pearce
66 1 Marcus Pearce
You may now proceed to the [[tutorial]].
67 8 Jeremy Gow
68 8 Jeremy Gow
h3. Problems loading foreign libraries
69 8 Jeremy Gow
70 8 Jeremy Gow
Depending on how your system is configured, <code>clsql:connect</code> may give a "Couldn't load foreign libraries" error.  In this case, you
71 8 Jeremy Gow
need to "tell CLSQL where it can find these libraries":http://clsql.b9.com/manual/appendix.html#foreignlibs, e.g.
72 8 Jeremy Gow
<pre>
73 8 Jeremy Gow
(clsql:push-library-path "/usr/local/mysql/lib/")
74 8 Jeremy Gow
</pre>
75 9 Jeremy Gow
The exact path will depend on your system.  Note that, for some database installations these libraries may not have been installed, and you should consult the database documentation.
76 10 Jeremy Gow
77 10 Jeremy Gow
78 1 Marcus Pearce
h2. Create a startup script [optional]
79 1 Marcus Pearce
80 11 Jeremy Gow
Every time you start IDyOM, you will need to connect to the database.  You may find it easier to combine all the startup commands in a single script, e.g.
81 11 Jeremy Gow
82 11 Jeremy Gow
<pre>
83 11 Jeremy Gow
(ql:quickload "idyom")
84 11 Jeremy Gow
(clsql:push-library-path "/usr/local/mysql/lib/")
85 11 Jeremy Gow
(defun connect-sqlite ()
86 11 Jeremy Gow
  (clsql:connect '("DIR/example.db") :if-exists :old :database-type :sqlite3))
87 11 Jeremy Gow
</pre>