I am using macos monterey 12.6 on a mac mini m1. I use the ocaml language quite a bit on linux mint, and was trying to get it working on the m1.
My programs (from linux) use package zarith (which is a multiple precision package). brew only allows an install of ocaml-zarith, not zarith. I installed opam with brew, and tried
opam install zarith
which gives the error:
#=== ERROR while compiling zarith.1.12 ========================================#
context 2.1.3 | macos/arm64 | ocaml.4.14.0 | https://opam.ocaml.org#efe0e534
path ~/.opam/default/.opam-switch/build/zarith.1.12
command ~/.opam/opam-init/hooks/sandbox.sh build make
exit-code 2
env-file ~/.opam/log/zarith-52113-b5f72c.env
output-file ~/.opam/log/zarith-52113-b5f72c.out
output
project.mak:150: depend: No such file or directory
(echo “let”; grep “version” META | head -1) > zarith_version.ml
ocamldep -native zarith_version.ml z.ml q.ml big_int_Z.ml z.mli q.mli big_int_Z.mli > depend
File “zarith_version.ml”, line 2, characters 0-1:
2 | version = “1.12”
^
Error: Illegal character (\027)
make: *** [depend] Error 2
===================================================================
The command
opam list
does not show ocaml-zarith as a package, and it is not found when I try
ocamlfind ocamlopt -o rho_z -linkpkg -package ocaml-zarith rho_z.ml
and zarith is not found trying
ocamlfind ocamlopt -o rho_z -linkpkg -package zarith rho_z.ml (note: this works on linux if zarith is installed)
So I am not clear how to use ocaml-zarith for zarith, since I cannot install zarith with opam.