-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
Build for Apple Silicon (Arm64, aarch64) #147
Comments
@RemiDesgrange be aware that you can't build qgis on qt6 completely yet -- see qgis/QGIS-Enhancement-Proposals#243 for a summary of the current situation |
Hi Remi,
Side note, I am working a bit on trying to bring the deps to a CI (see https://github.com/qgis/QGIS-Mac-Packager/tree/ci-v2). |
I can confirm that you have an adherence to where ninja is located, we'll have to use I'll try to build with Qt5. But I'll first have to build the deps 😄 |
On the other hand, it is possible to ship Apple Silicon and x86_64 binary in the same DMG: "universal binary" (https://developer.apple.com/documentation/apple-silicon/building-a-universal-macos-binary). I have little knowledge of how Qt build works, so no idea if it's possible or not to ship Apple Silicon and x86_64 binary of QGIS in the same DMG. |
that's the road vcpkg is apparently following microsoft/vcpkg#22908 |
we do not bundle anything from homebre |
@nyalldawson I identified that steps have been made to build QGIS with Qt6, What I can't see though is where we are regarding the QEP you wrote. Is it started yet? Is there a branch where we could test it (in the qgis/QGIS repo)? Thx. |
This QEP will go through the grant proposal (funding) process, so it is not started yet. |
Since qt5 seems to be available for Apple Silicon right now (at least in homebrew) is there a reconsideration about this? I would be interested in working on it, but I am no CMAKE expert and could use some help. |
If Qt5 is available on m1, there should have nothing but some hard-coded |
Actually, in Apple Silicon the default path for homebrew is I tried to build the dependencies, but certain things aren't working out of the box. I suppose the build configuration of certain dependencies might need to be changed to fit for the platform. |
Is there any news on this side? Qt5 can be compiled on m1, several attempts have been made to have a native Apple Silicon build (see qgis/QGIS#46299), |
It is possible to build up-to-date QGIS completely on Apple Silicon, running Ventura, with Xcode 14.2 – despite still using Qt5. It's all set up on MacPorts, currently for 3.28.4. There are a couple of traps, however:
Is there anyone around who knows how to fix the QGIS-Mac-Packager? I tried, but gave up in despair rather early in the process; MacPorts was a more effective way of getting a functioning QGIS without investing several days deciphering this packager. |
The conda-forge community have successfully built QGIS 3.28 and 3.30 for Arm64 and aarach64. I wasn't able to test it much as I don't have a mac arm64 myself, but seems functional to others. But it's definitely possible: |
Correct me if I'm wrong @SrNetoChan, but I can't take the DMG from conda, copy/paste it to a computer without conda, and having QGIS to work properly? That's the problem with macports/conda setup. @justinbb I already try to make this repo working with AppleSilicon but it was a lot a work, and a lot of breaking changes. |
@RemiDesgrange You can't with conda (though perhaps there is a way, never checked). You can with macports. I haven't managed to install it with macports however. Perhaps on a clean vm it might work, but I don't have experience with ports, just know there is a command to build an independent binary. |
Probably there is, but I don't know how to do it. I know there's something called conda constructor to create installers. |
conda is at the moment the easiest, quickest way to get an up-to-date QGIS running on a Mac. @SrNetoChan Nicely done! The problem with the conda version is that it is not a Mac app bundle (though there is a vestigial bundle created by QGIS's own cmake configuration); you run it from the shell by starting "qgis" in conda's bin directory, as if it were a command-line tool, and it dynamically links with many libraries in conda's lib directory. @RemiDesgrange To move it to a new computer, it's much easier to install Miniconda3 anew, then conda install qgis, than to try to make an archive of the conda directory hierarchy and copy it elsewhere. Compared with MacPorts, conda installs QGIS very quickly, uses more up-to-date versions of many libraries, and has a better-configured GDAL library. However, since there are various optional bits and pieces that not everyone uses, it's possible there might be gaps here and there. MacPorts does a better job of making an app bundle – not according to the rules, but it is usable. The proofs of concept clearly exist for building on Mac (Intel or Apple Silicon) the latest QGIS with recent versions of the libraries it depends on. The problems making official, standalone app bundles should eventually get dealt with (see #160 (comment) in QGIS-Mac-Packager). |
@SrNetoChan There is one more thing I had to do to avoid startup errors from SIP and Python. That vestigial bundle is not completely unused…
For the more general question of making app bundles from conda: see the interesting discussion by Daniël Schreij and set of scripts. I'll try out his suggestion one of these days. However, it's still not a way of making a conformant bundle, which requires strict separation of code and data directories to allow effective code signing. |
Some time back, I wrote an article in Italian on how to install QGIS with
MacPorts. It might be useful although I should update it.
https://ivano-giuliano.medium.com/installazione-di-qgis-3-beta-su-piattaforme-macos-tramite-macports-28940731ed2b
Il giorno dom 26 mar 2023 alle 04:40 justinbb ***@***.***> ha
scritto:
… @SrNetoChan <https://github.com/SrNetoChan> There is one more thing I had
to do to avoid startup errors from SIP and Python. That vestigial bundle is
not completely unused…
cd QGIS.app/Contents/MacOS
ln -s ../../../lib .
ln -s ../../../share .
For the more general question of making app bundles from conda: see the
interesting discussion by Daniël Schreij
<https://dschreij.github.io/how-to/package-anaconda-environments-as-apps>
and set of scripts <https://github.com/dschreij/anaconda-env-to-osx-app>.
I'll try out his suggestion one of these days. However, it's still not a
way of making a conformant bundle, which requires strict separation of code
and data directories to allow effective code signing.
—
Reply to this email directly, view it on GitHub
<#147 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACMJDNGPYTFXBREZW33IPSTW56UC7ANCNFSM5N3SZQRQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Hi I found this thread and it's nice to read good news regarding Mac environment, especially Apple Silicon Arch. A small tip for those who want to test conda native build without polluting the system environment, or even try multiple QGIS vesions at once :
Script:
|
Is there any easy and simple way to make this happen? I mean have the last version of QGIS for Apple Silicon and with Qt6 built? I'm wondering why we don't use Homebrew for this… even if we just need to build locally. |
Hi 👋
It seems that there is no QGIS build for apple silicon hardware so far. I started to look at, it's much more tricky that it seems !! I listed some checks that needed to be performed in order for QGIS to work on Apple Silicon hardware (arm64 ou aarch64)
/opt/Qt/6.X.Y
: Qt 5 is not supported on apple silicon hardware https://www.qt.io/blog/qt-on-apple-siliconsudo mv /opt/Qt/6.X.Y/{macos,clang_64}
$(arch)
(or something like that) make arg x86
to see what’s need to be changed. Mostlyrecipe.sh
for python stuff.config/{nightly,ltr}.conf
andconfig/default.conf
to remove any Qt5 variant. Also add a-DWITH_QT6=ON
in the config./usr/local
and on Apple Silicon to/opt/homebrew
.Maybe the qgis mac deps need to be completely revamp with 1 build for x86 and 1 build for arm (ex: `qgis-deps-x86_64-0.10.0.tar.gz).
I'll fork the repo and make some tried, but I already identify some hardcoded path that need to be added to the config files. Feel free to add more checks in order to have a complete build of QGIS on Apple Silicon hardware !
The text was updated successfully, but these errors were encountered: