Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Installing Babel2 on Mac OS X
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):
Make sure you have Homebrew installed.
Install Clozure Common Lisp (CCL)
by running. Unfortunately, Homebrew has decided to remove the
brew install clozure-cl
clozure-clpackage 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
- In the
ccl/scriptsfolder, you will find 2 scripts:
ccl64. Move these to
- Move the entire
- You can now start up a Lisp session by entering
ccl64from anywhere in the Terminal. If you prefer to use 64-bit Lisp, you may want to rename the
ccl32and rename the
Install Emacs running
brew install emacs-macand create a symlink:
ln -s /usr/local/opt/emacs-mac/Emacs.app /Applications.
Install Graphviz (dot) by running
brew install graphviz.
Install Aquaterm by running
brew cask install aquaterm.
Install Gnuplot with Aquaterm and PDF Cairo by running
brew install gnuplot --with-aquaterm --with-cairo.
Make sure you are in your home directory (
cd ~) and run
git clone https://github.com/slime/slime.gitto install Slime.
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
whoamiin the Terminal) and
<CCL>by the path to CCL on your machine (you can find this by running
which cclin the Terminal).
;;; -*- 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 <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)
Done! When you start Emacs it should automatically start a Lisp and looks like this:
If not, then something in the steps above went wrong, try again or contact one of the developers.
Download and install Quicklisp. This can be done by running the following commands:
curl -O https://beta.quicklisp.org/quicklisp.lisp ;;; 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)
Now you are ready to get the latest version of the Babel2 release repository on Github. Use
git clone https://github.com/EvolutionaryLinguisticsAssociation/Babel2.git
If you don't have Git, you can install it using Homebrew:
brew install git.
If you want Babel2 to be loaded whenever you start CCL, you can edit a file called
.ccl-init.lispfound 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 <USER>) (load "/Users/<USER>/Babel2/libraries/asdf") (load "/Users/<USER>/Babel2/init-babel")
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.
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.