我遇到的问题与this question非常相似。
我在MacOS Sierra上安装了MacBook Pro。我已经通过brew安装了ocaml和opam。 (brew install ocaml
,brew install opam
)已安装ocaml 4.03.0
,它似乎可以自行运行。
我尝试安装oasis
(opam install oasis
),但由于安装ocamlfind
失败导致安装失败:
➜ ~ opam install ocamlfind
The following actions will be performed:
∗ install ocamlfind 1.6.2
=-=- Gathering sources =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[ocamlfind] Archive in cache
=-=- Processing actions -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[ERROR] The compilation of ocamlfind failed at "./configure -bindir /Users/drautb/.opam/system/bin -sitelib /Users/drautb/.opam/system/lib -mandir /Users/drautb/.opam/system/man -config /Users/drautb/.opam/system/lib/findlib.conf -no-custom -no-topfind".
Processing 1/1: [ocamlfind: rm]
#=== ERROR while installing ocamlfind.1.6.2 ===================================#
# opam-version 1.2.2
# os darwin
# command ./configure -bindir /Users/drautb/.opam/system/bin -sitelib /Users/drautb/.opam/system/lib -mandir /Users/drautb/.opam/system/man -config /Users/drautb/.opam/system/lib/findlib.conf -no-custom -no-topfind
# path /Users/drautb/.opam/system/build/ocamlfind.1.6.2
# compiler system (4.03.0)
# exit-code 1
# env-file /Users/drautb/.opam/system/build/ocamlfind.1.6.2/ocamlfind-41584-6d07ae.env
# stdout-file /Users/drautb/.opam/system/build/ocamlfind.1.6.2/ocamlfind-41584-6d07ae.out
# stderr-file /Users/drautb/.opam/system/build/ocamlfind.1.6.2/ocamlfind-41584-6d07ae.err
### stdout ###
# [...]
# Configuration for str written to site-lib-src/str/META
# Configuration for threads written to site-lib-src/threads/META
# Configuration for unix written to site-lib-src/unix/META
# Configuration for stdlib written to site-lib-src/stdlib/META
# Configuration for bigarray written to site-lib-src/bigarray/META
# Configuration for ocamldoc written to site-lib-src/ocamldoc/META
# Configuration for camlp4 written to site-lib-src/camlp4/META
# Configuration for compiler-libs written to site-lib-src/compiler-libs/META
# Configuration for bytes written to site-lib-src/bytes/META
# Detecting compiler arguments: FAILED (see the file ocargs.log for details)
### stderr ###
# ./configure: line 553: cd: src: No such file or directory
=-=- Error report -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
The following actions failed
∗ install ocamlfind 1.6.2
No changes have been performed
我认为它可能与ocaml 4.03.0
有关,所以我尝试切换到ocaml 4.02.1
。 (opam switch 4.02.1
)这也失败了:
➜ ~ opam switch 4.02.1
=-=- Installing compiler 4.02.1 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[default.comp] http://caml.inria.fr/pub/distrib/ocaml-4.02/ocaml-4.02.1.tar.gz downloaded
Now compiling OCaml. This may take a while, please bear with us...
[ERROR] Compiler build failed at "./configure -prefix /Users/drautb/.opam/4.02.1 -with-debug-runtime":
# opam-version 1.2.2
# os darwin
# command ./configure -prefix /Users/drautb/.opam/4.02.1 -with-debug-runtime
# path /Users/drautb/.opam/4.02.1/build/ocaml
# exit-code 2
# env-file /Users/drautb/.opam/log/log-42620-d2c37b.env
# stdout-file /Users/drautb/.opam/log/log-42620-d2c37b.out
# stderr-file /Users/drautb/.opam/log/log-42620-d2c37b.err
### stdout ###
# [ERROR!]Cannot guess host type. You must specify one with the -host option.
### stderr ###
# ./configure: line 190: cd: config/auto-aux: No such file or directory
# ./configure: line 222: ../gnu/config.guess: No such file or directory
我尝试重新安装XCode,我尝试使用--build-from-source
选项(包括rm -rf ~/.opam
)通过自制程序重新安装ocaml和opam,并且错误仍然存在。
还有其他人有这样的问题吗?