
I've had a bit of an adventure trying to build and run lambdabothttp://hackage.haskell.org/package/lambdabot-4.2.2.1 on my box. 'cabal install lambdabot' does not work. It states it's not GHC 6.12 (and certainly not 7.0) compatible, but I tried 6.12 anyway and got nowhere. Next, I tried 6.10 but failed on the unix dependency (in the same manner as this threadhttp://web.archiveorange.com/archive/v/nDNOvQMXUGwfkyy0ITet). The thread is unresolved, so I've not tried modifying the cabal build-depends. I'm hoping to find someone who has a working lambdabot setup who can point me in the right direction. What further information about my struggles should I provide? Thanks, Joe

On Tue, Jan 4, 2011 at 5:16 PM, Joe Bruce
I've had a bit of an adventure trying to build and run lambdabot on my box. 'cabal install lambdabot' does not work. It states it's not GHC 6.12 (and certainly not 7.0) compatible, but I tried 6.12 anyway and got nowhere.
I'm assuming you ran into the mtl-2.0 api changes with respect to State. I didn't have any trouble building lambdabot after setting an upper version bound on the mtl dependency in lambdabot.cabal: Library build-depends: base, mtl <= 2.0, bytestring, unix I used ghc-6.12.3, and cabal-dev. --Rogan
Next, I tried 6.10 but failed on the unix dependency (in the same manner as this thread). The thread is unresolved, so I've not tried modifying the cabal build-depends. I'm hoping to find someone who has a working lambdabot setup who can point me in the right direction. What further information about my struggles should I provide? Thanks, Joe _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

On Wed, Jan 5, 2011 at 12:53 PM, Rogan Creswick
State. I didn't have any trouble building lambdabot after setting an upper version bound on the mtl dependency in lambdabot.cabal:
Library build-depends: base, mtl <= 2.0, bytestring, unix
My mistake, that should be strictly less-than: Library build-depends: base, mtl < 2.0, bytestring, unix --Rogan
I used ghc-6.12.3, and cabal-dev.
--Rogan
Next, I tried 6.10 but failed on the unix dependency (in the same manner as this thread). The thread is unresolved, so I've not tried modifying the cabal build-depends. I'm hoping to find someone who has a working lambdabot setup who can point me in the right direction. What further information about my struggles should I provide? Thanks, Joe _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Rogan, Thanks for taking a look at it. No, mtl is not the problem, at least not yet. A detail that I've discovered is important: I'm on Mac OS X (10.6). readline is my problem, and readline + mac + haskell seems to be a bad mix. Macports installs readline in /opt/local/ by default, so I discovered I needed to install this way: cabal install lambdabot --configure-option=--with-readline-includes="/opt/local/include" --configure-option=--with-readline-libraries="/opt/local/lib" That got the readline dependency installed correctly, but then the lambdabot build complained about the architecture (32- vs 64-bit). This threadhttp://osdir.com/ml/libraries@haskell.org/2010-04/msg00171.html was somewhat helpful. I reinstalled readline via macports with the universal flag and got past that error. Now I'm stuck on readline again [lambdabot build step 28 of 81]: "/Users/joe/.cabal/lib/readline-1.0.1.0/ghc-6.12.3/HSreadline-1.0.1.0.o: unknown symbol `_rl_basic_quote_characters'" What do I do with that?

On 6 January 2011 07:27, Joe Bruce
Now I'm stuck on readline again [lambdabot build step 28 of 81]: "/Users/joe/.cabal/lib/readline-1.0.1.0/ghc-6.12.3/HSreadline-1.0.1.0.o: unknown symbol `_rl_basic_quote_characters'"
This seems to have been covered on Stack Overflow: http://stackoverflow.com/questions/1979612/using-cabal-readline-package-on-i...

Thanks, Max. I had seen that thread already, but I don't understand how it
helps me. I'm on a x64 mac and I have both an i386 and x64 version of
readline installed (via macports install readline +universal). Perhaps
cabal is choosing the wrong one. How do I find out? How do I tell it which
to use? And which do I want it to use?
On Wed, Jan 5, 2011 at 11:59 PM, Max Bolingbroke wrote: On 6 January 2011 07:27, Joe Bruce Now I'm stuck on readline again [lambdabot build step 28 of 81]:
"/Users/joe/.cabal/lib/readline-1.0.1.0/ghc-6.12.3/HSreadline-1.0.1.0.o:
unknown symbol `_rl_basic_quote_characters'" This seems to have been covered on Stack Overflow: http://stackoverflow.com/questions/1979612/using-cabal-readline-package-on-i...

On 6 January 2011 16:11, Joe Bruce
Thanks, Max. I had seen that thread already, but I don't understand how it helps me. I'm on a x64 mac and I have both an i386 and x64 version of readline installed (via macports install readline +universal). Perhaps cabal is choosing the wrong one. How do I find out? How do I tell it which to use? And which do I want it to use?
Well, MacPorts +universal should install fat binaries that include both x86 and x64. On my machine: """ mbolingbroke@c089 ~ $ file /opt/local/lib/libreadline.5.0.dylib /opt/local/lib/libreadline.5.0.dylib: Mach-O universal binary with 2 architectures /opt/local/lib/libreadline.5.0.dylib (for architecture i386): Mach-O dynamically linked shared library i386 /opt/local/lib/libreadline.5.0.dylib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 mbolingbroke@c089 ~ $ file /opt/local/lib/libreadline.a /opt/local/lib/libreadline.a: Mach-O universal binary with 2 architectures /opt/local/lib/libreadline.a (for architecture i386): current ar archive random library /opt/local/lib/libreadline.a (for architecture x86_64): current ar archive random library """ GHC on OS X builds 32 bit executables, so you need to link against these binaries. Long story short: $ cabal unpack readline Then edit readline.cabal to add this line to the end: extra-lib-dirs: /opt/local/lib (You must indent it to put it in the "library" section). Finally: $ sudo cabal install --configure-option=--with-readline-includes="/opt/local/include" --configure-option=--with-readline-libraries="/opt/local/lib" It will now work. You can try it by opening ghci and typing: System.Console.Readline.readline "Command Me> " An alternative to editing the cabal file would have been to link to the Macports fat-binary libreadline.a from the OS X system library directories (maybe /usr/lib or /usr/local/lib). Cheers, Max

Thanks Max. That makes a lot of sense. That change got me to the point of linking lambdabot. I then encountered this error: Linking dist/build/lambdabot/lambdabot ... Undefined symbols: "_iconv_open", referenced from: _hs_iconv_open in libHSbase-4.2.0.2.a(iconv.o) (maybe you meant: _hs_iconv_open) "_iconv", referenced from: _hs_iconv in libHSbase-4.2.0.2.a(iconv.o) (maybe you meant: _hs_iconv_open, _hs_iconv , _hs_iconv_close ) "_iconv_close", referenced from: _hs_iconv_close in libHSbase-4.2.0.2.a(iconv.o) (maybe you meant: _hs_iconv_close) Let's see if I'm catching on. From herehttp://osdir.com/ml/haskell-cafe@haskell.org/2010-09/msg00489.htmland here http://stackoverflow.com/questions/2726248/ghc-6-12-and-macports, I learned I have iconv from my Mac and iconv from MacPorts, but the solutions didn't work, and didn't really make sense to me. readline is compiled with iconv from MacPorts, and base is compiled with iconv from my Mac, and they're slightly different. How do I fix this? Can I tell readline to use my Mac's iconv even though I installed it with MacPorts?

On 7 January 2011 06:20, Joe Bruce
Thanks Max. That makes a lot of sense. That change got me to the point of linking lambdabot.
Well, I tried to see if I could reproduce your problem but didn't get to this stage. It looks like v4.2.2.1 from Hackage hasn't been updated for donkeys years and breaks massively because of at least the new exceptions library, mtl 2.0 and the syb package being split off from base. I started to fix these issues but lost the will to live at step "[39 of 81] Compiling Plugin.Eval". Do you have access to some fixed source code that I might be able to build on GHC 7?
readline is compiled with iconv from MacPorts,
I don't think readline links against iconv. What that error says to me is that GHC is failing to link against *any* iconv. I bet that it's because you have iconv installed via Macports without +universal. Try: $ file /opt/local/lib/libiconv.a It should say: /opt/local/lib/libiconv.a: Mach-O universal binary with 2 architectures /opt/local/lib/libiconv.a (for architecture i386): current ar archive random library /opt/local/lib/libiconv.a (for architecture x86_64): current ar archive random library If it doesn't, do: $ sudo port install libiconv +universal And then link Lambdabot again. Does that help? Max

On Fri, Jan 7, 2011 at 11:00 AM, Max Bolingbroke
Well, I tried to see if I could reproduce your problem but didn't get to this stage. It looks like v4.2.2.1 from Hackage hasn't been updated for donkeys years and breaks massively because of at least the new exceptions library, mtl 2.0 and the syb package being split off from base.
I haven't commented before because most of the issues seemed to be Mac specific, which I know nothing about, but avoid the Hackage packages for lambdabot. You should be working out of darcs for lambdabot and its split-out packages like show or unlambda: http://code.haskell.org/lambdabot/ Darcs lambdabot ought to work reasonably well with GHC 6.12.1, which is what I have. -- gwern http://www.gwern.net

On Fri, Jan 7, 2011 at 8:00 AM, Max Bolingbroke
I don't think readline links against iconv. What that error says to me is that GHC is failing to link against *any* iconv. I bet that it's because you have iconv installed via Macports without +universal. Try:
$ file /opt/local/lib/libiconv.a
It should say:
/opt/local/lib/libiconv.a: Mach-O universal binary with 2 architectures /opt/local/lib/libiconv.a (for architecture i386): current ar archive random library /opt/local/lib/libiconv.a (for architecture x86_64): current ar archive random library
If nothing else, I've learned about checking locations and architectures of libraries in this little adventure, so I had checked that prior to writing. I do in fact have the universal binary installed. What's more, both the macport and system versions are universal. I tried telling cabal to explicitly use each, separately, and it failed both times, though it gave me a different error when compiling against the system lib. (It complained about readline again, which is why I assumed readline had some dependency on iconv.) I'm going to try what Gwern recommended (using the darcs repository for lambdabot) before I continue down this route. Thanks for your persistence.

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 1/6/11 02:27 , Joe Bruce wrote:
Now I'm stuck on readline again [lambdabot build step 28 of 81]: "/Users/joe/.cabal/lib/readline-1.0.1.0/ghc-6.12.3/HSreadline-1.0.1.0.o: unknown symbol `_rl_basic_quote_characters'"
This sounds like the cabal readline package (the Haskell bindings) used Apple's libreadline (which is really libedit, so doesn't have most readline functionality). I'd forcibly reinstall readline-1.0.1.0 and then try again. - -- brandon s. allbery [linux,solaris,freebsd,perl] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk0nvyYACgkQIn7hlCsL25X1kQCgpnQIC4GmI0fUBh5E+3Z9vXBx T8MAn35u+cna0Dni+amapHXFsukpb8wz =fnWv -----END PGP SIGNATURE-----

Wow, it sure has taken me a long time to get back to this, but I got it to work! Two ways actually. I did them both from scratch, just to make sure I understood what was going on and could communicate it for the next poor sap that is as ignorant as I was. All this is done with GHC-6.12.3, cabal, readline-1.0.1.0, In both cases, readline needed to be install. On a mac, this is troublesome because the mac comes with editline. Macports installs readline fine, except you have to make sure it's universal ('port install readline +universal') since GHC needs 32-bit libraries. When installing the haskell readline package, cabal has to be told where to find the macports readline ('cabal install --configuration-option=--with-readline-libraries=/opt/local/lib --configuration-option=--with-readline-includes=/opt/local/include --extra-lib-dirs=/opt/local/lib --extra-include-dirs=/opt/local/include readline'). The two ways of installing lambdabot branch from here. The first is from hackage, but it needs to be patched and I don't think the patch is complete anymore. The patch is at http://www.haskell.org/haskellwiki/Image:Lambdabot.patch. cabal unpack lambdabot cd lambdabot wget <patch url> -O | patch -p1 cabal install --extra-lib-dirs=/opt/local/lib --extra-include-dirs=/opt/local/include lambdabot should compile, but will complain about arrows when run (because the patch is insufficient). You can manually correct it, or try the other method: installing from darcs. 'darcs get http://code.haskell.org/lambdabot' (Note: you'll want mueval too: http://www.haskell.org/haskellwiki/Lambdabot/Building) I had to manually install Stream-0.3 as lambdabot required >= 0.3 but something else required Stream < 0.4. 'cabal install' in the lambdabot dir and it should be happy. Should/can I update the haskellwiki with this install process? Should the mac readline info go there too? Thank you to everyone who helped me sort this out; I learned quite a bit. Joe

On 18 January 2011 19:32, Joe Bruce
I did them both from scratch, just to make sure I understood what was going on and could communicate it for the next poor sap that is as ignorant as I was.
Congratulations :-)
Should/can I update the haskellwiki with this install process? Should the mac readline info go there too?
That sounds like a good thing to do. Also, oo you know if there's any reason that the most recent lambdabot is not pushed to Hackage? That might make things even easier for others who wish to install it. It certainly confused me! Cheers, Max

On Tue, Jan 18, 2011 at 3:41 PM, Max Bolingbroke
That sounds like a good thing to do. Also, oo you know if there's any reason that the most recent lambdabot is not pushed to Hackage? That might make things even easier for others who wish to install it. It certainly confused me!
Cheers, Max
It had a lot of issues which meant it wouldn't build anywhere, where at least the Hackage version worked at some point. I spent this evening working on fixing issues (rewriting the show package to use QuickCheck 2 rather than QuickCheck 1 was not fun!) and have uploaded a lambdabot and show that compile for me on GHC 6.12.1 -- gwern http://www.gwern.net
participants (5)
-
Brandon S Allbery KF8NH
-
Gwern Branwen
-
Joe Bruce
-
Max Bolingbroke
-
Rogan Creswick