Skip to content

Add support for MSYS2 - #908

Closed
Eon Jeong (eonj) wants to merge 0 commit into
Z3Prover:masterfrom
eonj:master
Closed

Eon Jeong (eonj) wants to merge 0 commit into
Z3Prover:masterfrom
eonj:master

Conversation

@eonj

Copy link
Copy Markdown

With this patch, Z3 is compiled via MSYS shell and toolchain of MSYS2. (MINGW32 shell and MINGW64 shell is not yet cared.)

@msftclas

Hi @Uni-, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!

This seems like a small (but important) contribution, so no Contribution License Agreement is required at this point. Real humans will now evaluate your PR.

TTYL, MSBOT;

@wintersteiger

Copy link
Copy Markdown
Contributor

Our scripts already supported mingw, see is_cygwin_mingw() and IS_CYGWIN_MINGW. Do we really want -D_CYGWIN when compiling via mingw?

@eonj

Eon Jeong (eonj) commented Feb 22, 2017 •

Copy link
Copy Markdown
Author

It's MSYS2, MinTTY subsystem running MinGW-w64 toolchain, based on recent Cygwin fork. It's different from traditional cmd.exe running MinGW toolchain.

When I run ./configure in the MSYS shell, I got this error:

Traceback (most recent call last):
  File "scripts/mk_make.py", line 21, in <module>
    mk_makefile()
  File "/home/Eon/Development/z3/scripts/mk_util.py", line 2575, in mk_makefile
    mk_config()
  File "/home/Eon/Development/z3/scripts/mk_util.py", line 2474, in mk_config
    raise MKException('Unsupported platform: %s' % sysname)
mk_exception.MKException: 'Unsupported platform: MSYS_NT-10.0'

What I got with ./configure in MINGW64 shell is:

Writing build/Makefile
Copied Z3Py example 'all_interval_series.py' to 'build/python'
Copied Z3Py example 'example.py' to 'build/python'
Copied Z3Py example 'socrates.py' to 'build/python'
Copied Z3Py example 'visitor.py' to 'build/python'
Makefile was successfully generated.
  compilation mode: Release
  platform: x86
To build Z3, open a [Visual Studio Command Prompt], then
type 'cd C:/Users/Eon/Development/z3/build && nmake'

Remark: to open a Visual Studio Command Prompt, go to: "Start > All Programs > Visual Studio > Visual Studio Tool

You're right, we may not want -D_CYGWIN in MSYS shell really, but this is what worked and I made a PR. I wish I can make a better patch later on.

@eonj

Copy link
Copy Markdown
Author

Christoph M. Wintersteiger (@wintersteiger) My conclusion is, in short, it's good to set -D_CYGWIN in build script for current source code when compiling in MSYS2. If you think the macro name is inappropriate for MSYS2, every appearance of the name _CYGWIN should be modified in source code.

@wintersteiger

Copy link
Copy Markdown
Contributor

This is not about the appropriateness of the macro name. On the MSYS2 platform we are not supposed to behave like we do on the Cygwin platform (adding -D_CYGWIN changes the behavior of Z3). Also, we already had support for mingw/msys, we just didn't recognize that particular version string yet.

I'm trying to add another commit to this PR/branch, but GitHub is acting up.

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