Compile z3 solver on redhat6.4, redhat6.4z3

Source: Internet
Author: User

Compile z3 solver on redhat6.4, redhat6.4z3

Because of the project requirements, we used Microsoft's z3 Solver For constraints, but the z3 solver did not release the compiled binary version on the Red Hat platform, our operating environment is RedHat Enterprise 6.4, so we need to compile the corresponding binary.

Z3 is an excellent SMT solver (also known as theorem validators) developed by Microsoft. It can check the enforceability of logical expressions. The latest version is 4.4.1 on the github homepage.

Download the latest code from the z3 Homepage

git clone git@github.com:Z3Prover/z3.git

Switch the working directory to Z3.

python ./scripts/mk_make.py

Report the following errors

Traceback (most recent call last):File "./scripts/mk_make.py", line 16, in <module>update_version()File "/home/ace/z3/scripts/mk_util.py", line 2614, in update_versionmk_version_dot_h(major, minor, build, revision)File "/home/ace/z3/scripts/mk_util.py", line 2641, in mk_version_dot_h'Z3_FULL_VERSION': get_full_version_string(major, minor, build, revision)File "/home/ace/z3/scripts/mk_util.py", line 3414, in configure_fileprint("Generating {} from {}".format(output_file_path, template_file_path))ValueError: zero length field name in format

This error is really hard to locate. The first thought was related to the python version. At that time, I was not sure about it. I finally found a bugfix that seemed to be a bit relevant here after I went to Google for a search.

Fix build error introduced with commit 1c5a57a "glapi/es3.1: Add supportfor GLES versions > 3.0" with Python < 2.7.File "src/mapi/glapi/gen/gl_genexec.py", line 230, in <module>printer.Print(api)File "src/mapi/glapi/gen/gl_XML.py", line 120, in Printself.printBody(api)File "src/mapi/glapi/gen/gl_genexec.py", line 187, in printBodycondition_parts.append('(ctx->API == API_OPENGLES2 && ctx->Version >= {})'.format(int(f.api_map['es2'] * 10)))ValueError: zero length field name in format

It should be related to the python version, so we started to upgrade the python version of RedHat. The default python version of RedHat 6.4 is 2.6.6. the upgrade process is based on an article in the linux community.

Upgrade python to 2.7.6 and run it again.

python ./scripts/mk_make.py

Or Error

UnicodeEncodeError: 'ascii' codec can't encode character u'\xa9' in position

However, this error is easy to understand and the solution is also simple. Add it in the scripts/mk_util.py file header.

import sysreload(sys)sys.setdefaultencoding('utf-8')

Specify the file character set as UTF-8.

Then run

python scripts/mk_make.py

Compile the configuration and follow the instructions on the official website.

cd buildmakesudo make install

The compilation was successful, and the expected results were obtained by entering the test file.

 

 

Refer:

Https://github.com/Z3Prover/z3

Http://code.metager.de/source/history/freedesktop/mesa/mesa/src/mapi/

Http://www.linuxidc.com/Linux/2014-03/98608.htm

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.