Rate This Document
Findability
Accuracy
Completeness
Readability

Failed to Install z3-solver

Symptom

The z3-solver installation failed.

Key Process and Cause Analysis

To a large extent, the GCC version and CMake version are too early (CMake 3.4 or later is required). Therefore, you need to upgrade GCC and CMake.

Conclusion and Solution

The following describes how to upgrade to GCC 7.3.0 and CMake 3.13.4.

  1. Upgrade GCC.
    1. Refer to the following document: https://www.hikunpeng.com/document/detail/en/kunpengcpfs/ecosystemEnable/OpenStack/kunpengopenstack_05_0017.html
    2. After the upgrade is complete, add environment variables.
      1
      2
      export LD_LIBRARY_PATH=/usr/local/mpc-1.0.3/lib:/usr/local/gmp-6.1.2/lib:/usr/local/mpfr-3.1.5/lib:/usr/local/gcc-7.3.0/lib64:/usr/local/isl-0.18/lib:/usr/local/lib:/usr/lib:$LD_LIBRARY_PATH
      export PATH=/usr/local/gcc-7.3.0/bin:$PATH
      
  2. Upgrade CMake.
    1. Download the CMake installation package.
      1
      wget https://github.com/Kitware/CMake/archive/refs/tags/v3.13.4.tar.gz --no-check-certificate
      
    2. Decompress the package, go to the directory, and run the following commands:
      1
      2
      3
      ./bootstrap
      gmake
      gmake install
      
  3. After both GCC and CMake are upgraded, reinstall z3-solver.
    1
    pip3 install z3-solver==4.8.15.0