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

Use system-shipped z3 libraries by pkg_config #248

Closed
wants to merge 4 commits into from

Conversation

wtdcode
Copy link

@wtdcode wtdcode commented Sep 10, 2023

Probably a bit more elegant way to use precompiled binaries compared to #193 by utilizing pkg-config, which is ubiquitous of all *nix platforms.

My usecase is to use homebrew installed z3 library.

Changes:

  • Detect dynamic/static precompiled libraries and use them with pkg_config
  • Add CI for macos using precompile libraries from homebrew.
  • Instead of manually encoded z3/src/api/z3.h, use the universal z3.h with corresponding include directories added, which should be a more general approach.

No break changes are introduced in theory and should be safe to go.

@waywardmonkeys
Copy link
Contributor

There is also now #249 which differs some from this ...

@wtdcode
Copy link
Author

wtdcode commented Sep 11, 2023

There is also now #249 which differs some from this ...

It’s totally different because it will use dynamic libraries from distributions like homebrew, Debian etc. In other words, the two PRs are not conflicting regarding features offered.

@waywardmonkeys
Copy link
Contributor

Okay, so now we have vcpkg support. What scenarios does having this help us in? We already build out of the box with syste, provided z3 on macOS (via homebrew) and with the Ubuntu package. Is it that you could build your own and have it elsewhere?

@wtdcode
Copy link
Author

wtdcode commented Oct 26, 2023

Okay, so now we have vcpkg support. What scenarios does having this help us in? We already build out of the box with syste, provided z3 on macOS (via homebrew) and with the Ubuntu package. Is it that you could build your own and have it elsewhere?

I can't understand how vcpkg helps here.

@poscat0x04
Copy link

Can confirm this works on fedora without manually setting the environment variable!

@poscat0x04
Copy link

@waywardmonkeys The problem is that bindgen is not finding the header files when it should be because the include path is not set up correctly. Most linux distributions use pkg-config to specify C library metadata such as include path, linker flags etc.

@poscat0x04
Copy link

poscat0x04 commented Nov 4, 2023

I've fixed the merge conflict, here is a patch: resolve-conflict.patch

@waywardmonkeys
Copy link
Contributor

I will get this landed later today when I am back home.

@poscat0x04
Copy link

politely pings @waywardmonkeys

@waywardmonkeys
Copy link
Contributor

I've done a fresh update of this PR in #277 and will land it once it passes CI.

Thanks for the initial work!

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 this pull request may close these issues.

3 participants