OS X Lion下的Opa构建失败

时间:2011-08-05 20:42:00

标签: osx-lion opa

我一直想和Opa弄脏手,但是我真的觉得缺少REPL,这是我接受新语言选择的武器。瞧,Opa博客提到了一个名为opatop的工具,似乎就是这样,但它似乎不包含在标准的Mac或Ubuntu发行版中。

我长途跋涉到GitHub,抓住了源头,然后开始构建,但是我收到了here提到的错误:

+ /opt/local/bin/ocamlopt.opt dynlink.cmxa unix.cmxa str.cmxa nums.cmxa -g threads.cmxa -thread -I +zip zip.cmxa -I +ocamlgraph graph.cmxa -I /opt/local/lib/ocaml/ulex ulexing.cmxa buildinfos.cmxa libbase.cmxa compilerlib.cmxa libtrx.cmxa opacapi.cmxa passlib.cmxa libqmlcompil.cmxa jslang.cmxa ocamllang.cmxa libbsl.cmxa libbsl/bslregister.cmx opalang.cmxa -o libbsl/bslregister.native
File "_none_", line 1, characters 0-1:
Error: Cannot find file dynlink.cmxa
Command exited with code 2.

我对OCaml开发几乎一无所知,但看起来在相关库目录中具有相同扩展名的其他文件是“OCaml本机库文件”。鉴于此,这只是一个未包含在OCaml发行版中的库我最终得到了吗?上面链接中引用的Mantis bug使得工作中的构建环境可能存在相互矛盾的假设。

无论如何,有人可以提供任何建议吗?

谢谢!

2 个答案:

答案 0 :(得分:2)

OCaml尚未使用Lion的本机dynlink构建,因此默认安装下不存在dynlink.cmxa。

以下补丁将允许您构建它。在OCaml src目录patch -p1 < PATH/TO/PATCH内,并根据需要重新安装OCaml。

这适用于OCaml 3.12.1

--- a/configure  2011-07-04 14:15:01.000000000 -0700
+++ b/configure  2011-08-26 10:18:42.000000000 -0700
@@ -619,9 +619,9 @@
   case "$host" in
     *-*-cygwin*)                  natdynlink=true;;
     i[3456]86-*-linux*)           natdynlink=true;;
     x86_64-*-linux*)              natdynlink=true;;
-    i[3456]86-*-darwin10.*)
+    i[3456]86-*-darwin1[01].*)
       if test $arch64 == true; then
         natdynlink=true
       fi;;
     i[3456]86-*-darwin[89]*)      natdynlink=true;;

答案 1 :(得分:1)

我已经调查了OS X Lion下的Opa构建,并在opalang上推出了2个补丁,等待批准以解决主要问题。

所以,当补丁可用时,这是我的步骤(我记得)让Opa在Lion下工作:

首先,安装必要的工具:

  • 安装OS X Lion
  • 安装Xcode 4
  • 安装MacPorts
  • 安装wget(macports)
  • 安装coreutils(macports)
  • 安装md5sha1sum(macports)
  • (我认为这就是......)

然后从源代码编译Opa:

  • git clone https://github.com/MLstate/opalang.git
  • cd opalang
  • dependencies / installation_helper.sh --prefix~ / Opa
  • 在你的〜/ .profile中更改你的PATH:export PATH =〜/ Opa / bin:$ PATH
  • 重新提供您的.bashrc:source~ / .profile
  • ./ configure -prefix~ / Opa
  • make all install
  • 你的新opa编译器应该在〜/ Opa / bin中:)