我刚刚拿到了 Real World OCaml 书,他们在书中使用了 Jane Street Core 标准库。这意味着如果没有它,书中的大多数代码都无法编译。似乎 Core 在 Fedora 20 中不作为软件包提供。有人推荐一种安装它的好方法吗?我曾尝试在包含它的 Fedora 上安装 OPAM,但无法编译它。
以下是一些输出:
$ opam install core
...
===== ERROR while installing type_conv.109.53.02 =====
# opam-version 1.1.0
# os linux
# command make
# path /home/user/.opam/system/build/type_conv.109.53.02
# compiler system (4.00.1)
# exit-code 2
# env-file /home/user/.opam/system/build/type_conv.109.53.02/type_conv-1610-1872ec.env
# stdout-file /home/user/.opam/system/build/type_conv.109.53.02/type_conv-1610-1872ec.out
# stderr-file /home/user/.opam/system/build/type_conv.109.53.02/type_conv-1610-1872ec.err
### stdout ###
# ocamlopt.opt -o setup.exe setup.ml || ocamlopt -o setup.exe setup.ml || ocamlc -o setup.exe setup.ml
# rm -f setup.cmx setup.cmi setup.o setup.obj setup.cmo
# ./setup.exe -configure
### stderr ###
# ocamlfind: Package `camlp4.quotations' not found
# W: Field 'pkg_camlp4_quotations' is not set: Command ''/home/user/.opam/system/bin/ocamlfind' query -format %d camlp4.quotations > '/tmp/oasis-715a9f.txt'' terminated with error code 2
# ocamlfind: Package `camlp4.extend' not found
# W: Field 'pkg_camlp4_extend' is not set: Command ''/home/user/.opam/system/bin/ocamlfind' query -format %d camlp4.extend > '/tmp/oasis-968a42.txt'' terminated with error code 2
# E: Cannot find findlib package camlp4.extend
# E: Cannot find findlib package camlp4.quotations
# E: Failure("2 configuration errors")
# make: *** [setup.data] Error 1
这是我在系统上安装的 OCaml 包集:
$ rpm -qa | grep ocaml | sort
ocaml-4.00.1-3.fc20.x86_64
ocaml-camlp4-4.00.1-3.fc20.x86_64
ocaml-camlp4-devel-4.00.1-3.fc20.x86_64
ocaml-camlp5-6.07-3.fc20.x86_64
ocaml-camlp5-devel-6.07-3.fc20.x86_64
ocaml-compiler-libs-4.00.1-3.fc20.x86_64
ocaml-ocamldoc-4.00.1-3.fc20.x86_64
ocaml-runtime-4.00.1-3.fc20.x86_64