[Haskell-cafe] Problems building lambdabot on osx

Antoine Latter aslatter at gmail.com
Tue Aug 9 04:59:06 CEST 2011

On Mon, Aug 8, 2011 at 8:38 PM, Adam Turoff <adam.turoff at gmail.com> wrote:
> I've tried off and on the last couple of days to build Lambdabot on Mac OS X
> (before and after the upgrade from 10.6 to 10.7) and I keep running into linker
> errors with the 64-bit Haskell Platform (ghc 7.0.3).
> First, there's the issue with linking against libiconv, which is solved this
> way:
>        cabal install --extra-lib-dirs=/usr/lib
> That leaves a whole mess of link errors against libHSreadline:
>        Linking dist/build/lambdabot/lambdabot ...
>        ld: warning: could not create compact unwind for _ffi_call_unix64: does not use RBP or RSP based frame
>        Undefined symbols for architecture x86_64:
>          "_rl_insert_completions", referenced from:
>              _readlinezm1zi0zi1zi0_SystemziConsoleziReadline_zdwa5_info in libHSreadline-
>          "_rl_possible_completions", referenced from:
>              _readlinezm1zi0zi1zi0_SystemziConsoleziReadline_zdwa7_info in libHSreadlin
> (full error report at http://hpaste.org/50036 )
> I did manage to install readline through macports:
>        $ port installed readline
>        The following ports are currently installed:
>          readline @6.2.000_0 (active)
>        $ file /opt/local/lib/libreadline.dylib
>        /opt/local/lib/libreadline.dylib: Mach-O 64-bit dynamically linked shared library x86_64
> and I did manage to get readline installed properly by specifying the
> include/lib dirs from macports:
>        cabal install readline --configure-option=--with-readline-libraries=/opt/local/lib --configure-option=--with-readline-includes=/opt/local/include
> and readline does work in ghci:
>        $ ghci
>        GHCi, version 7.0.3: http://www.haskell.org/ghc/  :? for help
>        Prelude> :m + System.Console.Readline
>        Prelude System.Console.Readline> readline "testing> "
>        testing> exit
>        exit
>        Just "exit"
>        Prelude System.Console.Readline>
> The only issue, which has me stumped, is that lambdabot can't seem to find the
> readline dependency.  Adding the --with-readline options when trying to build
> lambdabot has no effect.  Neither does adding --extra-lib-dirs=/opt/local/lib
> to cabal install.
> Anyone have a clue where to start to work around this?  Would switching to ghc
> HEAD help here?

My usually technique for solving readline-related issues is to rip-out
readline from whatever I want to build, substituting in Haskeline if I
want nice editing.

It isn't very scientific, but I find it to be a more interesting
problem to solve.

I've given this a try in the Lambdabot source, but I'm getting
unrelated errors building it so I'm not sure it works.

Ripping out readline should be a brief bit of hacking in
Plugin/OfflineRC.hs, from what I can tell.


More information about the Haskell-Cafe mailing list