2

I have asked this question before but it turns out that what I believed to be the solution is not.

The Problem

I have just started a fresh GODI installation and I am attempting to install the batteries library. I have all dependencies sorted, e.g. Camomile. I get the following error:

> ocamlfind ocamlopt -a -package camomile,num,str src/batCamomile.cmx src/batConcurrent.cmx src/batInnerWeaktbl.cmx src/batInnerIO.cmx src/batInterfaces.cmx src/batMonad.cmx src/batRef.cmx src/batValue_printer.cmx src/batEnum.cmx src/batPrintf.cmx src/batList.cmx src/batRefList.cmx src/batArg.cmx src/batBitSet.cmx src/batChar.cmx src/batReturn.cmx src/batString.cmx src/batUChar.cmx src/batUTF8.cmx src/batRope.cmx src/batUnix.cmx src/batIO.cmx src/batArray.cmx src/batBigarray.cmx src/batNumber.cmx src/batBig_int.cmx src/batStd.cmx src/batBool.cmx src/batBuffer.cmx src/batInt.cmx src/batMap.cmx src/batOption.cmx src/batPMap.cmx src/batLazyList.cmx src/batParserCo.cmx src/batVect.cmx src/batCharParser.cmx src/batFloat.cmx src/batStream.cmx src/batGenlex.cmx src/batComplex.cmx src/batDigest.cmx src/batFormat.cmx src/batGc.cmx src/batHashtbl.cmx src/batInt32.cmx src/batInt64.cmx src/batLexing.cmx src/batMarshal.cmx src/batNativeint.cmx src/batNum.cmx src/batOo.cmx src/batFile.cmx src/batPrint.cmx src/batPrintexc.cmx src/batPervasives.cmx src/batQueue.cmx src/batRandom.cmx src/batScanf.cmx src/batSet.cmx src/batStack.cmx src/batStr.cmx src/batSys.cmx src/batUnit.cmx src/batBase64.cmx src/batCharEncodings.cmx src/batDllist.cmx src/batDynArray.cmx src/batGlobal.cmx src/batSubstring.cmx src/batLogger.cmx src/batPSet.cmx src/batMultiPMap.cmx src/batOptParse.cmx src/batPair.cmx src/batUCharParser.cmx src/batPathGen.cmx src/batResult.cmx src/batSeq.cmx src/batAvlTree.cmx src/batISet.cmx src/batIMap.cmx src/batteries_config.cmx src/batteries_print.cmx src/batteries_uni.cmx src/batMutex.cmx src/batRMutex.cmx src/batteries.cmx -o src/batteries.cmxa
> 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

### Error: Command fails with code 1: godi_console

The solution that doesn't work

In my previous question, based on this post, I toggled the GODI setting

GODI_BATTERIES_SHLIB = no

and it did finish installing batteries. But I just started a fresh installation of GODI and even with this setting, I still get the error above (which is the same I had originally).

My Settings

I am using Mac OS X version 10.6.4 on a MacBookPro (64bit) with the most recent version of GODI (rocketboost-20091222).

Ideas?

From

> ld: warning: -read_only_relocs cannot be used with x86_64

it really seems that batteries/godi is trying to do something for 32 bits when it should be doing something for 64. Is there some setting in batteries or godi where this can be changed?

From

> ld: codegen problem, can't use rel32 to external symbol _caml_negf_mask in .L101 from src/batteries_uni.a(batFloat.o)

it can be seen that the source of the problem is the library batteries_uni.a. I don't know if there's something imposing 32 bits in there? I noticed that batteries_uni.ml includes modules Int32 and Int64 for integers, but that shouldn't really be a problem, should it?

Any ideas?

Any help on this would be great!

Thanks a lot, Surikator.

Community
  • 1
  • 1
Surikator
  • 1,463
  • 9
  • 26
  • Don't use GODI? Like you, I had tons of problems with dependencies and complexity, and since I've found it's just not worth it. I've successfully managed my OCaml packages myself with `ocamlfind`, creating `META` files if the package doesn't have them, and installing them myself. Most of the packages are wrappers, and do not get updated frequently enough to warrant a complex package manager. Just my two cents. Good luck! – nlucaroni Jan 26 '11 at 15:20
  • @nlucaroni Yes, that's always an option, although I quite like GODI. It's quite practical to have a single place listing most of the used packages and be able to install them with just 3-4 keystrokes. And it has been quite OK for everything else I did so far; just not batteries. But let's assume I don't use godi_console for now. Two questions: (1) can I install batteries by hand on the godi folder structure? (2) how do I use ocamlfind to understand which libraries I need to install before installing bateries? – Surikator Jan 26 '11 at 19:12
  • @nlucaroni Actually, I've just downloaded batteries 1.2.2 to a fresh folder and ran a "make all" on it and got exactly the same error as above. I think it's something with 32/64 bits involving (my) Mac OS and batteries... So, apparently nothing to do with GODI. – Surikator Jan 26 '11 at 19:27
  • 1
    It looks like the GODI script is not correctly turning off shared library builds (it could be that the Batteries makefile is buggy in that regard). I'll try to look at it tonight and see if it's something that can be fixed (relatively) easily. – Michael Ekstrand Jan 26 '11 at 20:39
  • For some reason, I'm worrying the problem is this: http://caml.inria.fr/mantis/view.php?id=4867 – Surikator Jan 27 '11 at 00:41

1 Answers1

2

I did some investigation, and it turns out that there was a bug in the GODI packaging script so that the GODI_BATTERIES_SHILB option was a no-op. I have corrected this bug and released updated build scripts, so setting it to no and building Batteries after updating your GODI installation (godi_update, or "Check for new source packages" in godi_console) should successfully prevent the .cmxs files from being built and installed. I think this will allow you to build on the Mac now.

I would like to find the actual build bug and get .cmxs files working on Mac, but none of the Batteries devs have Macs (to my knowledge) so it's kinda hard.

Michael Ekstrand
  • 28,379
  • 9
  • 61
  • 93
  • 1
    Thanks for all the effort. I did the update (and noticed a few more settings available for configuration in the batteries library too). It compiled fine and batteries is now installed on my godi installation of OCaml. Great stuff! Thanks for the great help! – Surikator Jan 27 '11 at 03:51