functional-programming - 已安装 ocamlfind (findlib),但在 Mac 中始终找不到任何额外的包

标签 functional-programming ocaml opam

刚买了一台新 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");;

最佳答案

运行“magic”命令来设置环境变量?

eval `opam config env`

关于functional-programming - 已安装 ocamlfind (findlib),但在 Mac 中始终找不到任何额外的包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15213437/

相关文章:

Javascript:回调中的无点样式

algorithm - 创建快速指数函数

ocaml - OPAM软件包未运行

macos - 使 OPAM 与 MacOS X 下的系统编译器一起工作

build - 如何使用带有 js_of_ocaml 的模块?

emacs - utop 错误 : No such package: sexplib. 语法 - `core.syntax' 需要

javascript - 算法识别javascript中的纯函数

r - 如何从函数内生成条件图

html - Haskell - Parsec 解析 <p> 元素

ocaml - 避免警告 "Warning 21: this statement never returns (or has an unsound type.)"