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: Revise the recipe to support Conan v2 and add the latest four minor releases. #17244

Merged
merged 21 commits into from
Jun 3, 2023

Conversation

0xFireWolf
Copy link
Contributor

@0xFireWolf 0xFireWolf commented Apr 26, 2023

Specify library name and version: z3/4.9.1, 4.10.2, 4.11.2, 4.12.1

This PR contains the following changes:

  • Revise the recipe to make it compatible with both Conan v1 and v2.
  • Fix an issue that the option multithreaded is passed to Z3's build system improperly.
    • The correct CMake variable is Z3_SINGLE_THREADED instead of SINGLE_THREADED.
  • Remove deprecated old versions, 4.8.x and earlier.
  • Remove the option multiprecision.
  • Remove the support for MPIR and its related patches that modify the original CMakeLists.txt for each release.
    • Note that Z3 officially supports GMP only. Hacking the build system for each Z3 release to use MPIR instead of GMP makes it hard to maintain the recipe. Users who strongly prefer MPIR to GMP may consider to submit a proposal to Z3's development team.
  • Add a new boolean option use_gmp whose default value, False, is consistent with the default value of Z3's CMake option Z3_USE_LIB_GMP.
  • Patch CMakeLists.txt for each supported version to use the GMP library provided by Conan Center.
    • Note that this patch is implemented in Python and will be applied if and only if users have specified to use the GMP library (i.e., by setting the option use_gmp=True)
  • Raise the minimum GCC version to 8.
    • Compiling Z3 using GCC 7 leads to an internal compiler error.
  • Set the flag -stdlib explicitly when compiling Z3 using Clang on Linux to fix the linker errors related to the standard library.
  • Disable the test suite "DeMorgan" because it triggers a page fault if Z3 v4.11.2 is compiled by Clang in release mode.

Known Issues:
When testing the recipe with the option use_gmp=True, Z3 cannot find the header gmp.h even though Conan has generated the target gmp::gmp successfully. A little help here would be much appreciated. For your convenience, you can test the recipe using the following commands. Note that the CI pipeline won't be able to capture this issue, because by default use_gmp is false.

# Use Z3's internal implementation
conan create all/conanfile.py --version 4.12.1 --build missing -o "z3*:use_gmp=False"
conan create all/conanfile.py --version 4.11.2 --build missing -o "z3*:use_gmp=False"
conan create all/conanfile.py --version 4.10.2 --build missing -o "z3*:use_gmp=False"
conan create all/conanfile.py --version 4.9.1 --build missing -o "z3*:use_gmp=False"

# Use GMP's implementation: gmp.h header not found error
conan create all/conanfile.py --version 4.12.1 --build missing -o "z3*:use_gmp=True"
conan create all/conanfile.py --version 4.11.2 --build missing -o "z3*:use_gmp=True"
conan create all/conanfile.py --version 4.10.2 --build missing -o "z3*:use_gmp=True"
conan create all/conanfile.py --version 4.9.1 --build missing -o "z3*:use_gmp=True"

Please let me know if we can improve this recipe further. Thanks for your time.


@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

…rary should be used and its default value is consistent with the default value of Z3's CMake option `Z3_USE_LIB_GMP`.
…library provided by Conan Center if and only if users have specified to use GMP.
…t when compiled with Z3 v4.11.2 and Clang in release mode.
@conan-center-bot

This comment has been minimized.

@@ -21,109 +23,104 @@ class Z3Conan(ConanFile):
"shared": [True, False],
"fPIC": [True, False],
"multithreaded": [True, False],
"multiprecision": ["internal", "gmp", "mpir"]
"use_gmp": [True, False]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've read your rational about this change, but do you know that there is set_property in CMakeDeps to avoid patching upstream CMakeLists? I think we can keep this option without any maintenance burden with some smart set_property.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see what you means. We can pretend that the target name of the MPIR library is GMP::GMP. I will give a try. Thanks for the suggestions.

…brary provided by Conan Center instead of patching `CMakeLists.txt` manually.
@0xFireWolf 0xFireWolf closed this May 11, 2023
@0xFireWolf 0xFireWolf reopened this May 11, 2023
@conan-center-bot

This comment has been minimized.

@CLAassistant
Copy link

CLAassistant commented May 18, 2023

CLA assistant check
All committers have signed the CLA.

@conan-center-bot
Copy link
Collaborator

Conan v1 pipeline ✔️

