Wiki Directions for Mac Compile via Homebrew Not working

Having trouble installing or compiling FreeCAD? Get help here.
chrisb
Posts: 27899
Joined: Tue Mar 17, 2015 9:14 am

Re: Wiki Directions for Mac Compile via Homebrew Not working

Post by chrisb » Fri Sep 04, 2020 4:09 am

Thanks for your work on the Mac version. Of course you are welcome to ask for support concerning models so we can give something back. You can also just upload some files and ask for recommendations. I am not familiar with Arch and BIM, but I hopefully can help with some woodworking models.
jmdzampieron
Posts: 20
Joined: Wed Aug 26, 2020 1:44 am

Re: Wiki Directions for Mac Compile via Homebrew Not working

Post by jmdzampieron » 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.
User avatar
Kunda1
Posts: 8378
Joined: Thu Jan 05, 2017 9:03 pm

Re: Wiki Directions for Mac Compile via Homebrew Not working

Post by Kunda1 » Mon Sep 14, 2020 12:41 am

Interesting
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
User avatar
looo
Posts: 3465
Joined: Mon Nov 11, 2013 5:29 pm

Re: Wiki Directions for Mac Compile via Homebrew Not working

Post by looo » Mon Sep 14, 2020 5:27 am

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 » 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?
vocx
Posts: 5206
Joined: Thu Oct 18, 2018 9:18 pm

Re: Wiki Directions for Mac Compile via Homebrew Not working

Post by vocx » 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.
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: 20
Joined: Wed Aug 26, 2020 1:44 am

Re: Wiki Directions for Mac Compile via Homebrew Not working

Post by jmdzampieron » Sat Sep 19, 2020 2:04 am

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: 20
Joined: Wed Aug 26, 2020 1:44 am

Re: Wiki Directions for Mac Compile via Homebrew Not working

Post by jmdzampieron » Sat Sep 19, 2020 2:15 am

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
Posts: 5206
Joined: Thu Oct 18, 2018 9:18 pm

Re: Wiki Directions for Mac Compile via Homebrew Not working

Post by vocx » Sat Sep 19, 2020 2:44 am

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
Posts: 27899
Joined: Tue Mar 17, 2015 9:14 am

Re: Wiki Directions for Mac Compile via Homebrew Not working

Post by chrisb » Sat Sep 19, 2020 8:12 am

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.
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests