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

僤鯓⒐⒋嵵緔 提交于 2019-12-13 02:23:44

问题


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

What is the exact usage of it?


回答1:


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;


来源:https://stackoverflow.com/questions/30155960/what-is-the-use-of-eval-opam-config-env

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!