[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#573978: libgmp-ocaml: Wrong conversion from int on 64 bits computer



tag 573978 + pending
thanks

On  0, Claude Marche <Claude.Marche@inria.fr> wrote:
> 
> The gmp bindings for ocaml proveded by this package 
> have a buggy implementation of Z.from_int on 64bits computer.
> The wrong behavior can be reproduced as follows:
> 
> > ocaml
> #directory "+gmp";;
> #load "gmp.cma";;
> open Gmp;;
> #install_printer Z.print;;
> Z.from_int Pervasives.max_int;; (* gives -1 instead of 4611686018427387903 *)
> Z.from_int Pervasives.min_int;; (* gives 0 instead of -4611686018427387904 *)
> 

I tested Jean-Christophe's patch and it seems to be working fine. It
will be part of the next upload which will close this bugreport.

> 
> Remark: there exists another open-source library providing Ocaml bindings for GMP, named MLGMPIDL and
> available at
> 
> http://www.inrialpes.fr/pop-art/people/bjeannet/mlxxxidl-forge/mlgmpidl/index.html
> 
> Moreover, it additionally provides bindings for MPFR.
> 
> I've tested it and it does not have the bug above. Hence, you maintainers should consider replacing
> the current MLGMP bindings with this new MLGMPIDL.
> 

Well... we already packaged the "arpon" library which includes
mlgmpidl. So, you may find what you're looking for there. However, my
quick test tells me that the apron's situation might not be perfect
since:

% ocaml              
        Objective Caml version 3.11.2

# #directory "+apron";;
# #load "gmp.cma";;
Cannot load required shared library dllgmp_caml.
Reason: /usr/lib/ocaml/stublibs/dllgmp_caml.so: /usr/lib/ocaml/stublibs/dllgmp_caml.so: undefined symbol: caml_ba_alloc_dims.
#

I didn't investigated further. So, I don't know what's missing/broken
but that's something to fix :)

Regards,

-- 
Mehdi Dogguy



Reply to: