I've been using
  eval $(opam config env)
myself. Maybe this would be less error-prone to document?
(Is it less portable to other shells?)

On Sun, Mar 6, 2016 at 6:23 AM, Hendrik Boom <hendrik@topoi.pooq.com> wrote:
On Sun, Mar 06, 2016 at 10:22:21AM +0000, Mick Sulley wrote:
> Hi,
>
> Totally new to OCaml.  I am trying to install OCaml version 4.02 or
> higher on a Raspberry Pi running Raspbian.  I have OPAM and OCaml
> 4.01 installed but if I enter
> opam switch 4.02.1
> I get
> pi@raspberrypi:~/geneweb $ opam switch 4.02.1
> # To setup the new switch in the current shell, you need to run:
> eval `opam config env`
>

I've just struggled with this stuff on a 32-bit x86 Linux.
The opam switch command alters the dotfiles (things like .bashrd)
so that the next time you log in or start a shell, the environment
variables are set to the new switch.

opam config env

generates the list of command you saw below:

> I then try -
> pi@raspberrypi:~/geneweb $ eval 'opam config env'
> CAML_LD_LIBRARY_PATH="/home/pi/.opam/4.02.1/lib/stublibs"; export
> CAML_LD_LIBRARY_PATH;
> MANPATH=":/home/pi/.opam/4.02.1/man"; export MANPATH;
> PERL5LIB="/home/pi/.opam/4.02.1/lib/perl5"; export PERL5LIB;
> OCAML_TOPLEVEL_PATH="/home/pi/.opam/4.02.1/lib/toplevel"; export
> OCAML_TOPLEVEL_PATH;
> PATH="/home/pi/.opam/4.02.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games";
> export PATH;

The eval command

> eval `opam config env`

is *supposed* to get them executed in the present shell.
If it doesn't work, your eval isn't the same as mine, and I suggest you
log in again, or start a new shell.

-- hendrik

--
Caml-list mailing list.  Subscription management and archives:
https://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs