qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.28k stars 2.96k forks source link

Native support for Apple Silicon (ARM64 architecture) #46299

Open frozenpandaman opened 2 years ago

frozenpandaman commented 2 years ago

Feature description

A build of QGIS that runs natively on M1 Macs would be great to see.

https://doesitarm.com/app/qgis/

Additional context

No response

AtelierCartographique commented 2 years ago

It would be great indeed! Any news on this?

zadorozhko commented 2 years ago

Just FYI: Rosetta2 is claimed to be REMOVED in OSX 11.3 beta 3 update in certain countries. I guess M1 owners will run QGIS in QEMU very soon.

tsmcgrath commented 2 years ago

I want to see QGIS run natively on the M1 Ultra with a Mac Studio.

beginor commented 2 years ago

Is there anyone who can provide remote access to a M1 mac may be it's better to donate a M1 😊

tsmcgrath commented 2 years ago

AWS provides M1 Mac instances: https://aws.amazon.com/about-aws/whats-new/2021/12/amazon-ec2-m1-mac-instances-macos/

tsmcgrath commented 2 years ago

But there are python performance issues on M1: https://developer.apple.com/forums/thread/695963

felix-ht commented 2 years ago

@tsmcgrath this is not a generic python issue - but rather a issue with numpy. Python in general is actually really fast on a M1 - the issue is that the default numpy wheels seem to ship with a slow numerical library.

This can be fixed by compiling numpy from source. So this should not be a blocker.

Mielie commented 2 years ago

Any news/progress on this? Native M1 QGIS is something I would very much like to have.

geodowd commented 2 years ago

Just to add to this, I find QGIS quite slow to start and use on an M1 Mac as it is running under Rosetta. Native support would be very much appreciated.

Smo-RBR commented 2 years ago

M1 multiprocessing support would be very, very great. Especially with large datasets, qgis will often not repsonding because 100% CPU usage :/

zadorozhko commented 2 years ago

In MacOS 13 Ventura Rosetta is not installed by default. QGIS still can be launched after installing it from command line: softwareupdate --install-rosetta Make your own conclusions.

Mielie commented 2 years ago

Rosetta 2 is not installed by default on Monterey either, it gives the user the option to install it when you try to launch an intel binary. Seems Ventura is getting additional translation support for intel binaries running within a linux VM as well, so it is hardly showing signs of going away.

shaunakv1 commented 2 years ago

Native apple silicon build would be great to have! Is this on the roadmap?

joaquinezcurra commented 2 years ago

+1 for Apple Silicon M1 native support

bryik commented 2 years ago

Edit: Turns out it is possible to run QGIS natively on M1 via MacPorts. See the discussion below, particularly this comment which gives a good idea of the steps required. Note that brew must be uninstalled since "You can’t have Homebrew and MacPorts running on the same Mac".


I'm not affiliated with QGIS, but was curious about M1 support.

tl;dr: QGIS needs to move to Qt 6. When that is done, native M1 support should be possible show up in binaries distributed by QGIS.org. This is on the roadmap and work is in-progress.

https://github.com/qgis/QGIS/issues/46299#issuecomment-1230434887

From looking around Github issues:

Donations to QGIS partly go towards funding these kinds of grants.

Veence commented 2 years ago

Well, I do have QGIS 3.26.2 running natively on my M1 MacBookPro. Everything is installed from source using MacPorts

tudorbarascu commented 2 years ago

Just FYI if you use Asahi Linux on M1 macs QGIS runs natively out of the box.

bryik commented 2 years ago

Well, I do have QGIS 3.26.2 running natively on my M1 MacBookPro. Everything is installed from source using MacPorts

Interesting. I guess I should have said "native M1 builds probably won't show up on QGIS.org until after the Qt 6 transition". Good to know MacPorts is an option.

It was hard to find official info on the state of Qt 5's support for M1. All I turned up was a blog post which mentions at the very end:

Some patches already went into Qt 5, so Qt 5.15.4 and above should build and run by passing -device-option QMAKE_APPLE_DEVICE_ARCHS=arm64 to configure. Note that this configuration is not tested in CI, and is hence unsupported at this point.

Sounds scary 😅

beginor commented 2 years ago

Just FYI if you use Asahi Linux on M1 macs QGIS runs natively out of the box.

Would you like to share it? I think it is not easy to build qgis from source?

tudorbarascu commented 2 years ago

Just FYI if you use Asahi Linux on M1 macs QGIS runs natively out of the box.

Would you like to share it? I think it is not easy to build qgis from source?

Actually the latest QGIS comes with the packages.

