Cannot compile FreeCad on MacOS X

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
chrisb
Veteran
Posts: 54183
Joined: Tue Mar 17, 2015 9:14 am

Re: Cannot compile FreeCad on MacOS X

Post by chrisb »

darryln wrote: Sun Jul 16, 2017 4:27 pm I recall reading somewhere in here (noob faq I think) about noobs needing a certain minimum number of posts, and some other requirements. So if the temple priests will provide their blessings, sure, I would gladly do it. :)
You have topped the minimum number already by 100%: https://forum.freecadweb.org/viewtopic.php?f=21&t=6830
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
darryln
Posts: 9
Joined: Sun Jul 16, 2017 5:11 am

Re: Cannot compile FreeCad on MacOS X

Post by darryln »

Thanks for the link. DM sent to yorik, NormandC, jmaustpc.
User avatar
federico.carminati
Posts: 66
Joined: Thu May 18, 2017 1:01 pm
Location: Geneva, Switzerland

Re: Cannot compile FreeCad on MacOS X

Post by federico.carminati »

Hello,
since I started this thread, I just wanted to say that with the following CMAKE command I am happily following the HEAD of FreeCAD since more than two months

cd .. ; rm -rf build ; mkdir build; cd build ; cmake -DBUILD_QT5=1 -DFREECAD_USE_EXTERNAL_KDL=1 -DBUILD_FEM_NETGEN=1 -DFREECAD_CREATE_MAC_APP=1 -DCMAKE_BUILD_TYPE="Release" -DCMAKE_PREFIX_PATH=/usr/local/Cellar/qt\@5.6/5.6.2/ -DCMAKE_INSTALL_PREFIX=/Applications -DBUILD_JTREADER=ON -DBUILD_SANDBOX=ON -DBUILD_TEMPLATE=ON -DFREECAD_USE_FREETYPE=OFF ../FreeCAD-git/


Best,
Federico Carminati
Co-Founder and Scientific Director of Transmutex SA
Switzerland/Suisse
microartisan
Posts: 12
Joined: Fri Mar 23, 2018 11:52 am
Location: beijing
Contact:

Re: Cannot compile FreeCad on MacOS X

Post by microartisan »

It will be wonderful if anyone can upgrade the mac-brew compile wiki.
User avatar
federico.carminati
Posts: 66
Joined: Thu May 18, 2017 1:01 pm
Location: Geneva, Switzerland

Re: Cannot compile FreeCad on MacOS X

Post by federico.carminati »

With the latest version the command has changed a bit

cmake -DBUILD_QT5=1 -DFREECAD_USE_EXTERNAL_KDL=1 -DBUILD_FEM_NETGEN=1 -DFREECAD_CREATE_MAC_APP=1 -DCMAKE_BUILD_TYPE="Release" -DCMAKE_PREFIX_PATH='/usr/local/opt/qt/lib/cmake;/usr/local/opt/qtwebkit/lib/cmake' -DCMAKE_INSTALL_PREFIX=/Applications -DBUILD_JTREADER=ON -DBUILD_SANDBOX=ON -DBUILD_TEMPLATE=ON -DFREECAD_USE_FREETYPE=OFF -DMpidotH=/usr/local/include/mpi.h -DBUILD_ENABLE_CXX_STD=C++14 ../FreeCAD-git/

Best
Federico Carminati
Co-Founder and Scientific Director of Transmutex SA
Switzerland/Suisse
microartisan
Posts: 12
Joined: Fri Mar 23, 2018 11:52 am
Location: beijing
Contact:

Re: Cannot compile FreeCad on MacOS X

Post by microartisan »

Code: Select all

-DBUILD_ENABLE_CXX_STD=C++14
@federico.carminati, c++14 is very userful option :)

and I create CMAKE_PREFIX_PATH by the command from https://www.freecadweb.org/wiki/CompileOnMac

Code: Select all

