Compare commits

...

36 Commits
f27 ... rawhide

Author SHA1 Message Date
Richard W.M. Jones 56f0b30345 Bump and rebuild for updated ocaml-findlib. 2021-03-15 15:45:43 +00:00
Jerry James 13d664ec46 Rebuild for ocaml-zarith 1.12. 2021-03-03 12:11:21 -07:00
Richard W.M. Jones 3a995b9be6 OCaml 4.12.0 build 2021-03-01 17:06:23 +00:00
Jerry James ef715e7ad3 Bump and rebuild for updated ocaml Dynlink dependency. 2021-02-17 21:55:04 -07:00
Fedora Release Engineering 9dc45b49e4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-01-26 22:09:18 +00:00
Jerry James 6313bc2939 Rebuild for ocaml-zarith 1.11. 2020-11-23 14:12:50 -07:00
Jerry James d9581084f4 Explicitly BR make. 2020-11-09 16:53:38 -07:00
Jerry James 83410ac2cb Rebuild for ocaml-zarith 1.10. 2020-09-25 13:16:25 -06:00
Richard W.M. Jones c49dddefb1 OCaml 4.11.1 rebuild 2020-09-01 20:33:19 +01:00
Richard W.M. Jones cb322b569e OCaml 4.11.0 rebuild 2020-08-21 12:19:50 +01:00
Fedora Release Engineering ca8a82d0b5 - Second attempt - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2020-08-01 06:45:09 +00:00
Fedora Release Engineering c728fe35f0 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2020-07-28 12:20:39 +00:00
Richard W.M. Jones 6cfeea9be4 OCaml 4.11.0+dev2-2020-04-22 rebuild 2020-05-05 00:01:02 +01:00
Richard W.M. Jones d937709009 OCaml 4.11.0 pre-release attempt 2 2020-04-21 19:49:11 +01:00
Richard W.M. Jones 2895eee114 OCaml 4.11.0 pre-release 2020-04-17 22:05:15 +01:00
Jerry James 823def308a Exclude ocamlx(Numeric_plugin) from Requires. 2020-04-13 11:01:01 -06:00
Richard W.M. Jones 49914c20d5 Update all OCaml dependencies for RPM 4.16. 2020-04-02 23:08:17 +01:00
Richard W.M. Jones ba98b87ae2 OCaml 4.10.0 final. 2020-02-26 16:25:14 +00:00
Fedora Release Engineering 390a6058cc - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2020-01-29 19:47:54 +00:00
Richard W.M. Jones 073f643246 OCaml 4.10.0+beta1 rebuild. 2020-01-19 16:14:27 +00:00
Jerry James 73a6dc8ca0 Temporarily disable tests on ppc64le. 2020-01-02 10:25:55 -07:00
Richard W.M. Jones 1b533114f6 OCaml 4.09.0 (final) rebuild. 2019-12-06 16:02:15 +00:00
Jerry James e413852354 Rebuild for mpfr 4. 2019-10-11 08:46:44 -06:00
Jerry James 5f69608aae Rebuild for ocaml-zarith 1.9. 2019-09-06 09:13:06 -06:00
Richard W.M. Jones d4d9fa565a OCaml 4.08.1 (final) rebuild. 2019-08-16 18:17:29 +01:00
Richard W.M. Jones 89f77a207e OCaml 4.08.1 (rc2) rebuild. 2019-08-01 08:54:29 +01:00
Fedora Release Engineering 89fae6f006 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2019-07-25 23:02:07 +00:00
Jerry James 3ad4e6853f Rebuild for ocaml 4.08.0. 2019-07-04 13:17:16 -06:00
Fedora Release Engineering e4cb14a3ab - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2019-02-01 16:58:41 +00:00
Fedora Release Engineering 217a2f865f - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2018-07-13 14:49:07 +00:00
Richard W.M. Jones 76ac5c961c OCaml 4.07.0 (final) rebuild. 2018-07-11 20:02:56 +01:00
Richard W.M. Jones 2eed69c543 OCaml 4.07.0-rc1 rebuild. 2018-06-20 21:47:10 +01:00
Fedora Release Engineering 5158c72e11 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2018-02-08 08:59:38 +00:00
Jerry James a4b8f7c376 Build with the PIC version of libasmrun. Fix the mlgmpidl interface. 2017-12-03 21:26:00 -07:00
Richard W.M. Jones 4135bf0b9f Add BR ocaml-num, now a separate subpackage. 2017-11-22 22:24:23 +00:00
Richard W.M. Jones 1601506283 OCaml 4.06.0 rebuild. 2017-11-18 00:46:40 +00:00
2 changed files with 274 additions and 5 deletions