If you want to run the LTR you can go to https://aur.archlinux.org/packages/qgis-ltr and click download from the snapshot of the build, after you unzip you go to that directory, edit the PKGBUILD file and change the architecture from arch=('x86_64') to arch=('aarch64'), after which you build the package with makepkg --clean --syncdeps --rmdeps -f. To install just run sudo pacman -U qgis-ltr-3.22.10-1-aarch64.pkg.tar.xz. So it's very easy.

Of course you need to install asahi linux first.

Veence commented 2 years ago

For information, the only part of QT5 that doesn’t compile on M1 is Scintilla. We’re stuck at 2.13.1 currently, but that’s not a dealbreaker.

Does Qt6 uses Metal for 3D display?

nyalldawson commented 2 years ago

@Veence

Does Qt6 uses Metal for 3D display?

No, qgis requires OpenGL right now -- even for qt 6 builds.

Mielie commented 2 years ago

For information, the only part of QT5 that doesn’t compile on M1 is Scintilla. We’re stuck at 2.13.1 currently, but that’s not a dealbreaker.

Does Qt6 uses Metal for 3D display?

Any pointers for getting QGIS to install using MacPorts? I've tried installing with the -s option but the install fails because it can't build py310-pyqt5-scintilla (command execution failed).

Veence commented 2 years ago

That’s exactly where the nub of the problem lies. I know there’s a way to install old versions, I’ll figure that out and post it here

Mielie commented 2 years ago

I can get the install past the error with pyqt5-scintilla by adding "use_xcode yes" to the portfile for py310-pyqt5-scintilla. Have now got it past all the dependencies but the QGIS build fails at 31%, still trying to figure that one out.

Veence commented 2 years ago

Ah, nice, I knew there was a workaround, it had been discussed in the mailing list. I’m going to do that too, thanks for posting it.

Mielie commented 2 years ago

This is the output of my qgis build, any pointers would be appreciated. Not getting much more with the log file:

% sudo port -sp install qgis3 ---> Computing dependencies for qgis3 ---> Fetching distfiles for qgis3 ---> Verifying checksums for qgis3 ---> Extracting qgis3 ---> Applying patches to qgis3 Warning: reinplace s|+ '.py'|+ '.py-3.10'| didn't change anything in /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_qgis3/qgis3/work/QGIS-3_26_2/python/plugins/processing/algs/gdal/AssignProjection.py Warning: reinplace s|+ '.py'|+ '.py-3.10'| didn't change anything in /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_qgis3/qgis3/work/QGIS-3_26_2/python/plugins/processing/algs/gdal/fillnodata.py Warning: reinplace s|+ '.py'|+ '.py-3.10'| didn't change anything in /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_qgis3/qgis3/work/QGIS-3_26_2/python/plugins/processing/algs/gdal/gdal2tiles.py Warning: reinplace s|+ '.py'|+ '.py-3.10'| didn't change anything in /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_qgis3/qgis3/work/QGIS-3_26_2/python/plugins/processing/algs/gdal/gdal2xyz.py Warning: reinplace s|+ '.py'|+ '.py-3.10'| didn't change anything in /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_qgis3/qgis3/work/QGIS-3_26_2/python/plugins/processing/algs/gdal/gdalcalc.py Warning: reinplace s|+ '.py'|+ '.py-3.10'| didn't change anything in /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_qgis3/qgis3/work/QGIS-3_26_2/python/plugins/processing/algs/gdal/merge.py Warning: reinplace s|+ '.py'|+ '.py-3.10'| didn't change anything in /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_qgis3/qgis3/work/QGIS-3_26_2/python/plugins/processing/algs/gdal/polygonize.py Warning: reinplace s|+ '.py'|+ '.py-3.10'| didn't change anything in /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_qgis3/qgis3/work/QGIS-3_26_2/python/plugins/processing/algs/gdal/proximity.py Warning: reinplace s|+ '.py'|+ '.py-3.10'| didn't change anything in /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_qgis3/qgis3/work/QGIS-3_26_2/python/plugins/processing/algs/gdal/retile.py Warning: reinplace s|+ '.py'|+ '.py-3.10'| didn't change anything in /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_qgis3/qgis3/work/QGIS-3_26_2/python/plugins/processing/algs/gdal/sieve.py ---> Configuring qgis3 Warning: reinplace s/\$\$\$\$/$$/ didn't change anything in /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_qgis3/qgis3/work/build/src/core/CMakeFiles/qgis_core.dir/build.make Warning: reinplace s/\$\$\$\$/$$/ didn't change anything in /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_qgis3/qgis3/work/build/src/core/CMakeFiles/qgis_core_autogen.dir/build.make ---> Building qgis3 Error: Failed to build qgis3: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_qgis3/qgis3/main.log for details. Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug. Error: Processing of port qgis3 failed ---> Scanning binaries for linking errors ---> No broken files found. ---> No broken ports found. jamesmilmine@MacBook-Pro qt5 % sudo port -s install qgis3 Password: ---> Computing dependencies for qgis3 ---> Building qgis3 Error: Failed to build qgis3: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_qgis3/qgis3/main.log for details. Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug. Error: Processing of port qgis3 failed

And:

% tail -20 main.log :info:build cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_qgis3/qgis3/work/QGIS-3_26_2/python/PyQt && /opt/local/bin/cmake -E make_directory /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_qgis3/qgis3/work/build/output/python/qgis/PyQt/uic :info:build cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_qgis3/qgis3/work/QGIS-3_26_2/python/PyQt && /opt/local/bin/cmake -E copy PyQt5/uic/properties.py /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_qgis3/qgis3/work/build/output/python/qgis/PyQt/uic :info:build make[2]: Leaving directory /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_qgis3/qgis3/work/build' :info:build [ 31%] Built target pyqtcompat :info:build make[1]: Leaving directory/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_qgis3/qgis3/work/build' :info:build make: ** [all] Error 2 :info:build make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_qgis3/qgis3/work/build' :info:build Command failed: cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_qgis3/qgis3/work/build" && /usr/bin/make -j8 -w all VERBOSE=ON :info:build Exit code: 2 :error:build Failed to build qgis3: command execution failed :debug:build Error code: CHILDSTATUS 85281 2 :debug:build Backtrace: command execution failed :debug:build while executing :debug:build "system {}$notty {}$callback {}$nice $fullcmdstring" :debug:build invoked from within :debug:build "command_exec -callback portprogress::target_progress_callback build" :debug:build (procedure "portbuild::build_main" line 8) :debug:build invoked from within :debug:build "$procedure $targetname" :error:build See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_qgis3/qgis3/main.log for details.

Veence commented 2 years ago

The error must be higher up in the log. Because make -j8 uses eight concurrent workers to build the software, the error is often buried in the output way before the actual build process stops (because the other threads continue, and the error is detected only when the build process reaches a sync point). Try and locate the word ‘error’ in the log, that might give you a better clue.

Mielie commented 2 years ago

Thanks for the info, looks like I have multiple error 127 so need to do some digging.

cat main.log | grep error -in 2291::debug:main libgpg-error 1.45_0 exists in the ports tree 2292::debug:main libgpg-error 1.45_0 is the latest installed 2293::debug:main libgpg-error 1.45_0 is active 2296::debug:main Changing to port directory: /opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/devel/libgpg-error 2307::debug:main No need to upgrade! libgpg-error 1.45_0 >= libgpg-error 1.45_0 6732::info:build make[2]: [src/providers/pdal/CMakeFiles/untwine.dir/untwine_autogen/mocs_compilation.cpp.o] Error 127 6734::info:build make[2]: [src/native/CMakeFiles/qgis_native.dir/qgis_native_autogen/mocs_compilation.cpp.o] Error 127 6736::info:build make[1]: [src/providers/pdal/CMakeFiles/untwine.dir/all] Error 2 6738::info:build make[1]: [src/native/CMakeFiles/qgis_native.dir/all] Error 2 6751::info:build make[2]: [src/app/qt-unix-signals/CMakeFiles/QTSignal.dir/QTSignal_autogen/mocs_compilation.cpp.o] Error 127 6754::info:build [src/app/qt-unix-signals/CMakeFiles/QTSignal.dir/all] Error 2 6761::info:build make[2]: [src/app/dwg/libdxfrw/CMakeFiles/libdxfrw.dir/libdxfrw_autogen/mocs_compilation.cpp.o] Error 127 6763::info:build make[1]: [src/app/dwg/libdxfrw/CMakeFiles/libdxfrw.dir/all] Error 2 6862::info:build [ 3%] Generating ui_qgserrordialogbase.h 6863::info:build cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_qgis3/qgis3/work/build/src/ui && /opt/local/libexec/qt5/bin/uic -o /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_qgis3/qgis3/work/build/src/ui/ui_qgserrordialogbase.h /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_qgis3/qgis3/work/QGIS-3_26_2/src/ui/qgserrordialogbase.ui 8518::info:build [ 16%] Generating ui_qgsauthsslerrorsdialog.h 8519::info:build cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_qgis3/qgis3/work/build/src/ui && /opt/local/libexec/qt5/bin/uic -o /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_qgis3/qgis3/work/build/src/ui/ui_qgsauthsslerrorsdialog.h /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_qgis3/qgis3/work/QGIS-3_26_2/src/ui/auth/qgsauthsslerrorsdialog.ui 8530::info:build [ 16%] Generating ui_qgsauthsslimporterrors.h 8531::info:build cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_qgis3/qgis3/work/build/src/ui && /opt/local/libexec/qt5/bin/uic -o /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_qgis3/qgis3/work/build/src/ui/ui_qgsauthsslimporterrors.h /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_qgis3/qgis3/work/QGIS-3_26_2/src/ui/auth/qgsauthsslimporterrors.ui 10485::info:build make: [all] Error 2 10489::error:build Failed to build qgis3: command execution failed 10490::debug:build Error code: CHILDSTATUS 78334 2 10499::error:build See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_qgis3/qgis3/main.log for details. 12790::debug:main libgpg-error 1.45_0 exists in the ports tree 12791::debug:main libgpg-error 1.45_0 is the latest installed 12792::debug:main libgpg-error 1.45_0 is active 12795::debug:main Changing to port directory: /opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/devel/libgpg-error 12806::debug:main No need to upgrade! libgpg-error 1.45_0 >= libgpg-error 1.45_0 16372::info:build make[2]: [src/native/CMakeFiles/qgis_native.dir/qgis_native_autogen/mocs_compilation.cpp.o] Error 127 16374::info:build make[1]: [src/native/CMakeFiles/qgis_native.dir/all] Error 2 16379::info:build make[2]: [src/providers/pdal/CMakeFiles/untwine.dir/untwine_autogen/mocs_compilation.cpp.o] Error 127 16382::info:build make[1]: [src/providers/pdal/CMakeFiles/untwine.dir/all] Error 2 16386::info:build make[2]: [src/app/qt-unix-signals/CMakeFiles/QTSignal.dir/QTSignal_autogen/mocs_compilation.cpp.o] Error 127 16392::info:build make[2]: [src/app/dwg/libdxfrw/CMakeFiles/libdxfrw.dir/libdxfrw_autogen/mocs_compilation.cpp.o] Error 127 16399::info:build make[2]: [src/app/qt-unix-signals/CMakeFiles/QTSignal.dir/sigwatch.cpp.o] Error 127 16401::info:build make[1]: [src/app/qt-unix-signals/CMakeFiles/QTSignal.dir/all] Error 2 16403::info:build make[2]: [src/app/dwg/libdxfrw/CMakeFiles/libdxfrw.dir/drw_base.cpp.o] Error 127 16411::info:build make[2]: [src/app/dwg/libdxfrw/CMakeFiles/libdxfrw.dir/drw_entities.cpp.o] Error 127 16412::info:build make[2]: [src/app/dwg/libdxfrw/CMakeFiles/libdxfrw.dir/drw_classes.cpp.o] Error 127 16417::info:build make[2]: [src/app/dwg/libdxfrw/CMakeFiles/libdxfrw.dir/drw_header.cpp.o] Error 127 16419::info:build make[1]: [src/app/dwg/libdxfrw/CMakeFiles/libdxfrw.dir/all] Error 2 16456::info:build make: *** [all] Error 2 16460::error:build Failed to build qgis3: command execution failed 16461::debug:build Error code: CHILDSTATUS 85281 2 16470::error:build See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_qgis3/qgis3/main.log for details.

I think this might be culprit:

Error copying file "init.py" to "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_qgis3/qgis3/work/build/output/python/qgis". make[2]: [pyutils] Error 1 make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_qgis3/qgis3/work/build' make[1]: [python/CMakeFiles/pyutils.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs....

Veence commented 2 years ago

Error 127 is not very informative in itself. What I would need is the log of the compilation of the file that ends up with that error. What surprises me (a little) is that I don’t have such a problem, and my compilation goes to completion like plain sailing.

Mielie commented 2 years ago

This is what I'm getting when I run the compilation myself:

