2020/11/26

Use a specific version of ocaml in debian/ubuntu

I used the latest Debian distribution. When I compiling coccinelle, I encountered the error message unbound module Parmap. The reason is that ocaml version that is too new. It is incompatible and must be returned to version 4.02.3. So I use opam to manage the ocaml version used.


1. Inteall opam (root).

sudo apt-get install opam


2.  Initial opam (none root).

opam init --compiler 4.02.3


3. Add ocaml path to environment $PATH.

eval $(opam config env)


4. Check the version you got.

ocamlc -v


5. Install modules.

opam install parmap

opam install camlp4

  

6. When need to switch installed versions.

opam switch 4.05.0

eval $(opam config env)


7. When need to compile and switch other versions.

opam switch create 4.03.0

eval $(opam config env)



沒有留言: