Installing Babel2 on Linux

Jens Nevens edited this page Jan 25, 2018 · 4 revisions

Follow these steps if you want to manually install a Lisp environment (Clozure Common Lisp) and all dependencies for Babel2 on Linux (the easy way is to install it via the installation script):

  1. Install and configure CCL by running these commands:

    CCLPREFIX=/usr/local/share/
    wget https://github.com/Clozure/ccl/releases/download/v1.11.5/ccl-1.11.5-linuxx86.tar.gz
    sudo tar xvzf ccl-1.11.5-linuxx86.tar.gz -C "$CCLPREFIX"
    rm ccl-1.11.5-linuxx86.tar.gz
    sudo sed -i -e "s|/usr/local/src/ccl|$CCLPREFIX/ccl|g" "$CCLPREFIX/ccl/scripts/ccl64"
    sudo ln -s "$CCLPREFIX/ccl/scripts/ccl64" /usr/local/bin/ccl
    
  2. Install Gnuplot using apt-get: sudo apt-get install gnuplot gnuplot-x11

  3. Install Graphviz (dot) using apt-get: sudo apt-get install graphviz

  4. Install Emacs using apt-get: sudo apt-get install emacs

  5. Download SLIME and move it to your home directory:

    wget http://common-lisp.net/project/slime/snapshots/slime-current.tgz
    mkdir -p ~/slime
    tar xzf slime-current.tgz -C ~/slime --strip-components 1
    rm slime-current.tgz
    
  6. For configuring your Emacs with SLIME, use a text editor to create a plain text file called .emacs (without extension) in your home directory (~/.emacs) with this content (adapt the paths to your Slime and to your CCL):

    ;;; -*- emacs-lisp -*-
    (custom-set-variables
    '(show-paren-mode t)
    '(size-indication-mode t)
    '(tool-bar-mode nil)
    '(transient-mark-mode t)
    '(column-number-mode t)
    '(indent-tabs-mode nil)
    '(make-backup-files nil))
    
    (set-face-foreground 'font-lock-string-face "navy")
    
    (setq mouse-wheel-scroll-amount '(1 ((shift) .1)))
    (setq mac-allow-anti-aliasing t)
    
    ;; Make sure gnuplot and dot are found. Add /usr/local/bin to the path
    (setenv "LANG" "en_US.UTF-8")
    (setenv "PATH" (concat (getenv "PATH") ":/usr/local/bin"))
    (setq exec-path (append exec-path '("/usr/local/bin")))
    
    ;; path to slime (adapt)
    (add-to-list 'load-path "/home/<USER>/slime")
    
    (require 'slime)
    (slime-setup '(slime-repl slime-autodoc slime-fancy-inspector))
    
    ;; path to lisp implementations (adapt)
    (setq inferior-lisp-program "<CCL>")
    
    (command-execute 'slime)
    
  7. Done! When you start Emacs it hopefully automatically starts a Lisp and looks like this: dot-emacs

  8. If not, then something in the steps above went wrong, try again or contact one of the developers.

  9. Download and install Quicklisp. This can be done by running the following commands:

    curl -O https://beta.quicklisp.org/quicklisp.lisp
    ccl -l quicklisp.lisp ;;; this will open a CCL session
     
    ? (quicklisp-quickstart:install)
    ? (ql:add-to-init-file)
    ? (ccl:quit)
    
  10. Now you are ready to clone or fork the latest version of the Babel2 release repository on Github.

  11. If you want Babel2 to be loaded whenever you start CCL, you can edit a file called .ccl-init.lisp found in your home directory. When you open this file (and you have followed the above steps), you will probably find something like this:

    ;;; The following lines added by ql:add-to-init-file:
    #-quicklisp
    (let ((quicklisp-init (merge-pathnames "quicklisp/setup.lisp" (user-homedir-pathname))))
      (when (probe-file quicklisp-init)
        (load quicklisp-init)))
    

    To load Babel2, add the following to this file (adapt your username where marked with ):

    ;;; load babel2 (adapt)
    (load "/home/<USER>/Babel2/libraries/asdf")
    (load "/home/<USER>/Babel2/init-babel")
    
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.