In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_qgis3/qgis3/work/QGIS-3_26_2/src/providers/mdal/qgsmdalprovider.cpp:20: In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_qgis3/qgis3/work/QGIS-3_26_2/src/providers/mdal/qgsmdalprovider.h:19: In file included from /opt/local/libexec/qt5/lib/QtCore.framework/Headers/QString:1: /opt/local/libexec/qt5/lib/QtCore.framework/Headers/qstring.h:78:7: error: definition of type 'QStringList' conflicts with type alias of the same name class QStringList; ^ /opt/homebrew/include/QtCore/qcontainerfwd.h:64:7: note: 'QStringList' declared here using QStringList = QList; ^ In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_qgis3/qgis3/work/QGIS-3_26_2/src/providers/mdal/qgsmdalprovider.cpp:20: In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_qgis3/qgis3/work/QGIS-3_26_2/src/providers/mdal/qgsmdalprovider.h:19: In file included from /opt/local/libexec/qt5/lib/QtCore.framework/Headers/QString:1: /opt/local/libexec/qt5/lib/QtCore.framework/Headers/qstring.h:81:29: error: redefinition of 'QVector' as different kind of symbol template class QVector; ^ /opt/homebrew/include/QtCore/qcontainerfwd.h:63:22: note: previous definition is here template using QVector = QList; ^ In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_qgis3/qgis3/work/QGIS-3_26_2/src/providers/mdal/qgsmdalprovider.cpp:20: In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_qgis3/qgis3/work/QGIS-3_26_2/src/providers/mdal/qgsmdalprovider.h:19: In file included from /opt/local/libexec/qt5/lib/QtCore.framework/Headers/QString:1: /opt/local/libexec/qt5/lib/QtCore.framework/Headers/qstring.h:261:13: error: unknown type name 'QStringData' typedef QStringData Data; ^ /opt/local/libexec/qt5/lib/QtCore.framework/Headers/qstring.h:967:37: error: unknown type name 'QStringDataPtr' Q_DECL_CONSTEXPR inline QString(QStringDataPtr dd) : d(dd.ptr) {} ^ /opt/local/libexec/qt5/lib/QtCore.framework/Headers/qstring.h:273:72: error: 'QString::Data' (aka 'int') is not a class, namespace, or enumeration inline QString(QString && other) noexcept : d(other.d) { other.d = Data::sharedNull(); } ^ /opt/local/libexec/qt5/lib/QtCore.framework/Headers/qstring.h:277:39: error: member reference base type 'QString::Data' (aka 'int') is not a structure or union inline int size() const { return d->size; } ~^ ~~~~ /opt/local/libexec/qt5/lib/QtCore.framework/Headers/qstring.h:278:40: error: member reference base type 'QString::Data' (aka 'int') is not a structure or union inline int count() const { return d->size; } ~^ ~~~~ /opt/local/libexec/qt5/lib/QtCore.framework/Headers/qstring.h:561:14: error: member reference base type 'QString::Data' (aka 'int') is not a structure or union if (d->ref.isShared() || uint(d->size) + 2u > d->alloc) ~^ ~~~ /opt/local/libexec/qt5/lib/QtCore.framework/Headers/qstring.h:561:40: error: member reference base type 'QString::Data' (aka 'int') is not a structure or union if (d->ref.isShared() || uint(d->size) + 2u > d->alloc) ~^ ~~~~ /opt/local/libexec/qt5/lib/QtCore.framework/Headers/qstring.h:561:56: error: member reference base type 'QString::Data' (aka 'int') is not a structure or union if (d->ref.isShared() || uint(d->size) + 2u > d->alloc) ~^ ~ /opt/local/libexec/qt5/lib/QtCore.framework/Headers/qstring.h:562:31: error: member reference base type 'QString::Data' (aka 'int') is not a structure or union reallocData(uint(d->size) + 2u, true); ~^ ~~~~ /opt/local/libexec/qt5/lib/QtCore.framework/Headers/qstring.h:563:10: error: member reference base type 'QString::Data' (aka 'int') is not a structure or union d->data()[d->size++] = c.unicode(); ~^ ~~~~ /opt/local/libexec/qt5/lib/QtCore.framework/Headers/qstring.h:563:20: error: member reference base type 'QString::Data' (aka 'int') is not a structure or union d->data()[d->size++] = c.unicode(); ~^ ~~~~ /opt/local/libexec/qt5/lib/QtCore.framework/Headers/qstring.h:564:10: error: member reference base type 'QString::Data' (aka 'int') is not a structure or union d->data()[d->size] = '\0'; ~^ ~~~~ /opt/local/libexec/qt5/lib/QtCore.framework/Headers/qstring.h:564:20: error: member reference base type 'QString::Data' (aka 'int') is not a structure or union d->data()[d->size] = '\0'; ~^ ~~~~ /opt/local/libexec/qt5/lib/QtCore.framework/Headers/qstring.h:701:9: error: unknown type name 'QStringDataPtr' QStringDataPtr dataPtr = { fromLatin1_helper(str, (str && size == -1) ? int(strlen(str)) : size) }; ^ In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_qgis3/qgis3/work/build/src/providers/mdal/provider_mdal_autogen/mocs_compilation.cpp:2: In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_qgis3/qgis3/work/build/src/providers/mdal/provider_mdal_autogen/EWIEGA46WW/moc_qgsmdalprovider.cpp:10: In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_qgis3/qgis3/work/build/src/providers/mdal/provider_mdal_autogen/EWIEGA46WW/../../../../../../QGIS-3_26_2/src/providers/mdal/qgsmdalprovider.h:19: In file included from /opt/local/libexec/qt5/lib/QtCore.framework/Headers/QString:1: /opt/local/libexec/qt5/lib/QtCore.framework/Headers/qstring.h:78:7: error: definition of type 'QStringList' conflicts with type alias of the same name class QStringList; ^ /opt/homebrew/include/QtCore/qcontainerfwd.h:64:7: note: 'QStringList' declared here using QStringList = QList; ^ In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_qgis3/qgis3/work/build/src/providers/mdal/provider_mdal_autogen/mocs_compilation.cpp:2: In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_qgis3/qgis3/work/build/src/providers/mdal/provider_mdal_autogen/EWIEGA46WW/moc_qgsmdalprovider.cpp:10: In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_qgis3/qgis3/work/build/src/providers/mdal/provider_mdal_autogen/EWIEGA46WW/../../../../../../QGIS-3_26_2/src/providers/mdal/qgsmdalprovider.h:19: In file included from /opt/local/libexec/qt5/lib/QtCore.framework/Headers/QString:1: /opt/local/libexec/qt5/lib/QtCore.framework/Headers/qstring.h:81:29: error: redefinition of 'QVector' as different kind of symbol template class QVector; ^ /opt/homebrew/include/QtCore/qcontainerfwd.h:63:22: note: previous definition is here template using QVector = QList; ^ /opt/local/libexec/qt5/lib/QtCore.framework/Headers/qstring.h:955:37: error: 'QString::Data' (aka 'int') is not a class, namespace, or enumeration inline QString(const Null &): d(Data::sharedNull()) {} ^ /opt/local/libexec/qt5/lib/QtCore.framework/Headers/qstring.h:958:46: error: 'QString::Data' (aka 'int') is not a class, namespace, or enumeration inline bool isNull() const { return d == Data::sharedNull(); } ^ /opt/local/libexec/qt5/lib/QtCore.framework/Headers/qstring.h:1070:11: error: member reference base type 'QString::Data' (aka 'int') is not a structure or union { return d->size; } ~^ ~~~~ fatal error: too many errors emitted, stopping now [-ferror-limit=] In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_qgis3/qgis3/work/build/src/providers/mdal/provider_mdal_autogen/mocs_compilation.cpp:2: In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_qgis3/qgis3/work/build/src/providers/mdal/provider_mdal_autogen/EWIEGA46WW/moc_qgsmdalprovider.cpp:10: In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_qgis3/qgis3/work/build/src/providers/mdal/provider_mdal_autogen/EWIEGA46WW/../../../../../../QGIS-3_26_2/src/providers/mdal/qgsmdalprovider.h:19: In file included from /opt/local/libexec/qt5/lib/QtCore.framework/Headers/QString:1: /opt/local/libexec/qt5/lib/QtCore.framework/Headers/qstring.h:261:13: error: unknown type name 'QStringData' typedef QStringData Data; ^ /opt/local/libexec/qt5/lib/QtCore.framework/Headers/qstring.h:967:37: error: unknown type name 'QStringDataPtr' Q_DECL_CONSTEXPR inline QString(QStringDataPtr dd) : d(dd.ptr) {} ^ /opt/local/libexec/qt5/lib/QtCore.framework/Headers/qstring.h:273:72: error: 'QString::Data' (aka 'int') is not a class, namespace, or enumeration inline QString(QString && other) noexcept : d(other.d) { other.d = Data::sharedNull(); } ^ /opt/local/libexec/qt5/lib/QtCore.framework/Headers/qstring.h:277:39: error: member reference base type 'QString::Data' (aka 'int') is not a structure or union inline int size() const { return d->size; } ~^ ~~~~ /opt/local/libexec/qt5/lib/QtCore.framework/Headers/qstring.h:278:40: error: member reference base type 'QString::Data' (aka 'int') is not a structure or union inline int count() const { return d->size; } ~^ ~~~~ /opt/local/libexec/qt5/lib/QtCore.framework/Headers/qstring.h:561:14: error: member reference base type 'QString::Data' (aka 'int') is not a structure or union if (d->ref.isShared() || uint(d->size) + 2u > d->alloc) ~^ ~~~ /opt/local/libexec/qt5/lib/QtCore.framework/Headers/qstring.h:561:40: error: member reference base type 'QString::Data' (aka 'int') is not a structure or union if (d->ref.isShared() || uint(d->size) + 2u > d->alloc) ~^ ~~~~ /opt/local/libexec/qt5/lib/QtCore.framework/Headers/qstring.h:561:56: error: member reference base type 'QString::Data' (aka 'int') is not a structure or union if (d->ref.isShared() || uint(d->size) + 2u > d->alloc) ~^ ~ /opt/local/libexec/qt5/lib/QtCore.framework/Headers/qstring.h:562:31: error: member reference base type 'QString::Data' (aka 'int') is not a structure or union reallocData(uint(d->size) + 2u, true); ~^ ~~~~ /opt/local/libexec/qt5/lib/QtCore.framework/Headers/qstring.h:563:10: error: member reference base type 'QString::Data' (aka 'int') is not a structure or union d->data()[d->size++] = c.unicode(); ~^ ~~~~ /opt/local/libexec/qt5/lib/QtCore.framework/Headers/qstring.h:563:20: error: member reference base type 'QString::Data' (aka 'int') is not a structure or union d->data()[d->size++] = c.unicode(); ~^ ~~~~ /opt/local/libexec/qt5/lib/QtCore.framework/Headers/qstring.h:564:10: error: member reference base type 'QString::Data' (aka 'int') is not a structure or union d->data()[d->size] = '\0'; ~^ ~~~~ /opt/local/libexec/qt5/lib/QtCore.framework/Headers/qstring.h:564:20: error: member reference base type 'QString::Data' (aka 'int') is not a structure or union d->data()[d->size] = '\0'; ~^ ~~~~ /opt/local/libexec/qt5/lib/QtCore.framework/Headers/qstring.h:701:9: error: unknown type name 'QStringDataPtr' QStringDataPtr dataPtr = { fromLatin1_helper(str, (str && size == -1) ? int(strlen(str)) : size) }; ^ /opt/local/libexec/qt5/lib/QtCore.framework/Headers/qstring.h:955:37: error: 'QString::Data' (aka 'int') is not a class, namespace, or enumeration inline QString(const Null &): d(Data::sharedNull()) {} ^ /opt/local/libexec/qt5/lib/QtCore.framework/Headers/qstring.h:958:46: error: 'QString::Data' (aka 'int') is not a class, namespace, or enumeration inline bool isNull() const { return d == Data::sharedNull(); } ^ /opt/local/libexec/qt5/lib/QtCore.framework/Headers/qstring.h:1070:11: error: member reference base type 'QString::Data' (aka 'int') is not a structure or union { return d->size; } ~^ ~~~~ fatal error: too many errors emitted, stopping now [-ferror-limit=]

