ocaml batteries installation

主宰稳场 提交于 2019-12-08 08:33:03

问题


There seems to be conflicting information about batteries installation. I have tried several suggestions, but none have worked for me.

I first tried

ocamlfind batteries/ocaml

but that gave this error:

ocamlfind: Cannot find command: /username/godi/lib/ocaml/pkg-lib/batteries/ocaml

I then tried copying the ocamlinit file from the batteries directory to .ocamlinit in my home directory. This gave this error:

Cannot find file topfind.
File ".ocamlinit", line 38, characters 0-20:
Error: Unbound module Toploop

I am using ocaml 4.00.1.

Note: I apologize if this question is redundant with this one ocaml batteries compiling : Unbound module Toploop but the answer given was not explicit enough for me to actually try.


回答1:


Like @rgrinberg said, try to install batteries with opam. For that, first download the quick installer:

$ wget http://www.ocamlpro.com/pub/opam_installer.sh

Then execute this script:

$ sh ./opam_installer.sh /usr/local/bin

It will install the latest "stable" opam (you can of course change the path /usr/local/bin) and the latest version of the OCaml compiler.

After that, you just need to run:

$ opam install batteries

and it should be ok.

You can also check ocaml.org install section (by package manager) or opam website.



来源:https://stackoverflow.com/questions/14840236/ocaml-batteries-installation

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