2013-03-04 117 views
4

刚刚有一台新的Mac,Mountain Lion,我希望设置所有与ocaml相关的东西。安装ocamlfind(findlib),但从来没有可以在Mac中找到任何额外的软件包

我用下面的命令:

opam switch 4.00.1 

opam install findlib 

opam install batteries 

所有安装成功没有错误。

但我不能使用batteries,bisect等。总是说package can't be found

有什么想法?

我应该设置任何path什么的?


编辑:

欲了解更多信息,我按照这些步骤:

1. install homebrew 

    http://mxcl.github.com/homebrew/ 

    ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)" 

2. Emacs for Mac OS X 

    http://emacsformacosx.com/ 

3. Install tuareg-mode 

    http://forge.ocamlcore.org/forum/forum.php?forum_id=808 

    http://marmalade-repo.org/ 
    Add to your .emacs: (require 'package) (in home directory) 

    (add-to-list 'package-archives 
     '("marmalade" . 
      "http://marmalade-repo.org/packages/")) 
    (package-initialize) 

    M-x eval-buffer to evaluate it, and then do M-x package-refresh-contents to load in the package listing.\ 

    ** m-x list-packages ** 

    select tuareg package 

    click install 

4. Install OCaml, OPam, rlwrap 

    make sure XCode command line tool is installed: 
     http://stackoverflow.com/questions/10921690/on-apple-osx-lion-make-not-in-path 

    brew install ocaml 

    brew install opam 

    opam init 

    brew install rlwrap 

5. Install batteries-included (ocamlfind will be installed automatically) 

    http://stackoverflow.com/questions/14947667/cant-load-batteries-using-findlib-in-ocaml-toplevel 

    opam switch 4.00.1 

    opam install batteries 

    http://stackoverflow.com/questions/14751914/opam-package-not-running/14752071#14752071 

    http://stackoverflow.com/questions/14840236/ocaml-batteries-installation 

    https://github.com/ocaml-batteries-team/batteries-included/blob/master/ocamlinit 

    Put the following in ~/.ocamlinit 

    #use "topfind";; 
    Toploop.use_silently 
      Format.err_formatter (Filename.concat (Findlib.package_directory 
      "batteries") "battop.ml");; 

回答

11

有你运行 “神奇” 命令来建立你的环境变量?

eval `opam config env` 
+0

是的,我确实。试了很多东西,我GOOGLE了 – 2013-03-05 00:42:08

+0

该死的,它的工作!谢谢!!!我怎样才能每次自动加载它? – 2013-03-05 00:44:00

+2

有可能是一种mac方式来做到这一点,但由于它也是一个unix系统,所以你可以在你的会话启动脚本('〜/ .profile')中编写该命令 – didierc 2013-03-05 01:20:05

相关问题