Diary of a Mac M1 build

I gave a new shot at building Fritzing on a mac and specifically on an M1 ARM processor. My first attempt went down in flames as I had embarked on building Qt from scratch as a prereq. But as @vanepp pointed out, that isn’t likely required to be an ARM build since it’s only instrumental in creating the UI source and facilitating the build if you do the build from Qt Creator. So, I went the download approach for Qt and got the x64 standard Qt items.

Once I got Qt installed, I grabbed boost 1.76 and libgit 0.28.5 per the instructions. And I built the libgit .a library in arm64 without issue.

In the fritzing-app/ folder I did modify the phoenix.pro file to have:

    CONFIG += arm64 

in place of x86_64

I ran Qt Creator and loaded phoenix.pro and eventually found the arguments section to place the “-f” and “-parts” and “-db” arguments into and kicked off a build.

I received over 250 warnings (dunno if that’s normal but wow…) and then I received 6 errors that killed the build. See the screeshot for the errors. Anyone have any knowledge they’d like to impart on me for what I can do to ferret out the remaining issues? I feel like I might be close to a success but maybe that’s overlay optimistic. :slight_smile:

clang: error: no such file or directory: '/usr/lib/libz.dylib'
clang: error: no such file or directory: '/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation'
clang: error: no such file or directory: '/System/Library/Frameworks/Carbon.framework/Carbon'
clang: error: no such file or directory: '/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit'
clang: error: no such file or directory: '/System/Library/Frameworks/Security.framework/Versions/A/Security'
make[1]: *** [../release64/Fritzing.app/Contents/MacOS/Fritzing] Error 1

I did rid the first issue of missing libz.dylib by commenting out the line and making sure -lz was included (which it was in the prior line) per google results.

    LIBS += -lz
    #    LIBS += /usr/lib/libz.dylib

Then I tried to rid myself of the missing /System framework errors and may have wound myself into a rathole. I tried commenting them out and wound up with a complaint about missing /System/Library/Frameworks/Security.framework/Versions/A/Security but no other complaints. And so I then tried FINDING the frameworks like Carbon that I had commented out and looked in /Applications/Xcode.app/Contents/ and found all of them. Great. So I changed the paths of them to /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Carbon.framework/Carbon but it didn’t like it until I specifically called out the suffix of “.tbd” and then it was happy to link including my own call-out to the Security one. But somehow the compilation still wants to add in its own hardwired version of the Security framework in /System despite me adding my own. So this starts to make me think I’m just beating on the problem with a hammer rather than knowing what I’m doing on this topic.

I’m unable to tell if this is because I’m on Big Sur or if its more because of M1/ARM64.

I think the other route I’ll give a shot at is compiling through xcode rather than Qt Creator.

Status update - After banging on Makefile.Release for a bit and realizing it was building in x86_64 rather than arm64 ; and then finding it wouldn’t link because libgit2 was also compiled with x86_64, I rebuilt libgit2 for arm64 and got a successful build of Fritzing.

Phew.

I ran it the first time with the -f, -parts, and -db flags and got a ton of stdout “noise” and the program stopped a few seconds later. This might be normal on the first run from what I gathered about the -db initialization. So I re-ran it without the -db and it friggin’ ran. I’m pretty shocked.

I’ve gotta get my notes together tomorrow on what I changed. And then I’ll need some advice on how to do it properly without the use of a sledgehammer but instead inside of phoenix.pro which I gave up on … and certainly the libgit2 piece I can facilitate a change in the docs with a “-D” option for cmake. But anyway - there’s a nice Sunday night success. I’d probably try to nail all this down tonight but I’ve got a rotten headache and this success is making it bearable. :slight_smile:

'night.
–robobob