What is the use of eval `opam config env`?

2019-08-06 08:06发布

After the installation of opam, it asks to do eval `opam config env`.

What is the exact usage of it?

标签: ocaml
1条回答
家丑人穷心不美
2楼-- · 2019-08-06 08:55

It will setup environment variables, that are necessary for the toolchain to work properly, e.g., CAML_LD_LIBRARY_PATH.

It is like activating virtual environment in Python's virtualenv.

If you want to see what variables are set exactly, the you can run it without the eval part:

$ opam config env
CAML_LD_LIBRARY_PATH="/home/ivg/.opam/4.02.1/lib/stublibs"; export CAML_LD_LIBRARY_PATH;
MANPATH=":/home/ivg/.opam/4.02.1/man"; export MANPATH;
PERL5LIB="/home/ivg/.opam/4.02.1/lib/perl5:"; export PERL5LIB;
OCAML_TOPLEVEL_PATH="/home/ivg/.opam/4.02.1/lib/toplevel"; export OCAML_TOPLEVEL_PATH;
PATH="/home/ivg/.opam/4.02.1/bin:/home/ivg/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"; export PATH;
查看更多
登录 后发表回答