ls -d $(brew list -1 | grep qt | tail -1 | xargs brew --cellar)/*/lib/cmake
it is my final cmake code :

Code: Select all

cmake \
-DBUILD_QT5=1 \
-DFREECAD_USE_EXTERNAL_KDL=1 \
-DBUILD_FEM_NETGEN=1 \
-DCMAKE_BUILD_TYPE="Release" \
-DCMAKE_PREFIX_PATH='/usr/local/Cellar/qtwebkit/5.212-72cfbd/lib/cmake' \
-DFREECAD_USE_FREETYPE=OFF \
-DBUILD_ENABLE_CXX_STD=C++14 \
../FreeCAD-git/
User avatar
federico.carminati
Posts: 66
Joined: Thu May 18, 2017 1:01 pm
Location: Geneva, Switzerland

Re: Cannot compile FreeCad on MacOS X

Post by federico.carminati »

This is nice! Careful that brew may want to update qt soon, so I use

-DCMAKE_PREFIX_PAT=/usr/local/opt/qt/lib/cmake

to be protected from change of qt version. best
Federico Carminati
Co-Founder and Scientific Director of Transmutex SA
Switzerland/Suisse
User avatar
KritzelKratzel
Posts: 2
Joined: Tue Jun 12, 2018 8:31 pm
Location: Germany

Re: Cannot compile FreeCad on MacOS X

Post by KritzelKratzel »

Jumping into this discussion with my own experiences in building FreeCAD on MacOSX El Capitan on my 11 year old SSD-pimped iMac. I ran into the QT5 not found issue as well. After installing al the Homebrew stuff as outlined in the Wiki I simply located QT5 manually and modified the CMake command line accordingly:

Code: Select all

cmake \
	-DCMAKE_BUILD_TYPE="Release" \
	-DBUILD_QT5=1 \
	-DCMAKE_PREFIX_PATH="/usr/local/Cellar/qt/5.11.0" \
	-DFREECAD_USE_EXTERNAL_KDL=1 \
	-DBUILD_FEM_NETGEN=1 \
	-DFREECAD_CREATE_MAC_APP=1 \
	-DCMAKE_INSTALL_PREFIX="./.." \
	-DBUILD_ENABLE_CXX_STD=C++14 ../FreeCAD-git/
Nevertheless I got trouble with Matplotlib. CMake was unable to find it and after digging around for a while I found this very helpful hint https://penandpants.com/2012/02/24/install-python/:

Code: Select all

brew install pig-config
pip install matplotlib
After that small tweak CMake went through almost flawlessly and at the time of writing this message compilation is on the way at currently 76% progress. Cross your fingers...

Cheers,
KK
chrisb
Veteran
Posts: 54183
Joined: Tue Mar 17, 2015 9:14 am

Re: Cannot compile FreeCad on MacOS X

Post by chrisb »

Hi KK, welcome to the forum. Thanks for starting with a helping hand right away! If it works out, would you mind describing it in the wiki?
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
KritzelKratzel
Posts: 2
Joined: Tue Jun 12, 2018 8:31 pm
Location: Germany

Re: Cannot compile FreeCad on MacOS X

Post by KritzelKratzel »

Compilation successful so far, but Assembly2 failure still present :?:

Code: Select all

########@iMac-2:~/misc/FreeCAD/build/bin $ ./FreeCAD
FreeCAD 0.18, Libs: 0.18R13962 (Git)
© Juergen Riegel, Werner Mayer, Yorik van Havre 2001-2018
  #####                 ####  ###   ####  
  #                    #      # #   #   # 
  #     ##  #### ####  #     #   #  #   # 
  ####  # # #  # #  #  #     #####  #   # 
  #     #   #### ####  #    #     # #   # 
  #     #   #    #     #    #     # #   #  ##  ##  ##
  #     #   #### ####   ### #     # ####   ##  ##  ##

Running the Python command 'importPart' failed:
Traceback (most recent call last):
  File "/Users/michael/Library/Preferences/FreeCAD/Mod/assembly2/importPart.py", line 137, in Activated
    QtGui.qApp.activeWindow(),

'NoneType' object has no attribute 'activeWindow'
I simply start FreeCAD, switch over to Assembly2 workbench, hit the "Import from another FreeCAD document" and nothing happens beside this error thrown in terminal window. Any ideas?
Post Reply