Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build failure: INT_MAX undeclared (first use in this function) #49

Closed
hhugo opened this issue Jul 30, 2019 · 2 comments
Closed

Build failure: INT_MAX undeclared (first use in this function) #49

hhugo opened this issue Jul 30, 2019 · 2 comments

Comments

@hhugo
Copy link
Contributor

hhugo commented Jul 30, 2019

$ ./configure 
binary ocaml: found in /xxx/4.08.0/bin
binary ocamlc: found in /xxx/4.08.0/bin
binary ocamldep: found in /xxx/4.08.0/bin
binary ocamlmklib: found in /xxx/4.08.0/bin
binary ocamldoc: found in /xxx/4.08.0/bin
binary ar: found in /usr/bin
binary perl: found in /usr/bin
binary gcc: found in /usr/lib64/ccache
binary ocamlopt: found in /xxx/4.08.0/bin
checking compilation with gcc -O3 -Wall -Wextra : working
include caml/mlvalues.h: found
library dynlink.cmxa: found
binary ocamlfind: found in /xxx/4.08.0/bin
OCaml's word size is 64
binary uname: found in /usr/bin
include gmp.h: found
library gmp: found
OCaml extended comparison supported
OCaml new hash functions available
OCaml supports -bin-annot to produce documentation

detected configuration:

  native-code:          yes
  dynamic linking:      yes
  asm path:             x86_64
  defines:              -DZ_OCAML_HASH -DZ_OCAML_COMPARE_EXT -DHAS_GMP -DZ_ELF -DZ_DOT_LABEL_PREFIX 
  libraries:             -lgmp
  C options:            -O3 -Wall -Wextra 
  asm options           
  installation path:    /xxx/4.08.0/lib
  installation method   findlib

configuration successful!
now type "make" to build
then type "make install" or "sudo make install" to install
$ make
project.mak:151: depend: No such file or directory
./z_pp.pl x86_64
Name "main::extra" used only once: possible typo at ./z_pp.pl line 29.
found assembly file caml_z_x86_64.S
  found abs
  found add
  found div
  found divexact
  found logand
  found lognot
  found logor
  found logxor
  found mul
  found neg
  found pred
  found rem
  found shift_left
  found shift_right
  found sub
  found succ
ocamldep -native  z.ml q.ml big_int_Z.ml z.mli q.mli big_int_Z.mli > depend
ocamlc -I +compiler-libs -bin-annot  -c z.mli
ocamlc -I +compiler-libs -bin-annot  -c z.ml
ocamlc -I +compiler-libs -bin-annot  -c q.mli
ocamlc -I +compiler-libs -bin-annot  -c q.ml
ocamlc -I +compiler-libs -bin-annot  -c big_int_Z.mli
ocamlc -I +compiler-libs -bin-annot  -c big_int_Z.ml
ocamlmklib -failsafe -o zarith z.cmo q.cmo big_int_Z.cmo -lgmp
gcc -DZ_OCAML_HASH -DZ_OCAML_COMPARE_EXT -DHAS_GMP -DZ_ELF -DZ_DOT_LABEL_PREFIX     -c -o caml_z_x86_64.o caml_z_x86_64.S
ocamlc -ccopt "-I/xxx/4.08.0/lib/ocaml  -DZ_OCAML_HASH -DZ_OCAML_COMPARE_EXT -DHAS_GMP -DZ_ELF -DZ_DOT_LABEL_PREFIX  -O3 -Wall -Wextra " -c caml_z.c
caml_z.c: In function ‘ml_z_mpz_set_z’:
caml_z.c:2573:31: error: ‘INT_MAX’ undeclared (first use in this function)
   if (size_op * Z_LIMB_BITS > INT_MAX)
                               ^
caml_z.c:2573:31: note: each undeclared identifier is reported only once for each function it appears in
caml_z.c: In function ‘ml_z_pow’:
caml_z.c:2739:16: error: ‘INT_MAX’ undeclared (first use in this function)
   if (ralloc > INT_MAX)
                ^
make: *** [caml_z.o] Error 2
@antoinemine
Copy link
Collaborator

Hi.
Would adding "#include <limits.h>" in caml_z.c solve your problem ?
See PR #51

@hhugo
Copy link
Contributor Author

hhugo commented Jul 30, 2019

#51 solves the issue. Thx

antoinemine added a commit that referenced this issue Jul 30, 2019
tentative fix for issue #49: add limits.h to make sure INT_MAX is there
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants