Skip to content

Commit 83937d3

Browse files
committed
[MLCUDDIDL] supports 5.0 by removing modules
1 parent 56e7d9d commit 83937d3

File tree

2 files changed

+112
-1
lines changed

2 files changed

+112
-1
lines changed
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
commit a584ab0e479f6a63b5a2fdac073ee8cb70fcb730
2+
Author: François Bobot <[email protected]>
3+
Date: Mon Sep 1 16:04:44 2025 +0200
4+
5+
Remove vdd and others which depends too much on the runtime
6+
7+
diff --git a/Makefile b/Makefile
8+
index ecfa494..66e4d9c 100644
9+
--- a/Makefile
10+
+++ b/Makefile
11+
@@ -40,9 +40,9 @@ LDFLAGS = -L$(CAMLIDL_DIR) -lcamlidl
12+
# Files
13+
#---------------------------------------
14+
15+
-IDLMODULES = hash cache memo man bdd vdd custom add
16+
+IDLMODULES = hash cache memo man bdd
17+
18+
-MLMODULES = hash cache memo man bdd vdd custom weakke pWeakke mtbdd mtbddc user mapleaf add
19+
+MLMODULES = hash cache memo man bdd
20+
21+
CUDDAUX_C = $(wildcard cuddaux*.c)
22+
CCMODULES = $(CUDDAUX_C:%.c=%) $(IDLMODULES:%=%_caml) cudd_caml
23+
diff --git a/configure b/configure
24+
index ab42604..5577c32 100755
25+
--- a/configure
26+
+++ b/configure
27+
@@ -114,8 +114,8 @@ find_ocmd OCAMLC ocamlc;
28+
29+
overs=$(${OCAMLC} -version);
30+
case "${overs}" in
31+
- [1-3].* | 4.0[1-3].* | [5-9]* | [1-9][0-9]*)
32+
- err "OCaml version found is ${overs}: OCaml >= 4.04 & < 5 is required.";;
33+
+ [1-3].* | 4.0[1-3].* | [1-9][0-9]*)
34+
+ err "OCaml version found is ${overs}: OCaml >= 4.04.";;
35+
*)
36+
:;;
37+
esac
38+
diff --git a/cudd_caml.c b/cudd_caml.c
39+
index 662b91d..6bb5846 100644
40+
--- a/cudd_caml.c
41+
+++ b/cudd_caml.c
42+
@@ -1080,7 +1080,7 @@ value camlidl_cudd_avdd_iter_cube(value _v_closure, value _v_no)
43+
_v_val = type.value;
44+
}
45+
else {
46+
- _v_val = copy_double(val);
47+
+ _v_val = caml_copy_double(val);
48+
}
49+
caml_callback2(_v_closure,_v_array,_v_val);
50+
}
51+
@@ -1604,8 +1604,8 @@ DdNode* camlidl_cudd_custom_op2(DdManager* dd, struct op2* op,
52+
_v_G = cuddauxCamlV(G);
53+
}
54+
else {
55+
- _v_F = copy_double(cuddV(F));
56+
- _v_G = copy_double(cuddV(G));
57+
+ _v_F = caml_copy_double(cuddV(F));
58+
+ _v_G = caml_copy_double(cuddV(G));
59+
}
60+
_v_val = caml_callback2_exn(op->closure2, _v_F, _v_G);
61+
res = camlidl_cudd_custom_result(&op->common2,_v_val);
62+
@@ -1654,9 +1654,9 @@ DdNode* camlidl_cudd_custom_op3(DdManager* dd, struct op3* op, DdNode* F, DdNode
63+
_v_H = cuddauxCamlV(H);
64+
}
65+
else {
66+
- _v_F = copy_double(cuddV(F));
67+
- _v_G = copy_double(cuddV(G));
68+
- _v_H = copy_double(cuddV(H));
69+
+ _v_F = caml_copy_double(cuddV(F));
70+
+ _v_G = caml_copy_double(cuddV(G));
71+
+ _v_H = caml_copy_double(cuddV(H));
72+
}
73+
_v_val = caml_callback3_exn(op->closure3,_v_F,_v_G,_v_H);
74+
res = camlidl_cudd_custom_result(&op->common3,_v_val);
75+
@@ -1707,8 +1707,8 @@ DdNode* camlidl_cudd_custom_test2(DdManager* dd, struct test2* op, DdNode* F, Dd
76+
_v_G = cuddauxCamlV(G);
77+
}
78+
else {
79+
- _v_F = copy_double(cuddV(F));
80+
- _v_G = copy_double(cuddV(G));
81+
+ _v_F = caml_copy_double(cuddV(F));
82+
+ _v_G = caml_copy_double(cuddV(G));
83+
}
84+
_v_val = caml_callback2_exn(op->closure2t, _v_F, _v_G);
85+
res = camlidl_cudd_custom_resultbool(&op->common2t,_v_val);
86+
diff --git a/cuddaux.h b/cuddaux.h
87+
index 71f9898..4df5615 100644
88+
--- a/cuddaux.h
89+
+++ b/cuddaux.h
90+
@@ -323,7 +323,7 @@ static inline DdNode* cuddauxUniqueType(struct CuddauxMan* man, CuddauxType* typ
91+
}
92+
static inline value Val_type(bool caml, CuddauxType* type)
93+
{
94+
- return caml ? type->value : copy_double(type->dbl);
95+
+ return caml ? type->value : caml_copy_double(type->dbl);
96+
}
97+
static inline value Val_DdNode(bool caml, DdNode* node)
98+
{

packages/mlcuddidl/mlcuddidl.3.0.8/opam

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,28 @@ install: [
1414
[make "install"]
1515
]
1616
depends: [
17-
"ocaml" {>= "4.04" & < "5"}
17+
"ocaml" {>= "4.04"}
1818
"ocamlfind" {build}
1919
"camlidl"
2020
"ocamlbuild" {build}
2121
"conf-m4" {build}
2222
]
23+
patches : [
24+
"compilation_ocaml5.diff" { ocaml:version >= "5" }
25+
]
2326
synopsis: "OCaml interface to the CUDD BDD library"
27+
post-messages: [
28+
"For supporting ocaml 5 some modules are removed compared to the release"
29+
{ ocaml:version >= "5" }
30+
]
31+
2432
available: [ os != "win32" & os != "cygwin" ]
2533
url {
2634
src: "https://framagit.org/nberth/mlcuddidl/-/archive/3.0.8/mlcuddidl-3.0.8.tar.gz"
2735
checksum: "sha512=b039fd1162bef7460bc7cf378a000d35730d5327ec4648dfe7eef88c148fb6812764bf32a1801353a09f59c9bcd6ea386f77e1896e48b53163d4c081fed5a80c"
2836
}
37+
extra-files: [
38+
["compilation_ocaml5.diff"
39+
"sha256=de3fc5fbb81a6a477d6c2b29e133c3228dfb572bd1d9950d84dfd614221004c5"
40+
]
41+
]

0 commit comments

Comments
 (0)