1

I am trying to compile the unison source using OCAML compiler(ver 4.01.0) and GNU make 4.0. The source code is taken from the link (http://www.seas.upenn.edu/~bcpierce/unison//download/releases/unison-2.27.57/)

I extracted the tar.gz and then wrote the command "make NATIVE=false" as mentioned in the user manual (http://www.seas.upenn.edu/~bcpierce/unison/download/releases/stable/unison-manual.html) see section building unison from scratch windows.

Code starts compiling for few seconds but stops and following errors appear:

----------

File "/cygdrive/c/unison_build/unison-2.27.57/update.ml", line 1:
Error: The implementation /cygdrive/c/unison_build/unison-2.27.57/update.ml
does not match the interface update.cmi:
...
In module NameMap:
The field `split' is required but not provided
In module NameMap:
The field `choose' is required but not provided
In module NameMap:
The field `max_binding' is required but not provided
In module NameMap:
The field `min_binding' is required but not provided
In module NameMap:
The field `bindings' is required but not provided
In module NameMap:
The field `cardinal' is required but not provided
In module NameMap:
The field `partition' is required but not provided
In module NameMap:
The field `filter' is required but not provided
In module NameMap:
The field `exists' is required but not provided
In module NameMap:
The field `for_all' is required but not provided
In module NameMap:
The field `merge' is required but not provided
In module NameMap:
The field `singleton' is required but not provided
Makefile.OCaml:339: recipe for target 'update.cmo' failed
make: *** [update.cmo] Error 2
hhs_89
  • 9
  • 4

3 Answers3

3

I got the exact same error (with ocaml 3.12) and solved it by patching file update.mli as follows (4th line):

-module NameMap : Map.S with type key = Name.t
+module NameMap : MyMap.S with type key = Name.t

Note that this is a known bug (bug #585453) and I got the patch from debian package here (file 0005-Fix-build-with-OCaml-3.12.patch). The patch is valid at least for 2.27.57 and 2.32.52. In the same package you can also find a patch for Ocaml 4 it seems.

Fuujuhi
  • 313
  • 3
  • 8
1

You should compile Unison with OCaml 3.12, it will not compile with later compilers. Nate that Unison is not under active development anymore:

Unison is no longer under active development as a research project. At this point, there is no one whose job it is to add new features, fix bugs, or answer questions.

The quote is from the website.

Money Mark
  • 84
  • 5
0

This error can occur if you compiled update.ml using different versions of the OCaml compiler, you clear the _build directory and try again from the beginning.

codelion
  • 1,056
  • 1
  • 11
  • 17