caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Grégoire Henry" <gregoire.henry@ocamlpro.com>
To: Yotam Barnoy <yotambarnoy@gmail.com>
Cc: OCaml Mailing List <caml-list@inria.fr>
Subject: Re: [Caml-list] opam local switch
Date: Fri, 19 Sep 2014 00:28:57 +0200	[thread overview]
Message-ID: <20140918222857.GA12277@mlqds.hnr.gr> (raw)
In-Reply-To: <CAN6ygOkjAOWPcZyFnUkfAKxNWM5-Bx2W+W8t+RXOdHYVe=2pdQ@mail.gmail.com>

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

  reply	other threads:[~2014-09-18 22:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-18 21:20 Yotam Barnoy
2014-09-18 21:24 ` Anil Madhavapeddy
2014-09-18 21:50   ` Yotam Barnoy
2014-09-18 22:28     ` Grégoire Henry [this message]
2014-09-18 22:29       ` Yotam Barnoy
2014-09-19  7:21 ` Louis Gesbert
2014-09-19  7:30   ` Gabriel Scherer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140918222857.GA12277@mlqds.hnr.gr \
    --to=gregoire.henry@ocamlpro.com \
    --cc=caml-list@inria.fr \
    --cc=yotambarnoy@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).