All green in build 11 (df863666458ebdd3c0d075afb25c5a86308c427e):

  • z3/4.12.1@:
    All packages built successfully! (All logs)

  • z3/4.9.1@:
    All packages built successfully! (All logs)

  • z3/4.11.2@:
    All packages built successfully! (All logs)

  • z3/4.10.2@:
    All packages built successfully! (All logs)

  • z3/4.12.2@:
    All packages built successfully! (All logs)


Conan v2 pipeline ✔️

Note: Conan v2 builds may be required once they are on the v2 ready list

All green in build 10 (df863666458ebdd3c0d075afb25c5a86308c427e):

  • z3/4.9.1@:
    All packages built successfully! (All logs)

  • z3/4.10.2@:
    All packages built successfully! (All logs)

  • z3/4.11.2@:
    All packages built successfully! (All logs)

  • z3/4.12.1@:
    All packages built successfully! (All logs)

  • z3/4.12.2@:
    All packages built successfully! (All logs)

@conan-center-bot conan-center-bot requested a review from AbrilRBS June 1, 2023 12:01
@conan-center-bot conan-center-bot merged commit 374db56 into conan-io:master Jun 3, 2023
@0xFireWolf 0xFireWolf deleted the z3-v2 branch June 4, 2023 01:04
datalogics-kam added a commit to datalogics-kam/conan-center-index that referenced this pull request Jun 5, 2023
…cmake-combined-recipe

- Resolved conflicts.

- Updated recipes/cmake/combined/conandata.yml to use CMake 3.26.4
  instead of 3.26.3

* 'master' of github.com:conan-io/conan-center-index: (219 commits)
  (conan-io#17379) zpp_bits: add version 4.4.17, add package_type
  (conan-io#17811) mongo-c-driver: add version 1.23.4
  (conan-io#17824) [bot] Update list of references (prod-v2/ListPackages)
  (conan-io#17827) [bot] Update authorized users list (2023-06-05)
  (conan-io#17791) c4core: update fast_float
  (conan-io#17447) llhttp: conan v2 support
  (conan-io#17821) daw_utf_range: update daw_header_libraries
  (conan-io#17819) add mbits-diags/0.9.5
  (conan-io#17471) Add Boost 1.82.0
  (conan-io#17816) uni-algo: add version 0.8.1
  (conan-io#17815) flatbuffers: add version 23.5.26
  (conan-io#17801) Bring tl-function to conan2
  (conan-io#17802) Bring ring-span-lite to conan2
  (conan-io#16572) ragel: support conan v2
  (conan-io#17244) Z3: Revise the recipe to support Conan v2 and add the latest four minor releases.
  (conan-io#17355) avahi/0.8: Disable the use of the setproctitle function on Linux
  (conan-io#17744) Bumped CMake to 3.26.4
  (conan-io#17763) Libwebsockets support for conan2
  (conan-io#17808) octo-logger-cpp: add version 1.4.0
  (conan-io#17428) Add libmemcached library
  ...
pezy pushed a commit to pezy/conan-center-index that referenced this pull request Jul 15, 2023
…e latest four minor releases.

* z3: Remove the entry `base_path` from each patch descriptor.

* z3: Create the test package for Conan 1.x.

* z3: Make the test package compatible with Conan 2.x.

* z3: Make the recipe compatible with Conan 2.x.

* z3: Add the latest three stable releases, 4.12.1, 4.11.2, 4.10.2.

* z3: Add a new boolean option `use_gmp` to specify whether the GMP library should be used and its default value is consistent with the default value of Z3's CMake option `Z3_USE_LIB_GMP`.

* z3: Patch `CMakeLists.txt` for all supported versions to use the GMP library provided by Conan Center if and only if users have specified to use GMP.

* z3: Add `gmp/6.2.1` as its dependency if and only if users have specified to use GMP.

* z3: Remove the deprecated option `multiprecision`.

* z3: Remove unneeded import statements from the recipe.

* z3: Remove deprecated patches.

* z3: Remove deprecated old versions.

* z3: Fix an issue that `CMakeLists.txt` is not patched.

* z3: Add version 4.9.1.

* z3: Specify the encoding when accessing `CMakeLists.txt`.

* z3: Raise the minimum GCC version to 8 because compiling with GCC 7 leads to a segfault.

* z3: Set the flag `stdlib` for Clang on Linux to fix the linker errors.

* z3: Disable the `DeMorgan` test suite because it triggers a page fault when compiled with Z3 v4.11.2 and Clang in release mode.

* z3: Use `replace_in_file` to patch `CMakeLists.txt`.

* z3: Use `CMakeDeps.set_property()` to override the name of the GMP library provided by Conan Center instead of patching `CMakeLists.txt` manually.

* z3: Add v4.12.2.
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.

7 participants