我是ocaml的新手。我正在尝试使用OPAM 1.1.1安装核心和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安装不正确吗?有关我如何解决问题的任何建议,请?
答案 0 :(得分:1)
这是error while installing ocamlfind.1.3.3 configure: m4 not in PATH; this is required的副本。
解决方案是sudo apt-get install m4
。
答案 1 :(得分:0)
opam从源代码安装软件包,而不是从预编译的二进制文件安装软件包。这意味着您需要安装所有构建先决条件。 opam会注意安装依赖于ocaml生态系统的那些,但是系统工具和库应该由用户手动安装。
很难猜出你的设置是什么,但看起来,你甚至没有安装过C编译器。通常带有它的包名为gcc
。如果您有一些debian或其衍生物,那么您可以尝试以root身份运行以下命令:apt-get install gcc
为了获得一个安装了OCaml的功能齐全的Linux,我建议使用专为Harvard的CS51课程准备的设备,该课程教授OCaml。
首先,您应该按照instructions安装设备。然后登录到设备,找到终端应用程序并调用以下命令
curl -s http://sites.fas.harvard.edu/~cs51/setup51.sh | sh
这将下载并安装opam,并自动设置处理Real World OCaml书籍中的示例所需的环境。
如果出现问题,请随时提出任何问题。