let-def / grenier Goto Github PK
View Code? Open in Web Editor NEWMisc algorithms in OCaml (HyperLogLog, jump consistent hashing)
License: ISC License
Misc algorithms in OCaml (HyperLogLog, jump consistent hashing)
License: ISC License
The beta release of OCaml 4.10 is around the corner, and currently, the latest version of grenier does not support 4.10 and fails with the following error message:
+ /home/opam/.opam/4.10.0+trunk/bin/dune "build" "-p" "grenier" "-j" "71" (CWD=/home/opam/.opam/4.10.0+trunk/.opam-switch/build/grenier.0.8)
- ocamlc physh/ml_physh_set.o (exit 2)
- (cd _build/default/physh && /home/opam/.opam/4.10.0+trunk/bin/ocamlc.opt -g -ccopt -O2 -ccopt -fno-strict-aliasing -ccopt -fwrapv -ccopt -fPIC -ccopt -g -o ml_physh_set.o ml_physh_set.c)
- In file included from /home/opam/.opam/4.10.0+trunk/lib/ocaml/caml/mlvalues.h:67,
- from /home/opam/.opam/4.10.0+trunk/lib/ocaml/caml/alloc.h:24,
- from ml_physh_set.c:3:
- /home/opam/.opam/4.10.0+trunk/lib/ocaml/caml/domain_state.h:55:43: error: expected ')' before '->' token
- 55 | #define Caml_state_field(field) Caml_state->_##field
- | ^~
- /home/opam/.opam/4.10.0+trunk/lib/ocaml/caml/compatibility.h:30:25: note: in expansion of macro 'Caml_state_field'
- 30 | #define caml_young_ptr (Caml_state_field(young_ptr))
- | ^~~~~~~~~~~~~~~~
- ml_physh_set.c:9:15: note: in expansion of macro 'caml_young_ptr'
- 9 | extern value *caml_young_ptr, *caml_young_start, *caml_young_end;
- | ^~~~~~~~~~~~~~
- /home/opam/.opam/4.10.0+trunk/lib/ocaml/caml/domain_state.h:55:43: error: expected ')' before '->' token
- 55 | #define Caml_state_field(field) Caml_state->_##field
- | ^~
- /home/opam/.opam/4.10.0+trunk/lib/ocaml/caml/compatibility.h:27:29: note: in expansion of macro 'Caml_state_field'
- 27 | #define caml_stat_heap_wsz (Caml_state_field(stat_heap_wsz))
- | ^~~~~~~~~~~~~~~~
- ml_physh_set.c:14:6: note: in expansion of macro 'caml_stat_heap_wsz'
- 14 | caml_stat_heap_wsz,
- | ^~~~~~~~~~~~~~~~~~
- In file included from /home/opam/.opam/4.10.0+trunk/lib/ocaml/caml/alloc.h:24,
- from ml_physh_set.c:3:
- ml_physh_set.c: In function 'ml_physh_set_alloc':
- ml_physh_set.c:72:25: error: 'caml_stat_compactions' undeclared (first use in this function); did you mean 'caml_stat_major_collections'?
- 72 | Field(v, 3) = Val_int(caml_stat_compactions);
- | ^~~~~~~~~~~~~~~~~~~~~
- /home/opam/.opam/4.10.0+trunk/lib/ocaml/caml/mlvalues.h:75:47: note: in definition of macro 'Val_long'
- 75 | #define Val_long(x) ((intnat) (((uintnat)(x) << 1)) + 1)
- | ^
- ml_physh_set.c:72:17: note: in expansion of macro 'Val_int'
- 72 | Field(v, 3) = Val_int(caml_stat_compactions);
- | ^~~~~~~
- ml_physh_set.c:72:25: note: each undeclared identifier is reported only once for each function it appears in
- 72 | Field(v, 3) = Val_int(caml_stat_compactions);
- | ^~~~~~~~~~~~~~~~~~~~~
- /home/opam/.opam/4.10.0+trunk/lib/ocaml/caml/mlvalues.h:75:47: note: in definition of macro 'Val_long'
- 75 | #define Val_long(x) ((intnat) (((uintnat)(x) << 1)) + 1)
- | ^
- ml_physh_set.c:72:17: note: in expansion of macro 'Val_int'
- 72 | Field(v, 3) = Val_int(caml_stat_compactions);
- | ^~~~~~~
- ml_physh_set.c: In function 't_major_is_valid':
- ml_physh_set.c:132:35: error: 'caml_stat_compactions' undeclared (first use in this function); did you mean 'caml_stat_major_collections'?
- 132 | return (Int_val(Field(t, 3)) == caml_stat_compactions);
- | ^~~~~~~~~~~~~~~~~~~~~
- | caml_stat_major_collections
- In file included from /home/opam/.opam/4.10.0+trunk/lib/ocaml/caml/alloc.h:24,
- from ml_physh_set.c:3:
- ml_physh_set.c: In function 't_major_set_valid':
- ml_physh_set.c:137:25: error: 'caml_stat_compactions' undeclared (first use in this function); did you mean 'caml_stat_major_collections'?
- 137 | Field(t, 3) = Val_int(caml_stat_compactions);
- | ^~~~~~~~~~~~~~~~~~~~~
- /home/opam/.opam/4.10.0+trunk/lib/ocaml/caml/mlvalues.h:75:47: note: in definition of macro 'Val_long'
- 75 | #define Val_long(x) ((intnat) (((uintnat)(x) << 1)) + 1)
- | ^
- ml_physh_set.c:137:17: note: in expansion of macro 'Val_int'
- 137 | Field(t, 3) = Val_int(caml_stat_compactions);
- | ^~~~~~~
- ocamlc physh/ml_physh_map.o (exit 2)
- (cd _build/default/physh && /home/opam/.opam/4.10.0+trunk/bin/ocamlc.opt -g -ccopt -O2 -ccopt -fno-strict-aliasing -ccopt -fwrapv -ccopt -fPIC -ccopt -g -o ml_physh_map.o ml_physh_map.c)
- In file included from /home/opam/.opam/4.10.0+trunk/lib/ocaml/caml/mlvalues.h:67,
- from /home/opam/.opam/4.10.0+trunk/lib/ocaml/caml/alloc.h:24,
- from ml_physh_map.c:3:
- /home/opam/.opam/4.10.0+trunk/lib/ocaml/caml/domain_state.h:55:43: error: expected ')' before '->' token
- 55 | #define Caml_state_field(field) Caml_state->_##field
- | ^~
- /home/opam/.opam/4.10.0+trunk/lib/ocaml/caml/compatibility.h:30:25: note: in expansion of macro 'Caml_state_field'
- 30 | #define caml_young_ptr (Caml_state_field(young_ptr))
- | ^~~~~~~~~~~~~~~~
- ml_physh_map.c:10:15: note: in expansion of macro 'caml_young_ptr'
- 10 | extern value *caml_young_ptr, *caml_young_start, *caml_young_end;
- | ^~~~~~~~~~~~~~
- /home/opam/.opam/4.10.0+trunk/lib/ocaml/caml/domain_state.h:55:43: error: expected ')' before '->' token
- 55 | #define Caml_state_field(field) Caml_state->_##field
- | ^~
- /home/opam/.opam/4.10.0+trunk/lib/ocaml/caml/compatibility.h:27:29: note: in expansion of macro 'Caml_state_field'
- 27 | #define caml_stat_heap_wsz (Caml_state_field(stat_heap_wsz))
- | ^~~~~~~~~~~~~~~~
- ml_physh_map.c:15:6: note: in expansion of macro 'caml_stat_heap_wsz'
- 15 | caml_stat_heap_wsz,
- | ^~~~~~~~~~~~~~~~~~
- In file included from /home/opam/.opam/4.10.0+trunk/lib/ocaml/caml/alloc.h:24,
- from ml_physh_map.c:3:
- ml_physh_map.c: In function 'ml_physh_map_alloc':
- ml_physh_map.c:75:25: error: 'caml_stat_compactions' undeclared (first use in this function); did you mean 'caml_stat_major_collections'?
- 75 | Field(v, 3) = Val_int(caml_stat_compactions);
- | ^~~~~~~~~~~~~~~~~~~~~
- /home/opam/.opam/4.10.0+trunk/lib/ocaml/caml/mlvalues.h:79:20: note: in expansion of macro 'Val_long'
- 79 | #define Val_int(x) Val_long(x)
- | ^~~~~~~~
- ml_physh_map.c:75:17: note: in expansion of macro 'Val_int'
- 75 | Field(v, 3) = Val_int(caml_stat_compactions);
- | ^~~~~~~
- ml_physh_map.c:75:25: note: each undeclared identifier is reported only once for each function it appears in
- 75 | Field(v, 3) = Val_int(caml_stat_compactions);
- | ^~~~~~~~~~~~~~~~~~~~~
- /home/opam/.opam/4.10.0+trunk/lib/ocaml/caml/mlvalues.h:79:20: note: in expansion of macro 'Val_long'
- 79 | #define Val_int(x) Val_long(x)
- | ^~~~~~~~
- ml_physh_map.c:75:17: note: in expansion of macro 'Val_int'
- 75 | Field(v, 3) = Val_int(caml_stat_compactions);
- | ^~~~~~~
- ml_physh_map.c: In function 't_major_is_valid':
- ml_physh_map.c:135:35: error: 'caml_stat_compactions' undeclared (first use in this function); did you mean 'caml_stat_major_collections'?
- 135 | return (Int_val(Field(t, 3)) == caml_stat_compactions);
- | ^~~~~~~~~~~~~~~~~~~~~
- | caml_stat_major_collections
- In file included from /home/opam/.opam/4.10.0+trunk/lib/ocaml/caml/alloc.h:24,
- from ml_physh_map.c:3:
- ml_physh_map.c: In function 't_major_set_valid':
- ml_physh_map.c:140:25: error: 'caml_stat_compactions' undeclared (first use in this function); did you mean 'caml_stat_major_collections'?
- 140 | Field(t, 3) = Val_int(caml_stat_compactions);
- | ^~~~~~~~~~~~~~~~~~~~~
- /home/opam/.opam/4.10.0+trunk/lib/ocaml/caml/mlvalues.h:75:47: note: in definition of macro 'Val_long'
- 75 | #define Val_long(x) ((intnat) (((uintnat)(x) << 1)) + 1)
- | ^
- ml_physh_map.c:140:17: note: in expansion of macro 'Val_int'
- 140 | Field(t, 3) = Val_int(caml_stat_compactions);
- | ^~~~~~~
Judging from the error message, painless support will require ocaml/ocaml#9202
I'm using HyperLogLog in a long-running program and would like to save its state to a file, so it would be useful if the module could provide conversion functions to a visible type or make the Hll.t
type visible.
via opam install
=-=- Processing actions -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 🐫
[ERROR] The compilation of grenier failed at "make install".
Processing 1/1: [grenier: ocamlfind remove]
#=== ERROR while installing grenier.0.1 =======================================#
# opam-version 1.2.2
# os darwin
# command make install
# path /Users/isaachodes/.opam/system/build/grenier.0.1
# compiler system (4.02.3)
# exit-code 2
# env-file /Users/isaachodes/.opam/system/build/grenier.0.1/grenier-68931-ad8886.env
# stdout-file /Users/isaachodes/.opam/system/build/grenier.0.1/grenier-68931-ad8886.out
# stderr-file /Users/isaachodes/.opam/system/build/grenier.0.1/grenier-68931-ad8886.err
### stdout ###
# [...]
# make[2]: `doubledouble.cma' is up to date.
# make[2]: `doubledouble.cmxa' is up to date.
# make[1]: Nothing to be done for `all'.
# make[2]: `baltree.cma' is up to date.
# make[2]: `baltree.cmxa' is up to date.
# make[2]: `trope.cma' is up to date.
# make[2]: `trope.cmxa' is up to date.
#
# Installing library with ocamlfind
# ocamlfind install grenier META hll/hll.mli hll/hll.cmi hll/hll_consts.cmi hll/hll.a hll/hll.cma hll/hll.cmxa jmphash/jmphash.mli jmphash/jmphash.cmi jmphash/jmphash.a jmphash/jmphash.cma jmphash/jmphash.cmxa pcg/pcg.mli pcg/pcg.cmi pcg/pcg.a pcg/pcg.cma pcg/pcg.cmxa orderme/order_list.mli orderme/order_indir.mli orderme/order_managed.mli orderme/order_list.cmi orderme/order_indir.cmi orderme/order_managed.cmi orderme/orderme.a orderme/orderme.cma orderme/orderme.cmxa orderme/dllorderme_stubs.so orderme/liborderme_stubs.a doubledouble/doubledouble.mli doubledouble/doubledouble.cmi doubledouble/doubledouble.cmo doubledouble/doubledouble.cmx physh/physh.mli physh/physh.cmi physh/physh.a physh/physh.cma physh/physh.cmxa physh/lib_physh_stubs.a physh/dll_physh_stubs.so baltree/baltree.a baltree/baltree.cma baltree/baltree.cmxa baltree/bt1.mli baltree/bt1.cmi baltree/bt2.mli baltree/bt2.cmi baltree/mbt.mli baltree/mbt.cmi trope/trope.a trope/trope.cma trope/trope.cmxa trope/trope.mli trope/trope.cmi
### stderr ###
# [...]
# Installed /Users/isaachodes/.opam/system/lib/grenier/physh.cma
# Installed /Users/isaachodes/.opam/system/lib/grenier/physh.a
# Installed /Users/isaachodes/.opam/system/lib/grenier/physh.cmi
# Installed /Users/isaachodes/.opam/system/lib/grenier/physh.mli
# Installed /Users/isaachodes/.opam/system/lib/grenier/doubledouble.cmx
# Installed /Users/isaachodes/.opam/system/lib/grenier/doubledouble.cmo
# Installed /Users/isaachodes/.opam/system/lib/grenier/doubledouble.cmi
# Installed /Users/isaachodes/.opam/system/lib/grenier/doubledouble.mli
# ocamlfind: orderme/liborderme_stubs.a: No such file or directory
# make: *** [libinstall] Error 2
There are a few errors in balmap:
File "balmap/map.ml", lines 12-371, characters 0-3:
12 | struct
13 | type key = O.t
14 |
15 | type 'a t = (O.t, 'a) balmap
16 |
...
368 |
369 | let of_seq seq =
370 | add_seq seq empty
371 | end
Error: Signature mismatch:
...
The value `add_to_list' is required but not provided
File "map.mli", line 88, characters 4-56: Expected declaration
The value `to_list' is required but not provided
File "map.mli", line 333, characters 4-41: Expected declaration
The value `of_list' is required but not provided
File "map.mli", line 337, characters 4-41: Expected declaration
and physh:
In file included from alloc.h:21,
from ml_physh_map.c:6:
ml_physh_map.c: In function ‘ml_physh_map_alloc’:
ml_physh_map.c:64:25: error: ‘caml_stat_minor_collections’ undeclared (first use in this function); did you mean ‘caml_stat_major_collections’?
64 | Field(v, 0) = Val_int(caml_stat_minor_collections);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.