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

Z3 is installed on system but get error "Failure("Z3 not installed")" #332

Closed
Shawdox opened this issue Jun 27, 2024 · 9 comments · Fixed by #379
Closed

Z3 is installed on system but get error "Failure("Z3 not installed")" #332

Shawdox opened this issue Jun 27, 2024 · 9 comments · Fixed by #379
Assignees

Comments

@Shawdox
Copy link

Shawdox commented Jun 27, 2024

What I ran:

sudo apt install z3
z3
# Z3 [version 4.8.7 - 64 bit]. (C) Copyright 2006-2016 Microsoft Corp.
# Usage: z3 [options] [-file:]file
owi conc test.wat

What I got:

owi: internal error, uncaught exception:
     Failure("Z3 not installed")

I'm a beginner in OCaml, is there something I'm getting wrong?

@filipeom
Copy link
Collaborator

I believe the version of Z3 available through apt is not compiled with OCaml bindings. Therefore, you should install Z3 through the opam package manager. For example:

opam install z3

@Shawdox
Copy link
Author

Shawdox commented Jun 27, 2024

Hi, thanks for the help. I tried to use this opam install z3 and recompiled the whole project, but still got the samle problem.

opam install z3
opam install . --deps-only
dune clean
dune build -p owi @install
dune install

@zapashcanon
Copy link
Member

You should rebuild and reinstall smtml after installing Z3. (We changed a lot of things recently in smtml so things are a little bit unstable, sorry!)

@filipeom
Copy link
Collaborator

filipeom commented Jun 27, 2024

You should rebuild and reinstall smtml after installing Z3. (We changed a lot of things recently in smtml so things are a little bit unstable, sorry!)

You can try to do this:

opam install z3 # skip if you already have done this 
opam update && opam install smtml.0.2.0
dune build -p owi @install
dune install

If you get issues saying the version of smtml is not available consider updating opam repository to the git version:

opam repository remove default --all-switches
opam repository add default https://github.com/ocaml/opam-repository.git --all-switches --set-default
opam update && opam install smtml.0.2.0

@Shawdox
Copy link
Author

Shawdox commented Jun 27, 2024

Thanks! I tried to run all these commands but the issue is still unchanged. It's so weird.
Do you have any suggestion how to identity the root cause?

@filipeom
Copy link
Collaborator

Thanks! I tried to run all these commands but the issue is still unchanged. It's so weird. Do you have any suggestion how to identity the root cause?

Maybe you're opam switch is out of sync? Could you post the outputs of opam switch? And maybe even opam list just to see if the packages are correctly installed in your switch?

@Shawdox
Copy link
Author

Shawdox commented Jun 27, 2024

Thanks! I tried to run all these commands but the issue is still unchanged. It's so weird. Do you have any suggestion how to identity the root cause?

Maybe you're opam switch is out of sync? Could you post the outputs of opam switch? And maybe even opam list just to see if the packages are correctly installed in your switch?

That is the point. I just repull the repo and recomplie it, and the problem is solved.

@Shawdox Shawdox closed this as completed Jun 27, 2024
@zapashcanon zapashcanon reopened this Jun 27, 2024
@zapashcanon
Copy link
Member

I'm reopening because we should give some advice in the README about installing at least one solver (Z3 or Bitwuzla currently) if the user is interested in symbolic execution.

@krtab
Copy link
Collaborator

krtab commented Jun 27, 2024

We should wait for formalsec/smtml#165 to be merged and released to opam to check that everything works smoothly.

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

Successfully merging a pull request may close this issue.

4 participants