0

我是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 安装不正确?请问有什么建议可以解决这个问题吗?

4

2 回答 2

1

这是安装 ocamlfind.1.3.3 configure: m4 not in PATH 时的重复错误;这是必需的

解决办法是sudo apt-get install m4

于 2014-06-10T09:38:30.463 回答
0

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

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

更新

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

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

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

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

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

于 2014-06-07T03:04:25.360 回答