nyalldawson commented 2 years ago

@Mielie

Try building with master, not 3.26.

Veence commented 2 years ago

You can’t have Homebrew and MacPorts running on the same Mac. You have to choose your allegiance! 🤕

Mielie commented 2 years ago

Awesome, finally got it to compile through (3.26.2). Had to uninstall Homebrew. Thanks for the help!

qgis

Veence commented 2 years ago

Fantastic. Glad to know it works, and happy to help!

joaquinezcurra commented 1 year ago

Hello @Mielie @Veence how would one go to install QGIS with native Silicon M1 support? Just sudo port install qgis3 ? Any tips appreciated, thank you!

Veence commented 1 year ago

Yes, that basically it. It will install everything from binaries if available, otherwise will compile it from source. Note however the error Mielie reported with qt5-scintilla. However, I have a committed a fix since then, so everything should go smoothly. If you have a lot of time ahead and want to compile from source, add the -s option after port. Add the -v to have more info and be able to located errors easily.

joaquinezcurra commented 1 year ago

Hello @Veence I'm back here to report that the installation went smoothly wothout a hassle or single error message! I now have QGIS running natively on my MB Air M1. I was able to open a project where I have several raster files that usually would take very long to load, and I can see a very noticeable speed increase! this is great. For anyone interested, my steps where: 1- Uninstall Homebrew and install MacPorts 2- Completely uninstall QGIS 3- Install brand new QGIS with sudo port install qgis3 4- Wait a long time, I think it must have taken between 45 and 60 minutes 5- The QGIS App appeared installed on a MacPorts folder on Applications, so I just moved it to the Applications folder 6- Open and test! Thanks again, and one final thought... Given this is quite big or the Mac QGIS community and prospective Mac QGIS users, shoouldn't it be communicated more broadly?

