ocaml-batteries-team / batteries-included

Batteries Included project
http://ocaml-batteries-team.github.com/batteries-included/hdoc2/
Other
519 stars 106 forks source link

batteries 1.3.0 compilation unsuccessful ".size expression [...] does not evaluate to a constant" #139

Closed ajendrex closed 13 years ago

ajendrex commented 13 years ago

Hello,

I'm trying to install batteries 1.3.0 and this is the output to 'make all' command:

cp -f src/batCamomile-0.8.2.ml src/batCamomile.ml test ! -e src/batteries_config.ml || rm src/batteries_config.ml ocamlbuild syntax.otarget byte.otarget src/batteries_help.cmo META shared.otarget Finished, 0 targets (0 cached) in 00:00:00. Warning: tag "package" does not expect a parameter, but is used with parameter "str"

Please help me, I am a beginner in ocaml and have no idea what to do. (Actually, I may have some ideas, but they would imply to edit files that are supposed to work...)

thanks!

gasche commented 13 years ago

This is a very low-level (assembly-level !) error. I have no idea where that would come from, but I suspect it's not batteries-related, but rather something with your general OCaml install. Are you sure your ocaml setup is consistent? Are you using some exotic OS/architecture combination? Have you succeeded compiling other programs using floating points?

ajendrex commented 13 years ago

I use ArchLinux over a intel Pentium x86_64 Dual-Core CPU. I have installed:

ocaml 3.12.0-1 ocaml-camomile 0.8.2-1 ocaml-findlib 1.2.7-1 ocaml-ounit 1.1.0-4

I haven't had any floating point related problem before...

gasche commented 13 years ago

Do you have a way to try with ocaml 3.11 (3.11.2 for instance)? It may make no difference, but I think that the compiler internals regarding floating point have changed between them.

Sorry for wasting your time; unfortunately, I can't reproduce the bug (nor the setting) on my box.

ajendrex commented 13 years ago

Thanks for your help, gasche.

While compiling ocaml 3.11.2, at step 4.- 'make opt'; it gives me the same error:

/tmp/camlasma00df8.s: Assembler messages: /tmp/camlasma00df8.s:1959: Error: .size expression for camlRandom__rawfloat_126 does not evaluate to a constant File "random.ml", line 1, characters 0-1: Error: Assembler error, input left in file /tmp/camlasma00df8.s make[2]: *\ [random.cmx] Error 2

step 5 also fails. So, should I get another machine? :s

thelema commented 13 years ago

This seems like this problem with ocaml. There's an issue between ocaml and newer binutils that's fixed in ocaml SVN and will be in the next release. See here for details. http://caml.inria.fr/mantis/view.php?id=5237 Since there's nothing for batteries to fix on this, I'm closing this issue.

gasche commented 13 years ago

So I suspect you hit this bug Can you confirm your version of binutils? You may want to try the attached patch (against 3.12) that reportedly solves the issue.

Edit: well, anyway... Good luck with batteries!

ajendrex commented 13 years ago

The svn version solved this issue. However, batteries now throws the following error:

Error: The files /usr/lib/ocaml/camlp4/Camlp4.cmi and /usr/local/lib/ocaml/string.cmi make inconsistent assumptions over interface String Command exited with code 2. Compilation unsuccessful after building 5 targets (0 cached) in 00:00:01. make: *\ [all] Error 10

should I open a new thread with this new error? Thanks!

gasche commented 13 years ago

This is a common error when you compile something with a version of a library, then change the library, compile the rest, and try to combine them. Just "make clean" of your batteries directory to erase the previous object files, and retry.

Edit: uh oh, I didn't notice that the two files in conflicts are not related to Batteries. Apparently your system has libraries from the ocaml distribution (the core package, not batteries) in different version. Find them, kill them all, and re-do a clean install.

AngryBirdShu commented 7 years ago

wow!amazing!I am a Chinese girl! I want to solve my compile Error “ .size expression for does not evaluate to a constant ”,and I search on the Internet,and find this web page,this is my first time to Communicate to foreigners. so Excited!!!