The topic will be functional programming with emphasis on Haskell. I'm also writing my own language called Mikan and hope to share progress here. So let's have fun!

Sunday, August 29, 2010

Installing Haskell Bindings to Readline on Mac OS X with Homebrew

Since this caused me a bit of grief, I thought I'd document the process. My objective: to have "cabal install readline" work on Mac OS X. If you just run it after a fresh install of the Haskell Platform, no pony.

Here are some relevant link:

  • A discussion on StackOverflow pointing out the correct cabal install mechanism
  • A GHC ticket that points out the readline script is not using standard cabal flags
  • The Homebrew package management system for Mac OS X -- highly recommended
Using homebrew, you can quickly install readline by typing "brew install readline" at the prompt. There is a note that this homebrew formula is "keg-only" which means it is not linked up into usr/local as other packages are to prevent conflict with the BSD readline library that comes with OS X.

So, all you have to do is direct link into where the actual GNU readline code is stored when running cabal install:

$ cabal install readline --configure-option=--with-readline-libraries="/usr/local/Cellar/readline/6.0/lib" --configure-option=--with-readline-includes="/usr/local/Cellar/readline/6.0/include"

Anyhow, this worked for me and hopefully can save someone else some runaround time and headache.

Cheers,

Michael

0 comments:

Post a Comment

About Me

My Photo
A comic artist, sometimes programmer, and engineer in the field of renewable energy.

Tags

© 2009, 2010 Michael Patrick O'Keefe, all rights reserved

Interesting Shtuff

Followers