
I understand that gmp is needed for the certain libraries like the Prelude with Double and Integer. But I do not understand why gmp is so deeply buried in the rts. Are the basic types Int and Pointer not enough to write a compiler like ghc? Cheers Christian

Christian.Maeder:
I understand that gmp is needed for the certain libraries like the Prelude with Double and Integer.
But I do not understand why gmp is so deeply buried in the rts. Are the basic types Int and Pointer not enough to write a compiler like ghc?
Integer is a good type :) However, its buried in the rts/distributed with the runtime, so that users may optionally use that version, rather than finding and installing their own external gmp package. On almost all platforms though, the distributed-with-ghc gmp is unused. -- Don

Don Stewart wrote:
However, its buried in the rts/distributed with the runtime, so that users may optionally use that version, rather than finding and installing their own external gmp package. On almost all platforms though, the distributed-with-ghc gmp is unused.
But doesn't that mean that it gets linked into any program compiled with ghc? If so, that is not a good choice for a just-in-case mp lib. -Yitz

gale:
Don Stewart wrote:
However, its buried in the rts/distributed with the runtime, so that users may optionally use that version, rather than finding and installing their own external gmp package. On almost all platforms though, the distributed-with-ghc gmp is unused.
But doesn't that mean that it gets linked into any program compiled with ghc? If so, that is not a good choice for a just-in-case mp lib.
only on systems that, when ghc was built, there was no libgmp available. on any system where an external libgmp is available, it will be dynamically linked into the generated haskell programs, and in-tree gmp isn't used at all (or compiled, or installed) e.g $ ldd `which xmonad` /home/dons/bin/xmonad: Start End Type Open Ref GrpRef Name 0000000048cc0000 00000000490e3000 rlib 0 1 0 /usr/lib/libpthread.so.8.0 0000000050424000 000000005083d000 rlib 0 1 0 /usr/lib/libm.so.2.3 0000000042a92000 0000000042ece000 rlib 0 1 0 /usr/local/lib/libgmp.so.7.0 000000004e3f2000 000000004e8c4000 rlib 0 1 0 /usr/lib/libc.so.42.0 -- Don

Don Stewart wrote:
on any system where an external libgmp is available, it will be dynamically linked into the generated haskell programs, and in-tree gmp isn't used at all (or compiled, or installed)
So on linux and *bsd, that should be fine. On Mac OS X (as a special case of *bsd), we have that framework thing. It is a real pain, and it also requires the framework on any client machine where you install your ghc-compiled binary. OK for the time being, but it would be really, really good to be able to compile ghc without gmp. This idea of a Mac OS X binary with statically-linked gmp is nice, it is really convenient. But someone needs to completely clarify the license issues in that case, and make it completely clear to all users. What is the situation on Windows? Does the standard GHC binary on Windows have dynamically linked gmp for binaries produced by ghc? Thanks, Yitz

Hi
What is the situation on Windows? Does the standard GHC binary on Windows have dynamically linked gmp for binaries produced by ghc?
No, they are statically linked. (Please, can no one start discussing licensing, people already know there are issues with it, and I get plenty of traffic already!) Thanks Neil

Yitzchak Gale:
OK for the time being, but it would be really, really good to be able to compile ghc without gmp.
Well, just go ahead and write an alternative portable & high- performance implementation of Integer.
This idea of a Mac OS X binary with statically-linked gmp is nice, it is really convenient. But someone needs to completely clarify the license issues in that case, and make it completely clear to all users.
I completely agree that we need to document the situation clearly. Otherwise, I don't really see what the fuss is about. Most GHC users don't care whether GMP is linked into their code (as its either only used internally or has a GPL-compatible license anyway). If a company wants to distribute GHC compiled binaries of non-GPL compatible code, well, they have to compile their own version of GHC on the Mac that links GMP dynamically, and then, use that version of GHC to link their final product. That is going to be a trivial task compared to developing that product in the first place. So, who cares? Manuel

| > gmp is nice, it is really convenient. But someone needs | > to completely clarify the license issues in that case, and | > make it completely clear to all users. | | I completely agree that we need to document the situation clearly. Although I hate discussing licensing (which is why GHC has a BSD license), this thread has been illuminating. Would anyone who feels they understand the situation feel able to write a few paragraphs explaining the situation, in a form suitable for a random user of GHC to read and understand? If someone wants to know in a year or two's time, they *might* find this thread; but they might not. A GHC wiki page would be ideal "Explanation of GHC's licensing". Thank you! (Meanwhile, we continue to welcome efforts to make the licensing situation simpler, by making it possible to do without GPL stuff in the core libraries, notably GMP and readline.) Simon

chak:
Yitzchak Gale:
OK for the time being, but it would be really, really good to be able to compile ghc without gmp.
Well, just go ahead and write an alternative portable & high- performance implementation of Integer.
This idea of a Mac OS X binary with statically-linked gmp is nice, it is really convenient. But someone needs to completely clarify the license issues in that case, and make it completely clear to all users.
I completely agree that we need to document the situation clearly. Otherwise, I don't really see what the fuss is about. Most GHC users don't care whether GMP is linked into their code (as its either only used internally or has a GPL-compatible license anyway).
If a company wants to distribute GHC compiled binaries of non-GPL compatible code, well, they have to compile their own version of GHC on the Mac that links GMP dynamically, and then, use that version of GHC to link their final product. That is going to be a trivial task compared to developing that product in the first place. So, who cares?
I agree: there's a lot of effort here without an obvious demand. Do we know of anyone not using GHC commercially because the can't use GMP? -- Don

Christian Maeder wrote:
I understand that gmp is needed for the certain libraries like the Prelude with Double and Integer.
Why is GMP needed for Double? Based on the online report Double is "double precision floating"; it does not need to represent arbitrary big numbers. I thought it is there only for Integers and Rationals. Peter.

phercek:
Christian Maeder wrote:
I understand that gmp is needed for the certain libraries like the Prelude with Double and Integer.
Why is GMP needed for Double? Based on the online report Double is "double precision floating"; it does not need to represent arbitrary big numbers. I thought it is there only for Integers and Rationals.
It isn't needed for Double. Double is a native type.
participants (7)
-
Christian Maeder
-
Don Stewart
-
Manuel M T Chakravarty
-
Neil Mitchell
-
Peter Hercek
-
Simon Peyton-Jones
-
Yitzchak Gale