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

Add support for MSYS2 #908

Closed
wants to merge 0 commits into from
Closed

Add support for MSYS2 #908

wants to merge 0 commits into from

Conversation

eonj
Copy link

@eonj eonj commented Feb 22, 2017

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

@msftclas
Copy link

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
Member

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

@eonj
Copy link
Author

eonj commented Feb 22, 2017

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
Author

eonj commented Apr 6, 2017

@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
Member

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.

None yet

3 participants