不认识opam安装了ocamlfind


0

我想跑 make 涉及依赖 ocamlfind 但是当我尝试安装它时,它给了我循环依赖和依赖 ocaml-base-nox

我发现我可以得到 ocaml-findliblibfindlib-ocaml 它们相互依赖,只需一个命令即可同时安装: sudo apt install ocaml-findlib ocaml-findlib libfindlib-ocaml ocaml-base-nox-4.01.0 但是,剩余的依赖性返回 Package 'ocaml-base-nox-4.01.0' has no installation candidate。它确实提到了几个包,显然:

Package ocaml-base-nox-4.01.0 is a virtual package provided by:
  ocaml-base-nox 4.01.0-3ubuntu3.1 [Not candidate version]
  ocaml-base-nox 4.01.0-3ubuntu3 [Not candidate version]

有助于在安装该软件包方面取得进展的答案可能会有所帮助。否则,一个揭示我如何得到认识的 opam 安装实例可能有帮助。如您所见,该安装实际上有效:

vagrant@vagrant-ubuntu-trusty-64:~/projectfolder$ opam list
# Installed packages for system:
base-bigarray   base  Bigarray library distributed with the OCaml compiler
base-threads    base  Threads library distributed with the OCaml compiler
base-unix       base  Unix library distributed with the OCaml compiler
conf-m4            1  Virtual package relying on m4
ocamlfind      1.7.3  A library manager for OCaml

如您所见,我能够通过opam成功安装ocamlfind。 有趣的是,我的make命令似乎无法识别 ocamlfind 我在安装时添加到环境中 opam

/path/to/some/folder/which/is/super/secret -O2 -d acommand file.f
[Error] Critical: Error starting ocamlopt process: Cannot run program
"ocamlfind" (in directory
"/path/to/some/folder/."): error=2, No such file
or directory (Cannot run program "ocamlfind" (in directory
"/path/to/some/folder/."): error=2, No such file
or directory)
make: *** [some/folder/timestamp] Error 113

Answers:


0

出现此问题的原因是您的环境变量未正确设置。为此,运行以下命令应该足够了:

eval `opam config env`

我问这个问题已经有一段时间了。从那以后我一直在使用Virtual Box Ubuntu而且我没有弄乱OCaml。我不确定我是否通过这样做解决了这个问题。我想你确定这是典型的解决方案,我会选择它作为最有用的答案,特别是因为其他答案不存在。
Timothy Swan
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.