Installing Babel2 on Mac OS X

Jens Nevens edited this page May 14, 2018 · 8 revisions

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

  1. Make sure you have Homebrew installed.

  2. Install Clozure Common Lisp (CCL) by running brew install clozure-cl. Unfortunately, Homebrew has decided to remove the clozure-cl package from its listings. People are trying to get it back. In the meantime, you can install Clozure Common Lisp the manual way:

    • Download CCL from the website.
    • Extract the zip archive. You should have a directory called ccl.
    • In the ccl/scripts folder, you will find 2 scripts: ccl and ccl64. Move these to /usr/local/bin.
    • Move the entire ccl folder to /usr/local/src.
    • You can now start up a Lisp session by entering ccl or ccl64 from anywhere in the Terminal. If you prefer to use 64-bit Lisp, you may want to rename the ccl script (in /usr/local/bin) to ccl32 and rename the ccl64 script to ccl.
  3. Install Emacs running brew install emacs-mac and create a symlink: ln -s /usr/local/opt/emacs-mac/ /Applications.

  4. Install Graphviz (dot) by running brew install graphviz.

  5. Install Aquaterm by running brew cask install aquaterm.

  6. Install Gnuplot with Aquaterm and PDF Cairo by running brew install gnuplot --with-aquaterm --with-cairo.

  7. Make sure you are in your home directory (cd ~) and run git clone to install Slime.

  8. For configuring your Emacs, use a text editor to create a plain text file called .emacs (without extension) in your home directory (~/.emacs). This file should have the following content. Replace <USER> by your username (you can find this by running whoami in the Terminal) and <CCL> by the path to CCL on your machine (you can find this by running which ccl in the Terminal).

    ;;; -*- emacs-lisp -*-
    '(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 <USER>)
    (add-to-list 'load-path "/Users/<USER>/slime")
    (require 'slime)
    (slime-setup '(slime-repl slime-autodoc slime-fancy-inspector))
    ;; path to lisp implementations (ADAPT <CCL>)
    (setq inferior-lisp-program "<CCL>")
    (command-execute 'slime)
  9. Done! When you start Emacs it should automatically start a Lisp and looks like this: dot-emacs

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

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

    curl -O ;;; this will download a file called quicklisp.lisp
    ccl -l quicklisp.lisp ;;; this will open a CCL session and load the quicklisp.lisp file
    ? (quicklisp-quickstart:install)
    ? (ql:add-to-init-file)
    ? (ccl:quit)
  12. Now you are ready to get the latest version of the Babel2 release repository on Github. Use

    git clone

    If you don't have Git, you can install it using Homebrew: brew install git.

  13. 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:
    (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 <USER>):

    ;;; load babel2 (ADAPT <USER>)
    (load "/Users/<USER>/Babel2/libraries/asdf")
    (load "/Users/<USER>/Babel2/init-babel")
  14. To test your Babel2 installation, run the following command:

    ccl -l "~/Babel2/test-babel-installation.lisp" --eval '(quit)' -b

    The test consists in opening a PDF file with a diagram and displaying a window with a sinus function. If the file didn't open or the window didn't display, there is a problem with your installation. Contact the Babel team for help.

  15. On some versions of mac OS, the Babel2 web interface (found on localhost:8000) does not work. This can be fixed by setting up a local web server. Instructions can be found here. Restart your machine, after following the instructions, to make sure the changes took place.

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.