Re: link problem under macosx

2010-11-04 Thread Christian Maeder
Am 03.11.2010 11:59, schrieb John Lato:
 From: Simon Michael si...@joyful.com mailto:si...@joyful.com
 
 On 11/2/10 10:20 AM, John Lato wrote:
  Since Apple seems disinclined to fix the system's libiconv, and
 macports projects refuse to use it, the only real
  solution is to use either HP without macports or the macports GHC
 without HP.  Personally I chose to use the HP and
 
 Not so, as mentioned you just need to make sure /usr/lib is in the
 link path before /opt/local/lib. Add -L/usr/lib to
 your build flags for ghc --make, and put:
 
 extra-lib-dirs: /usr/lib
 extra-lib-dirs: /opt/local/lib
 
 in that order in ~/.cabal/config for cabal build.
 
 This is a very FAQ and needs to be documented somewhere more
 obvious, I wonder where. cabal-install and GHC release notes ?
 
 
 As I mentioned in another reply, this worked for me until I tried to
 link to a macports lib (I think some regex lib) that actually used the
 macports libiconv (a lot of them don't even if they pull in the
 dependency).  Then I was really stuck because I had dependencies on two
 different libiconv's, and neither one would link properly.
 
 As such, I consider this a pretty fragile solution.

Right, therefore I've reopened
http://hackage.haskell.org/trac/ghc/ticket/4068

Christian

 
 John
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: link problem under macosx

2010-11-03 Thread Christian Maeder
Am 02.11.2010 18:03, schrieb Thorkil Naur:
 Hello,
 
 On Tue, Nov 02, 2010 at 01:03:04PM +0100, Christian Maeder wrote:
 ...
 Are there better workarounds?
 
 I am not sure about that, I assume that you have looked at 
 http://hackage.haskell.org/trac/ghc/ticket/4068?

no, I found Simon Michael's message
http://www.mail-archive.com/haskell-c...@haskell.org/msg81961.html
by chance.

I did not try out his extra-lib-dirs proposal, since all cabal packages
were already installed.

And I agree with him that it should be documented somewhere more
prominent and that avoiding macports is no (good) solution.

I'll add his proposal to your (closed) ticket to increase the hit rate.

Cheers Christian

 
 ...
 
 Best regards
 Thorkil
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: link problem under macosx

2010-11-03 Thread John Lato
On Wed, Nov 3, 2010 at 9:55 AM, Christian Maeder
christian.mae...@dfki.dewrote:

 Am 02.11.2010 18:03, schrieb Thorkil Naur:
  Hello,
 
  On Tue, Nov 02, 2010 at 01:03:04PM +0100, Christian Maeder wrote:
  ...
  Are there better workarounds?
 
  I am not sure about that, I assume that you have looked at
 http://hackage.haskell.org/trac/ghc/ticket/4068?

 no, I found Simon Michael's message
 http://www.mail-archive.com/haskell-c...@haskell.org/msg81961.html
 by chance.

 I did not try out his extra-lib-dirs proposal, since all cabal packages
 were already installed.

 And I agree with him that it should be documented somewhere more
 prominent and that avoiding macports is no (good) solution.

 I'll add his proposal to your (closed) ticket to increase the hit rate.

 Cheers Christian


His proposed solution works until you try to link a Haskell project to a
macports lib that requires libiconv.  It's also inconvenient that you'll
sometimes need to unpack hackage code and manually edit the .cabal file.

If you want to use macports, the only real solution is to build a GHC+libs
that prefers /opt/local/ to the system-installed locations.  The macports
GHC does this, or you can try to compile it yourself with appropriate flags
to configure (whatever they may be).

John
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: link problem under macosx

2010-11-03 Thread John Lato

 From: Simon Michael si...@joyful.com

 On 11/2/10 10:20 AM, John Lato wrote:
  Since Apple seems disinclined to fix the system's libiconv, and macports
 projects refuse to use it, the only real
  solution is to use either HP without macports or the macports GHC without
 HP.  Personally I chose to use the HP and

 Not so, as mentioned you just need to make sure /usr/lib is in the link
 path before /opt/local/lib. Add -L/usr/lib to
 your build flags for ghc --make, and put:

 extra-lib-dirs: /usr/lib
 extra-lib-dirs: /opt/local/lib

 in that order in ~/.cabal/config for cabal build.

 This is a very FAQ and needs to be documented somewhere more obvious, I
 wonder where. cabal-install and GHC release notes ?


As I mentioned in another reply, this worked for me until I tried to link to
a macports lib (I think some regex lib) that actually used the macports
libiconv (a lot of them don't even if they pull in the dependency).  Then I
was really stuck because I had dependencies on two different libiconv's, and
neither one would link properly.

As such, I consider this a pretty fragile solution.

John
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


link problem under macosx

2010-11-02 Thread Christian Maeder
Hi,

after installing
http://lambda.galois.com/hp-tmp/2010.2.0.0/haskell-platform-2010.2.0.0.i386.dmg
and various more libraries using cabal, we get the following linker
error below.

A simple hello program compiles and links fine and uses
/usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version
7.0.0) as shown by otool -L.

Does someone have an explanation or solution?

Cheers Christian

Linking dist/build/hets/hets ...
Undefined symbols:
  _iconv_close, referenced from:
  _hs_iconv_close in libHSbase-4.2.0.2.a(iconv.o)
  _iconv_open, referenced from:
  _hs_iconv_open in libHSbase-4.2.0.2.a(iconv.o)
  _iconv, referenced from:
  _hs_iconv in libHSbase-4.2.0.2.a(iconv.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: link problem under macosx

2010-11-02 Thread Christian Maeder
Am 02.11.2010 11:48, schrieb Christian Maeder:
 Hi,
 
 after installing
 http://lambda.galois.com/hp-tmp/2010.2.0.0/haskell-platform-2010.2.0.0.i386.dmg
 and various more libraries using cabal, we get the following linker
 error below.
 
 A simple hello program compiles and links fine and uses
 /usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version
 7.0.0) as shown by otool -L.
 
 Does someone have an explanation or solution?

adding -L/usr/lib as first argument to ghc solved the problem.
Another cabal-package (gtk and friends) used /opt/local/lib under
library-dirs:.

Are there better workarounds?

C.

 
 Cheers Christian
 
 Linking dist/build/hets/hets ...
 Undefined symbols:
   _iconv_close, referenced from:
   _hs_iconv_close in libHSbase-4.2.0.2.a(iconv.o)
   _iconv_open, referenced from:
   _hs_iconv_open in libHSbase-4.2.0.2.a(iconv.o)
   _iconv, referenced from:
   _hs_iconv in libHSbase-4.2.0.2.a(iconv.o)
 ld: symbol(s) not found
 collect2: ld returned 1 exit status
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: link problem under macosx

2010-11-02 Thread Thorkil Naur
Hello,

On Tue, Nov 02, 2010 at 01:03:04PM +0100, Christian Maeder wrote:
 ...
 Are there better workarounds?

I am not sure about that, I assume that you have looked at 
http://hackage.haskell.org/trac/ghc/ticket/4068?

 ...

Best regards
Thorkil
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: link problem under macosx

2010-11-02 Thread John Lato

 From: Christian Maeder christian.mae...@dfki.de

 Am 02.11.2010 11:48, schrieb Christian Maeder:
  Hi,
 
  after installing
 
 http://lambda.galois.com/hp-tmp/2010.2.0.0/haskell-platform-2010.2.0.0.i386.dmg
  and various more libraries using cabal, we get the following linker
  error below.
 
  A simple hello program compiles and links fine and uses
  /usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version
  7.0.0) as shown by otool -L.
 
  Does someone have an explanation or solution?

 adding -L/usr/lib as first argument to ghc solved the problem.
 Another cabal-package (gtk and friends) used /opt/local/lib under
 library-dirs:.

 Are there better workarounds?


Judging from the /opt/*, it looks like you're using macports for gtk.  The
libiconv provided by macports is incompatible with the system libiconv, and
trying to mix the two is a doomed effort.

If you're using a gtk2hs from macports (or gtk+ from macports) it will link
to /opt/local/lib/libiconv, but HP and ghc core libraries will link to
/usr/lib/libiconv.  This means that various haskell packages will be
entirely incompatible with each other, and problems will manifest as these
linker errors.

Since Apple seems disinclined to fix the system's libiconv, and macports
projects refuse to use it, the only real solution is to use either HP
without macports or the macports GHC without HP.  Personally I chose to use
the HP and built gtk+ using http://gtk-osx.sourceforge.net/ , which is
moderately painful but has been stable once it's built.

John
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: link problem under macosx

2010-11-02 Thread Simon Michael

On 11/2/10 10:20 AM, John Lato wrote:

Since Apple seems disinclined to fix the system's libiconv, and macports 
projects refuse to use it, the only real
solution is to use either HP without macports or the macports GHC without HP.  
Personally I chose to use the HP and


Not so, as mentioned you just need to make sure /usr/lib is in the link path before /opt/local/lib. Add -L/usr/lib to 
your build flags for ghc --make, and put:


extra-lib-dirs: /usr/lib
extra-lib-dirs: /opt/local/lib

in that order in ~/.cabal/config for cabal build.

This is a very FAQ and needs to be documented somewhere more obvious, I wonder 
where. cabal-install and GHC release notes ?

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users