Hi,
> My question is, if I set OPAMSWITCH, will I then be able to run regular
> (non-opam) ocaml build commands in the local shell in the given compiler,
> while running commands in a different shell with a different compiler?
No, it is not. But, what you are looking for is probably:
eval $(opam config env --switch 3.12.1)
This will setup the proper environment for ocaml-3.12.1 in the current
terminal (including the OPAMSWITCH variable) without changing the
"global default switch".
The previous command is equivalent to:
export OPAMSWITCH=3.12.1
eval $(opam config env)
-- Grégoire