On Thursday, March 4, 2021 at 12:18:22 PM UTC+1 Albrecht Schlosser wrote:
Great! Now we can share our (FLTK) build experiences on M1 Macs!
For now, I see only deficiencies relatively to my intel MacBook Pro.
BTW: Rumors say (and I think this is sensible) that there are no M1
(arm_64) versions of Virtualbox and maybe many or all the other VM tools
(particularly parallels) - and these VM tools are not expected to come
(at least not soon) since they would have to *emulate* an Intel
processor, at least for Windows. Windows is officially available for ARM
but (again, rumors say) is only distributed to/by OEM's and can't be
bought by single users. Did you research this already for your own
development?
These are my conclusions too.
If it's true you'd certainly need to keep an older Intel Mac for your VM's.
Yes indeed.
The only issues I'm having (so far):
(1) VS Code can't debug arm64 (or universal) apps (using lldb), but this
is a VS Code problem and will hopefully be fixed soon. I can circumvent
this issue by building for x86_64 and debug with VS Code - unless I need
"other" libs (see (2)). My alternative option to debug is to use Xcode
(I built FLTK with CMake/Xcode, tested, works) but I'm not yet familiar
with it. It's very similar to what I used previously though. I'll try
again later when I have a real use case.
(2) I can't build x86_64 or universal apps if I need to link to
libraries (e.g. Cairo) installed with Homebrew because these libs are
all arm64 only - which means I can't debug such apps with VS Code, see
(1). But that's a minor issue for now and can be resolved later. I think
that I can build such libs myself (with Homebrew) and then hopefully as
universal libs. Maybe, we'll see.
I have just tried macports since fink isn't ready for macOS 11, and it seems quite
good. Noticeably you can install binaries in arm or in universal form.
I jut did that for pkg-config, as an example of package, which I had first installed in arm form :
% file /opt/local/bin/pkg-config
/opt/local/bin/pkg-config: Mach-O 64-bit executable arm64
% sudo port install pkgconfig +universal <-- the install command in its universal flavor
---> Fetching archive for pkgconfig
---> Attempting to fetch pkgconfig-0.29.2_0+universal.darwin_20.arm64-x86_64.tbz2 from https://lil.fr.packages.macports.org/pkgconfig
---> Attempting to fetch pkgconfig-0.29.2_0+universal.darwin_20.arm64-x86_64.tbz2 from https://packages.macports.org/pkgconfig
---> Attempting to fetch pkgconfig-0.29.2_0+universal.darwin_20.arm64-x86_64.tbz2.rmd160 from https://packages.macports.org/pkgconfig
---> Installing pkgconfig @0.29.2_0+universal
---> Deactivating pkgconfig @0.29.2_0
---> Cleaning pkgconfig
---> Activating pkgconfig @0.29.2_0+universal
---> Cleaning pkgconfig
% file /opt/local/bin/pkg-config
/opt/local/bin/pkg-config: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit executable x86_64] [arm64:Mach-O 64-bit executable arm64]
/opt/local/bin/pkg-config (for architecture x86_64): Mach-O 64-bit executable x86_64
/opt/local/bin/pkg-config (for architecture arm64): Mach-O 64-bit executable arm64