Cannot compile FreeCad on MacOS X

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

Re: Cannot compile FreeCad on MacOS X

Postby chrisb » Sun Jul 16, 2017 4:42 pm

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
User avatar
darryln
Posts: 9
Joined: Sun Jul 16, 2017 5:11 am

Re: Cannot compile FreeCad on MacOS X

Postby darryln » Sun Jul 16, 2017 4:53 pm

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

Re: Cannot compile FreeCad on MacOS X

Postby federico.carminati » Mon Jul 17, 2017 1:04 pm

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
Switzerland/Suisse
User avatar
microartisan
Posts: 12
Joined: Fri Mar 23, 2018 11:52 am
Location: beijing
Contact:

Re: Cannot compile FreeCad on MacOS X

Postby microartisan » Tue Apr 03, 2018 10:52 am

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

Re: Cannot compile FreeCad on MacOS X

Postby federico.carminati » Tue Apr 03, 2018 12:06 pm

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
Switzerland/Suisse
User avatar
microartisan
Posts: 12
Joined: Fri Mar 23, 2018 11:52 am
Location: beijing
Contact:

Re: Cannot compile FreeCad on MacOS X

Postby microartisan » Tue Apr 03, 2018 1:33 pm

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: 49
Joined: Thu May 18, 2017 1:01 pm

Re: Cannot compile FreeCad on MacOS X

Postby federico.carminati » Tue Apr 03, 2018 1:41 pm

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
Switzerland/Suisse
User avatar
KritzelKratzel
Posts: 2
Joined: Tue Jun 12, 2018 8:31 pm
Location: Germany

Re: Cannot compile FreeCad on MacOS X

Postby KritzelKratzel » Tue Jun 12, 2018 8:52 pm

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

Re: Cannot compile FreeCad on MacOS X

Postby chrisb » Wed Jun 13, 2018 3:32 am

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?
User avatar
KritzelKratzel
Posts: 2
Joined: Tue Jun 12, 2018 8:31 pm
Location: Germany

Re: Cannot compile FreeCad on MacOS X

Postby KritzelKratzel » Wed Jun 13, 2018 5:55 am

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?