2

I am trying to install godi-batteries using GODI console. I seem to have all dependencies sorted (like Camomile). I get the following error within Godi's interface:

    > ocamlfind ocamlopt -shared -linkall -package camomile,num,str -o src/batteries_uni.cmxs src/batteries_uni.cmxa
    > + ocamlfind ocamlopt -shared -linkall -package camomile,num,str -o src/batteries_uni.cmxs src/batteries_uni.cmxa
    > ld: warning: -read_only_relocs cannot be used with x86_64
    > ld: codegen problem, can't use rel32 to external symbol _caml_negf_mask in .L101 from src/batteries_uni.a(batFloat.o)
    > collect2: ld returned 1 exit status
    > File "caml_startup", line 1, characters 0-1:
    > Error: Error during linking
    > Command exited with code 2.
    > make[7]: *** [all] Error 10
    > Error: Exec error: File /Users/surikator/godi/build/godi/godi-batteries/./../../mk/bsd.pkg.mk, line 1039: Command returned with non-zero exit code
    > Error: Exec error: File /Users/surikator/godi/build/godi/godi-batteries/./../../mk/bsd.pkg.mk, line 1378: Command returned with non-zero exit code

I'm using Mac OS X 10.6.4. and I have a 64 bit machine.

Any ideas on how to go around this?

Thanks, Surikator.

Surikator
  • 1,463
  • 9
  • 26
  • Can you post more of the output log? That smells like Batteries is somehow building incorrectly, perhaps building 32-bit when it should be 64. More output might shed light on whether it's a GODI problem or a Batteries problem. I seem to remember various problems cropping up as Batteries is used on the Mac. – Michael Ekstrand Jan 11 '11 at 15:12
  • @Michael I edited my question and added two lines above and the last two lines, also. What is missing before is a huge set of calls to `ocamlfind ocamlopt`. Thanks! – Surikator Jan 11 '11 at 16:35
  • @Michael OK, I found this (http://comments.gmane.org/gmane.comp.lang.ocaml.godi/462) and by changing the option of shared libraries to "no" in godi console, it passed through that part. What potential problems can having it as a non-shared library bring? – Surikator Jan 11 '11 at 16:41
  • What you'll be missing is the ability to dynamically load Batteries in native-code projects. This capability isn't used very often (it's primarily for things like Ocsigen). – Michael Ekstrand Jan 11 '11 at 17:00

1 Answers1

1

For some reason, OSX OCaml can't build shared libraries. You'll have to disable batteries' building of shared libraries with

BATTERIES_NATIVE_SHLIB=no make

This problem has been fixed in git commit 92b323, and will be included in the next release.

Thelema
  • 14,257
  • 6
  • 27
  • 35