ocaml电池安装 [英] ocaml batteries installation

查看:110
本文介绍了ocaml电池安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

关于电池安装的信息似乎存在冲突.我尝试了一些建议,但没有一个对我有用.

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

我第一次尝试

ocamlfind batteries/ocaml

但是出现了这个错误:

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

然后我尝试将ocamlinit文件从Batterys目录复制到我的主目录中的.ocamlinit.这给出了此错误:

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

我正在使用ocaml 4.00.1.

I am using ocaml 4.00.1.

注意:对于此问题 ocaml电池编译:未绑定,我深表歉意模块Toploop ,但是给出的答案不够明确,无法让我实际尝试.

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.

推荐答案

就像@rgrinberg说的那样,请尝试使用opam安装电池.为此,请先下载快速安装程序:

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

然后执行此脚本:

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

它将安装最新的稳定" opam(您当然可以更改路径/usr/local/bin)和最新版本的OCaml编译器.

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.

之后,您只需要运行:

$ opam install batteries

应该没问题.

您还可以通过软件包管理器检查 ocaml.org 安装部分或

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

这篇关于ocaml电池安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