153
ocaml-tplib-mlgmpidl.patch Normal file
View File

@ -0,0 +1,153 @@
--- src/numeric_plugins/mlgmp_plugin.ml.orig 2013-02-14 04:08:25.000000000 -0700
+++ src/numeric_plugins/mlgmp_plugin.ml 2017-12-03 14:00:36.471566987 -0700
@@ -19,48 +19,69 @@
*)
-open Gmp
-
-let bits_of_string s =
- let s' = String.sub s 2 ((String.length s)-2) in (* remove prefix "0b" *)
- Z.from_string_base ~base:2 s'
+let randobj = Gmp_random.init_default ();
module Mlgmp_int =
struct
- type t = Z.t
+ type t = Mpz.t
- let zero = Z.of_int 0
- let max x y = if Z.cmp x y >= 0 then x else y
- let min x y = if Z.cmp x y >= 0 then y else x
- let add = Z.add
- let neg = Z.neg
- let mul = Z.mul
- let div = Z.cdiv_q
- let pow = Z.pow_ui
- let compare = Z.cmp
+ let zero = Mpz.of_int 0
+ let max x y = if Mpz.cmp x y >= 0 then x else y
+ let min x y = if Mpz.cmp x y >= 0 then y else x
+ let add x y =
+ let res = Mpz.init () in
+ Mpz.add res x y;
+ res
+ let neg x =
+ let res = Mpz.init () in
+ Mpz.neg res x;
+ res
+ let mul x y =
+ let res = Mpz.init () in
+ Mpz.mul res x y;
+ res
+ let div x y =
+ let res = Mpz.init () in
+ Mpz.cdiv_q res x y;
+ res
+ let pow x y =
+ let res = Mpz.init () in
+ Mpz.pow_ui res x y;
+ res
+ let compare = Mpz.cmp
let random n =
- bits_of_string (Random_generator.to_string n)
- let of_int = Z.from_int
- let of_string x =
- try
- Z.from_string_base ~base:10 x
- with Invalid_argument _ ->
- raise (Failure ("Mpzf.of_string: "^x^" is not well-formatted"))
- let to_string = Z.to_string_base ~base:10
+ let res = Mpz.init () in
+ Gmp_random.Mpz.urandomb res randobj n;
+ res
+ let of_int = Mpz.of_int
+ let of_string = Mpz.of_string
+ let to_string = Mpz.get_str ~base:10
end
module Mlgmp_rat =
struct
- type t = Q.t
+ type t = Mpq.t
- let zero = Q.from_int 0
- let one = Q.from_int 1
- let max x y = if Q.cmp x y >= 0 then x else y
- let min x y = if Q.cmp x y >= 0 then y else x
- let add = Q.add
- let neg = Q.neg
- let mul = Q.mul
- let div = Q.div
+ let zero = Mpq.of_int 0
+ let one = Mpq.of_int 1
+ let max x y = if Mpq.cmp x y >= 0 then x else y
+ let min x y = if Mpq.cmp x y >= 0 then y else x
+ let add x y =
+ let res = Mpq.init () in
+ Mpq.add res x y;
+ res
+ let neg x =
+ let res = Mpq.init () in
+ Mpq.neg res x;
+ res
+ let mul x y =
+ let res = Mpq.init () in
+ Mpq.mul res x y;
+ res
+ let div x y =
+ let res = Mpq.init () in
+ Mpq.div res x y;
+ res
let pow x n =
let rec pow_aux x n =
@@ -68,31 +89,29 @@ struct
if n = 0 then one
else
let y = pow_aux x (n/2) in
- let z = mul y y in
- if n mod 2 = 0 then
- z
- else
- mul x z
+ let z = Mpq.init () in
+ Mpq.mul z y y;
+ if n mod 2 != 0 then
+ Mpq.mul z x z;
+ z
in
if n >= 0 then
pow_aux x n
else
- pow_aux (Q.inv x) (-n)
+ pow_aux (Mpq.inv x x; x) (-n)
- let compare = Q.cmp
+ let compare = Mpq.cmp
let random n =
- let num = bits_of_string (Random_generator.to_string n) in
- let den = bits_of_string (Random_generator.to_string n) in
- Q.div (Q.from_z num) (Q.add Q.one (Q.from_z den))
- let of_int = Q.from_int
- let of_string x =
- try
- let i = String.index x '/' in
- let num = Z.from_string_base ~base:10 (String.sub x 0 i) in
- let den = Z.from_string_base ~base:10 (String.sub x (i+1) ((String.length x)-(i+1))) in
- Q.div (Q.from_z num) (Q.from_z den)
- with Not_found -> Q.from_z (Z.from_string_base ~base:10 x)
- let to_string = Q.to_string
+ let num = Mpz.init () in
+ let den = Mpz.init () in
+ Gmp_random.Mpz.urandomb num randobj n;
+ Gmp_random.Mpz.urandomb den randobj n;
+ let res = Mpq.init () in
+ Mpq.div res (Mpq.init_set_z num) (Mpq.add res one (Mpq.init_set_z den); res);
+ res
+ let of_int = Mpq.of_int
+ let of_string = Mpq.of_string
+ let to_string = Mpq.to_string
end
let _ =

