1

There seems to be conflicting information about batteries installation. I have tried several suggestions, but none have worked for me.

I first tried

ocamlfind batteries/ocaml

but that gave this error:

ocamlfind: Cannot find command: /username/godi/lib/ocaml/pkg-lib/batteries/ocaml

I then tried copying the ocamlinit file from the batteries directory to .ocamlinit in my home directory. This gave this error:

Cannot find file topfind.
File ".ocamlinit", line 38, characters 0-20:
Error: Unbound module Toploop

I am using ocaml 4.00.1.

Note: I apologize if this question is redundant with this one ocaml batteries compiling : Unbound module Toploop but the answer given was not explicit enough for me to actually try.

Community
  • 1
  • 1
  • 2
    A bit unrelated but you should dump GODI asap and use opam: https://github.com/OCamlPro/opam once you have opam running then a simple `opam install batteries` should make everything work. – rgrinberg Feb 12 '13 at 21:20

1 Answers1

4

Like @rgrinberg said, try to install batteries with opam. For that, first download the quick installer:

$ wget http://www.ocamlpro.com/pub/opam_installer.sh

Then execute this script:

$ sh ./opam_installer.sh /usr/local/bin

It will install the latest "stable" opam (you can of course change the path /usr/local/bin) and the latest version of the OCaml compiler.

After that, you just need to run:

$ opam install batteries

and it should be ok.

You can also check ocaml.org install section (by package manager) or opam website.

Çağdaş Bozman
  • 2,537
  • 16
  • 21
  • Thanks - the installation works, but I'm still having trouble getting batteries to run in the top level. I get "unbound module Toploop" when I try ocamlfind batteries/ocaml. – user2065942 Feb 13 '13 at 15:49
  • OK you juste need to set some variable environment, see my answer in this [topic](http://stackoverflow.com/questions/14751914/opam-package-not-running/14752071#14752071) – Çağdaş Bozman Feb 14 '13 at 08:38
  • Ah - sorry. In the meantime, I had just installed batteries from source, and that went fine. – user2065942 Feb 21 '13 at 19:31