ocaml / Zarith

The Zarith library implements arithmetic and logical operations over arbitrary-precision integers and rational numbers. The implementation, based on GMP, is very efficient.
Other
226 stars 69 forks source link

Compiling Zarith 1.14 on MacOS ARM #156

Open arozovyk opened 2 weeks ago

arozovyk commented 2 weeks ago

The ./configure does not seem to find gmp.h on ARM based MacOS even though the gmp 6.3.0 is installed with homebrew.

binary ocaml: found in /Users/arozovyk/.opam/default/bin
binary ocamlc: found in /Users/arozovyk/.opam/default/bin
binary ocamldep: found in /Users/arozovyk/.opam/default/bin
binary ocamlmklib: found in /Users/arozovyk/.opam/default/bin
binary ocamldoc: found in /Users/arozovyk/.opam/default/bin
binary ocamlopt: found in /Users/arozovyk/.opam/default/bin
checking compilation with ocamlc -O3 -Wall -Wextra : working
include caml/mlvalues.h: found
library dynlink.cmxa: found
binary ocamlfind: found in /Users/arozovyk/.opam/default/bin
OCaml's word size is 64
include gmp.h: not found
include mpir.h: not found
cannot find GMP nor MPIR

Setting the env variables to indicate the path allows to build locally


export CPPFLAGS="-I/opt/homebrew/Cellar/gmp/6.3.0/include $CPPFLAGS"
export LDFLAGS="-L/opt/homebrew/Cellar/gmp/6.3.0/lib $LDFLAGS"

./configure
make
antoinemine commented 2 weeks ago

Note: I just removed a comment by user abdulhkeemGit that contained a link to a zip-file hosted on mediafire containing executable code, with no explanation and seemingly no relation to the issue at hand.