libmojave ("lm") is the OCaml support library that grew out of the MetaPRL proof assistant, extracted as a standalone library in 2003. It provides an extended standard library, portable Unix/system bindings with C stubs, and a suite of data-structure and utility modules that predate (and in places anticipate) much of what later landed in the OCaml ecosystem. The same library underpins the OMake build system, which vendors a copy of it.
Status: archived in 2017; refreshed in 2026 (see below). LGPL-2.1. Unlike its sibling MetaPRL, libmojave is camlp-free and structurally simple — a modern-OCaml/dune port is feasible and is the natural "this lineage still compiles" demonstrator. Of historical interest as a snapshot of large-scale OCaml systems practice from the 2000s.
Since October 2026 libmojave builds again, on OCaml 4.14 and 5.4. CI covers Linux (both versions) and Windows (MinGW and MSVC, OCaml 5.4).
Releases are in opam:
opam install libmojaveTo build from a checkout:
dune build # the library: _build/default/lib/lm.cma, lm.cmxa
dune build --profile threads # the same, with system threads (as MetaPRL uses)
dune runtest # the pinning tests in test/The OMake build still works (omake, with OMake 0.10.7 from opam) and
produces the same 108 modules. It stays because MetaPRL builds libmojave
as an OMake subdirectory. Do not mix the two in one tree: an OMake build
writes stdlib/lm_thread_{core,pool}.ml, and dune then refuses to build
until they are removed.
The tests in test/ are of two kinds. A pin prints a function's
answers on chosen inputs. A model check runs the module against an
independent oracle (a list or brute-force model, an Earley recognizer,
native ints) on cases from a fixed generator and prints one line per
operation: how many of N cases disagree, and the first. Either way the
.expected file is the output as generated from the code, never typed,
so any change shows up as a diff, and a fix shows up as a change to an
expected file. The filename and glob tests have separate expected files
for Windows. Behaviour a test records that may be a bug is listed in
CHANGES.md, with the defects fixed so far.
| test | kind | modules |
|---|---|---|
test_arg.ml |
pin | Lm_arg |
test_arg_fold.ml |
pin | Lm_arg |
test_array_util.ml |
pin | Lm_array_util |
test_attribute.ml |
pin | Lm_attribute |
test_big_int.ml |
model | Lm_big_int, Lm_num |
test_bitmatrix.ml |
model | Lm_bitmatrix |
test_channel.ml |
pin | Lm_channel |
test_channel_rest.ml |
pin | Lm_channel, Lm_location |
test_config.ml |
pin | Lm_config |
test_cstubs.ml |
pin | Lm_rusage |
test_ctype.ml |
model | Lm_ctype |
test_cycle_dag.ml |
model | Lm_cycle_dag |
test_db.ml |
model | Lm_db |
test_debug.ml |
pin | Lm_debug |
test_digraph.ml |
model | Lm_digraph |
test_dlist.ml |
model | Lm_dlist |
test_field_table.ml |
model | Lm_field_table, Lm_symbol |
test_file_util.ml |
pin | Lm_file_util |
test_filename_util.ml |
pin | Lm_filename_util |
test_flags.ml |
pin | Lm_flags |
test_fmarshal.ml |
pin | Lm_fmarshal, Lm_rawfloat, Lm_rawint |
test_format_model.ml |
pin | Lm_format |
test_glob.ml |
pin | Lm_glob |
test_glob_rest.ml |
pin | Lm_glob, Lm_lexer |
test_graph.ml |
model | Lm_graph |
test_graph_dfs.ml |
model | Lm_graph |
test_hash.ml |
pin | Lm_hash |
test_hash_cons.ml |
model | Lm_hash |
test_hashtbl_util.ml |
model | Lm_hashtbl_util |
test_imp_dag.ml |
pin | Lm_dag_sig, Lm_imp_dag |
test_index.ml |
pin | Lm_index |
test_index_model.ml |
model | Lm_index |
test_inet.ml |
pin | Lm_inet |
test_int_set.ml |
pin | Lm_int_set |
test_interval_set.ml |
model | Lm_interval_set |
test_large_array.ml |
model | Lm_large_array, Lm_large_array_weak |
test_lexer.ml |
pin | Lm_channel, Lm_lexer, Lm_printf |
test_lexer_anchors.ml |
model | Lm_channel, Lm_lexer, Lm_printf |
test_lexer_args.ml |
pin | Lm_channel, Lm_lexer, Lm_printf |
test_lexer_eof.ml |
model | Lm_channel, Lm_lexer, Lm_printf |
test_lexer_model.ml |
model | Lm_channel, Lm_lexer, Lm_printf |
test_lexer_search.ml |
model | Lm_channel, Lm_lexer, Lm_printf |
test_linear_set.ml |
model | Lm_array_linear_set, Lm_array_util, Lm_linear_set_sig, Lm_splay_linear_set |
test_linear_set_compose.ml |
model | Lm_array_linear_set, Lm_array_util, Lm_linear_set_sig, Lm_splay_linear_set |
test_list_util.ml |
pin | Lm_list_util |
test_listbuf.ml |
model | Lm_listbuf |
test_location.ml |
pin | Lm_location, Lm_printf, Lm_symbol |
test_loop.ml |
model | Lm_loop, Lm_printf, Lm_symbol, Lm_trace |
test_marshal_buf.ml |
pin | Lm_marshal_buf, Lm_marshal_sig |
test_min_sets.ml |
model | Lm_hash_set, Lm_set, Lm_set_sig, Lm_small_set, Lm_splay_set |
test_num.ml |
pin | Lm_num |
test_num_model.ml |
model | Lm_num |
test_num_rest.ml |
pin | Lm_big_int, Lm_num |
test_os_small.ml |
pin | Lm_fs_case_sensitive, Lm_id, Lm_nocompare, Lm_unix_util |
test_parse_id.ml |
pin | Lm_parse_id |
test_parser.ml |
pin | Lm_location, Lm_parser, Lm_printf, Lm_symbol |
test_parser_model.ml |
model | Lm_location, Lm_parser, Lm_printf |
test_parser_prec.ml |
model | Lm_location, Lm_parser, Lm_printf |
test_position.ml |
pin | Lm_location, Lm_position, Lm_printf, Lm_symbol |
test_print_utils.ml |
pin | Lm_format_util, Lm_print_util, Lm_printf, Lm_symbol |
test_printf.ml |
pin | Lm_printf |
test_printf_model.ml |
pin | Lm_format, Lm_rprintf |
test_printf_rbuffer.ml |
pin | Lm_printf, Lm_printf_rbuffer, Lm_rformat |
test_printf_rest.ml |
pin | Lm_printf |
test_rawfloat_model.ml |
pin | Lm_rawfloat, Lm_rawint |
test_rawint_model.ml |
model | Lm_fmarshal, Lm_rawint |
test_rformat.ml |
pin | Lm_num, Lm_rformat, Lm_rformat_text |
test_rformat_backends.ml |
pin | Lm_rformat, Lm_rformat_html, Lm_rformat_tex |
test_rprintf.ml |
pin | Lm_ref_util, Lm_rformat, Lm_rprintf |
test_serial_map.ml |
model | Lm_serial_map |
test_set_map.ml |
pin | Lm_map, Lm_set |
test_splay.ml |
pin | Lm_rformat_raw, Lm_splay, Lm_thread_util |
test_splay_table.ml |
pin | Lm_printf, Lm_splay_table |
test_string_hash.ml |
model | Lm_string_hash |
test_string_model.ml |
model | Lm_string_util |
test_string_rest.ml |
pin | Lm_string_util |
test_string_set.ml |
pin | Lm_string_set |
test_string_util.ml |
pin | Lm_string_util |
test_symbol.ml |
pin | Lm_symbol |
test_symbol_hash.ml |
model | Lm_int_util, Lm_symbol, Lm_symbol_hash |
test_symbol_hash_model.ml |
pin | Lm_symbol_hash |
test_symbol_matrix.ml |
pin | Lm_symbol, Lm_symbol_matrix |
test_symbol_model.ml |
pin | Lm_printf, Lm_symbol, Lm_symbol_hash |
test_table_compose.ml |
model | Lm_printf, Lm_splay_table |
test_thread.ml |
pin | Lm_thread |
test_thread_event.ml |
pin | Lm_printf, Lm_thread, Lm_thread_event |
test_thread_event_null.ml |
pin | Lm_thread, Lm_thread_event |
test_thread_pool.ml |
pin | Lm_thread_pool |
test_thread_pool_null.ml |
pin | Lm_thread_pool |
test_thread_shell.ml |
pin | Lm_thread_shell |
test_trace.ml |
pin | Lm_printf, Lm_trace |
91 test files: 33 model checks, 58 pins.
Known gaps:
Lm_dll(the dynamic-loading foreign-function runtime) is not built. Its C side relies on redirectingcaml_local_roots, which no longer works on OCaml 5.Lm_parseraccepts only when the start production consumes the end-of-input token itself (for exampleprog -> e $eof).
stdlib/,util/— the extended standard library and data-structure / utility modules.unix/,system/— portable Unix and system bindings.cutil/— the C stubs backing the system bindings.lib/,config/— the dune build of the library, and its C configuration (the same checks OMake's configure step makes).test/— the pinning tests.
GNU Lesser General Public License, version 2.1. See
LICENSE.libmojave for the libmojave-specific terms
(including the OpenSSL / OCaml-runtime linking exceptions) and
LICENSE.txt for the full LGPL-2.1 text.