RandomDSdevel
RandomDSdevel

Reputation: 429

Installing OPAM System-Wide?

I've made a few attempts to install OPAM system-wide via Homebrew and opam init, but I haven't gotten it to work yet. How should I go about trying this again?

Upvotes: 2

Views: 678

Answers (1)

ivg
ivg

Reputation: 35280

First of all it is not recommended to install it system wide. But if you still want, then this are the steps:

  1. sudo brew install opam # installs opam executable system-wide
  2. sudo mkdir -p /opt/opam # create a home for opam
  3. sudo opam init --root=/opt/opam --comp=4.02.1
  4. eval $(opam config env) # activate the environment
  5. ocaml # run ocaml to make sure, that everything went fine

Some footnotes: I'm expecting that you've failed on your previous attempts, because you didn't specify the compiler version and didn't install system compiler. I still suggest you to reconsider, and install opam locally. To do that you need to perform the following:

  1. brew install opam # installs opam executable system-wide
  2. opam init --comp=4.02.1
  3. eval $(opam config env) # activate the environment
  4. ocaml # run ocaml to make sure, that everything went fine

Upvotes: 5

Related Questions