-
Notifications
You must be signed in to change notification settings - Fork 282
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 M1 macs #2173
Comments
Thank you for this request. At the time of the 0.27.5 release, my MacBookPro with the m1 chip was generating thousands of linker visibility warnings which I didn't understand. The x86_64 build was clean. So, I only provided the x86_64 on Darwin. I'm happy to say that Luis (@piponazo) solved the linker issue on branch main, however the fix cannot be back-ported to 0.27-maintenance because it will break the 0.27 API. If there is a 0.27.6 release, the m1 build is unlikely to be provided because or the linker warnings. The release of binary builds is a relic from the days before CI. Team Exiv2 decided to discontinue binary releases after the 0.27 "dots" because we provide daily builds from branch main. Can a member of Team Exiv2 confiirm/configure the macOS daily to build both x86_64 and arm64/aarch64? |
@vieux. I frequently (almost daily) build exiv2 on my MBP with the m1 chip. Both branches 0.27-maintenance and main build arm64 binaries:
I got the MBP/m1 in February 2021 and the machine has always built arm64 binaries. I had some initial difficulties with the linker wanting to link arm64 build artefacts with x86_64 libraries in /usr/local/lib which the Apple Transfer utility had copied from my "old" Intel MBP. The current version of Xcode is 13.3 and I have cmake 3.22.1 installed. I will be happy to screen share with you on Zoom to assist you to get up-and-running. |
We are only building with x86_64 at the moment: It would be nice to add support for the Therefore, I do not think we can do much about it in CI. Of course, we could add some instructions in our README in case we need to do something special for that platform. |
I'm not aware of anything special about building on the Apple/arm64/m1 chip, so I don't think it's necessary to change README.md for the m1. I believe Xcode running on Intel can build arm64 and "universal" builds. A "universal" has both x86_64 and arm64 code. I'll investigate. If this is possible, I'll update README.md to discuss this. |
I have built x86_64 on the m1 machine. The cmake documentation is here: https://cmake.org/cmake/help/latest/variable/CMAKE_APPLE_SILICON_PROCESSOR.html#variable:CMAKE_APPLE_SILICON_PROCESSOR _/0.27-maintenance/ $ rm -rf build ; mkdir build ; cd build
_/0.27-maintenance/build $ cmake .. -DEXIV2_ENABLE_BMFF=1 -DCMAKE_APPLE_SILICON_PROCESSOR=x86_64
...
_/0.27-maintenance/build $ make
...
_/0.27-maintenance/build $ file /Users/rmills/gnu/github/exiv2/0.27-maintenance/build/bin/exiv2
/Users/rmills/gnu/github/exiv2/0.27-maintenance/build/bin/exiv2: Mach-O 64-bit executable x86_64
_/0.27-maintenance/build $ I know that I do not have x86_64 libraries on my m1, so I believe it's linking expat and zlib using macOS/SDK installed by Xcode. I'll investigate "universal" builds later today. |
I have built "universal" on the m1 machine based on this discussion: https://stackoverflow.com/questions/65157483/macos-build-universal-binary-2-with-cmake
Observations:
|
No user feedback. I'm going to close this. |
Hi @clanmills , regarding this:
At the moment exiv2json is used in some of the bash tests:
But those tests are exercising the exiv2json sample app and not too much the library ... I would also vote for removing that sample app. I can create a PR for that pointing to |
@piponazo Well spotted about those tests. #984 concerns a null-ptr read in exiv2json, So when samples/exiv2json is killed, test_issue-984.py should be removed. test_issue_1054.py is there to prevent a regression of code that recursively parses the xmp output into JSON. So, when exiv2json.cpp dies, this test should also be removed. @vieux I'm very surprised you haven't said anything. Is the M1 building OK for you? It would be useful to get the CI to build "universal" on branch 'main'. I will re-open this issue. |
hey all, I tried building on mac m1 air, but it is failing again and again. Can someone please share build steps for m1 macs, that will be very helpful. Thanks in advance. I am stuck here, on make it is giving error updates: Any direction on how to create a standalone m1 build would be helpful. Updates: |
Does anyone mind helping the python version of this project out and creating mac compatible builds? |
Does anyone have any updates for building / consuming EXIV2 universally for M1 and Intel machines both? |
Is your feature request related to a problem?
Exiv2 darwin builds are only available for x86_64, not arm64/aarch64
Describe the solution you would like
Update build scripts and CI to build on M1 macs
Describe alternatives you have considered
I tried building locally, but the binary produced are still x86_64
The text was updated successfully, but these errors were encountered: