Problem linking with GHC 6.8.1

This is a program that works under ghci. GHC was installed using the tarball on hashell.org. When I try to compile the program, it can't link. It used to work with 6.6.1. ghc --version The Glorious Glasgow Haskell Compilation System, version 6.8.1 ghc --make -O2 -o edimail Main.hs [1 of 5] Compiling Decode ( Decode.hs, Decode.o ) [2 of 5] Compiling Net ( Net.hs, Net.o ) [3 of 5] Compiling Smtp ( Smtp.hs, Smtp.o ) [4 of 5] Compiling Pop3 ( Pop3.hs, Pop3.o ) [5 of 5] Compiling Main ( Main.hs, Main.o ) Linking edimail ... /usr/bin/ld: cannot find -lgmp collect2: ld a retourné 1 code d'état d'exécution

I have the same problem. And gmp.h is also not found when using the FFI. I must add: cc-options: -I/path/to/ghc-6.8.1/gmp On Tuesday 06 November 2007 16:07, david48 wrote:
This is a program that works under ghci. GHC was installed using the tarball on hashell.org. When I try to compile the program, it can't link. It used to work with 6.6.1.
ghc --version The Glorious Glasgow Haskell Compilation System, version 6.8.1
ghc --make -O2 -o edimail Main.hs [1 of 5] Compiling Decode ( Decode.hs, Decode.o ) [2 of 5] Compiling Net ( Net.hs, Net.o ) [3 of 5] Compiling Smtp ( Smtp.hs, Smtp.o ) [4 of 5] Compiling Pop3 ( Pop3.hs, Pop3.o ) [5 of 5] Compiling Main ( Main.hs, Main.o ) Linking edimail ... /usr/bin/ld: cannot find -lgmp collect2: ld a retourné 1 code d'état d'exécution _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

On 11/6/07, Alberto Ruiz
I have the same problem. And gmp.h is also not found when using the FFI. I must add: cc-options: -I/path/to/ghc-6.8.1/gmp
unfortunately : $ find /usr/local/lib/ghc-6.8.1 -name *gmp* -ls $ ghc was installed this way : $ tar xvfj ghc-6.8.1-i386-unknown-linux.tar.bz2 $ cd ghc-6.8.1 $ ./configure $ sudo make install it looks like gmp is not installed : $ locate libgmp.a /home/david/Desktop/ghc-6.8.1/gmp/libgmp.a

On 11/6/07, david48

If you don't use the foreign function interface I think that you only need the -L option: ghc --make -L/usr/local/lib/ghc-6.8.1/gmp -O2 -o edimail Main.hs Something similar worked for me, but this new behavior is not very reasonable. Could it be a bug? On Tuesday 06 November 2007 17:47, david48 wrote:
On 11/6/07, david48
wrote: well I'm not sure where to use the -I/path/to/ghc... so I tried this :
$ cd /usr/local/lib/ghc-6.8.1 $ sudo cp -R /home/david/Desktop/ghc-6.8.1/gmp .
$ ghc --make -I/usr/local/lib/ghc-6.8.1/gmp -O2 -o edimail Main.hs Linking edimail ... /usr/bin/ld: cannot find -lgmp
I'm not sure what to do next.

Alberto Ruiz wrote:
If you don't use the foreign function interface I think that you only need the -L option:
ghc --make -L/usr/local/lib/ghc-6.8.1/gmp -O2 -o edimail Main.hs
Something similar worked for me, but this new behavior is not very reasonable. Could it be a bug?
It looks like a problem with the binary distributions. They include gmp, but somehow don't install it. As a workaround, you can take gmp.h and libgmp.a from from the binary tarball and put them by hand into /usr/local/lib/ghc-6.8.1 (or wherever you installed it). Alternatively you can install a suitable gmp package using your OS's package manager (you didn't say which flavour of Linux you're on). BTW, a better place to ask questions about GHC is glasgow-haskell-users@haskell.org, you're more likely to get a quick answer. Cheers, Simon

On Nov 7, 2007 10:44 AM, Simon Marlow
/usr/local/lib/ghc-6.8.1 (or wherever you installed it). Alternatively you can install a suitable gmp package using your OS's package manager (you didn't say which flavour of Linux you're on).
This is what I did, following an advice on another thread. It worked. I didn't think of doing that because it worked with 6.6.1. ( I'm on Kubuntu 7.10 )
BTW, a better place to ask questions about GHC is glasgow-haskell-users@haskell.org, you're more likely to get a quick answer.
Thanks for the heads up ... ... and sorry everyone for the noise here. David.
participants (3)
-
Alberto Ruiz
-
david48
-
Simon Marlow