我在Mac OS X 10.10上安装了带自制程序的opam。但我无法使用opam安装任何东西。这是我尝试安装ocamlfind时获得的示例错误输出:
# opam-version 1.2.0
# os darwin
# command ./configure -bindir /Users/roger/.opam/system/bin -sitelib /Users/roger/.opam/system/lib -mandir /Users/roger/.opam/system/man -config /Users/roger/.opam/system/lib/findlib.conf -no-topfind
# path /Users/roger/.opam/system/build/ocamlfind.1.5.5
# compiler system (4.02.1)
# exit-code 1
# env-file /Users/roger/.opam/system/build/ocamlfind.1.5.5/ocamlfind-91360-c61e7b.env
# stdout-file /Users/roger/.opam/system/build/ocamlfind.1.5.5/ocamlfind-91360-c61e7b.out
# stderr-file /Users/roger/.opam/system/build/ocamlfind.1.5.5/ocamlfind-91360-c61e7b.err
### stdout ###
# ...[truncated]
# 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 camlp4 written to site-lib-src/camlp4/META
# Configuration for ocamlbuild written to site-lib-src/ocamlbuild/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 547: cd: src: No such file or directory
答案 0 :(得分:1)
brew install opam
opam init --comp=4.02.1
eval `opam config env`
ocaml
更新
有时,使用Illegal Instruction
,自酿的opam会失败,在这种情况下,您需要从源代码重新安装opam:
brew reinstall --build-from-source opam
此外,您还需要一个有效的工具链,即编译器,自动工具和其他开发人员工具。您可以尝试使用brew
安装它,例如brew install autotools
等。或者您可以尝试安装xcode
工具链,包括Apple命令行开发人员工具。
答案 1 :(得分:1)
我在尝试安装海市蜃楼遇到同样的问题,问题是因为当前目录默认情况下不在MacOS X上的CDPATH.posix / bin / sh不会“cd src”虽然可以“cd ./src ”。快速修复是在运行opam之前执行以下操作(或者只是将其放在.bash_profile中。
export CDPATH=.
opam install WHATEVER