Installation » History » Version 48

« Previous - Version 48/85 (diff) - Next » - Current version
Marcus Pearce, 2014-06-03 07:40 PM


Installing IDyOM and its prerequisites

Summary

The following is a description of each of these steps tested on MacOS 10.7.5 and Ubuntu 14.04 (GNU/Linux 3.13.0-24-generic x86_64).

Install SBCL

  1. download SBCL for MacOS X (the AMD64 version) here: http://www.sbcl.org/platform-table.html
  2. on MacOS make sure you have the Xcode developer tools installed from the DVD that came with your Mac (required for GNU make)
  3. install SBCL by following the instructions here: http://www.sbcl.org/getting.html

(Basically: unpack the downloaded tar.bz2 file, open a terminal window,
change directory ('cd') into the unpacked directory and type 'sudo sh
install.sh').

Download and install Emacs

MacOS: Universal binaries available here: http://emacsformacosx.com/
Linux: sudo apt-get install emacs

Install Quicklisp

  1. make a new folder in your home directory called 'quicklisp'
  2. download the file http://beta.quicklisp.org/quicklisp.lisp and put it into the new folder
  3. open a terminal window and type 'sbcl' to start sbcl
  4. type each of the following lines followed by enter, changing the path to match the location of your quicklisp folder:
    (load "/Users/marcusp/quicklisp/quicklisp.lisp")
    (quicklisp-quickstart:install :path "/Users/marcusp/quicklisp/")
    (ql:add-to-init-file)
    (ql:quickload "quicklisp-slime-helper")
    <pre>
    # Remember to follow the instructions given by each of these commands, *in particular* the final command, which prints some lines of code to copy and paste into the emacs configuration file called <code>.emacs</code> in your home directory (you must create this file in Emacs or another text editor).
    # open (or restart) Emacs, press Alt-x and type slime - you should now be running SBCL from within Emacs
    
    h2. Download and install IDyOM
    
    # download the latest version of IDyOM from: https://code.soundsoftware.ac.uk/projects/idyom-project
    # unzip the zip file into the folder 'local-projects' within the 'quicklisp' folder (e.g., '/Users/marcusp/quicklisp/local-projects/')
    # make a folder in your home directory called 'idyom'. Within that folder make two further folders, one called 'db', the other called 'data'. Within the 'data' folder make three further folders called 'cache', 'models' and 'resampling'.
    # using Emacs or another text editor open the file called '.sbclrc' in your home directory and add the following lines to the end of the file (the file should already have some lisp code in it), changing the paths to match the location of the 'idyom' folder you created in step 3:
    <pre>
    ;;; Load CLSQL by default
    (ql:quickload "clsql")
    
    ;;; IDyOM
    (defun start-idyom ()
       (defvar *idyom-root* "/Users/marcusp/idyom/")
       (ql:quickload "idyom")
       (clsql:connect '("/Users/marcusp/idyom/db/database-cents.sqlite") :if-exists :old :database-type :sqlite3))
    </pre>
    # Restart Emacs, run Slime again (<code>Alt-x slime</code>) and type <code>(start-idyom)</code> at the prompt, <code>CL-USER></code>, to load IDyOM. The first time you run this, it will also download all the required third-party lisp libraries.
    # The first time you run IDyOM, you must initialise the database by issuing the following command at the prompt (<code>CL-USER></code>):
    <pre>
    (mtp-admin:initialise-database)
    </pre>
    NB: if you run this command later it will delete all the contents of your database, so only run it once.
    
    h1. Starting IDyOM
    
    Having installed IDyOM as described above, you can start it by:
    
    # starting Emacs
    # typing <code>Alt-x slime</code>
    # entering <code>(start-idyom)</code> at the Lisp prompt, <code>CL-USER></code>
    
    h1. Troubleshooting
    
    h2. Reinstalling
    
    *Removing previous installations*: *If* you have any previous installations of these libraries, you would do well to remove them, especially if they are in folders such as '~/.local' which are automatically scanned by asdf/quicklisp. You may also want to clear the corresponding entries from <code>asdf:*central-registry*</code> in your .sbclrc file, should any exist.
    
    h2. Creating a database
    
    You may use different kinds of databases. For example, to create an SQLite database called 'example.db' in directory <code>DIR</code>:
    
    <pre>
    (clsql:connect '("DIR/example.db") :if-exists :old :database-type :sqlite3)
    </pre>
    
    Alternatively, to connect to an existing local MySQL database:
    
    <pre>
    (clsql:connect '("localhost" "example-database" "username" "password") :if-exists :old :database-type :mysql)
    </pre>
    
    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.
    
    h2. Problems loading foreign database libraries:
    
    Depending on how your system is configured, <code>clsql:connect</code> may give a "Couldn't load foreign libraries" error.  In this case, you
    need to "tell CLSQL where it can find these libraries":http://clsql.b9.com/manual/appendix.html#foreignlibs, e.g.
    
    <pre>
    (clsql:push-library-path "/usr/local/mysql/lib/")
    </pre>
    
    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.