joaquinezcurra commented 1 year ago

Brief update: upon 2nd start and hereon consequently I get the following error message:

Ocurrió un error durante la ejecución del siguiente código: faulthandler.enable(file=fault_handler_file)

Traceback (most recent call last): File "", line 1, in PermissionError: [Errno 1] Operation not permitted

Versión de Python: 3.10.6 (main, Aug 3 2022, 03:22:45) [Clang 13.0.0 (clang-1300.0.29.30)]

Versión de QGIS: 3.26.2-Buenos Aires 'Buenos Aires', exported

Ruta de Python: ['/Applications/QGIS3.app/Contents/MacOS/../Resources/python', '/Users/joaquinx/Library/Application Support/QGIS/QGIS3/profiles/default/python', '/Users/joaquinx/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins', '/Applications/QGIS3.app/Contents/MacOS/../Resources/python/plugins', '/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python310.zip', '/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10', '/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/lib-dynload', '/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages']

Whithout being an expert, my guesses are: Problem with Mac OS security setting such as Disk access or a problem with my Python installations.

Veence commented 1 year ago

Cool! I suppose everything was installed from binaries, except maybe a small number of ports. But that’s great news to hear, because the QGis community on MacPorts is quite small, and even smaller if you filter out all those who don’t run it on the new Apple hardware.

