Replacement for GMP: Update

Peter Tanski p.tanski at gmail.com
Thu Aug 10 22:30:09 EDT 2006


Reilly,

> ...  this shouldn't prohibit linking
> GMP in dynamically, should it?  It's just a C library and GCC should
> happily generate relocatable code.  As a dynamically linked library,
> there should be no tainting issues to worry about even if the
> dynamically linked code is shipped with the executable.
>
> Am I missing something?

Not at all.  GHC builds the GMP library only if it is not already  
available on the system.  On my Mac OS X computer it uses a dynamic  
library.  I have not tried using gmp.dll on Windows since I have not  
built GHC on my Windows computer (it is a bit slow--a 600MHz P3).   
But the dynamic library form of GMP only solves the licensing problem  
(admittedly, for my purposes the worst of the bunch).  It should be  
easy to change GMP's build settings so GHC is distributed with a  
dynamic GMP library.

The other problem is that GMP has a mechanism to let the user  
determine its memory allocator, with the caveat that only one  
allocator can be used by a single program.  GHC configures GMP to use  
GHC's RTS-GC for allocation so GHC-compiled programs can't interface  
with GHC separately.  (This would not be such a big problem for  
general programs but C-Haskell cryptographic or scientific programs  
that might benefit from GMP's additional functionality would suffer.)

On a side note, if you have been reading this user-list recently it  
seems that programmers (including myself, I guess) do not want to  
have to package a dynamic library (GMP) with programs compiled with  
GHC--a particularly irksome task if your Haskell program doesn't even  
*use* Integer.  Not only do users have to package the separate dll,  
they also have to package a notice of the GMP copyright along with  
the binary.  Just today Einar Karttunen mentioned that:

>> *    "This product includes software developed by the OpenSSL Project
>> *    for use in the OpenSSL Toolkit (http://www.openssl.org/)".
>>
>> All developers would have to do is include the acknowledgment stated
>> above.
> ...
> ps. personally I don't think the advertising clause is bad, but
> I think it is bad to force it on other users.

Einar does have a good point, here.  Personally speaking, such  
packaging and licensing stuff is o.k. for free software but for a  
clean commercial distribution it would be a bad thing; a reason to  
choose not to use GHC (or nhc98, for that matter).

Best regards,
Peter


More information about the Glasgow-haskell-users mailing list