我正在尝试通过 opam 构建 OCaml 包 Javalib。我无法构建它,这是输出:
The following actions will be performed:
∗ install javalib 2.3.1
=-=- Gathering sources =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[javalib] Archive in cache
=-=- Processing actions -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[ERROR] The compilation of javalib failed at "make".
Processing 1/1: [javalib: ocamlfind remove]
#=== ERROR while installing javalib.2.3.1 =====================================#
# opam-version 1.2.2
# os linux
# command make
# path /home/mttjone/.opam/system/build/javalib.2.3.1
# compiler system (4.02.3)
# exit-code 2
# env-file /home/mttjone/.opam/system/build/javalib.2.3.1/javalib-1074-d2c37b.env
# stdout-file /home/mttjone/.opam/system/build/javalib.2.3.1/javalib-1074-d2c37b.out
# stderr-file /home/mttjone/.opam/system/build/javalib.2.3.1/javalib-1074-d2c37b.err
### stdout ###
# [...]
# /home/mttjone/.opam/system/bin/ocamlfind ocamlc -g -w Aer -annot -package unix,str,extlib,ptrees,zip -c jDumpBasics.ml
# /home/mttjone/.opam/system/bin/ocamlfind ocamlc -g -w Aer -annot -package unix,str,extlib,ptrees,zip -c jParseCode.ml
# /home/mttjone/.opam/system/bin/ocamlfind ocamlc -g -w Aer -annot -package unix,str,extlib,ptrees,zip -c jInstruction.ml
# /home/mttjone/.opam/system/bin/ocamlfind ocamlc -g -w Aer -annot -package unix,str,extlib,ptrees,zip -c jUnparseSignature.ml
# /home/mttjone/.opam/system/bin/ocamlfind ocamlc -g -w Aer -annot -package unix,str,extlib,ptrees,zip -c jDumpLow.ml
# /home/mttjone/.opam/system/bin/ocamlfind ocamlc -g -w Aer -annot -package unix,str,extlib,ptrees,zip -c jHigh2Low.ml
# /home/mttjone/.opam/system/bin/ocamlfind ocamlc -g -w Aer -annot -package unix,str,extlib,ptrees,zip -c jDumpJasmin.ml
# /home/mttjone/.opam/system/bin/ocamlfind ocamlc -g -w Aer -annot -package unix,str,extlib,ptrees,zip -c jUnparse.ml
# /home/mttjone/.opam/system/bin/ocamlfind ocamlc -g -w Aer -annot -package unix,str,extlib,ptrees,zip -package camlp4 -syntax camlp4o -c jParseSignature.ml
# make[1]: Leaving directory `/local/home/mttjone/.opam/system/build/javalib.2.3.1/src'
### stderr ###
# [...]
# Warning 44: this open statement shadows the value identifier write_ui16 (which is later used)
# File "jUnparse.ml", line 22, characters 0-17:
# Warning 44: this open statement shadows the value identifier write_i32 (which is later used)
# sh: camlp4: command not found
# File "jParseSignature.ml", line 1:
# Error: Error while running external preprocessor
# Command line: camlp4 '-I' '/home/mttjone/sw//lib/ocaml/camlp4' '-parser' 'o' '-parser' 'op' '-printer' 'p' 'jParseSignature.ml' > /tmp/ocamlpp214326
#
# make[1]: *** [jParseSignature.cmo] Error 2
# make: *** [javalib] Error 2
=-=- Error report -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
The following actions failed
∗ install javalib 2.3.1
No changes have been performed
我一开始以为我错过了camlp4,但我没有。有趣的是,它并不位于 lib/ocaml 目录中。
它可能与jUnparse.ml
orjParseSignature.ml
文件有关,但我并不真正了解 OCaml,也无法完全解析其中发生的事情。