Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you install the haskell readline library on Mac OSX?

I'm referring to the haskell readline library wrapper to the c readline library.

cabal install readline output below:

$ cabal install readline
Resolving dependencies...
Configuring readline-1.0.1.0...
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for GNUreadline.framework... checking for readline... no
checking for tputs in -lncurses... yes
checking for readline in -lreadline... yes
checking for rl_readline_version... yes
checking for rl_begin_undo_group... no
configure: error: readline not found, so this package cannot be built
See `config.log' for more details.
cabal: Error: some packages failed to install:
readline-1.0.1.0 failed during the configure step. The exception was:
ExitFailure 1

I have the c readline library installed via macports (using sudo port install readline), but I still get the same error while trying to install the haskell readline library.

like image 939
David Miani Avatar asked Nov 28 '11 03:11

David Miani


1 Answers

If your MacPorts installation uses the default paths for installed files, try specifying where to look for the C headers and libraries:

cabal install readline --extra-include-dirs=/opt/local/include \
--extra-lib-dirs=/opt/local/lib

Update 2x: On my machine with GNU Readline installed via Homebrew rather than MacPorts, it looks like the configure script for the Haskell readline library needs some non-standard flags to properly find its bearings. If the above doesn't work, try this:

cabal install readline --extra-include-dirs=/opt/local/include \
--extra-lib-dirs=/opt/local/lib \
--configure-option=--with-readline-includes=/opt/local/include \
--configure-option=--with-readline-libraries=/opt/local/lib
like image 66
acfoltzer Avatar answered Sep 22 '22 23:09

acfoltzer