Wiki Directions for Mac Compile via Homebrew Not working

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
jmdzampieron
Posts: 27
Joined: Wed Aug 26, 2020 1:44 am

Re: Wiki Directions for Mac Compile via Homebrew Not working

Post by jmdzampieron »

For anyone still following... I ran the latest update from Apple to 10.15.6 and it broke the Conda Compiler (cxx-compiler=1.1.1) package from conda-forge.

There's some kind of ABI conflict between the OS X SDK and clang. CMake reports it as a broken compiler. You can check which clang you are using by running `which clang` ... it needs to be `/usr/bin/clang` instead of the one from the conda environment.

The fix is to `conda remove cxx-compiler` and `export CC=clang`, `export CXX=clang++` prior to running cmake. FreeCAD will build fine after that.

There are clearly limits to the Conda environment isolation. Maybe the fix is to only rely on the system compiler, but if that has ABI problems then who knows what other libraries will do.

QT on Windows can have the same issues... you need to match the compiler with the QT build. It's 2020 and we are still fighting C++ ABI issues.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Wiki Directions for Mac Compile via Homebrew Not working

Post by Kunda1 »

Interesting
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: Wiki Directions for Mac Compile via Homebrew Not working

Post by looo »

jmdzampieron wrote: Sat Sep 05, 2020 2:35 pm For anyone still following... I ran the latest update from Apple to 10.15.6 and it broke the Conda Compiler (cxx-compiler=1.1.1) package from conda-forge.

There's some kind of ABI conflict between the OS X SDK and clang. CMake reports it as a broken compiler. You can check which clang you are using by running `which clang` ... it needs to be `/usr/bin/clang` instead of the one from the conda environment.

The fix is to `conda remove cxx-compiler` and `export CC=clang`, `export CXX=clang++` prior to running cmake. FreeCAD will build fine after that.

There are clearly limits to the Conda environment isolation. Maybe the fix is to only rely on the system compiler, but if that has ABI problems then who knows what other libraries will do.

QT on Windows can have the same issues... you need to match the compiler with the QT build. It's 2020 and we are still fighting C++ ABI issues.
as I understand: conda tries to use old osx sdk's to make packages compatible for as many mac's as possible. But there are for sure limitations to this approach.
But osx is for sure the most difficult platform at the moment and we are already seeing arm packages for osx. So I guess building for arm is the more important task right now to support future versions of osx.
earlye
Posts: 8
Joined: Sun Sep 13, 2020 2:11 pm

Re: Wiki Directions for Mac Compile via Homebrew Not working

Post by earlye »

I'm also trying to get mac build working. Sadly, I went to the wiki first, and wasted some time trying to figure out why homebrew doesn't work.

Now I'm trying to figure out conda, and I gotta say... it's a lot to pick up.

Like jmdzampieron , I primarily view FreeCAD as an augmentation to my woodworking (and other media) efforts, so I expect to use it on an ongoing basis.

On the off chance that others will be joining the ranks of Mac developers for FreeCAD, should we update the wiki to point at this thread rather than continue to advertise homebrew-based build steps?
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: Wiki Directions for Mac Compile via Homebrew Not working

Post by vocx »

earlye wrote: Mon Sep 14, 2020 7:14 pm ...should we update the wiki to point at this thread rather than continue to advertise homebrew-based build steps?
I added a message to the Compile on MacOS page specifying that the information there is obsolete.

What is important is that the information is correct. If the information is obsolete, but there is a warning stressing that it is obsolete, then the user is properly warned. However, what would be better is that the information actually works for the intended purpose (compiling for MacOS), so if you or anybody can rewrite that information so it works correctly today, that would be preferable.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
jmdzampieron
Posts: 27
Joined: Wed Aug 26, 2020 1:44 am

Re: Wiki Directions for Mac Compile via Homebrew Not working

Post by jmdzampieron »

earlye wrote: Mon Sep 14, 2020 7:14 pm I'm also trying to get mac build working. Sadly, I went to the wiki first, and wasted some time trying to figure out why homebrew doesn't work.

Now I'm trying to figure out conda, and I gotta say... it's a lot to pick up.

Like jmdzampieron , I primarily view FreeCAD as an augmentation to my woodworking (and other media) efforts, so I expect to use it on an ongoing basis.

On the off chance that others will be joining the ranks of Mac developers for FreeCAD, should we update the wiki to point at this thread rather than continue to advertise homebrew-based build steps?
Earlye,

If you clone `master` from github and follow the directions I wrote in `BUILD_OSX.md` you should get a working binary on your Mac.

If not, drop me a note and we can work through it. Installing Conda and the xcode command line tools aren't too bad.

As Vocx said, the native OS X build environment is kind of a trashfire.
jmdzampieron
Posts: 27
Joined: Wed Aug 26, 2020 1:44 am

Re: Wiki Directions for Mac Compile via Homebrew Not working

Post by jmdzampieron »

vocx wrote: Mon Sep 14, 2020 9:35 pm
earlye wrote: Mon Sep 14, 2020 7:14 pm ...should we update the wiki to point at this thread rather than continue to advertise homebrew-based build steps?
I added a message to the Compile on MacOS page specifying that the information there is obsolete.

What is important is that the information is correct. If the information is obsolete, but there is a warning stressing that it is obsolete, then the user is properly warned. However, what would be better is that the information actually works for the intended purpose (compiling for MacOS), so if you or anybody can rewrite that information so it works correctly today, that would be preferable.
vocx -- based on what I learned trying those homebrew directions a few weeks ago... IMHO there is no path to making those directions work correctly on current versions of OS X. You'd have to rebuild a number of upstream dependency packages to remove python2 as a transitive. I'm pretty sure we don't want to try to have different build directions for different OS X versions.

It would be a serious effort with minimal value since the Conda approach seems to work nicely. I think one thing the dev community needs to think about is slimming down the supported build configurations for FreeCAD. Let build complexity, less test complexity.

For example, I'm curious why I still see QT4 references in commit messages ... why would QT4 still be supported at all? QT5 has been out for ages.
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: Wiki Directions for Mac Compile via Homebrew Not working

Post by vocx »

jmdzampieron wrote: Sat Sep 19, 2020 2:15 am ...
For example, I'm curious why I still see QT4 references in commit messages ... why would QT4 still be supported at all? QT5 has been out for ages.
See here removal of Qt4 support. There aren't many combinations, basically Py2/Qt4 and Py3/Qt5.

I won't modify the MacOS instructions because I don't have this system. So if you want to change the instructions to refer to Conda, that is fine. As I said, the information should be correct and should work, whether that is homebrew or Conda is not of particular interest to me.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
chrisb
Veteran
Posts: 54213
Joined: Tue Mar 17, 2015 9:14 am

Re: Wiki Directions for Mac Compile via Homebrew Not working

Post by chrisb »

jmdzampieron wrote: Sat Sep 19, 2020 2:04 am ping
earlye wrote: Mon Sep 14, 2020 7:14 pm ping
I would very much appreciate if you could replace the wiki contents with a working recipe how to setup a development environment for MacOS.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
kkremitzki
Veteran
Posts: 2515
Joined: Thu Mar 03, 2016 9:52 pm
Location: Illinois

Re: Wiki Directions for Mac Compile via Homebrew Not working

Post by kkremitzki »

I recently picked up a used Mac Mini to try to fix things up on that platform, specifically Homebrew, since that is perhaps the de facto FOSS distribution method, and hopefully after that getting it signed so people don't have to bypass an error message on installation, and possibly even into the app store.
Like my FreeCAD work? I'd appreciate any level of support via Patreon, Liberapay, or PayPal! Read more about what I do at my blog.
Post Reply