Cannot install readline on Mac OS X

Yitzchak Gale gale at sefer.org
Thu Apr 29 07:29:38 EDT 2010


I wrote:
>> Linking pileonText ...
>> Undefined symbols:
>>  "_iconv_close", referenced from:
>>     _hs_iconv_close in libHSbase-4.2.0.0.a(iconv.o)
>>    (maybe you meant: _hs_iconv_close)
>> [and similar for _iconv_open and _iconv]
>> ld: symbol(s) not found
>> collect2: ld returned 1 exit status

Brandon S. Allbery KF8NH
> This is actually a problem with finding/using the correct iconv library.
>  See http://code.google.com/p/gpsee/issues/detail?id=19 for a
> (Haskell-related, even) discussion.  I don't have SL so can't really help
> with this.

Thanks for the link. I don't see the Haskell connection - it's
a JavaScript interpreter with its own FFI. But anyway...

If this is the same problem, then I don't see how to proceed.

In their case, it was two modules within their own project
that were linking to the two different copies of iconv.
They just needed to get the two modules to agree.

But in our case, MacPorts readline is linking to
MacPorts iconv as it should, and HP base is linking to
native iconv as it should.

So i've abandoned MacPorts readline, and I'm trying
to build GNU readline manually. So far, I haven't been
able to get this to work either. I have a number of
questions:

What version of GNU readline should I use? The current
version is 6.1, but the Haskell readline package doesn't
seem to support that. The highest version mentioned in
HsReadlineConfig.h.in is 5.0. I tried 6.1 anyway, but
unsurprisingly, Haskell readline didn't recognize it.
What version should I use?

Older versions of readline stubbornly refuse to build
shared libraries on Snow Leopard. The make fails with:

i686-apple-darwin10-gcc-4.2.1: -compatibility_version
only allowed with -dynamiclib

But I can't figure out how to pass the flag it wants.
When I put it in CFLAGS or LDFLAGS, configure
fails right at the start with

configure: error: cannot run C compiled programs.

Also - should I use -m32 or not when building
readline?

Could be that the real solution is to go back to Judah's
GNUreadline.framework idea, and to arrange for the
readline package to use it on the Mac. The only difference
is that now the framework is not required for GHC as
it was in the past, only for the readline package.

It's clear that it is currently at least extremely difficult
and non-intuitive, if not impossible, to use the readline
package on Snow Leopard. That needs to be fixed.

Thanks,
Yitz


More information about the Libraries mailing list