【问题标题】:Installing core library安装核心库
【发布时间】:2014-06-06 18:28:57
【问题描述】:

我是 ocaml 的新手。我正在尝试使用 OPAM 1.1.1 安装 core 和 utop 但是我得到以下信息:

mario@mario-VirtualBox:~$ opam install core
The following actions will be performed:
 - install   ocamlfind.1.4.0                       [required by core]
 - install   type_conv.111.13.00                   [required variantslib,               pa_test,       pa_bench, enumerate, comparelib, bin_prot, custom_printf, fieldslib, pa_ounit, sexplib]
 - install   pipebang.110.01.00                    [required by core]
 - install   ounit.2.0.0                           [required by pa_ounit]
 - install   herelib.109.35.02                     [required by core]
 - install   variantslib.109.15.03                 [required by core]
 - install   sexplib.111.13.00                     [required by core]
 - install   fieldslib.109.20.03                   [required by core]
 - install   enumerate.111.08.00                   [required by core]
 - install   comparelib.109.60.00                  [required by core]
 - install   bin_prot.111.03.00                    [required by core]
 - install   pa_ounit.109.53.02                    [required by core]
 - install   pa_test.111.08.00                     [required by core]
 - install   typerep.111.06.00                     [required by core_kernel]
 - install   pa_bench.109.55.02                    [required by core]
 - install   custom_printf.111.03.00               [required by core]
 - install   core_kernel.111.13.00                 [required by core]
 - install   core.111.13.00
18 to install | 0 to reinstall | 0 to upgrade | 0 to downgrade | 0 to remove
Do you want to continue ? [Y/n] y

=-=-= Synchronizing package archives =-=-=

=-=-= Installing ocamlfind.1.4.0 =-=-=
Building ocamlfind.1.4.0:
  ./configure -bindir /home/mario/.opam/system/bin -sitelib /home/mario/.opam/system/lib -mandir /home/mario/.opam/system/man -config /home/mario/.opam/system/lib/findlib.conf -no-topfind
  make all
  make opt
  make install
[ERROR] The compilation of ocamlfind.1.4.0 failed.
Removing ocamlfind.1.4.0.
  Nothing to do.

[ERROR] Failure while processing ocamlfind.1.4.0


===== ERROR while installing ocamlfind.1.4.0 =====
# opam-version 1.1.1 (71b2a01ee571507c1819fbd282b0500d628f92d3)
# os           linux
# command      ./configure -bindir /home/mario/.opam/system/bin -sitelib /home/mario/.opam/system/lib -mandir /home/mario/.opam/system/man -config /home/mario/.opam/system/lib/findlib.conf -no-topfind
# path         /home/mario/.opam/system/build/ocamlfind.1.4.0
# compiler     system (4.01.0)
# exit-code    1
# env-file     /home/mario/.opam/system/build/ocamlfind.1.4.0/ocamlfind-2662-c743ac.env
# stdout-file  /home/mario/.opam/system/build/ocamlfind.1.4.0/ocamlfind-2662-c743ac.out
# stderr-file  /home/mario/.opam/system/build/ocamlfind.1.4.0/ocamlfind-2662-c743ac.err
### stdout ###
# Welcome to findlib version 1.4
# Configuring core...
### stderr ###
# configure: m4 not in PATH; this is required

会不会是OPAM安装不正确?有什么建议可以解决这个问题吗?

【问题讨论】:

标签: ocaml ocamlfind


【解决方案1】:

这是error while installing ocamlfind.1.3.3 configure: m4 not in PATH; this is required 的副本。

解决方案是sudo apt-get install m4

【讨论】:

    【解决方案2】:

    opam 从源代码安装包,而不是从预编译的二进制文件。这意味着您需要安装所有构建先决条件。 opam 会注意安装那些依赖于 ocaml 生态系统的工具,但系统工具和库应该由用户手动安装。

    很难猜出您的设置是什么,但看起来您甚至没有安装 C 编译器。通常带有它的包被命名为gcc。如果你有一些 debian 或其衍生版本,那么你可以尝试以 root 身份运行以下命令:apt-get install gcc

    更新

    要获得一个安装了 OCaml 的功能齐全的 linux,我建议使用专门为哈佛的 CS51 课程准备的设备,它可以教授 OCaml。

    首先您应该按照instructions 安装一个设备。然后登录到设备,找到一个终端应用程序并调用以下命令

    curl -s http://sites.fas.harvard.edu/~cs51/setup51.sh | sh
    

    这将下载并安装一个 opam,并自动设置使用 Real World OCaml 书中示例所需的环境。

    如果出现问题,请随时提出任何问题。

    【讨论】:

    • 感谢那些非常有帮助的人。请问在哪里可以了解诸如 apt-get install 之类的命令?我在 Oracle VM 上使用 Xubuntu,但对 Linux 知之甚少。
    • 有很多学习 Linux 的资源,但是如果您对 OCaml 感兴趣,我建议您使用预先安装了 OCaml 的专门准备的设备。我已经用详细说明更新了帖子。
    • 似乎 ivg 读懂了我的想法。我正在设置 OCaml,以便我可以跟随 CS51(我去年跟随 CS50 并学到了很多东西)。谢谢,你很有帮助。
    猜你喜欢
    • 2016-09-16
    • 2011-06-14
    • 1970-01-01
    • 2018-07-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多