That’s tricky to answer. Technically Haxe does not even depends on opam. We can “install” the OCaml libraries in some other ways, e.g. using the Debian packages, or manually build the libraries and place them to some places. But the easiest way should still be using opam.
I guess we can even use opam 1 and make use of those opam 2 libs, by installing those opam 2 libs using non-opam methods. But again, the easiest way should still be using opam 2…
# environment setup
opam init
eval `opam env`
# install given version of the compiler
opam switch create 4.08.1
eval `opam env`
# check you got what you want
which ocaml
ocaml -version
I followed the same steps @andyli provided, but I am facing this error:
<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
┌─ The following actions failed
│ λ build conf-m4 1
│ λ build ocaml-secondary-compiler 4.08.1
│ λ build ocaml-system 4.05.0
└─
╶─ No changes have been performed
<><> ocaml-secondary-compiler.4.08.1 troubleshooting ><><><><><><><><><><><><><>
=> A failure in the middle of the build may be caused by build parallelism
(enabled by default).
Please file a bug report at https://github.com/ocaml/ocaml/issues
The packages you requested declare the following system dependencies. Please make sure they are installed before
retrying:
m4
I executed sudo apt install m4 as well but did not help.