As for reaching out, that has never been MacPorts’s forte; the team is more focussed on technique than mar/com. Don’t hesitate to spread the word!

Python errors? Do you have any extension loaded?

felix-ht commented 1 year ago

As this seems to run fine on ARM - would it be possible to also get an official release?

joaquinezcurra commented 1 year ago

I am not sure wether the fact that QGIS runs perfectly on Apple M1 via MacPorts would necesseraly mean that an official release supporting the ARM64 architecture is possible... @Veence what's your take?

Veence commented 1 year ago

It would need extensive testing to be certain everything runs fine, and above all it would need copying the application bundle and install it on another mac. MacPorts has a built-in script to create a .dmg archive from an application, so that could be done quite easily

shaunakv1 commented 1 year ago

Official release would be much appreciated. Kind of stuck here, because I use homebrew extensively and can't afford to uninstall it in favor of macports. Fingers crossed!

felix-ht commented 1 year ago

@shaunakv1 i have the same situation - no way that i can (or want) to move from homebrew

joaquinezcurra commented 1 year ago

@shaunakv1 @felix-ht I did install Macports and still found some issues as described on previous comment https://github.com/qgis/QGIS/issues/46299#issuecomment-1230472526 So I unistalled Macports and M1 optimized QGIS and went back to standard Intel installation.

Veence commented 1 year ago

On 28 Aug 2022, at 22:20, Bryan Wall @.***> wrote:

I didn't know this and just installed Macports a couple of days ago to be able to run the native ARM version of QGIS. I have Homebrew installed, also. It worked although I did have to manually install the "future" Python library, but that might have been for a plugin rather than the main QGIS.

So I assume from your answer that you managed to make it run. Small adjustments with Python are likely, especially if you don’t opted for the latest version available.

Have fun!

V.

RemiDesgrange commented 1 year ago

Hi @Veence I managed to compile QGIS on a newly installed Apple Silicon machine with macport. Is there a way to package (I think with ports dmg qgis3?) the whole app ? With all the lib, in order to distribute it to my coworker ? (even if the app won't be signed).

Veence commented 1 year ago

Hi @Veence I managed to compile QGIS on a newly installed Apple Silicon machine with macport. Is there a way to package (I think with ports dmg qgis3?) the whole app ? With all the lib, in order to distribute it to my coworker ? (even if the app won't be signed).

Salut !

Yeah, MacPorts has a mechanism to automatically create .dmg archives from port. I can’t really tell you what it is or how to call it but you find it easily in MacPort’s documentation pages. As far as I know, it embeds the app plus all the librairies it depends on.

georgeboot commented 1 year ago

Hi @Veence I managed to compile QGIS on a newly installed Apple Silicon machine with macport. Is there a way to package (I think with ports dmg qgis3?) the whole app ? With all the lib, in order to distribute it to my coworker ? (even if the app won't be signed).

See https://guide.macports.org/chunked/using.binaries.html

Feel free to share the binary! I can't install macports on my machine (heavily use Homebrew) but would love to get a faster copy of Qgis running over here.