View File

@ -1,8 +1,6 @@
%global opt %(test -x %{_bindir}/ocamlopt && echo 1 || echo 0)
Name: ocaml-tplib
Version: 1.3
Release: 29%{?dist}
Release: 61%{?dist}
Summary: Tropical Polyhedra Library
License: LGPLv2+
@ -20,16 +18,22 @@ Source6: compute_tropical_complex.1
# Upstream patch to adapt to new ocamlbuild behavior. See
# https://github.com/ocaml/opam-repository/blob/master/packages/tplib/tplib.1.3/files/fix-makefile.diff
Patch0: %{name}-ocamlbuild.patch
# Adapt to current versions of mlgmpidl
Patch1: %{name}-mlgmpidl.patch
BuildRequires: make
BuildRequires: mpfr-devel
BuildRequires: ocaml
BuildRequires: ocaml-ocamlbuild
BuildRequires: ocaml-ocamlbuild-devel
BuildRequires: ocaml-camlidl-devel
BuildRequires: ocaml-findlib-devel
BuildRequires: ocaml-mlgmpidl-devel
BuildRequires: ocaml-num-devel
BuildRequires: ocaml-ocamldoc
BuildRequires: ocaml-zarith-devel
# This is an internal symbol that winds up in Requires, but not Provides
%global __requires_exclude ocaml\\\(Numeric_plugin\\\)
%global __requires_exclude ocamlx?\\\(Numeric_plugin\\\)
# Don't advertise the numeric plugins
%global __provides_exclude plugin
@ -59,10 +63,18 @@ Tools that use TPLib.
%prep
%setup -q -n tplib-%{version}
%patch0
%patch1
# Enable debuginfo generation
sed -i 's/@OCAMLBUILD@/& -cflag -g -lflag -g/' Makefile.in
# Use the PIC version of libasmrun
sed -i 's/-lasmrun/&_pic/g' Makefile.in configure
sed -i 's/libasmrun\.a/libasmrun_pic.a/' Makefile.in
# Build the bindings with -fPIC
sed -i 's,CFLAGS += -I\$(OCAML_HOME_DIR),& -fPIC,' Makefile.in
%build
%configure
# Don't use %%{?_smp_mflags}; it leads to build failures
@ -80,9 +92,16 @@ cp -p %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE6} \
%{buildroot}%{_mandir}/man1
%check
# Disable tests on ppc64le for now. With ocaml 4.09.0, errors like this occur
# when linking the tests:
# _build/src/bindings/libtplib_double.a(tplib_double_callback.obj.o): in function `camlStdlib__arg__assoc3_118':
# (.text+0xe9258): relocation truncated to fit: R_PPC64_TOC16_DS against `.toc'+101d0
# (.text+0xe9298): relocation truncated to fit: R_PPC64_TOC16_DS against `.toc'+ffe8
%ifnarch %{power64}
make test
_build/tests/test_tplib_double
_build/tests/test_tplib_rational
%endif
%files
%doc README
@ -104,6 +123,103 @@ _build/tests/test_tplib_rational
%doc %{_mandir}/man1/*
%changelog
* Mon Mar 15 2021 Richard W.M. Jones <rjones@redhat.com> - 1.3-61
- Bump and rebuild for updated ocaml-findlib.
* Wed Mar 3 2021 Jerry James <loganjerry@gmail.com> - 1.3-60
- Rebuild for ocaml-zarith 1.12
* Mon Mar 1 17:06:22 GMT 2021 Richard W.M. Jones <rjones@redhat.com> - 1.3-59
- OCaml 4.12.0 build
* Wed Feb 17 2021 Jerry James <loganjerry@gmail.com> - 1.3-58
- Bump and rebuild for updated ocaml Dynlink dependency
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.3-57
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Mon Nov 23 2020 Jerry James <loganjerry@gmail.com> - 1.3-56
- Rebuild for ocaml-zarith 1.11
* Fri Sep 25 2020 Jerry James <loganjerry@gmail.com> - 1.3-55
- Rebuild for ocaml-zarith 1.10
* Tue Sep 01 2020 Richard W.M. Jones <rjones@redhat.com> - 1.3-54
- OCaml 4.11.1 rebuild
* Fri Aug 21 2020 Richard W.M. Jones <rjones@redhat.com> - 1.3-53
- OCaml 4.11.0 rebuild
* Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.3-52
- Second attempt - Rebuilt for
https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.3-51
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Mon May 04 2020 Richard W.M. Jones <rjones@redhat.com> - 1.3-50
- OCaml 4.11.0+dev2-2020-04-22 rebuild
* Tue Apr 21 2020 Richard W.M. Jones <rjones@redhat.com> - 1.3-49
- OCaml 4.11.0 pre-release attempt 2
* Fri Apr 17 2020 Richard W.M. Jones <rjones@redhat.com> - 1.3-48
- OCaml 4.11.0 pre-release
* Mon Apr 13 2020 Jerry James <loganjerry@gmail.com> - 1.3-47
- Exclude ocamlx(Numeric_plugin) from Requires
* Thu Apr 02 2020 Richard W.M. Jones <rjones@redhat.com> - 1.3-46
- Update all OCaml dependencies for RPM 4.16.
* Wed Feb 26 2020 Richard W.M. Jones <rjones@redhat.com> - 1.3-45
- OCaml 4.10.0 final.
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.3-44
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Sun Jan 19 2020 Richard W.M. Jones <rjones@redhat.com> - 1.3-43
- OCaml 4.10.0+beta1 rebuild.
* Fri Dec 06 2019 Richard W.M. Jones <rjones@redhat.com> - 1.3-42
- OCaml 4.09.0 (final) rebuild.
* Fri Oct 11 2019 Jerry James <loganjerry@gmail.com> - 1.3-41
- Rebuild for mpfr 4
* Tue Sep 3 2019 Jerry James <loganjerry@gmail.com> - 1.3-40
- Rebuild for ocaml-zarith 1.9
* Fri Aug 16 2019 Richard W.M. Jones <rjones@redhat.com> - 1.3-39
- OCaml 4.08.1 (final) rebuild.
* Thu Aug 01 2019 Richard W.M. Jones <rjones@redhat.com> - 1.3-38
- OCaml 4.08.1 (rc2) rebuild.
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.3-37
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Thu Jul 4 2019 Jerry James <loganjerry@gmail.com> - 1.3-36
- Rebuild for ocaml 4.08.0
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.3-35
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.3-34
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Wed Jul 11 2018 Richard W.M. Jones <rjones@redhat.com> - 1.3-33
- OCaml 4.07.0 (final) rebuild.
* Wed Jun 20 2018 Richard W.M. Jones <rjones@redhat.com> - 1.3-32
- OCaml 4.07.0-rc1 rebuild.
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.3-31
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Sat Nov 18 2017 Richard W.M. Jones <rjones@redhat.com> - 1.3-30
- OCaml 4.06.0 rebuild.
* Wed Aug 09 2017 Richard W.M. Jones <rjones@redhat.com> - 1.3-29
- OCaml 4.05.0 rebuild.