I am trying to use Z3 in OCaml in VSCode (Mac).
To make use of it, I wrote the following code: open Z3
but it has raised me the following error: Unbound module Z3 Merlin
So I understand Z3 is not installed.
However, I have just run: opam install z3
, so it should work.
I also realized that open Num
is working, so maybe it has to do with having an old version of OCaml (since Num
is now deprecated).
Any help?
EDIT:
I just discovered Z3 has not been correctly installed in the opam install z3
part. This is the message that has thrown:
[ERROR] The compilation of z3 failed at
"/Users/.../.opam/opam-init/hooks/sandbox.sh build make -C
build -j 3".
#=== ERROR while compiling z3.4.8.9-1 =========================================#
# context 2.0.8 | macos/x86_64 | ocaml-base-compiler.4.10.2 | https://opam.ocaml.org#ff95b837
# path ~/.opam/4.10.2/.opam-switch/build/z3.4.8.9-1
# command ~/.opam/opam-init/hooks/sandbox.sh build make -C build -j 3
# exit-code 2
# env-file ~/.opam/log/z3-21131-e7966f.env
# output-file ~/.opam/log/z3-21131-e7966f.out
### output ###
# /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:641:18: error: no template named 'numeric_limits'
# [...]
# ^
# /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:641:50: error: no template named 'numeric_limits'
# int _Bits = (numeric_limits<_IntT>::digits - numeric_limits<_FloatT>::digits)>
# ^
# /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:646:17: error: no template named 'numeric_limits'
# static_assert(numeric_limits<_FloatT>::radix == 2, "FloatT has incorrect radix");
# ^
# fatal error: too many errors emitted, stopping now [-ferror-limit=]
# 20 errors generated.
# make: *** [util/luby.o] Error 1
# make: *** Waiting for unfinished jobs....
<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
┌─ The following actions failed
│ λ build z3 4.8.9-1
It is giving me an error related to Xcode...
I guess correcting this will yield correcting the original unbound module
error. Is that the case? Any help with this?