[Haskell-beginners] Re: error with cabal install readline

Heinrich Apfelmus apfelmus at quantentunnel.de
Thu Mar 11 04:49:49 EST 2010

Ashish Agarwal wrote:
> I'm on a Mac, and trying to install readline through cabal. I installed the
> readline library through macports and thus tried the command below. However,
> readline is still not found. Are there other options I can try? Thank you.
> $ cabal install readline --extra-include-dirs=/opt/local/include/
> --extra-lib-dirs=/opt/local/lib/
> Resolving dependencies...
> Configuring readline-
> 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- failed during the configure step. The exception was:
> exit: ExitFailure 1

It's the  configure  shell script that doesn't see the extra
directories. Setting the CPPFLAGS and LDFLAGS environment variables
should do the trick. Personally, I'm using the following shell script

    > cat cabal-macports
    # Run commands with /opt/local/ directories
    export CPPFLAGS=-I/opt/local/include
    export LDFLAGS=-L/opt/local/lib
    cabal $@ --extra-include-dirs=/opt/local/include \

    > cabal-macports install readline

(Make sure you installed the MacPorts readline with  +universal .)

Heinrich Apfelmus


More information about the Beginners mailing list