-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Release arm64
/ universal binaries for macOS
#5848
Comments
arm64
/ universal binaries for macOSarm64
/ universal binaries for macOS
what is the build configuration for this? |
releases use hosted agents configured as: |
On my M1 Mac, the usual I took a quick stab at cross-compiling by passing |
Build config for cross-compilation on Overall, I had to
(Keeping SSE would fail with |
I read somewhere, but can't find it, that you can pass -arch x86_64 amd64 and get a single (universal?) binary. |
Yes, passing On my machine, the results look fine:
I don't know if there's a way to control per-architecture switches (FP unit / SSE) this way, though. |
Thanks, closer with scripts/nightly.yaml. nightly now builds, but I see: nikolaj@DESKTOP-7DPTQP8:/mnt/c/mac/z3-4.8.15-x64-osx-10.16/bin$ file z3 libz3.* Only the archive contains some trace of arm64. |
Cool, thanks for working on this! I checked the latest nightly, can confirm that only the static library reports as a universal binary on my machine. Maybe it's the toolchain version? This mentions that XCode >= 12.2 is necessary to build universal binaries. I'm running the command-line tools, which report as
|
toolchains should be >= 12.2 (https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops&tabs=yaml) During compilation it shows |
Is clang required? It currently configures with gcc. Host platform: Darwin |
So far, I have only tried this with Apple's clang that's distributed with the Xcode command line tools. |
I am a bit stuck here: the build uses g++ by default. It can be changed but requires some bandwidth and understanding of what may work. |
Could you try the arm64 releases from the Nightly build? |
This is great, thank you! I verified the binary, dynamic and static libraries working natively on arm64. The Java dynamic library still seems to be built for x86_64?
When I try running the Java example on an arm64 JVM I get:
The exception ("no libz3java") is expected if the library file is for a wrong architecture; I confirmed that the paths are set correctly. |
what is the command line for javac to cross compile to arm64? |
This is C++ code, the Makefile target is |
CXXFLAGS should have arch arm64 already, so I don't see immediately how it can miss the cross compile. This is probably easiest to debug on a non-arm MacOS x64 by running |
Hey there, the second link doesn't exist anymore. I was trying to do pip install z3-solver but there is this build error for z3-solver |
The new link is https://github.com/Z3Prover/z3/releases/download/Nightly/z3_solver-4.8.18.0-py2.py3-none-macosx_10_16_arm64.whl In other words, the version number increased since I pasted in the link. The path to the "Nightly" build does not change:
you get directed to the nightly builds and you can browse the assets of the nightly build. The bad news is that I don't think this works. It was tested before and I was told it didn't install / work properly.
You can see the steps used for building the arm64 version.
It definitely isn't a project that goes to the core of developing automated reasoning tools, but I think it is an issue that affects a growing audience. So maybe we can call it "take one for the team not-so-beach project". I am even happy to facilitate a vendor position for this, with the caveat that the overhead of setting it up for this specific task probably outweighs the overall efforts. |
Java bindings with nightly were tested by Isabel Garcia Contreras and reported to work. |
Did the path to the nightly change? I am seeking the Java bindings for arm64 and am getting 404s |
@TodAmon they have, new links above |
Great |
in release 4.9.1 |
The When compiling it myself with an M1 chip I needed to add |
Can you paste the line from your Makefile? Line 1834 in af80bd1
but it is easier if there is some corrobation. I can then run the nightly build and we can try this before I release 4.9.2 fully (it will be soon). |
I don't think current compilation pipeline can produce universal binaries. However, there are both x86 and arm releases of z3. Is the claim that x86 binary included in arm release? |
mk_unix_dist.py takes a command-line to specify arm64. See Line 51 in af80bd1
|
It seems to be the one from Line 1834 in af80bd1
|
@agurfinkel yes the arm release does not include an arm binary:
|
Could you (one of you) see if the current nightly is built correctly? https://github.com/Z3Prover/z3/releases/download/Nightly/z3-4.9.2-arm64-osx-11.0.zip Some context: the link flags did not have the arm64 flag specified. I have updated the build script to include link flags that include the -arm64 option (at least should). |
Looks good! Confirmed via
|
release 11.0 includes these fixes |
It would be great to include
arm64
binaries for macOS in the github releases, given the adoption of Apple's M1.The text was updated successfully, but these errors were encountered: