我遇到的问题与这个问题非常相似。
我在 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,我尝试通过 homebrew 使用--build-from-source
选项(包括rm -rf ~/.opam
)重新安装 ocaml 和 opam,并且错误仍然存在。
有没有其他人遇到过这样的问题?