Compiling on Mac OS Yosemite 10.10.5

Having trouble installing or compiling FreeCAD? Get help here.
User avatar
f3nix
Posts: 338
Joined: Sat May 30, 2015 11:58 am

Re: Compiling on Mac OS Yosemite 10.10.5

Postby f3nix » Fri Nov 10, 2017 3:29 pm

Hi!
peterl94 wrote:
Fri Nov 10, 2017 7:19 am
You need to install qt 5.6 instead of the latest 5.9 because pyside2 does not work with qt 5.9 yet.
FYI. PySide2 has been working great with Qt 5.9 for quite some time now.

E.g.
OS: Debian GNU/Linux unstable (sid)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.12556 (Git)
Build type: Debug
Branch: master
Hash: 3daa4fe6905b081e2a84f7236e585e486477c368
Python version: 2.7.14
Qt version: 5.9.2
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: Polish/Poland (pl_PL)

Cheers,
Mateusz
triplus
Posts: 9475
Joined: Mon Dec 12, 2011 4:45 pm

Re: Compiling on Mac OS Yosemite 10.10.5

Postby triplus » Fri Nov 10, 2017 10:53 pm

nyholku wrote:
Fri Nov 10, 2017 10:18 am
Now if I only could locate those nice Onshape like icons that someone had made and could install those... ;)
https://github.com/pgilfernandez/FreeCA ... eme_simple
User avatar
Kunda1
Posts: 8719
Joined: Thu Jan 05, 2017 9:03 pm

Re: Compiling on Mac OS Yosemite 10.10.5

Postby Kunda1 » Fri Nov 10, 2017 11:22 pm

Off-topic: This should be install-able via the Addon Manager...amirite?
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
nyholku
Posts: 149
Joined: Wed Dec 28, 2016 4:18 pm

Re: Compiling on Mac OS Yosemite 10.10.5

Postby nyholku » Sat Nov 11, 2017 8:50 am

@triplus

Brilliant, just what I was looking for!

Gradually getting there [tuning the UI to work for me].

Still some little annoyances that I need to take care of but I'll start a new topic on those.
nyholku
Posts: 149
Joined: Wed Dec 28, 2016 4:18 pm

Re: Compiling on Mac OS Yosemite 10.10.5

Postby nyholku » Tue Nov 14, 2017 5:00 am

Hi,

it seems that my build worked by fluke because I had done the qt install in that same terminal session where I tried the build.

In a new terminal/session I need pass the qt5 path to CMake to make it work like this:

Code: Select all

cmake -DCMAKE_PREFIX_PATH=/usr/local/Cellar/qt5/5.6.1-1 -DBUILD_QT5="1" -DBUILD_ROBOT="0" -DFREECAD_USE_EXTERNAL_PIVY="1" -DBUILD_FEM_NETGEN="1"  -DFREECAD_CREATE_MAC_APP="1" ../FreeCAD-git
nyholku
Posts: 149
Joined: Wed Dec 28, 2016 4:18 pm

Re: Compiling on Mac OS Yosemite 10.10.5

Postby nyholku » Wed Nov 15, 2017 5:14 am

The saga of C-tool chain keeps continuing!

This is so fragile.

Yesterday I renamed my FC directory and followed my notes above and
though the CMake worked the compilation failed with a missing QtInfo member.
So CMake had picked up wrong Qt (/usr/local/Qt/4.8.1-macosx105 ??) I guess,
although I thought I had removed all other version from my system.

So for posterity here is what worked for me this (!) time.

Completely remove homebrew with script from here:

Code: Select all

https://raw.githubusercontent.com/Homebrew/install/master/install)"
Re install homebrew like this:

Code: Select all

 /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
And then installing the dependencies like this:

Code: Select all

brew install --only-dependencies freecad
brew install --only-dependencies freecad #Ensure all dependencies are satisfied
brew install qt5
brew install eigen
And finally CMake like this:

Code: Select all

cmake -DCMAKE_PREFIX_PATH=/usr/local/opt/qt -DBUILD_QT5="1" -DBUILD_ROBOT="0" -DFREECAD_USE_EXTERNAL_PIVY="1" -DBUILD_FEM_NETGEN="1"  -DFREECAD_CREATE_MAC_APP="1" ../FreeCAD-git

Altogether in the past nine months I've spent more time configuring my
compilation environment and re-compiling stuff than what it has taken
me to code my contribution effort (NaviCube) to FreeCAD. What a waste
of human effort. Thanks for letting me vent my frustration here although
this is not really FreeCAD project's fault at all, as C/C++ projects go
FC is easy to compile.

cheers Kusti
User avatar
Kunda1
Posts: 8719
Joined: Thu Jan 05, 2017 9:03 pm

Re: Compiling on Mac OS Yosemite 10.10.5

Postby Kunda1 » Wed Nov 15, 2017 2:56 pm

nyholku wrote:
Wed Nov 15, 2017 5:14 am
Altogether in the past nine months I've spent more time configuring my
compilation environment and re-compiling stuff than what it has taken
me to code my contribution effort (NaviCube) to FreeCAD. What a waste
of human effort. Thanks for letting me vent my frustration here although
this is not really FreeCAD project's fault at all, as C/C++ projects go
FC is easy to compile.
Thanks for your perseverance, this is something I know many people in this project and in other open source projects would love to streamline.
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
nyholku
Posts: 149
Joined: Wed Dec 28, 2016 4:18 pm

Re: Compiling on Mac OS Yosemite 10.10.5

Postby nyholku » Wed Nov 15, 2017 3:20 pm

I think a lot of the problem is rooted in the reliance on package managers or the way the package managers are used in a typical FOSS project.

Every top level should have their own "sandbox" into which dependent libraries are compiled so that installing different version of the libraries for different top level projects would not break each other. But most project and instructions assume that the libraries live in their standard global/shared locations which results in the dependency hell.

Perhaps (even likely) the package managers can be instructed to build the dependencies into different locations but so far I've not had the courage to try to spend all the time to learn how to do this. Probably easy for any single/simple libraries but I dread how complex it can get when libraries depend on libraries.

So that should be doable.

On the higher level the C compilers should output some sort of intermediate byte code for a virtual machine which would allow easy distribution of binaries but I think a strong element in the FOSS would be against that so not likely to happen.

I'm an old hand at C/C++ but for the past 10 or so years I've worked mainly with desktop Java and never see any problems like what we have with the C tool chain. Performance with Java has never been an issue in my experience but perhaps the ideal solution is somewhere in between i.e. C# + CLI where you can mix and match unsafe and managed code. But converting all existing C/C++ code in the world to C# or any other language is a pipe dream so having the C-compiler to output the byte code which the linking loader would perhaps compile to direct assembly code is at least theoretically possible.

But this is becoming off topic.

cheers Kusti
nyholku
Posts: 149
Joined: Wed Dec 28, 2016 4:18 pm

Re: Compiling on Mac OS Yosemite 10.10.5

Postby nyholku » Thu Nov 16, 2017 5:18 am

Never ends that ...

https://www.youtube.com/watch?v=AIbTXCQgvRk



My above 'instructions' work to get FC to compile and produced an executable but the executable crashes!

On closer inspection it looks like there must be some conflict with Qt 5.6 and Qt 5.9 or something in homebrew cellar.

Attempts to fix that by deleting Qt 5.6 failed... the misery just spreads to other dependent libraries.
I *guess* the FreeCAD homebrew formula references 5.6 and installs 5.6 even though after installing the dependencies
CMake fails to find it.

So cleared up '/usr/local/cellar' and started over ... I'll be back in a few hours when the installation finishes...argh.
nyholku
Posts: 149
Joined: Wed Dec 28, 2016 4:18 pm

Re: Compiling on Mac OS Yosemite 10.10.5

Postby nyholku » Fri Nov 17, 2017 5:29 am

This time below sequence worked for me.

Cleaned up i.e. removed 'everything qt' from homebrew cellar '/usr/local/Cellar/' with Finder.

Completely remove homebrew with script from here:

https://raw.githubusercontent.com/Homeb ... er/install)"

Re install homebrew like this:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homeb ... er/install)"

I suppose (but did not test because I just delete qt from cellar) issuing home brew cleanup command
at this point when nothing is installed should clean up the cellar:

Code: Select all

brew cleanup # did not try this



And then installing the dependencies like this:

Code: Select all

brew install --only-dependencies freecad
brew install --only-dependencies freecad #Ensure all dependencies are satisfied
brew install qt5
brew install eigen
And finally CMake like this:


Code: Select all

cmake -DCMAKE_PREFIX_PATH=/usr/local/opt/qt@5.6 -DBUILD_QT5="1" -DBUILD_ROBOT="0" -DFREECAD_USE_EXTERNAL_PIVY="1" -DBUILD_FEM_NETGEN="1"  -DFREECAD_CREATE_MAC_APP="1" ../FreeCAD-git
Last edited by nyholku on Fri Nov 17, 2017 6:15 am, edited 1 time in total.
cron