【问题标题】:Installed ocamlfind (findlib), but never can find any extra package in Mac安装了 ocamlfind (findlib),但在 Mac 中永远找不到任何额外的包
【发布时间】:2013-03-04 23:58:37
【问题描述】:

刚买了一台新的 Mac,Mountain Lion,我希望设置所有与 ocaml 相关的东西。

我使用了以下命令:

opam switch 4.00.1

opam install findlib

opam install batteries

全部安装成功,没有错误。

但我不能使用batteriesbisect等。总是说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");;

【问题讨论】:

    标签: functional-programming ocaml opam


    【解决方案1】:

    让你运行“魔法”命令来设置你的环境变量吗?

    eval `opam config env`
    

    【讨论】:

    • 可能有 mac 方式可以做到这一点,但由于它也是一个 unix 系统,您可能可以在会话启动脚本中编写该命令 (~/.profile)
    猜你喜欢
    • 2014-01-21
    • 1970-01-01
    • 2016-12-19
    • 1970-01-01
    • 1970-01-01
    • 2019-08-19
    • 1970-01-01
    • 1970-01-01
    • 2013-10-17
    相关资源
    最近更新 更多