How can I install a specific version of ocaml compiler (and compatible packages) using opam (or another package manger)?
I took a quick look through the opam documentation, but I don't find a relevant information.
I need ocaml compiler (preferably the native code compiler) to build unison, a software for file synchronization. I need to build unison on two machines using the same version of ocaml, or otherwise unison emits an error and aborts its duty (yiiii!).
I tried building ocaml version 4.04.0 from a tar ball and then using it for building unison, but on one of the machine the build of unison failed with the error message,
make[1]: Entering directory '/home/norio/Downloads/unison/unison-2.48.4_expand/src'
ocamlc -o mkProjectInfo unix.cma str.cma mkProjectInfo.ml
File "mkProjectInfo.ml", line 1:
Error: Error while linking /home/norio/Downloads/unison/ocaml_for_unison/lib/ocaml/unix.cma(Unix):
The external function `unix_has_symlink' is not available
if [ -f `which etags` ]; then \
etags *.mli */*.mli *.ml */*.ml */*.m *.c */*.c *.txt \
; fi
make[1]: Leaving directory '/home/norio/Downloads/unison/unison-2.48.4_expand/src'
I don't want to set off for the quest of unix_has_symlink
function and devote myself for the exploration of the swamp of library dependencies where many developers had fallen before the civilization came and package managers were invented.
Is there anything like,
opam install ocamlc-4.04
and opam install all-packages
?
Addendum
The error message about unix_has_symlink
was observed on a machine running Linux Mint 18 Cinnamon 64 bit. Is this function a part of some unix/linux library, rather than ocaml package?
unix_has_symlink
is a pretty standard Unix thing. – Asokaunix_has_symlink
is new and was not in older versions of OCaml (not OCaml 4.01.0). So you could install an old version if this doesn't get resolved. :/ – Asokaopam init --compiler=4.04.0
should install OCaml 4.04.0 for you. – Redfordopam switch create 4.06.0
? Should switch and install all at once. – Pahangocaml-variants.4.07.1+flambda
but it doesn't show up:[ERROR] No compiler matching
ocaml-variants.4.07.1+flambda' found, useopam switch list-available' to see what is available, or use
--packages' to select packages explicitly.` but I've installed it before. What is going on? – Pahang